Chromium Code Reviews| Index: webrtc/video_encoder.h |
| diff --git a/webrtc/video_encoder.h b/webrtc/video_encoder.h |
| index 0100239e0a42ab8942de17373cc0bb66a991509f..4a3a670a5076b986d081ae896115efd62a1382d1 100644 |
| --- a/webrtc/video_encoder.h |
| +++ b/webrtc/video_encoder.h |
| @@ -15,6 +15,7 @@ |
| #include <string> |
| #include <vector> |
| +#include "webrtc/base/timedelta.h" |
|
sprang_webrtc
2016/06/28 13:54:18
Is this import used?
Sergey Ulanov
2016/06/29 22:18:52
Done.
|
| #include "webrtc/common_types.h" |
| #include "webrtc/typedefs.h" |
| #include "webrtc/video_frame.h" |
| @@ -30,11 +31,33 @@ class EncodedImageCallback { |
| public: |
| virtual ~EncodedImageCallback() {} |
| + struct Result { |
| + static Result FrameDropped() { |
| + Result result; |
| + result.dropped = true; |
| + return result; |
| + } |
| + |
| + bool dropped = false; |
|
sprang_webrtc
2016/06/28 13:54:18
I "dropped" the right name for this? From what I c
Sergey Ulanov
2016/06/29 22:18:53
Yes, good point. Done. For now I just added two po
|
| + uint32_t frame_id = 0; |
| + bool drop_next_frame = false; |
| + }; |
|
sprang_webrtc
2016/06/28 13:54:18
Please comment how frame_id and drop_next_frame sh
Sergey Ulanov
2016/06/29 22:18:53
Done.
|
| + |
| // Callback function which is called when an image has been encoded. |
| - // TODO(perkj): Change this to return void. |
| + virtual Result OnEncodedImage( |
| + const EncodedImage& encoded_image, |
| + const CodecSpecificInfo* codec_specific_info, |
| + const RTPFragmentationHeader* fragmentation) = 0; |
| + |
| + // DEPRECATED. |
| + // TODO(sergeyu): Remove this method. |
| virtual int32_t Encoded(const EncodedImage& encoded_image, |
| const CodecSpecificInfo* codec_specific_info, |
| - const RTPFragmentationHeader* fragmentation) = 0; |
| + const RTPFragmentationHeader* fragmentation) { |
| + Result result = |
| + OnEncodedImage(encoded_image, codec_specific_info, fragmentation); |
| + return result.dropped ? -1 : (result.drop_next_frame ? 1 : 0); |
| + } |
| }; |
| class VideoEncoder { |