OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/pepper_video_decoder_host.h" | 5 #include "content/renderer/pepper/pepper_video_decoder_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "content/common/gpu/client/gpu_channel_host.h" | 9 #include "content/common/gpu/client/gpu_channel_host.h" |
10 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
11 #include "content/public/renderer/renderer_ppapi_host.h" | 11 #include "content/public/renderer/renderer_ppapi_host.h" |
| 12 #include "content/renderer/pepper/gfx_conversion.h" |
12 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" | 13 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
13 #include "content/renderer/pepper/video_decoder_shim.h" | 14 #include "content/renderer/pepper/video_decoder_shim.h" |
14 #include "media/video/video_decode_accelerator.h" | 15 #include "media/video/video_decode_accelerator.h" |
15 #include "ppapi/c/pp_completion_callback.h" | 16 #include "ppapi/c/pp_completion_callback.h" |
16 #include "ppapi/c/pp_errors.h" | 17 #include "ppapi/c/pp_errors.h" |
17 #include "ppapi/host/dispatch_host_message.h" | 18 #include "ppapi/host/dispatch_host_message.h" |
18 #include "ppapi/host/ppapi_host.h" | 19 #include "ppapi/host/ppapi_host.h" |
19 #include "ppapi/proxy/ppapi_messages.h" | 20 #include "ppapi/proxy/ppapi_messages.h" |
20 #include "ppapi/proxy/video_decoder_constants.h" | 21 #include "ppapi/proxy/video_decoder_constants.h" |
21 #include "ppapi/thunk/enter.h" | 22 #include "ppapi/thunk/enter.h" |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 uint32 requested_num_of_buffers, | 308 uint32 requested_num_of_buffers, |
308 const gfx::Size& dimensions, | 309 const gfx::Size& dimensions, |
309 uint32 texture_target) { | 310 uint32 texture_target) { |
310 RequestTextures(requested_num_of_buffers, | 311 RequestTextures(requested_num_of_buffers, |
311 dimensions, | 312 dimensions, |
312 texture_target, | 313 texture_target, |
313 std::vector<gpu::Mailbox>()); | 314 std::vector<gpu::Mailbox>()); |
314 } | 315 } |
315 | 316 |
316 void PepperVideoDecoderHost::PictureReady(const media::Picture& picture) { | 317 void PepperVideoDecoderHost::PictureReady(const media::Picture& picture) { |
317 // So far picture.visible_rect is not used. If used, visible_rect should | 318 // Don't bother validating the visible rect, since the plugin process is less |
318 // be validated since it comes from GPU process and may not be trustworthy. | 319 // trusted than the gpu process. |
319 host()->SendUnsolicitedReply( | 320 PP_Rect visible_rect = PP_FromGfxRect(picture.visible_rect()); |
320 pp_resource(), | 321 host()->SendUnsolicitedReply(pp_resource(), |
321 PpapiPluginMsg_VideoDecoder_PictureReady(picture.bitstream_buffer_id(), | 322 PpapiPluginMsg_VideoDecoder_PictureReady( |
322 picture.picture_buffer_id())); | 323 picture.bitstream_buffer_id(), |
| 324 picture.picture_buffer_id(), visible_rect)); |
323 } | 325 } |
324 | 326 |
325 void PepperVideoDecoderHost::DismissPictureBuffer(int32 picture_buffer_id) { | 327 void PepperVideoDecoderHost::DismissPictureBuffer(int32 picture_buffer_id) { |
326 host()->SendUnsolicitedReply( | 328 host()->SendUnsolicitedReply( |
327 pp_resource(), | 329 pp_resource(), |
328 PpapiPluginMsg_VideoDecoder_DismissPicture(picture_buffer_id)); | 330 PpapiPluginMsg_VideoDecoder_DismissPicture(picture_buffer_id)); |
329 } | 331 } |
330 | 332 |
331 void PepperVideoDecoderHost::NotifyEndOfBitstreamBuffer( | 333 void PepperVideoDecoderHost::NotifyEndOfBitstreamBuffer( |
332 int32 bitstream_buffer_id) { | 334 int32 bitstream_buffer_id) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 host()->SendUnsolicitedReply( | 403 host()->SendUnsolicitedReply( |
402 pp_resource(), | 404 pp_resource(), |
403 PpapiPluginMsg_VideoDecoder_RequestTextures( | 405 PpapiPluginMsg_VideoDecoder_RequestTextures( |
404 requested_num_of_buffers, | 406 requested_num_of_buffers, |
405 PP_MakeSize(dimensions.width(), dimensions.height()), | 407 PP_MakeSize(dimensions.width(), dimensions.height()), |
406 texture_target, | 408 texture_target, |
407 mailboxes)); | 409 mailboxes)); |
408 } | 410 } |
409 | 411 |
410 } // namespace content | 412 } // namespace content |
OLD | NEW |