OLD | NEW |
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 "content/renderer/pepper/ppb_video_decoder_impl.h" | 5 #include "content/renderer/pepper/ppb_video_decoder_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 return false; | 124 return false; |
125 | 125 |
126 InitCommon(graphics_context, graphics_3d->gles2_impl()); | 126 InitCommon(graphics_context, graphics_3d->gles2_impl()); |
127 FlushCommandBuffer(); | 127 FlushCommandBuffer(); |
128 | 128 |
129 // This is not synchronous, but subsequent IPC messages will be buffered, so | 129 // This is not synchronous, but subsequent IPC messages will be buffered, so |
130 // it is okay to immediately send IPC messages through the returned channel. | 130 // it is okay to immediately send IPC messages through the returned channel. |
131 GpuChannelHost* channel = graphics_3d->channel(); | 131 GpuChannelHost* channel = graphics_3d->channel(); |
132 DCHECK(channel); | 132 DCHECK(channel); |
133 decoder_ = channel->CreateVideoDecoder(command_buffer_route_id); | 133 decoder_ = channel->CreateVideoDecoder(command_buffer_route_id); |
134 return (decoder_ && decoder_->Initialize(PPToMediaProfile(profile), this)); | 134 return (decoder_ && decoder_->Initialize(PPToMediaProfile(profile), 0, this)); |
135 } | 135 } |
136 | 136 |
137 const PPP_VideoDecoder_Dev* PPB_VideoDecoder_Impl::GetPPP() { | 137 const PPP_VideoDecoder_Dev* PPB_VideoDecoder_Impl::GetPPP() { |
138 if (!ppp_videodecoder_) { | 138 if (!ppp_videodecoder_) { |
139 PluginModule* plugin_module = | 139 PluginModule* plugin_module = |
140 HostGlobals::Get()->GetInstance(pp_instance())->module(); | 140 HostGlobals::Get()->GetInstance(pp_instance())->module(); |
141 if (plugin_module) { | 141 if (plugin_module) { |
142 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( | 142 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( |
143 plugin_module->GetPluginInterface(PPP_VIDEODECODER_DEV_INTERFACE)); | 143 plugin_module->GetPluginInterface(PPP_VIDEODECODER_DEV_INTERFACE)); |
144 } | 144 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 DCHECK(RenderThreadImpl::current()); | 293 DCHECK(RenderThreadImpl::current()); |
294 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); | 294 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); |
295 } | 295 } |
296 | 296 |
297 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 297 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
298 DCHECK(RenderThreadImpl::current()); | 298 DCHECK(RenderThreadImpl::current()); |
299 RunFlushCallback(PP_OK); | 299 RunFlushCallback(PP_OK); |
300 } | 300 } |
301 | 301 |
302 } // namespace content | 302 } // namespace content |
OLD | NEW |