video_encoder_info.cc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "media/video/video_encoder_info.h"
  5. namespace media {
  6. ResolutionBitrateLimit::ResolutionBitrateLimit() = default;
  7. ResolutionBitrateLimit::ResolutionBitrateLimit(const ResolutionBitrateLimit&) =
  8. default;
  9. ResolutionBitrateLimit::ResolutionBitrateLimit(const gfx::Size& frame_size,
  10. int min_start_bitrate_bps,
  11. int min_bitrate_bps,
  12. int max_bitrate_bps)
  13. : frame_size(frame_size),
  14. min_start_bitrate_bps(min_start_bitrate_bps),
  15. min_bitrate_bps(min_bitrate_bps),
  16. max_bitrate_bps(max_bitrate_bps) {}
  17. ResolutionBitrateLimit::~ResolutionBitrateLimit() = default;
  18. VideoEncoderInfo::VideoEncoderInfo() = default;
  19. VideoEncoderInfo::VideoEncoderInfo(const VideoEncoderInfo&) = default;
  20. VideoEncoderInfo::~VideoEncoderInfo() = default;
  21. bool operator==(const ResolutionBitrateLimit& l,
  22. const ResolutionBitrateLimit& r) {
  23. return l.frame_size == r.frame_size &&
  24. l.min_start_bitrate_bps == r.min_start_bitrate_bps &&
  25. l.min_bitrate_bps == r.min_bitrate_bps &&
  26. l.max_bitrate_bps == r.max_bitrate_bps;
  27. }
  28. bool operator==(const VideoEncoderInfo& l, const VideoEncoderInfo& r) {
  29. for (size_t i = 0; i < VideoEncoderInfo::kMaxSpatialLayers; ++i) {
  30. if (l.fps_allocation[i] != r.fps_allocation[i])
  31. return false;
  32. }
  33. return l.implementation_name == r.implementation_name &&
  34. l.supports_native_handle == r.supports_native_handle &&
  35. l.has_trusted_rate_controller == r.has_trusted_rate_controller &&
  36. l.is_hardware_accelerated == r.is_hardware_accelerated &&
  37. l.supports_simulcast == r.supports_simulcast &&
  38. l.reports_average_qp == r.reports_average_qp &&
  39. l.resolution_bitrate_limits == r.resolution_bitrate_limits;
  40. }
  41. } // namespace media