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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); | 240 PP_Size out_dim = PP_MakeSize(dimensions.width(), dimensions.height()); |
241 ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), | 241 ppp_videodecoder_->ProvidePictureBuffers(pp_instance(), |
242 pp_resource(), | 242 pp_resource(), |
243 requested_num_of_buffers, | 243 requested_num_of_buffers, |
244 &out_dim, | 244 &out_dim, |
245 texture_target); | 245 texture_target); |
246 } | 246 } |
247 | 247 |
248 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { | 248 void PPB_VideoDecoder_Impl::PictureReady(const media::Picture& picture) { |
249 // So far picture.visible_rect is not used. If used, visible_rect should | |
250 // be validated since it comes from GPU process and may not be trustworthy. | |
251 DCHECK(RenderThreadImpl::current()); | 249 DCHECK(RenderThreadImpl::current()); |
252 if (!ppp_videodecoder_) | 250 if (!ppp_videodecoder_) |
253 return; | 251 return; |
254 | 252 |
255 PP_Picture_Dev output; | 253 PP_Picture_Dev output; |
256 output.picture_buffer_id = picture.picture_buffer_id(); | 254 output.picture_buffer_id = picture.picture_buffer_id(); |
257 output.bitstream_buffer_id = picture.bitstream_buffer_id(); | 255 output.bitstream_buffer_id = picture.bitstream_buffer_id(); |
258 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); | 256 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); |
259 } | 257 } |
260 | 258 |
(...skipping 28 matching lines...) Expand all Loading... |
289 DCHECK(RenderThreadImpl::current()); | 287 DCHECK(RenderThreadImpl::current()); |
290 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); | 288 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); |
291 } | 289 } |
292 | 290 |
293 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 291 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
294 DCHECK(RenderThreadImpl::current()); | 292 DCHECK(RenderThreadImpl::current()); |
295 RunFlushCallback(PP_OK); | 293 RunFlushCallback(PP_OK); |
296 } | 294 } |
297 | 295 |
298 } // namespace content | 296 } // namespace content |
OLD | NEW |