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 <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void DismissPictureBuffer(int32 picture_buffer_id) override; | 63 void DismissPictureBuffer(int32 picture_buffer_id) override; |
64 void PictureReady(const media::Picture& picture) override; | 64 void PictureReady(const media::Picture& picture) override; |
65 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; | 65 void NotifyEndOfBitstreamBuffer(int32 bitstream_buffer_id) override; |
66 void NotifyFlushDone() override; | 66 void NotifyFlushDone() override; |
67 void NotifyResetDone() override; | 67 void NotifyResetDone() override; |
68 void NotifyError(media::VideoDecodeAccelerator::Error error) override; | 68 void NotifyError(media::VideoDecodeAccelerator::Error error) override; |
69 | 69 |
70 int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, | 70 int32_t OnHostMsgInitialize(ppapi::host::HostMessageContext* context, |
71 const ppapi::HostResource& graphics_context, | 71 const ppapi::HostResource& graphics_context, |
72 PP_VideoProfile profile, | 72 PP_VideoProfile profile, |
73 PP_HardwareAcceleration acceleration); | 73 PP_HardwareAcceleration acceleration, |
| 74 uint32_t min_picture_count); |
74 int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context, | 75 int32_t OnHostMsgGetShm(ppapi::host::HostMessageContext* context, |
75 uint32_t shm_id, | 76 uint32_t shm_id, |
76 uint32_t shm_size); | 77 uint32_t shm_size); |
77 int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context, | 78 int32_t OnHostMsgDecode(ppapi::host::HostMessageContext* context, |
78 uint32_t shm_id, | 79 uint32_t shm_id, |
79 uint32_t size, | 80 uint32_t size, |
80 int32_t decode_id); | 81 int32_t decode_id); |
81 int32_t OnHostMsgAssignTextures(ppapi::host::HostMessageContext* context, | 82 int32_t OnHostMsgAssignTextures(ppapi::host::HostMessageContext* context, |
82 const PP_Size& size, | 83 const PP_Size& size, |
83 const std::vector<uint32_t>& texture_ids); | 84 const std::vector<uint32_t>& texture_ids); |
(...skipping 18 matching lines...) Expand all Loading... |
102 | 103 |
103 // A vector holding our shm buffers, in sync with a similar vector in the | 104 // A vector holding our shm buffers, in sync with a similar vector in the |
104 // resource. We use a buffer's index in these vectors as its id on both sides | 105 // resource. We use a buffer's index in these vectors as its id on both sides |
105 // of the proxy. Only add buffers or update them in place so as not to | 106 // of the proxy. Only add buffers or update them in place so as not to |
106 // invalidate these ids. | 107 // invalidate these ids. |
107 ScopedVector<base::SharedMemory> shm_buffers_; | 108 ScopedVector<base::SharedMemory> shm_buffers_; |
108 // A vector of true/false indicating if a shm buffer is in use by the decoder. | 109 // A vector of true/false indicating if a shm buffer is in use by the decoder. |
109 // This is parallel to |shm_buffers_|. | 110 // This is parallel to |shm_buffers_|. |
110 std::vector<uint8_t> shm_buffer_busy_; | 111 std::vector<uint8_t> shm_buffer_busy_; |
111 | 112 |
| 113 uint32_t min_picture_count_; |
112 typedef std::set<uint32_t> TextureSet; | 114 typedef std::set<uint32_t> TextureSet; |
113 TextureSet pictures_in_use_; | 115 TextureSet pictures_in_use_; |
114 TextureSet dismissed_pictures_in_use_; | 116 TextureSet dismissed_pictures_in_use_; |
115 | 117 |
116 // Maps decode uid to PendingDecode info. | 118 // Maps decode uid to PendingDecode info. |
117 typedef base::hash_map<int32_t, PendingDecode> PendingDecodeMap; | 119 typedef base::hash_map<int32_t, PendingDecode> PendingDecodeMap; |
118 PendingDecodeMap pending_decodes_; | 120 PendingDecodeMap pending_decodes_; |
119 | 121 |
120 ppapi::host::ReplyMessageContext flush_reply_context_; | 122 ppapi::host::ReplyMessageContext flush_reply_context_; |
121 ppapi::host::ReplyMessageContext reset_reply_context_; | 123 ppapi::host::ReplyMessageContext reset_reply_context_; |
122 // Only used when in software fallback mode. | 124 // Only used when in software fallback mode. |
123 ppapi::host::ReplyMessageContext initialize_reply_context_; | 125 ppapi::host::ReplyMessageContext initialize_reply_context_; |
124 | 126 |
125 bool initialized_; | 127 bool initialized_; |
126 | 128 |
127 DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); | 129 DISALLOW_COPY_AND_ASSIGN(PepperVideoDecoderHost); |
128 }; | 130 }; |
129 | 131 |
130 } // namespace content | 132 } // namespace content |
131 | 133 |
132 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ | 134 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_DECODER_HOST_H_ |
OLD | NEW |