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. |
249 DCHECK(RenderThreadImpl::current()); | 251 DCHECK(RenderThreadImpl::current()); |
250 if (!ppp_videodecoder_) | 252 if (!ppp_videodecoder_) |
251 return; | 253 return; |
252 | 254 |
253 PP_Picture_Dev output; | 255 PP_Picture_Dev output; |
254 output.picture_buffer_id = picture.picture_buffer_id(); | 256 output.picture_buffer_id = picture.picture_buffer_id(); |
255 output.bitstream_buffer_id = picture.bitstream_buffer_id(); | 257 output.bitstream_buffer_id = picture.bitstream_buffer_id(); |
256 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); | 258 ppp_videodecoder_->PictureReady(pp_instance(), pp_resource(), &output); |
257 } | 259 } |
258 | 260 |
(...skipping 28 matching lines...) Expand all Loading... |
287 DCHECK(RenderThreadImpl::current()); | 289 DCHECK(RenderThreadImpl::current()); |
288 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); | 290 RunBitstreamBufferCallback(bitstream_buffer_id, PP_OK); |
289 } | 291 } |
290 | 292 |
291 void PPB_VideoDecoder_Impl::NotifyFlushDone() { | 293 void PPB_VideoDecoder_Impl::NotifyFlushDone() { |
292 DCHECK(RenderThreadImpl::current()); | 294 DCHECK(RenderThreadImpl::current()); |
293 RunFlushCallback(PP_OK); | 295 RunFlushCallback(PP_OK); |
294 } | 296 } |
295 | 297 |
296 } // namespace content | 298 } // namespace content |
OLD | NEW |