Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: content/common/gpu/media/omx_video_decode_accelerator.h

Issue 9346012: Video decode in hardware on ARM platform. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <map> 9 #include <map>
10 #include <queue> 10 #include <queue>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 #include <utility> 13 #include <utility>
14 #include <vector> 14 #include <vector>
15 15
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
19 #include "base/message_loop.h" 19 #include "base/message_loop.h"
20 #include "base/shared_memory.h" 20 #include "base/shared_memory.h"
21 #include "media/video/video_decode_accelerator.h" 21 #include "media/video/video_decode_accelerator.h"
22 #include "third_party/angle/include/EGL/egl.h" 22 #include "content/common/gpu/media/gles2_texture_to_egl_image_translator.h"
Ami GONE FROM CHROMIUM 2012/02/18 00:00:25 Since only a pointer to the translator is held by
23 #include "third_party/angle/include/EGL/eglext.h"
24 #include "third_party/openmax/il/OMX_Component.h" 23 #include "third_party/openmax/il/OMX_Component.h"
25 #include "third_party/openmax/il/OMX_Core.h" 24 #include "third_party/openmax/il/OMX_Core.h"
26 #include "third_party/openmax/il/OMX_Video.h" 25 #include "third_party/openmax/il/OMX_Video.h"
27 26
28 // Class to wrap OpenMAX IL accelerator behind VideoDecodeAccelerator interface. 27 // Class to wrap OpenMAX IL accelerator behind VideoDecodeAccelerator interface.
29 // The implementation assumes an OpenMAX IL 1.1.2 implementation conforming to 28 // The implementation assumes an OpenMAX IL 1.1.2 implementation conforming to
30 // http://www.khronos.org/registry/omxil/specs/OpenMAX_IL_1_1_2_Specification.pd f 29 // http://www.khronos.org/registry/omxil/specs/OpenMAX_IL_1_1_2_Specification.pd f
31 // 30 //
32 // This class lives on a single thread and DCHECKs that it is never accessed 31 // This class lives on a single thread and DCHECKs that it is never accessed
33 // from any other. OMX callbacks are trampolined from the OMX component's 32 // from any other. OMX callbacks are trampolined from the OMX component's
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // Following are input port related variables. 140 // Following are input port related variables.
142 int input_buffer_count_; 141 int input_buffer_count_;
143 int input_buffer_size_; 142 int input_buffer_size_;
144 OMX_U32 input_port_; 143 OMX_U32 input_port_;
145 int input_buffers_at_component_; 144 int input_buffers_at_component_;
146 145
147 // Following are output port related variables. 146 // Following are output port related variables.
148 OMX_U32 output_port_; 147 OMX_U32 output_port_;
149 int output_buffers_at_component_; 148 int output_buffers_at_component_;
150 149
150 int width_ ;
Ami GONE FROM CHROMIUM 2012/02/18 00:00:25 prefix both this and the next member to indicate t
151 int height_;
152
151 // NOTE: someday there may be multiple contexts for a single decoder. But not 153 // NOTE: someday there may be multiple contexts for a single decoder. But not
152 // today. 154 // today.
153 // TODO(fischman,vrk): handle lost contexts? 155 // TODO(fischman,vrk): handle lost contexts?
154 EGLDisplay egl_display_; 156 EGLDisplay egl_display_;
155 EGLContext egl_context_; 157 EGLContext egl_context_;
156 158
157 // Free input OpenMAX buffers that can be used to take bitstream from demuxer. 159 // Free input OpenMAX buffers that can be used to take bitstream from demuxer.
158 std::queue<OMX_BUFFERHEADERTYPE*> free_input_buffers_; 160 std::queue<OMX_BUFFERHEADERTYPE*> free_input_buffers_;
159 161
160 // For output buffer recycling cases. 162 // For output buffer recycling cases.
(...skipping 11 matching lines...) Expand all
172 BitstreamBufferList queued_bitstream_buffers_; 174 BitstreamBufferList queued_bitstream_buffers_;
173 // Available output picture buffers released during Reset() and awaiting 175 // Available output picture buffers released during Reset() and awaiting
174 // re-use once Reset is done. Is empty most of the time and drained right 176 // re-use once Reset is done. Is empty most of the time and drained right
175 // before NotifyResetDone is sent. 177 // before NotifyResetDone is sent.
176 std::vector<int> queued_picture_buffer_ids_; 178 std::vector<int> queued_picture_buffer_ids_;
177 179
178 // To expose client callbacks from VideoDecodeAccelerator. 180 // To expose client callbacks from VideoDecodeAccelerator.
179 // NOTE: all calls to this object *MUST* be executed in message_loop_. 181 // NOTE: all calls to this object *MUST* be executed in message_loop_.
180 Client* client_; 182 Client* client_;
181 183
184 Gles2TextureToEglImageTranslator* texture2eglImage_translator_;
Ami GONE FROM CHROMIUM 2012/02/18 00:00:25 we don't use '2' as a synonym for 'to', and what w
185
182 // These two members are only used during Initialization. 186 // These two members are only used during Initialization.
Ami GONE FROM CHROMIUM 2012/02/18 00:00:25 s/two //
183 // OMX_AVCProfile requested during Initialization. 187 // OMX_AVCProfile requested during Initialization.
184 uint32 profile_; 188 uint32 profile_;
185 bool component_name_is_nvidia_h264ext_; 189 bool component_name_is_nvidia_h264ext_;
190 bool component_name_is_sec_h264ext_;
186 191
187 // Method to handle events 192 // Method to handle events
188 void EventHandlerCompleteTask(OMX_EVENTTYPE event, 193 void EventHandlerCompleteTask(OMX_EVENTTYPE event,
189 OMX_U32 data1, 194 OMX_U32 data1,
190 OMX_U32 data2); 195 OMX_U32 data2);
191 196
192 // Method to receive buffers from component's input port 197 // Method to receive buffers from component's input port
193 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); 198 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer);
194 199
195 // Method to receive buffers from component's output port 200 // Method to receive buffers from component's output port
(...skipping 13 matching lines...) Expand all
209 OMX_PTR event_data); 214 OMX_PTR event_data);
210 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, 215 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component,
211 OMX_PTR priv_data, 216 OMX_PTR priv_data,
212 OMX_BUFFERHEADERTYPE* buffer); 217 OMX_BUFFERHEADERTYPE* buffer);
213 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, 218 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component,
214 OMX_PTR priv_data, 219 OMX_PTR priv_data,
215 OMX_BUFFERHEADERTYPE* buffer); 220 OMX_BUFFERHEADERTYPE* buffer);
216 }; 221 };
217 222
218 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ 223 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698