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

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

Issue 2613793007: Revert of [Mojo Video Capture] Simplify media::VideoCaptureDevice::Client:Buffer to a struct (Closed)
Patch Set: Created 3 years, 11 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_device.cc ('k') | media/capture/video/video_capture_device_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/video_capture_device_client.h
diff --git a/media/capture/video/video_capture_device_client.h b/media/capture/video/video_capture_device_client.h
index b2dcb0a15b188d6364b2e9142ee3bab264ac2b58..adac1bc19a31a2b7e415ef4ee2478dd4e4e4d8d0 100644
--- a/media/capture/video/video_capture_device_client.h
+++ b/media/capture/video/video_capture_device_client.h
@@ -49,11 +49,6 @@
const VideoCaptureJpegDecoderFactoryCB& jpeg_decoder_factory);
~VideoCaptureDeviceClient() override;
- static Buffer MakeBufferStruct(
- scoped_refptr<VideoCaptureBufferPool> buffer_pool,
- int buffer_id,
- int frame_feedback_id);
-
// VideoCaptureDevice::Client implementation.
void OnIncomingCapturedData(const uint8_t* data,
int length,
@@ -62,36 +57,49 @@
base::TimeTicks reference_time,
base::TimeDelta timestamp,
int frame_feedback_id = 0) override;
- Buffer ReserveOutputBuffer(const gfx::Size& dimensions,
- media::VideoPixelFormat format,
- media::VideoPixelStorage storage,
- int frame_feedback_id) override;
- void OnIncomingCapturedBuffer(Buffer buffer,
+ std::unique_ptr<Buffer> ReserveOutputBuffer(const gfx::Size& dimensions,
+ media::VideoPixelFormat format,
+ media::VideoPixelStorage storage,
+ int frame_feedback_id) override;
+ void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
const VideoCaptureFormat& format,
base::TimeTicks reference_time,
base::TimeDelta timestamp) override;
void OnIncomingCapturedBufferExt(
- Buffer buffer,
+ std::unique_ptr<Buffer> buffer,
const VideoCaptureFormat& format,
base::TimeTicks reference_time,
base::TimeDelta timestamp,
gfx::Rect visible_rect,
const VideoFrameMetadata& additional_metadata) override;
- Buffer ResurrectLastOutputBuffer(const gfx::Size& dimensions,
- media::VideoPixelFormat format,
- media::VideoPixelStorage storage,
- int new_frame_feedback_id) override;
+ std::unique_ptr<Buffer> ResurrectLastOutputBuffer(
+ const gfx::Size& dimensions,
+ media::VideoPixelFormat format,
+ media::VideoPixelStorage storage,
+ int new_frame_feedback_id) override;
void OnError(const tracked_objects::Location& from_here,
const std::string& reason) override;
void OnLog(const std::string& message) override;
double GetBufferPoolUtilization() const override;
private:
- void InitializeI420PlanePointers(const gfx::Size& dimensions,
- uint8_t* const data,
- uint8_t** y_plane_data,
- uint8_t** u_plane_data,
- uint8_t** v_plane_data);
+ // Reserve output buffer into which I420 contents can be copied directly.
+ // The dimensions of the frame is described by |dimensions|, and requested
+ // output buffer format is specified by |storage|. The reserved output buffer
+ // is returned; and the pointer to Y plane is stored at [y_plane_data], U
+ // plane is stored at [u_plane_data], V plane is stored at [v_plane_data].
+ // Returns an nullptr if allocation fails.
+ //
+ // When requested |storage| is PIXEL_STORAGE_CPU, a single shared memory
+ // chunk is reserved. The output buffers stay reserved and mapped for use
+ // until the Buffer objects are destroyed or returned.
+ std::unique_ptr<Buffer> ReserveI420OutputBuffer(
+ const gfx::Size& dimensions,
+ media::VideoPixelStorage storage,
+ int frame_feedback_id,
+ uint8_t** y_plane_data,
+ uint8_t** u_plane_data,
+ uint8_t** v_plane_data);
// A branch of OnIncomingCapturedData for Y16 frame_format.pixel_format.
void OnIncomingCapturedY16Data(const uint8_t* data,
« no previous file with comments | « media/capture/video/video_capture_device.cc ('k') | media/capture/video/video_capture_device_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698