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

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

Issue 10808058: Add support for VP8 decode to OmxVideoDecodeAccelerator, for HW that supports it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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) 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // DESTROYING or ERRORING. 63 // DESTROYING or ERRORING.
64 enum CurrentStateChange { 64 enum CurrentStateChange {
65 NO_TRANSITION, // Not in the middle of a transition. 65 NO_TRANSITION, // Not in the middle of a transition.
66 INITIALIZING, 66 INITIALIZING,
67 FLUSHING, 67 FLUSHING,
68 RESETTING, 68 RESETTING,
69 DESTROYING, 69 DESTROYING,
70 ERRORING, // Trumps all other transitions; no recovery is possible. 70 ERRORING, // Trumps all other transitions; no recovery is possible.
71 }; 71 };
72 72
73 // Add codecs as we get HW that supports them (and which are supported by SW
74 // decode!).
75 enum Codec {
76 UNKNOWN,
77 H264,
78 VP8
79 };
80
73 // Helper struct for keeping track of the relationship between an OMX output 81 // Helper struct for keeping track of the relationship between an OMX output
74 // buffer and the PictureBuffer it points to. 82 // buffer and the PictureBuffer it points to.
75 struct OutputPicture { 83 struct OutputPicture {
76 OutputPicture(media::PictureBuffer p_b, OMX_BUFFERHEADERTYPE* o_b_h, 84 OutputPicture(media::PictureBuffer p_b, OMX_BUFFERHEADERTYPE* o_b_h,
77 EGLImageKHR e_i) 85 EGLImageKHR e_i)
78 : picture_buffer(p_b), omx_buffer_header(o_b_h), egl_image(e_i) {} 86 : picture_buffer(p_b), omx_buffer_header(o_b_h), egl_image(e_i) {}
79 media::PictureBuffer picture_buffer; 87 media::PictureBuffer picture_buffer;
80 OMX_BUFFERHEADERTYPE* omx_buffer_header; 88 OMX_BUFFERHEADERTYPE* omx_buffer_header;
81 EGLImageKHR egl_image; 89 EGLImageKHR egl_image;
82 }; 90 };
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 // before NotifyResetDone is sent. 197 // before NotifyResetDone is sent.
190 std::vector<int> queued_picture_buffer_ids_; 198 std::vector<int> queued_picture_buffer_ids_;
191 199
192 // To expose client callbacks from VideoDecodeAccelerator. 200 // To expose client callbacks from VideoDecodeAccelerator.
193 // NOTE: all calls to this object *MUST* be executed in message_loop_. 201 // NOTE: all calls to this object *MUST* be executed in message_loop_.
194 Client* client_; 202 Client* client_;
195 203
196 scoped_ptr<Gles2TextureToEglImageTranslator> texture_to_egl_image_translator_; 204 scoped_ptr<Gles2TextureToEglImageTranslator> texture_to_egl_image_translator_;
197 205
198 // These members are only used during Initialization. 206 // These members are only used during Initialization.
199 // OMX_AVCProfile requested during Initialization. 207 Codec codec_;
200 uint32 profile_; 208 uint32 h264_profile_; // OMX_AVCProfile requested during Initialization.
201 bool component_name_is_nvidia_h264ext_; 209 bool component_name_is_nvidia_h264ext_;
202 210
203 // Method to handle events 211 // Method to handle events
204 void EventHandlerCompleteTask(OMX_EVENTTYPE event, 212 void EventHandlerCompleteTask(OMX_EVENTTYPE event,
205 OMX_U32 data1, 213 OMX_U32 data1,
206 OMX_U32 data2); 214 OMX_U32 data2);
207 215
208 // Method to receive buffers from component's input port 216 // Method to receive buffers from component's input port
209 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer); 217 void EmptyBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer);
210 218
(...skipping 14 matching lines...) Expand all
225 OMX_PTR event_data); 233 OMX_PTR event_data);
226 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component, 234 static OMX_ERRORTYPE EmptyBufferCallback(OMX_HANDLETYPE component,
227 OMX_PTR priv_data, 235 OMX_PTR priv_data,
228 OMX_BUFFERHEADERTYPE* buffer); 236 OMX_BUFFERHEADERTYPE* buffer);
229 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component, 237 static OMX_ERRORTYPE FillBufferCallback(OMX_HANDLETYPE component,
230 OMX_PTR priv_data, 238 OMX_PTR priv_data,
231 OMX_BUFFERHEADERTYPE* buffer); 239 OMX_BUFFERHEADERTYPE* buffer);
232 }; 240 };
233 241
234 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_ 242 #endif // CONTENT_COMMON_GPU_MEDIA_OMX_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698