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

Unified Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 2395913003: Cleanup of passing GpuMemoryBuffer backed video frames (Closed)
Patch Set: Rebase Created 4 years, 2 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 | « no previous file | content/browser/renderer_host/media/video_capture_controller_event_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2779c95320807a3766bcdf39618b0520ad93905f..85f0a2948c7586ce94c82b43916f65668e3426d9 100644
--- a/content/browser/renderer_host/media/video_capture_controller.cc
+++ b/content/browser/renderer_host/media/video_capture_controller.cc
@@ -427,9 +427,7 @@ void VideoCaptureController::OnIncomingCapturedVideoFrame(
<< media::VideoPixelFormatToString(frame->format());
// Sanity-checks to confirm |frame| is actually being backed by |buffer|.
- DCHECK(frame->storage_type() == media::VideoFrame::STORAGE_SHMEM ||
- (frame->storage_type() ==
- media::VideoFrame::STORAGE_GPU_MEMORY_BUFFERS));
+ DCHECK(frame->storage_type() == media::VideoFrame::STORAGE_SHMEM);
DCHECK(frame->data(media::VideoFrame::kYPlane) >= buffer->data(0) &&
(frame->data(media::VideoFrame::kYPlane) <
(reinterpret_cast<const uint8_t*>(buffer->data(0)) +
@@ -512,31 +510,13 @@ void VideoCaptureController::DoNewBufferOnIOThread(
DCHECK_CURRENTLY_ON(BrowserThread::IO);
const int buffer_id = buffer->id();
- switch (frame->storage_type()) {
- case media::VideoFrame::STORAGE_GPU_MEMORY_BUFFERS: {
- std::vector<gfx::GpuMemoryBufferHandle> handles;
- const size_t num_planes = media::VideoFrame::NumPlanes(frame->format());
- for (size_t i = 0; i < num_planes; ++i) {
- gfx::GpuMemoryBufferHandle remote_handle;
- handles.push_back(remote_handle);
- }
- client->event_handler->OnBufferCreated2(client->controller_id, handles,
- buffer->dimensions(), buffer_id);
- break;
- }
- case media::VideoFrame::STORAGE_SHMEM: {
- base::SharedMemoryHandle remote_handle;
- buffer_pool_->ShareToProcess(buffer_id, client->render_process_handle,
- &remote_handle);
- client->event_handler->OnBufferCreated(
- client->controller_id, remote_handle, buffer->mapped_size(),
- buffer_id);
- break;
- }
- default:
- NOTREACHED();
- break;
- }
+ DCHECK_EQ(media::VideoFrame::STORAGE_SHMEM, frame->storage_type());
+
+ base::SharedMemoryHandle remote_handle;
+ buffer_pool_->ShareToProcess(buffer_id, client->render_process_handle,
+ &remote_handle);
+ client->event_handler->OnBufferCreated(client->controller_id, remote_handle,
+ buffer->mapped_size(), buffer_id);
}
VideoCaptureController::ControllerClient* VideoCaptureController::FindClient(
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_controller_event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698