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 if (!command_buffer) | 124 if (!command_buffer) |
125 return false; | 125 return false; |
126 | 126 |
127 InitCommon(graphics_context, graphics_3d->gles2_impl()); | 127 InitCommon(graphics_context, graphics_3d->gles2_impl()); |
128 FlushCommandBuffer(); | 128 FlushCommandBuffer(); |
129 | 129 |
130 // This is not synchronous, but subsequent IPC messages will be buffered, so | 130 // This is not synchronous, but subsequent IPC messages will be buffered, so |
131 // it is okay to immediately send IPC messages. | 131 // it is okay to immediately send IPC messages. |
132 if (command_buffer->channel()) { | 132 if (command_buffer->channel()) { |
133 decoder_.reset(new media::GpuVideoDecodeAcceleratorHost(command_buffer)); | 133 decoder_.reset(new media::GpuVideoDecodeAcceleratorHost(command_buffer)); |
134 return decoder_->Initialize(PPToMediaProfile(profile), this); | 134 media::VideoDecodeAccelerator::Config config(PPToMediaProfile(profile)); |
| 135 config.supported_output_formats.assign( |
| 136 {media::PIXEL_FORMAT_XRGB, media::PIXEL_FORMAT_ARGB}); |
| 137 return decoder_->Initialize(config, this); |
135 } | 138 } |
136 return false; | 139 return false; |
137 } | 140 } |
138 | 141 |
139 const PPP_VideoDecoder_Dev* PPB_VideoDecoder_Impl::GetPPP() { | 142 const PPP_VideoDecoder_Dev* PPB_VideoDecoder_Impl::GetPPP() { |
140 if (!ppp_videodecoder_) { | 143 if (!ppp_videodecoder_) { |
141 PluginModule* plugin_module = | 144 PluginModule* plugin_module = |
142 HostGlobals::Get()->GetInstance(pp_instance())->module(); | 145 HostGlobals::Get()->GetInstance(pp_instance())->module(); |
143 if (plugin_module) { | 146 if (plugin_module) { |
144 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( | 147 ppp_videodecoder_ = static_cast<const PPP_VideoDecoder_Dev*>( |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 DCHECK(RenderThreadImpl::current()); | 300 DCHECK(RenderThreadImpl::current()); |
298 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); | 301 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); |
299 } | 302 } |
300 | 303 |
301 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 304 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
302 DCHECK(RenderThreadImpl::current()); | 305 DCHECK(RenderThreadImpl::current()); |
303 RunFlushCallback(PP_OK); | 306 RunFlushCallback(PP_OK); |
304 } | 307 } |
305 | 308 |
306 } // namespace content | 309 } // namespace content |
OLD | NEW |