| 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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <list> | 10 #include <list> |
| 9 #include <map> | 11 #include <map> |
| 10 #include <set> | 12 #include <set> |
| 11 #include <vector> | 13 #include <vector> |
| 12 | 14 |
| 13 #include "base/basictypes.h" | |
| 14 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
| 16 #include "base/macros.h" |
| 15 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 17 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 18 #include "media/video/video_decode_accelerator.h" | 20 #include "media/video/video_decode_accelerator.h" |
| 19 #include "ppapi/c/pp_codecs.h" | 21 #include "ppapi/c/pp_codecs.h" |
| 20 #include "ppapi/host/host_message_context.h" | 22 #include "ppapi/host/host_message_context.h" |
| 21 #include "ppapi/host/resource_host.h" | 23 #include "ppapi/host/resource_host.h" |
| 22 #include "ppapi/proxy/resource_message_params.h" | 24 #include "ppapi/proxy/resource_message_params.h" |
| 23 | 25 |
| 24 namespace base { | 26 namespace base { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 typedef std::list<PendingDecode> PendingDecodeList; | 65 typedef std::list<PendingDecode> PendingDecodeList; |
| 64 | 66 |
| 65 friend class VideoDecoderShim; | 67 friend class VideoDecoderShim; |
| 66 | 68 |
| 67 // ResourceHost implementation. | 69 // ResourceHost implementation. |
| 68 int32_t OnResourceMessageReceived( | 70 int32_t OnResourceMessageReceived( |
| 69 const IPC::Message& msg, | 71 const IPC::Message& msg, |
| 70 ppapi::host::HostMessageContext* context) override; | 72 ppapi::host::HostMessageContext* context) override; |
| 71 | 73 |
| 72 // media::VideoDecodeAccelerator::Client implementation. | 74 // media::VideoDecodeAccelerator::Client implementation. |
| 73 void ProvidePictureBuffers(uint32 requested_num_of_buffers, | 75 void ProvidePictureBuffers(uint32_t requested_num_of_buffers, |
| 74 const gfx::Size& dimensions, | 76 const gfx::Size& dimensions, |
| 75 uint32 texture_target) override; | 77 uint32_t texture_target) override; |
| 76 void DismissPictureBuffer(int32 picture_buffer_id) override; | 78 void DismissPictureBuffer(int32_t picture_buffer_id) override; |
| 77 void PictureReady(const media::Picture& picture) override; | 79 void PictureReady(const media::Picture& picture) override; |
| 78 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; | 80 void NotifyEndOfBitstreamBuffer(int32_t bitstream_buffer_id) override; |
| 79 void NotifyFlushDone() override; | 81 void NotifyFlushDone() override; |
| 80 void NotifyResetDone() override; | 82 void NotifyResetDone() override; |
| 81 void NotifyError(media::VideoDecodeAccelerator::Error error) override; | 83 void NotifyError(media::VideoDecodeAccelerator::Error error) override; |
| 82 | 84 |
| 83 int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, | 85 int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, |
| 84 const ppapi::HostResource& graphics_context, | 86 const ppapi::HostResource& graphics_context, |
| 85 PP_VideoProfile profile, | 87 PP_VideoProfile profile, |
| 86 PP_HardwareAcceleration acceleration, | 88 PP_HardwareAcceleration acceleration, |
| 87 uint32_t min_picture_count); | 89 uint32_t min_picture_count); |
| 88 int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context, | 90 int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context, |
| 89 uint32_t shm_id, | 91 uint32_t shm_id, |
| 90 uint32_t shm_size); | 92 uint32_t shm_size); |
| 91 int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context, | 93 int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context, |
| 92 uint32_t shm_id, | 94 uint32_t shm_id, |
| 93 uint32_t size, | 95 uint32_t size, |
| 94 int32_t decode_id); | 96 int32_t decode_id); |
| 95 int32_t OnHostMsgAssignTextures(ppapi::host::HostMessageContext* context, | 97 int32_t OnHostMsgAssignTextures(ppapi::host::HostMessageContext* context, |
| 96 const PP_Size& size, | 98 const PP_Size& size, |
| 97 const std::vector<uint32_t>& texture_ids); | 99 const std::vector<uint32_t>& texture_ids); |
| 98 int32_t OnHostMsgRecyclePicture(ppapi::host::HostMessageContext* context, | 100 int32_t OnHostMsgRecyclePicture(ppapi::host::HostMessageContext* context, |
| 99 uint32_t picture_id); | 101 uint32_t picture_id); |
| 100 int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); | 102 int32_t OnHostMsgFlush(ppapi::host::HostMessageContext* context); |
| 101 int32_t OnHostMsgReset(ppapi::host::HostMessageContext* context); | 103 int32_t OnHostMsgReset(ppapi::host::HostMessageContext* context); |
| 102 | 104 |
| 103 // These methods are needed by VideoDecodeShim, to look like a | 105 // These methods are needed by VideoDecodeShim, to look like a |
| 104 // VideoDecodeAccelerator. | 106 // VideoDecodeAccelerator. |
| 105 const uint8_t* DecodeIdToAddress(uint32_t decode_id); | 107 const uint8_t* DecodeIdToAddress(uint32_t decode_id); |
| 106 void RequestTextures(uint32 requested_num_of_buffers, | 108 void RequestTextures(uint32_t requested_num_of_buffers, |
| 107 const gfx::Size& dimensions, | 109 const gfx::Size& dimensions, |
| 108 uint32 texture_target, | 110 uint32_t texture_target, |
| 109 const std::vector<gpu::Mailbox>& mailboxes); | 111 const std::vector<gpu::Mailbox>& mailboxes); |
| 110 | 112 |
| 111 // Tries to initialize software decoder. Returns true on success. | 113 // Tries to initialize software decoder. Returns true on success. |
| 112 bool TryFallbackToSoftwareDecoder(); | 114 bool TryFallbackToSoftwareDecoder(); |
| 113 | 115 |
| 114 PendingDecodeList::iterator GetPendingDecodeById(int32_t decode_id); | 116 PendingDecodeList::iterator GetPendingDecodeById(int32_t decode_id); |
| 115 | 117 |
| 116 // Non-owning pointer. | 118 // Non-owning pointer. |
| 117 RendererPpapiHost* renderer_ppapi_host_; | 119 RendererPpapiHost* renderer_ppapi_host_; |
| 118 | 120 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 143 ppapi::host::ReplyMessageContext reset_reply_context_; | 145 ppapi::host::ReplyMessageContext reset_reply_context_; |
| 144 | 146 |
| 145 bool initialized_ = false; | 147 bool initialized_ = false; |
| 146 | 148 |
| 147 DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); | 149 DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); |
| 148 }; | 150 }; |
| 149 | 151 |
| 150 } // namespace content | 152 } // namespace content |
| 151 | 153 |
| 152 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | 154 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ |
| OLD | NEW |