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

Unified Diff: content/browser/renderer_host/media/video_capture_controller.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
Index: content/browser/renderer_host/media/video_capture_controller.h
diff --git a/content/browser/renderer_host/media/video_capture_controller.h b/content/browser/renderer_host/media/video_capture_controller.h
index e429e1d23bbae90dc6ef675ca4c36714525eddb1..4be8085bbf67c870971c272da674c7e897691234 100644
--- a/content/browser/renderer_host/media/video_capture_controller.h
+++ b/content/browser/renderer_host/media/video_capture_controller.h
@@ -67,10 +67,12 @@
base::WeakPtr<VideoCaptureController> GetWeakPtrForIOThread();
- // Factory code creating instances of VideoCaptureController may optionally
- // set a FrameBufferPool. Setting the host is done in this method separate
- // from the constructor to allow clients to create and use instances before
- // they can provide the observer. (This is the case with VideoCaptureManager).
+ // Factory code creating instances of VideoCaptureController must set a
+ // FrameBufferPool before any of the media::VideoFrameReceiver are used.
+ // Setting the observer is done in this method separate from the constructor
+ // in order to allow use the media::VideoFrameReceiver methods
+ // before the observer can be provided. (This is the case with
+ // VideoCaptureManager).
void SetFrameBufferPool(
std::unique_ptr<media::FrameBufferPool> frame_buffer_pool);
@@ -132,7 +134,7 @@
// Implementation of media::VideoFrameReceiver interface:
void OnIncomingCapturedVideoFrame(
- media::VideoCaptureDevice::Client::Buffer buffer,
+ std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> buffer,
scoped_refptr<media::VideoFrame> frame) override;
void OnError() override;
void OnLog(const std::string& message) override;
@@ -148,7 +150,8 @@
int buffer_id,
int frame_feedback_id,
media::VideoFrameConsumerFeedbackObserver* consumer_feedback_observer,
- media::FrameBufferPool* frame_buffer_pool);
+ media::FrameBufferPool* frame_buffer_pool,
+ scoped_refptr<media::VideoFrame> frame);
~BufferState();
BufferState(const BufferState& other);
void RecordConsumerUtilization(double utilization);
@@ -164,9 +167,15 @@
const int frame_feedback_id_;
media::VideoFrameConsumerFeedbackObserver* consumer_feedback_observer_;
media::FrameBufferPool* frame_buffer_pool_;
+ const scoped_refptr<media::VideoFrame> frame_;
double max_consumer_utilization_;
int consumer_hold_count_;
};
+
+ // Notify renderer that a new buffer has been created.
+ void DoNewBufferOnIOThread(ControllerClient* client,
+ media::VideoCaptureDevice::Client::Buffer* buffer,
+ const scoped_refptr<media::VideoFrame>& frame);
// Find a client of |id| and |handler| in |clients|.
ControllerClient* FindClient(VideoCaptureControllerID id,

Powered by Google App Engine
This is Rietveld 408576698