Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 #include "media/base/video_codecs.h" | |
| 14 #include "third_party/webrtc/media/engine/webrtcvideoencoderfactory.h" | 15 #include "third_party/webrtc/media/engine/webrtcvideoencoderfactory.h" |
| 15 | 16 |
| 16 namespace media { | 17 namespace media { |
| 17 class GpuVideoAcceleratorFactories; | 18 class GpuVideoAcceleratorFactories; |
| 18 } // namespace media | 19 } // namespace media |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 // This class creates RTCVideoEncoder instances (each wrapping a | 23 // This class creates RTCVideoEncoder instances (each wrapping a |
| 23 // media::VideoEncodeAccelerator) on behalf of the WebRTC stack. | 24 // media::VideoEncodeAccelerator) on behalf of the WebRTC stack. |
| 24 class CONTENT_EXPORT RTCVideoEncoderFactory | 25 class CONTENT_EXPORT RTCVideoEncoderFactory |
| 25 : NON_EXPORTED_BASE(public cricket::WebRtcVideoEncoderFactory) { | 26 : NON_EXPORTED_BASE(public cricket::WebRtcVideoEncoderFactory) { |
| 26 public: | 27 public: |
| 27 explicit RTCVideoEncoderFactory( | 28 explicit RTCVideoEncoderFactory( |
| 28 media::GpuVideoAcceleratorFactories* gpu_factories); | 29 media::GpuVideoAcceleratorFactories* gpu_factories); |
| 29 ~RTCVideoEncoderFactory() override; | 30 ~RTCVideoEncoderFactory() override; |
| 30 | 31 |
| 31 // cricket::WebRtcVideoEncoderFactory implementation. | 32 // cricket::WebRtcVideoEncoderFactory implementation. |
| 32 webrtc::VideoEncoder* CreateVideoEncoder( | 33 webrtc::VideoEncoder* CreateVideoEncoder( |
| 33 webrtc::VideoCodecType type) override; | 34 const cricket::VideoCodec& codec) override; |
| 34 const std::vector<VideoCodec>& codecs() const override; | 35 const std::vector<cricket::VideoCodec>& supported_codecs() const override; |
| 35 void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override; | 36 void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override; |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 media::GpuVideoAcceleratorFactories* gpu_factories_; | 39 media::GpuVideoAcceleratorFactories* gpu_factories_; |
| 39 | 40 |
| 40 // List of supported cricket::WebRtcVideoEncoderFactory::VideoCodec. | 41 // List of supported cricket::WebRtcVideoEncoderFactory::VideoCodec. |
| 41 std::vector<VideoCodec> codecs_; | 42 // |profiles_| and |supported_codecs_| have the same length and the profile |
| 43 // for |supported_codecs_[i]| is |profiles_[i]|. | |
| 44 std::vector<media::VideoCodecProfile> profiles_; | |
|
Pawel Osciak
2016/11/17 07:30:05
Perhaps std::pair<media::VCP, cricket::VC> instead
magjed_chromium
2016/11/17 13:08:03
Yes, I would prefer this myself, but the problem i
emircan
2016/11/17 19:02:15
Can you add CHECK_EQ(profiles_.size(), supported_c
magjed_chromium
2016/11/18 09:46:47
Done.
| |
| 45 std::vector<cricket::VideoCodec> supported_codecs_; | |
| 42 | 46 |
| 43 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoderFactory); | 47 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoderFactory); |
| 44 }; | 48 }; |
| 45 | 49 |
| 46 } // namespace content | 50 } // namespace content |
| 47 | 51 |
| 48 #endif // CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ | 52 #endif // CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ |
| OLD | NEW |