Chromium Code Reviews| Index: webrtc/config.h |
| diff --git a/webrtc/config.h b/webrtc/config.h |
| index d5fd1fe564f6ea2b7d8d93f8b8280ebe27e221f0..f1b0ab38767d063ab4be1634ce0044c238eb90ac 100644 |
| --- a/webrtc/config.h |
| +++ b/webrtc/config.h |
| @@ -16,6 +16,8 @@ |
| #include <string> |
| #include <vector> |
| +#include "webrtc/base/refcount.h" |
| +#include "webrtc/base/scoped_ref_ptr.h" |
| #include "webrtc/common.h" |
| #include "webrtc/common_types.h" |
| #include "webrtc/typedefs.h" |
| @@ -120,6 +122,47 @@ struct VideoStream { |
| }; |
| struct VideoEncoderConfig { |
| + class EncoderSpecificSettings : public rtc::RefCountInterface { |
|
mflodman
2016/06/16 09:05:48
Add comment why ref counted and possible next step
pbos-webrtc
2016/07/13 08:44:12
Done.
|
| + public: |
| + virtual ~EncoderSpecificSettings() {} |
| + // TODO(pbos): Remove FillEncoderSpecificSettings as soon as VideoCodec is |
| + // not in use and encoder implementations ask for codec-specific structs |
| + // directly. |
| + void FillEncoderSpecificSettings(VideoCodec* codec_struct) const; |
| + |
| + virtual void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const; |
| + virtual void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const; |
| + virtual void FillVideoCodecH264(VideoCodecH264* h264_settings) const; |
| + }; |
| + |
| + class H264EncoderSpecificSettings : public EncoderSpecificSettings { |
| + public: |
| + explicit H264EncoderSpecificSettings(const VideoCodecH264& specifics); |
| + virtual void FillVideoCodecH264( |
| + VideoCodecH264* vp8_settings) const override; |
|
mflodman
2016/06/16 09:05:48
s/vp8/h264
pbos-webrtc
2016/07/13 08:44:12
Done.
|
| + |
| + private: |
| + VideoCodecH264 specifics_; |
| + }; |
| + |
| + class Vp8EncoderSpecificSettings : public EncoderSpecificSettings { |
| + public: |
| + explicit Vp8EncoderSpecificSettings(const VideoCodecVP8& specifics); |
| + virtual void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const override; |
| + |
| + private: |
| + VideoCodecVP8 specifics_; |
| + }; |
| + |
| + class Vp9EncoderSpecificSettings : public EncoderSpecificSettings { |
| + public: |
| + explicit Vp9EncoderSpecificSettings(const VideoCodecVP9& specifics); |
| + virtual void FillVideoCodecVp9(VideoCodecVP9* vp8_settings) const override; |
|
mflodman
2016/06/16 09:05:48
s/vp8/vp9
pbos-webrtc
2016/07/13 08:44:12
Done.
|
| + |
| + private: |
| + VideoCodecVP9 specifics_; |
| + }; |
| + |
| enum class ContentType { |
| kRealtimeVideo, |
| kScreen, |
| @@ -132,7 +175,7 @@ struct VideoEncoderConfig { |
| std::vector<VideoStream> streams; |
| std::vector<SpatialLayer> spatial_layers; |
| ContentType content_type; |
| - void* encoder_specific_settings; |
| + rtc::scoped_refptr<const EncoderSpecificSettings> encoder_specific_settings; |
| // Padding will be used up to this bitrate regardless of the bitrate produced |
| // by the encoder. Padding above what's actually produced by the encoder helps |