OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 MessageLoop* message_loop_; | 97 MessageLoop* message_loop_; |
98 OMX_HANDLETYPE component_handle_; | 98 OMX_HANDLETYPE component_handle_; |
99 | 99 |
100 // Create the Component for OMX. Handles all OMX initialization. | 100 // Create the Component for OMX. Handles all OMX initialization. |
101 bool CreateComponent(); | 101 bool CreateComponent(); |
102 // Buffer allocation/free methods for input and output buffers. | 102 // Buffer allocation/free methods for input and output buffers. |
103 bool AllocateInputBuffers(); | 103 bool AllocateInputBuffers(); |
104 bool AllocateFakeOutputBuffers(); | 104 bool AllocateFakeOutputBuffers(); |
105 bool AllocateOutputBuffers(); | 105 bool AllocateOutputBuffers(); |
106 void FreeInputBuffers(); | 106 void FreeOMXBuffers(); |
107 void FreeOutputBuffers(); | |
108 | 107 |
109 // Methods to handle OMX state transitions. See section 3.1.1.2 of the spec. | 108 // Methods to handle OMX state transitions. See section 3.1.1.2 of the spec. |
110 // Request transitioning OMX component to some other state. | 109 // Request transitioning OMX component to some other state. |
111 void BeginTransitionToState(OMX_STATETYPE new_state); | 110 void BeginTransitionToState(OMX_STATETYPE new_state); |
112 // The callback received when the OMX component has transitioned. | 111 // The callback received when the OMX component has transitioned. |
113 void DispatchStateReached(OMX_STATETYPE reached); | 112 void DispatchStateReached(OMX_STATETYPE reached); |
114 // Callbacks handling transitioning to specific states during state changes. | 113 // Callbacks handling transitioning to specific states during state changes. |
115 // These follow a convention of OnReached<STATE>In<CurrentStateChange>(), | 114 // These follow a convention of OnReached<STATE>In<CurrentStateChange>(), |
116 // requiring that each pair of <reached-state>/CurrentStateChange is unique | 115 // requiring that each pair of <reached-state>/CurrentStateChange is unique |
117 // (i.e. the source state is uniquely defined by the pair). | 116 // (i.e. the source state is uniquely defined by the pair). |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 OMX_PTR event_data); | 244 OMX_PTR event_data); |
246 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, | 245 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, |
247 OMX_PTR priv_data, | 246 OMX_PTR priv_data, |
248 OMX_BUFFERHEADERTYPE* buffer); | 247 OMX_BUFFERHEADERTYPE* buffer); |
249 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, | 248 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, |
250 OMX_PTR priv_data, | 249 OMX_PTR priv_data, |
251 OMX_BUFFERHEADERTYPE* buffer); | 250 OMX_BUFFERHEADERTYPE* buffer); |
252 }; | 251 }; |
253 | 252 |
254 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 253 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |