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

Unified Diff: media/filters/gpu_video_decoder.cc

Issue 19638008: Refactor GpuVideoDecoder::Factories out of GpuVideoDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 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
Index: media/filters/gpu_video_decoder.cc
diff --git a/media/filters/gpu_video_decoder.cc b/media/filters/gpu_video_decoder.cc
index 940bec1c52dc7c9a518590682fc5ce5e3f91402d..94fece4cb9017d273a603408fd62eff630ed10fb 100644
--- a/media/filters/gpu_video_decoder.cc
+++ b/media/filters/gpu_video_decoder.cc
@@ -23,7 +23,7 @@ namespace media {
// Proxies calls to a VideoDecodeAccelerator::Client from the calling thread to
// the client's thread.
//
-// TODO(scherkus): VDAClientProxy should hold onto GpuVideoDecoder::Factories
+// TODO(scherkus): VDAClientProxy should hold onto GpuVideoDecoderFactories
// and take care of some of the work that GpuVideoDecoder does to minimize
// thread hopping. See following for discussion:
//
@@ -131,8 +131,6 @@ void VDAClientProxy::NotifyError(media::VideoDecodeAccelerator::Error error) {
// resources.
enum { kMaxInFlightDecodes = 4 };
-GpuVideoDecoder::Factories::~Factories() {}
-
// Size of shared-memory segments we allocate. Since we reuse them we let them
// be on the beefy side.
static const size_t kSharedMemorySegmentBytes = 100 << 10;
@@ -160,7 +158,7 @@ GpuVideoDecoder::BufferData::~BufferData() {}
GpuVideoDecoder::GpuVideoDecoder(
const scoped_refptr<base::MessageLoopProxy>& message_loop,
- const scoped_refptr<Factories>& factories)
+ const scoped_refptr<GpuVideoDecoderFactories>& factories)
: needs_bitstream_conversion_(false),
gvd_loop_proxy_(message_loop),
weak_factory_(this),
@@ -547,21 +545,24 @@ void GpuVideoDecoder::PictureReady(const media::Picture& picture) {
&natural_size);
DCHECK(decoder_texture_target_);
- scoped_refptr<VideoFrame> frame(
- VideoFrame::WrapNativeTexture(
- new VideoFrame::MailboxHolder(
- pb.texture_mailbox(),
- 0, // sync_point
- BindToCurrentLoop(base::Bind(
- &GpuVideoDecoder::ReusePictureBuffer, weak_this_,
- picture.picture_buffer_id()))),
- decoder_texture_target_,
- pb.size(), visible_rect,
- natural_size, timestamp,
- base::Bind(&Factories::ReadPixels, factories_, pb.texture_id(),
- decoder_texture_target_,
- gfx::Size(visible_rect.width(), visible_rect.height())),
- base::Closure()));
+ scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture(
+ new VideoFrame::MailboxHolder(
+ pb.texture_mailbox(),
+ 0, // sync_point
+ BindToCurrentLoop(base::Bind(&GpuVideoDecoder::ReusePictureBuffer,
+ weak_this_,
+ picture.picture_buffer_id()))),
+ decoder_texture_target_,
+ pb.size(),
+ visible_rect,
+ natural_size,
+ timestamp,
+ base::Bind(&GpuVideoDecoderFactories::ReadPixels,
+ factories_,
+ pb.texture_id(),
+ decoder_texture_target_,
+ gfx::Size(visible_rect.width(), visible_rect.height())),
+ base::Closure()));
CHECK_GT(available_pictures_, 0);
--available_pictures_;
bool inserted =

Powered by Google App Engine
This is Rietveld 408576698