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" | |
15 #include "third_party/webrtc/media/engine/webrtcvideoencoderfactory.h" | 14 #include "third_party/webrtc/media/engine/webrtcvideoencoderfactory.h" |
16 | 15 |
17 namespace media { | 16 namespace media { |
18 class GpuVideoAcceleratorFactories; | 17 class GpuVideoAcceleratorFactories; |
19 } // namespace media | 18 } // namespace media |
20 | 19 |
21 namespace content { | 20 namespace content { |
22 | 21 |
23 // This class creates RTCVideoEncoder instances (each wrapping a | 22 // This class creates RTCVideoEncoder instances (each wrapping a |
24 // media::VideoEncodeAccelerator) on behalf of the WebRTC stack. | 23 // media::VideoEncodeAccelerator) on behalf of the WebRTC stack. |
25 class CONTENT_EXPORT RTCVideoEncoderFactory | 24 class CONTENT_EXPORT RTCVideoEncoderFactory |
26 : NON_EXPORTED_BASE(public cricket::WebRtcVideoEncoderFactory) { | 25 : NON_EXPORTED_BASE(public cricket::WebRtcVideoEncoderFactory) { |
27 public: | 26 public: |
28 explicit RTCVideoEncoderFactory( | 27 explicit RTCVideoEncoderFactory( |
29 media::GpuVideoAcceleratorFactories* gpu_factories); | 28 media::GpuVideoAcceleratorFactories* gpu_factories); |
30 ~RTCVideoEncoderFactory() override; | 29 ~RTCVideoEncoderFactory() override; |
31 | 30 |
32 // cricket::WebRtcVideoEncoderFactory implementation. | 31 // cricket::WebRtcVideoEncoderFactory implementation. |
33 webrtc::VideoEncoder* CreateVideoEncoder( | 32 webrtc::VideoEncoder* CreateVideoEncoder( |
34 const cricket::VideoCodec& codec) override; | 33 webrtc::VideoCodecType type) override; |
35 const std::vector<cricket::VideoCodec>& supported_codecs() const override; | 34 const std::vector<VideoCodec>& codecs() const override; |
36 void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override; | 35 void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) override; |
37 | 36 |
38 private: | 37 private: |
39 media::GpuVideoAcceleratorFactories* gpu_factories_; | 38 media::GpuVideoAcceleratorFactories* gpu_factories_; |
40 | 39 |
41 // List of supported cricket::WebRtcVideoEncoderFactory::VideoCodec. | 40 // List of supported cricket::WebRtcVideoEncoderFactory::VideoCodec. |
42 // |profiles_| and |supported_codecs_| have the same length and the profile | 41 std::vector<VideoCodec> codecs_; |
43 // for |supported_codecs_[i]| is |profiles_[i]|. | |
44 std::vector<media::VideoCodecProfile> profiles_; | |
45 std::vector<cricket::VideoCodec> supported_codecs_; | |
46 | 42 |
47 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoderFactory); | 43 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoderFactory); |
48 }; | 44 }; |
49 | 45 |
50 } // namespace content | 46 } // namespace content |
51 | 47 |
52 #endif // CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ | 48 #endif // CONTENT_RENDERER_MEDIA_GPU_RTC_VIDEO_ENCODER_FACTORY_H_ |
OLD | NEW |