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> |
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/message_loop.h" | 18 #include "base/message_loop.h" |
19 #include "base/threading/thread.h" | |
piman
2012/10/06 06:42:40
nit: alpha order
| |
19 #include "base/shared_memory.h" | 20 #include "base/shared_memory.h" |
20 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
21 #include "media/video/video_decode_accelerator.h" | 22 #include "media/video/video_decode_accelerator.h" |
22 #include "third_party/angle/include/EGL/egl.h" | 23 #include "third_party/angle/include/EGL/egl.h" |
23 #include "third_party/angle/include/EGL/eglext.h" | 24 #include "third_party/angle/include/EGL/eglext.h" |
24 #include "third_party/openmax/il/OMX_Component.h" | 25 #include "third_party/openmax/il/OMX_Component.h" |
25 #include "third_party/openmax/il/OMX_Core.h" | 26 #include "third_party/openmax/il/OMX_Core.h" |
26 #include "third_party/openmax/il/OMX_Video.h" | 27 #include "third_party/openmax/il/OMX_Video.h" |
27 | 28 |
28 class Gles2TextureToEglImageTranslator; | 29 class Gles2TextureToEglImageTranslator; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 OMX_PTR priv_data, | 242 OMX_PTR priv_data, |
242 OMX_EVENTTYPE event, | 243 OMX_EVENTTYPE event, |
243 OMX_U32 data1, OMX_U32 data2, | 244 OMX_U32 data1, OMX_U32 data2, |
244 OMX_PTR event_data); | 245 OMX_PTR event_data); |
245 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, | 246 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, |
246 OMX_PTR priv_data, | 247 OMX_PTR priv_data, |
247 OMX_BUFFERHEADERTYPE* buffer); | 248 OMX_BUFFERHEADERTYPE* buffer); |
248 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, | 249 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, |
249 OMX_PTR priv_data, | 250 OMX_PTR priv_data, |
250 OMX_BUFFERHEADERTYPE* buffer); | 251 OMX_BUFFERHEADERTYPE* buffer); |
252 | |
253 // When we get a texture back via ReusePictureBuffer(), we want to ensure | |
254 // that its contents have been read out by rendering layer, before we start | |
255 // overwriting it with the decoder. This thread is used to wait for a sync | |
256 // object inserted into the command stream at the time of | |
257 // ReusePictureBuffer. This guarantees that the object is in the stream after | |
258 // the corresponding texture commands have been inserted into it. Once the | |
259 // sync object is signalled, we are sure that the stream reached the sync | |
260 // object, which ensures that all commands related to the texture we are | |
261 // getting back have been finished as well. | |
262 base::Thread sync_thread_; | |
263 | |
264 // Run on the sync_thread_. Wait on the given sync object and post a task | |
265 // back onto the main thread to queue the texture for reuse. | |
266 void WaitForPictureSync(int32 picture_buffer_id, EGLSyncKHR egl_sync_obj); | |
267 | |
268 // Posted onto the main thread by WaitForPictureSync to queue the texture | |
269 // back for reuse. | |
270 void QueuePictureBuffer(int32 picture_buffer_id); | |
251 }; | 271 }; |
252 | 272 |
253 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ | 273 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ |
OLD | NEW |