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

Unified Diff: media/capture/video/video_frame_receiver.h

Issue 2686763002: [Mojo Video Capture] Split OnIncomingCapturedVideoFrame() to OnNewBuffer() and OnFrameReadyInBuffer( (Closed)
Patch Set: rebase Created 3 years, 10 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
« no previous file with comments | « media/capture/video/video_capture_jpeg_decoder.h ('k') | media/capture/video_capture_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_frame_receiver.h
diff --git a/media/capture/video/video_frame_receiver.h b/media/capture/video/video_frame_receiver.h
index 841040ae0c1615219f6df9260b8623081b24c5f4..67d2a2d31b725fc3864a4a6b8efbbc2d9ca73e82 100644
--- a/media/capture/video/video_frame_receiver.h
+++ b/media/capture/video/video_frame_receiver.h
@@ -6,6 +6,8 @@
#define MEDIA_CAPTURE_VIDEO_VIDEO_FRAME_RECEIVER_H_
#include "media/capture/capture_export.h"
+#include "media/capture/mojo/video_capture_types.mojom.h"
+#include "media/capture/video/video_capture_buffer_handle.h"
#include "media/capture/video/video_capture_device.h"
namespace media {
@@ -16,20 +18,40 @@ class CAPTURE_EXPORT VideoFrameReceiver {
public:
virtual ~VideoFrameReceiver(){};
- virtual void OnIncomingCapturedVideoFrame(
- media::VideoCaptureDevice::Client::Buffer buffer,
- scoped_refptr<media::VideoFrame> frame) = 0;
- virtual void OnError() = 0;
- virtual void OnLog(const std::string& message) = 0;
+ // Tells the VideoFrameReceiver that the producer is going to subsequently use
+ // the provided buffer as one of possibly many for frame delivery via
+ // OnFrameReadyInBuffer(). Note, that a call to this method does not mean that
+ // the caller allows the receiver to read from or write to the buffer.
+ virtual void OnNewBufferHandle(
+ int buffer_id,
+ std::unique_ptr<VideoCaptureDevice::Client::Buffer::HandleProvider>
+ handle_provider) = 0;
+
+ // Tells the VideoFrameReceiver that a new frame is ready for consumption
+ // in the buffer with id |buffer_id| and allows it to read the data from
+ // the buffer. The producer guarantees that the buffer and its contents stay
+ // alive and unchanged until VideoFrameReceiver releases the given
+ // |buffer_read_permission|.
+ virtual void OnFrameReadyInBuffer(
+ int buffer_id,
+ int frame_feedback_id,
+ std::unique_ptr<
+ VideoCaptureDevice::Client::Buffer::ScopedAccessPermission>
+ buffer_read_permission,
+ mojom::VideoFrameInfoPtr frame_info) = 0;
// Tells the VideoFrameReceiver that the producer is no longer going to use
// the buffer with id |buffer_id| for frame delivery. This may be called even
- // while the receiver is still consuming the buffer from a call to
- // OnIncomingCapturedVideoFrame(). In that case, it means that the
- // caller is asking the VideoFrameReceiver to release the buffer
- // at its earliest convenience.
- // A producer may reuse a retired |buffer_id| immediately after this call.
+ // while the receiver is still holding |buffer_read_permission| from a call to
+ // OnFrameReadInBuffer() for the same buffer. In that case, it means that the
+ // caller is asking the VideoFrameReceiver to release the read permission and
+ // buffer handle at its earliest convenience.
+ // After this call, a producer may immediately reuse the retired |buffer_id|
+ // with a new buffer via a call to OnNewBufferHandle().
virtual void OnBufferRetired(int buffer_id) = 0;
+
+ virtual void OnError() = 0;
+ virtual void OnLog(const std::string& message) = 0;
};
} // namespace media
« no previous file with comments | « media/capture/video/video_capture_jpeg_decoder.h ('k') | media/capture/video_capture_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698