Chromium Code Reviews| Index: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h |
| diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h |
| index 269e0411b2f8e3ed22683721297ec1efb6dadd1d..01c1bddf185a0b3638deb0402bc86cfc6f9e2c61 100644 |
| --- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h |
| +++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h |
| @@ -13,6 +13,7 @@ |
| #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_VIDEO_TOOLBOX_ENCODER_H_ |
| #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" |
| +#include "webrtc/modules/video_coding/include/bitrate_adjuster.h" |
| #if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) |
| @@ -26,7 +27,8 @@ |
| namespace webrtc { |
| -class H264VideoToolboxEncoder : public H264Encoder { |
| +class H264VideoToolboxEncoder : public H264Encoder, |
| + public BitrateAdjusterObserver { |
|
stefan-webrtc
2016/02/18 20:56:58
I think I would have preferred simply asking the b
pbos-webrtc
2016/02/18 21:08:30
I would prefer this as well.
tkchin_webrtc
2016/02/18 23:50:39
Done. Let me know if this is what you had in mind.
stefan-webrtc
2016/02/19 08:23:02
Exactly.
|
| public: |
| H264VideoToolboxEncoder(); |
| @@ -50,14 +52,26 @@ class H264VideoToolboxEncoder : public H264Encoder { |
| const char* ImplementationName() const override; |
| + void OnBitrateAdjusted(uint32_t adjusted_bitrate) override; |
| + void OnEncodedFrame(OSStatus status, |
| + VTEncodeInfoFlags info_flags, |
| + CMSampleBufferRef sample_buffer, |
| + CodecSpecificInfo codec_specific_info, |
| + int32_t width, |
| + int32_t height, |
| + int64_t render_time_ms, |
| + uint32_t timestamp); |
| + |
| private: |
| int ResetCompressionSession(); |
| void ConfigureCompressionSession(); |
| void DestroyCompressionSession(); |
| + void SetBitrate(uint32_t bitrate_kbit); |
| - webrtc::EncodedImageCallback* callback_; |
| + EncodedImageCallback* callback_; |
| VTCompressionSessionRef compression_session_; |
| - int32_t bitrate_; // Bitrate in bits per second. |
| + BitrateAdjuster bitrate_adjuster_; |
| + uint32_t bitrate_kbit_; |
| int32_t width_; |
| int32_t height_; |
| }; // H264VideoToolboxEncoder |