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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 PP_Resource graphics_context, | 133 PP_Resource graphics_context, |
134 PlatformContext3D* context, | 134 PlatformContext3D* context, |
135 gpu::gles2::GLES2Implementation* gles2_impl, | 135 gpu::gles2::GLES2Implementation* gles2_impl, |
136 PP_VideoDecoder_Profile profile) { | 136 PP_VideoDecoder_Profile profile) { |
137 InitCommon(graphics_context, gles2_impl); | 137 InitCommon(graphics_context, gles2_impl); |
138 | 138 |
139 int command_buffer_route_id = context->GetCommandBufferRouteId(); | 139 int command_buffer_route_id = context->GetCommandBufferRouteId(); |
140 if (command_buffer_route_id == 0) | 140 if (command_buffer_route_id == 0) |
141 return false; | 141 return false; |
142 | 142 |
143 platform_video_decoder_.reset(new PlatformVideoDecoder( | 143 platform_video_decoder_.reset( |
144 this, command_buffer_route_id)); | 144 new PlatformVideoDecoder(command_buffer_route_id)); |
145 if (!platform_video_decoder_) | 145 if (!platform_video_decoder_) |
146 return false; | 146 return false; |
147 | 147 |
148 FlushCommandBuffer(); | 148 FlushCommandBuffer(); |
149 return platform_video_decoder_->Initialize(PPToMediaProfile(profile)); | 149 return platform_video_decoder_->Initialize(PPToMediaProfile(profile), this); |
150 } | 150 } |
151 | 151 |
152 int32_t PPB_VideoDecoder_Impl::Decode( | 152 int32_t PPB_VideoDecoder_Impl::Decode( |
153 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, | 153 const PP_VideoBitstreamBuffer_Dev* bitstream_buffer, |
154 scoped_refptr<TrackedCallback> callback) { | 154 scoped_refptr<TrackedCallback> callback) { |
155 if (!platform_video_decoder_) | 155 if (!platform_video_decoder_) |
156 return PP_ERROR_BADRESOURCE; | 156 return PP_ERROR_BADRESOURCE; |
157 | 157 |
158 EnterResourceNoLock<PPB_Buffer_API> enter(bitstream_buffer->data, true); | 158 EnterResourceNoLock<PPB_Buffer_API> enter(bitstream_buffer->data, true); |
159 if (enter.failed()) | 159 if (enter.failed()) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 293 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
294 RunFlushCallback(PP_OK); | 294 RunFlushCallback(PP_OK); |
295 } | 295 } |
296 | 296 |
297 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { | 297 void PPB_VideoDecoder_Impl::NotifyInitializeDone() { |
298 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; | 298 NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; |
299 } | 299 } |
300 | 300 |
301 } // namespace content | 301 } // namespace content |
OLD | NEW |