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

Side by Side Diff: content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.cc

Issue 1267883002: Pass GpuMemoryBuffer backed VideoFrame from browser to renderer processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmbtracker-multiple
Patch Set: Rebase Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h" 5 #include "content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS)) 122 #if defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS))
123 const gfx::Size dimensions = frame_format.frame_size; 123 const gfx::Size dimensions = frame_format.frame_size;
124 base::SharedMemoryHandle out_handle = out_buffer->AsPlatformFile(); 124 base::SharedMemoryHandle out_handle = out_buffer->AsPlatformFile();
125 scoped_refptr<media::VideoFrame> out_frame = 125 scoped_refptr<media::VideoFrame> out_frame =
126 media::VideoFrame::WrapExternalSharedMemory( 126 media::VideoFrame::WrapExternalSharedMemory(
127 media::PIXEL_FORMAT_I420, // format 127 media::PIXEL_FORMAT_I420, // format
128 dimensions, // coded_size 128 dimensions, // coded_size
129 gfx::Rect(dimensions), // visible_rect 129 gfx::Rect(dimensions), // visible_rect
130 dimensions, // natural_size 130 dimensions, // natural_size
131 static_cast<uint8_t*>(out_buffer->data()), // data 131 static_cast<uint8_t*>(out_buffer->data()), // data
132 out_buffer->size(), // data_size 132 out_buffer->mapped_size(), // data_size
133 out_handle, // handle 133 out_handle, // handle
134 0, // shared_memory_offset 134 0, // shared_memory_offset
135 base::TimeDelta()); // timestamp 135 base::TimeDelta()); // timestamp
136 if (!out_frame) { 136 if (!out_frame) {
137 base::AutoLock lock(lock_); 137 base::AutoLock lock(lock_);
138 decoder_status_ = FAILED; 138 decoder_status_ = FAILED;
139 LOG(ERROR) << "DecodeCapturedData: WrapExternalSharedMemory failed"; 139 LOG(ERROR) << "DecodeCapturedData: WrapExternalSharedMemory failed";
140 return; 140 return;
141 } 141 }
142 out_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE, 142 out_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 lock_.AssertAcquired(); 233 lock_.AssertAcquired();
234 return !decode_done_closure_.is_null(); 234 return !decode_done_closure_.is_null();
235 } 235 }
236 236
237 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() { 237 void VideoCaptureGpuJpegDecoder::RecordInitDecodeUMA_Locked() {
238 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess", 238 UMA_HISTOGRAM_BOOLEAN("Media.VideoCaptureGpuJpegDecoder.InitDecodeSuccess",
239 decoder_status_ == INIT_PASSED); 239 decoder_status_ == INIT_PASSED);
240 } 240 }
241 241
242 } // namespace content 242 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698