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

Side by Side Diff: content/browser/media/capture/content_video_capture_device_core.cc

Issue 1154153003: Relanding 1143663007: VideoFrame: Separate Pixel Format from Storage Type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NV12 support in CrOS Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/media/capture/content_video_capture_device_core.h" 5 #include "content/browser/media/capture/content_video_capture_device_core.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_forward.h" 9 #include "base/callback_forward.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 "trigger", event_name); 111 "trigger", event_name);
112 return false; 112 return false;
113 } 113 }
114 int frame_number = oracle_.RecordCapture(); 114 int frame_number = oracle_.RecordCapture();
115 TRACE_EVENT_ASYNC_BEGIN2("gpu.capture", "Capture", output_buffer.get(), 115 TRACE_EVENT_ASYNC_BEGIN2("gpu.capture", "Capture", output_buffer.get(),
116 "frame_number", frame_number, 116 "frame_number", frame_number,
117 "trigger", event_name); 117 "trigger", event_name);
118 // NATIVE_TEXTURE frames wrap a texture mailbox, which we don't have at the 118 // NATIVE_TEXTURE frames wrap a texture mailbox, which we don't have at the
119 // moment. We do not construct those frames. 119 // moment. We do not construct those frames.
120 if (params_.requested_format.pixel_format != media::PIXEL_FORMAT_TEXTURE) { 120 if (params_.requested_format.pixel_format != media::PIXEL_FORMAT_TEXTURE) {
121 *storage = media::VideoFrame::WrapExternalPackedMemory( 121 *storage = media::VideoFrame::WrapExternalData(
122 media::VideoFrame::I420, 122 media::VideoFrame::I420,
123 coded_size, 123 coded_size,
124 gfx::Rect(visible_size), 124 gfx::Rect(visible_size),
125 visible_size, 125 visible_size,
126 static_cast<uint8*>(output_buffer->data()), 126 static_cast<uint8*>(output_buffer->data()),
127 output_buffer->size(), 127 output_buffer->size(),
128 base::SharedMemory::NULLHandle(),
129 0,
130 base::TimeDelta()); 128 base::TimeDelta());
131 DCHECK(*storage); 129 DCHECK(*storage);
132 } 130 }
133 *callback = base::Bind(&ThreadSafeCaptureOracle::DidCaptureFrame, 131 *callback = base::Bind(&ThreadSafeCaptureOracle::DidCaptureFrame,
134 this, 132 this,
135 frame_number, 133 frame_number,
136 base::Passed(&output_buffer), 134 base::Passed(&output_buffer),
137 capture_begin_time, 135 capture_begin_time,
138 oracle_.estimated_frame_duration()); 136 oracle_.estimated_frame_duration());
139 return true; 137 return true;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 return; 316 return;
319 317
320 if (oracle_proxy_.get()) 318 if (oracle_proxy_.get())
321 oracle_proxy_->ReportError(reason); 319 oracle_proxy_->ReportError(reason);
322 320
323 StopAndDeAllocate(); 321 StopAndDeAllocate();
324 TransitionStateTo(kError); 322 TransitionStateTo(kError);
325 } 323 }
326 324
327 } // namespace content 325 } // namespace content
OLDNEW
« no previous file with comments | « cc/resources/video_resource_updater.cc ('k') | content/browser/renderer_host/media/video_capture_buffer_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698