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

Side by Side Diff: media/filters/gpu_video_decoder.cc

Issue 11016006: Support reading pixels from HW-decoded video textures into canvas/webgl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | webkit/media/android/webmediaplayer_android.cc » ('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 #include "media/filters/gpu_video_decoder.h" 5 #include "media/filters/gpu_video_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/cpu.h" 9 #include "base/cpu.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 const PictureBuffer& pb = it->second; 411 const PictureBuffer& pb = it->second;
412 412
413 // Update frame's timestamp. 413 // Update frame's timestamp.
414 base::TimeDelta timestamp; 414 base::TimeDelta timestamp;
415 gfx::Size natural_size; 415 gfx::Size natural_size;
416 GetBufferData(picture.bitstream_buffer_id(), &timestamp, &natural_size); 416 GetBufferData(picture.bitstream_buffer_id(), &timestamp, &natural_size);
417 DCHECK(decoder_texture_target_); 417 DCHECK(decoder_texture_target_);
418 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( 418 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture(
419 pb.texture_id(), decoder_texture_target_, pb.size(), natural_size, 419 pb.texture_id(), decoder_texture_target_, pb.size(), natural_size,
420 timestamp, 420 timestamp,
421 base::Bind(&Factories::ReadPixels, factories_, pb.texture_id(),
422 decoder_texture_target_, pb.size()),
421 base::Bind(&GpuVideoDecoder::ReusePictureBuffer, this, 423 base::Bind(&GpuVideoDecoder::ReusePictureBuffer, this,
422 picture.picture_buffer_id()))); 424 picture.picture_buffer_id())));
423 425
424 EnqueueFrameAndTriggerFrameDelivery(frame); 426 EnqueueFrameAndTriggerFrameDelivery(frame);
425 } 427 }
426 428
427 void GpuVideoDecoder::EnqueueFrameAndTriggerFrameDelivery( 429 void GpuVideoDecoder::EnqueueFrameAndTriggerFrameDelivery(
428 const scoped_refptr<VideoFrame>& frame) { 430 const scoped_refptr<VideoFrame>& frame) {
429 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread()); 431 DCHECK(gvd_loop_proxy_->BelongsToCurrentThread());
430 432
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 585
584 error_occured_ = true; 586 error_occured_ = true;
585 587
586 if (!pending_read_cb_.is_null()) { 588 if (!pending_read_cb_.is_null()) {
587 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL); 589 base::ResetAndReturn(&pending_read_cb_).Run(kDecodeError, NULL);
588 return; 590 return;
589 } 591 }
590 } 592 }
591 593
592 } // namespace media 594 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.h ('k') | webkit/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698