Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1369)

Unified Diff: webrtc/video_encoder.h

Issue 2089773002: Add EncodedImageCallback::OnEncodedImage(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {
« webrtc/modules/video_coding/video_coding_impl.cc ('K') | « webrtc/video/vie_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698