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

Side by Side Diff: content/renderer/media/video_capture_impl.cc

Issue 1134643002: Add distinction between RGB and RGBA native texture video frames and resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test breakage from bad merge Created 5 years, 7 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
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Notes about usage of this object by VideoCaptureImplManager. 5 // Notes about usage of this object by VideoCaptureImplManager.
6 // 6 //
7 // VideoCaptureImplManager access this object by using a Unretained() 7 // VideoCaptureImplManager access this object by using a Unretained()
8 // binding and tasks on the IO thread. It is then important that 8 // binding and tasks on the IO thread. It is then important that
9 // VideoCaptureImpl never post task to itself. All operations must be 9 // VideoCaptureImpl never post task to itself. All operations must be
10 // synchronous. 10 // synchronous.
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 if (first_frame_timestamp_.is_null()) 275 if (first_frame_timestamp_.is_null())
276 first_frame_timestamp_ = timestamp; 276 first_frame_timestamp_ = timestamp;
277 277
278 scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTexture( 278 scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTexture(
279 mailbox_holder, 279 mailbox_holder,
280 media::BindToCurrentLoop(base::Bind( 280 media::BindToCurrentLoop(base::Bind(
281 &VideoCaptureImpl::OnClientBufferFinished, weak_factory_.GetWeakPtr(), 281 &VideoCaptureImpl::OnClientBufferFinished, weak_factory_.GetWeakPtr(),
282 buffer_id, scoped_refptr<ClientBuffer>())), 282 buffer_id, scoped_refptr<ClientBuffer>())),
283 packed_frame_size, gfx::Rect(packed_frame_size), packed_frame_size, 283 packed_frame_size, gfx::Rect(packed_frame_size), packed_frame_size,
284 timestamp - first_frame_timestamp_, false); 284 timestamp - first_frame_timestamp_, false /* allow_overlay */,
285 true /* has_alpha */);
285 frame->metadata()->MergeInternalValuesFrom(metadata); 286 frame->metadata()->MergeInternalValuesFrom(metadata);
286 287
287 for (const auto& client : clients_) 288 for (const auto& client : clients_)
288 client.second.deliver_frame_cb.Run(frame, timestamp); 289 client.second.deliver_frame_cb.Run(frame, timestamp);
289 } 290 }
290 291
291 void VideoCaptureImpl::OnClientBufferFinished( 292 void VideoCaptureImpl::OnClientBufferFinished(
292 int buffer_id, 293 int buffer_id,
293 const scoped_refptr<ClientBuffer>& /* ignored_buffer */, 294 const scoped_refptr<ClientBuffer>& /* ignored_buffer */,
294 uint32 release_sync_point) { 295 uint32 release_sync_point) {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 const ClientInfoMap::iterator it = clients->find(client_id); 421 const ClientInfoMap::iterator it = clients->find(client_id);
421 if (it != clients->end()) { 422 if (it != clients->end()) {
422 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED); 423 it->second.state_update_cb.Run(VIDEO_CAPTURE_STATE_STOPPED);
423 clients->erase(it); 424 clients->erase(it);
424 found = true; 425 found = true;
425 } 426 }
426 return found; 427 return found;
427 } 428 }
428 429
429 } // namespace content 430 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698