OLD | NEW |
---|---|
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> |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; | 45 void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE; |
46 void Flush() OVERRIDE; | 46 void Flush() OVERRIDE; |
47 void Abort() OVERRIDE; | 47 void Abort() OVERRIDE; |
48 | 48 |
49 void SetEglState(EGLDisplay egl_display, EGLContext egl_context); | 49 void SetEglState(EGLDisplay egl_display, EGLContext egl_context); |
50 | 50 |
51 private: | 51 private: |
52 // Helper struct for keeping track of the relationship between an OMX output | 52 // Helper struct for keeping track of the relationship between an OMX output |
53 // buffer and the GLESBuffer it points to. | 53 // buffer and the GLESBuffer it points to. |
54 struct OutputPicture { | 54 struct OutputPicture { |
55 OutputPicture(media::GLESBuffer g_b, OMX_BUFFERHEADERTYPE* o_b_h) | 55 OutputPicture(media::GLESBuffer g_b, OMX_BUFFERHEADERTYPE* o_b_h, void* e_i) |
56 : gles_buffer(g_b), omx_buffer_header(o_b_h) {} | 56 : gles_buffer(g_b), omx_buffer_header(o_b_h), egl_image(e_i) {} |
57 media::GLESBuffer gles_buffer; | 57 media::GLESBuffer gles_buffer; |
58 OMX_BUFFERHEADERTYPE* omx_buffer_header; | 58 OMX_BUFFERHEADERTYPE* omx_buffer_header; |
59 void* egl_image; | |
Ami GONE FROM CHROMIUM
2011/07/07 06:13:33
s/void*/EGLImageKHR/ here and above?
| |
59 }; | 60 }; |
60 typedef std::map<int32, OutputPicture> OutputPictureById; | 61 typedef std::map<int32, OutputPicture> OutputPictureById; |
61 | 62 |
62 MessageLoop* message_loop_; | 63 MessageLoop* message_loop_; |
63 OMX_HANDLETYPE component_handle_; | 64 OMX_HANDLETYPE component_handle_; |
64 | 65 |
65 // Create the Component for OMX. Handles all OMX initialization. | 66 // Create the Component for OMX. Handles all OMX initialization. |
66 bool CreateComponent(); | 67 bool CreateComponent(); |
67 // Buffer allocation/free methods for input and output buffers. | 68 // Buffer allocation/free methods for input and output buffers. |
68 bool AllocateInputBuffers(); | 69 bool AllocateInputBuffers(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 // To kick the component from Loaded to Idle before we know the real size of | 129 // To kick the component from Loaded to Idle before we know the real size of |
129 // the video (so can't yet ask for textures) we populate it with fake output | 130 // the video (so can't yet ask for textures) we populate it with fake output |
130 // buffers. Keep track of them here. | 131 // buffers. Keep track of them here. |
131 // TODO(fischman): do away with this madness. | 132 // TODO(fischman): do away with this madness. |
132 std::set<OMX_BUFFERHEADERTYPE*> fake_output_buffers_; | 133 std::set<OMX_BUFFERHEADERTYPE*> fake_output_buffers_; |
133 | 134 |
134 // To expose client callbacks from VideoDecodeAccelerator. | 135 // To expose client callbacks from VideoDecodeAccelerator. |
135 // NOTE: all calls to this object *MUST* be executed in message_loop_. | 136 // NOTE: all calls to this object *MUST* be executed in message_loop_. |
136 Client* client_; | 137 Client* client_; |
137 | 138 |
138 std::vector<uint32> texture_ids_; | |
139 std::vector<uint32> context_ids_; | |
140 // Method to handle events | 139 // Method to handle events |
141 void EventHandlerCompleteTask(OMX_EVENTTYPE event, | 140 void EventHandlerCompleteTask(OMX_EVENTTYPE event, |
142 OMX_U32 data1, | 141 OMX_U32 data1, |
143 OMX_U32 data2); | 142 OMX_U32 data2); |
144 | 143 |
145 // Method to receive buffers from component's input port | 144 // Method to receive buffers from component's input port |
146 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); | 145 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); |
147 | 146 |
148 // Method to receive buffers from component's output port | 147 // Method to receive buffers from component's output port |
149 void FillBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); | 148 void FillBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); |
(...skipping 18 matching lines...) Expand all Loading... | |
168 OMX_PTR event_data); | 167 OMX_PTR event_data); |
169 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, | 168 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, |
170 OMX_PTR priv_data, | 169 OMX_PTR priv_data, |
171 OMX_BUFFERHEADERTYPE* buffer); | 170 OMX_BUFFERHEADERTYPE* buffer); |
172 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, | 171 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, |
173 OMX_PTR priv_data, | 172 OMX_PTR priv_data, |
174 OMX_BUFFERHEADERTYPE* buffer); | 173 OMX_BUFFERHEADERTYPE* buffer); |
175 }; | 174 }; |
176 | 175 |
177 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 176 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |