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

Unified Diff: content/renderer/media/pepper_platform_video_decoder.cc

Issue 170843004: Pass Client pointer in Initialize() for VDA/VEA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 48f212da fischman@ comments. Created 6 years, 10 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: content/renderer/media/pepper_platform_video_decoder.cc
diff --git a/content/renderer/media/pepper_platform_video_decoder.cc b/content/renderer/media/pepper_platform_video_decoder.cc
index 89fdbb4a0faad18769644a748268ae846c49e4ea..aa630e2e88bde830ffd1fc55364b5e918981bac9 100644
--- a/content/renderer/media/pepper_platform_video_decoder.cc
+++ b/content/renderer/media/pepper_platform_video_decoder.cc
@@ -14,17 +14,16 @@ using media::BitstreamBuffer;
namespace content {
-PlatformVideoDecoder::PlatformVideoDecoder(
- VideoDecodeAccelerator::Client* client,
- int32 command_buffer_route_id)
- : client_(client),
- command_buffer_route_id_(command_buffer_route_id) {
- DCHECK(client);
-}
+PlatformVideoDecoder::PlatformVideoDecoder(int32 command_buffer_route_id)
+ : command_buffer_route_id_(command_buffer_route_id) {}
PlatformVideoDecoder::~PlatformVideoDecoder() {}
-bool PlatformVideoDecoder::Initialize(media::VideoCodecProfile profile) {
+bool PlatformVideoDecoder::Initialize(
+ media::VideoDecodeAccelerator::Client* client,
+ media::VideoCodecProfile profile) {
+ client_ = client;
+
// TODO(vrk): Support multiple decoders.
if (decoder_)
return true;
@@ -41,9 +40,8 @@ bool PlatformVideoDecoder::Initialize(media::VideoCodecProfile profile) {
return false;
// Send IPC message to initialize decoder in GPU process.
- decoder_ =
- channel->CreateVideoDecoder(command_buffer_route_id_, profile, this);
- return decoder_.get() != NULL;
+ decoder_ = channel->CreateVideoDecoder(command_buffer_route_id_, profile);
+ return (decoder_ && decoder_->Initialize(this, profile));
}
void PlatformVideoDecoder::Decode(const BitstreamBuffer& bitstream_buffer) {

Powered by Google App Engine
This is Rietveld 408576698