summaryrefslogtreecommitdiff
path: root/chromium/media/video/video_encoder_info.cc
blob: 252925cb339dda2103a5bf700b8118f15e4de019 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/video/video_encoder_info.h"

namespace media {

ResolutionBitrateLimit::ResolutionBitrateLimit() = default;
ResolutionBitrateLimit::ResolutionBitrateLimit(const ResolutionBitrateLimit&) =
    default;
ResolutionBitrateLimit::ResolutionBitrateLimit(const gfx::Size& frame_size,
                                               int min_start_bitrate_bps,
                                               int min_bitrate_bps,
                                               int max_bitrate_bps)
    : frame_size(frame_size),
      min_start_bitrate_bps(min_start_bitrate_bps),
      min_bitrate_bps(min_bitrate_bps),
      max_bitrate_bps(max_bitrate_bps) {}
ResolutionBitrateLimit::~ResolutionBitrateLimit() = default;

VideoEncoderInfo::VideoEncoderInfo() = default;
VideoEncoderInfo::VideoEncoderInfo(const VideoEncoderInfo&) = default;
VideoEncoderInfo::~VideoEncoderInfo() = default;

bool operator==(const ResolutionBitrateLimit& l,
                const ResolutionBitrateLimit& r) {
  return l.frame_size == r.frame_size &&
         l.min_start_bitrate_bps == r.min_start_bitrate_bps &&
         l.min_bitrate_bps == r.min_bitrate_bps &&
         l.max_bitrate_bps == r.max_bitrate_bps;
}

bool operator==(const VideoEncoderInfo& l, const VideoEncoderInfo& r) {
  for (size_t i = 0; i < VideoEncoderInfo::kMaxSpatialLayers; ++i) {
    if (l.fps_allocation[i] != r.fps_allocation[i])
      return false;
  }

  return l.implementation_name == r.implementation_name &&
         l.supports_native_handle == r.supports_native_handle &&
         l.has_trusted_rate_controller == r.has_trusted_rate_controller &&
         l.is_hardware_accelerated == r.is_hardware_accelerated &&
         l.supports_simulcast == r.supports_simulcast &&
         l.reports_average_qp == r.reports_average_qp &&
         l.resolution_bitrate_limits == r.resolution_bitrate_limits;
}
}  // namespace media