Chromium Code Reviews| Index: content/browser/renderer_host/media/video_capture_controller.cc |
| diff --git a/content/browser/renderer_host/media/video_capture_controller.cc b/content/browser/renderer_host/media/video_capture_controller.cc |
| index 4775a77c061688c4dfb76d33b847fd23be70eeaf..af69bbb7b2b65cc67ddd270c73fcdfe996fafdb1 100644 |
| --- a/content/browser/renderer_host/media/video_capture_controller.cc |
| +++ b/content/browser/renderer_host/media/video_capture_controller.cc |
| @@ -53,6 +53,27 @@ class PoolBuffer : public media::VideoCaptureDevice::Client::Buffer { |
| const scoped_refptr<VideoCaptureBufferPool> pool_; |
| }; |
| +class SyncPointProviderImpl : public media::VideoFrame::SyncPointProvider { |
| + public: |
| + explicit SyncPointProviderImpl(uint32 sync_point) : sync_point_(sync_point) {} |
| + virtual ~SyncPointProviderImpl(); |
| + virtual uint32 InsertSyncPoint(); |
| + virtual void WaitSyncPoint(uint32 sync_point); |
| + |
| + private: |
| + uint32 sync_point_; |
| +}; |
| + |
| +SyncPointProviderImpl::~SyncPointProviderImpl() { |
| +} |
| + |
| +uint32 SyncPointProviderImpl::InsertSyncPoint() { |
| + return sync_point_; |
| +} |
| + |
| +void SyncPointProviderImpl::WaitSyncPoint(uint32 sync_point) { |
|
danakj
2014/06/19 15:56:26
Why is this ok to drop the current sync point in t
dshwang
2014/06/23 18:33:20
I misunderstood that this file is used by only uni
|
| +} |
| + |
| } // anonymous namespace |
| struct VideoCaptureController::ControllerClient { |
| @@ -249,7 +270,7 @@ void VideoCaptureController::ReturnBuffer( |
| const VideoCaptureControllerID& id, |
| VideoCaptureControllerEventHandler* event_handler, |
| int buffer_id, |
| - const std::vector<uint32>& sync_points) { |
| + uint32 sync_point) { |
| DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| ControllerClient* client = FindClient(id, event_handler, controller_clients_); |
| @@ -265,10 +286,8 @@ void VideoCaptureController::ReturnBuffer( |
| scoped_refptr<media::VideoFrame> frame = iter->second; |
| client->active_buffers.erase(iter); |
| - if (frame->format() == media::VideoFrame::NATIVE_TEXTURE) { |
| - for (size_t i = 0; i < sync_points.size(); i++) |
| - frame->AppendReleaseSyncPoint(sync_points[i]); |
| - } |
| + SyncPointProviderImpl provider(sync_point); |
| + frame->UpdateReleaseSyncPoint(provider); |
| buffer_pool_->RelinquishConsumerHold(buffer_id, 1); |
| } |