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

Unified Diff: content/common/gpu/omx_video_decode_accelerator.h

Issue 7057027: Updated OMX decoder for recent PPAPI changes, and added to the build. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated include guards. Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/omx_video_decode_accelerator.h
diff --git a/content/gpu/omx_video_decode_accelerator.h b/content/common/gpu/omx_video_decode_accelerator.h
similarity index 81%
rename from content/gpu/omx_video_decode_accelerator.h
rename to content/common/gpu/omx_video_decode_accelerator.h
index ea4e6c25f1814ccb268ffab1133b4c185b9062cb..0ab80c0ba84bf0f20579e7bf625dd4575d9837bc 100644
--- a/content/gpu/omx_video_decode_accelerator.h
+++ b/content/common/gpu/omx_video_decode_accelerator.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
-#define CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
+#ifndef CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
+#define CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
#include <dlfcn.h>
#include <map>
@@ -30,20 +30,24 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
virtual ~OmxVideoDecodeAccelerator();
// media::VideoDecodeAccelerator implementation.
- const std::vector<uint32>& GetConfig(
- const std::vector<uint32>& prototype_config);
+ void GetConfigs(const std::vector<uint32>& requested_configs,
+ std::vector<uint32>* matched_configs);
bool Initialize(const std::vector<uint32>& config);
- bool Decode(const media::BitstreamBuffer& bitstream_buffer,
- const media::VideoDecodeAcceleratorCallback& callback);
- void AssignPictureBuffer(std::vector<PictureBuffer*> picture_buffers);
+ bool Decode(const media::BitstreamBuffer& bitstream_buffer);
+ virtual void AssignGLESBuffers(const std::vector<media::GLESBuffer>& buffers);
+ virtual void AssignSysmemBuffers(
+ const std::vector<media::SysmemBuffer>& buffers);
void ReusePictureBuffer(int32 picture_buffer_id);
- bool Flush(const media::VideoDecodeAcceleratorCallback& callback);
- bool Abort(const media::VideoDecodeAcceleratorCallback& callback);
+ bool Flush();
+ bool Abort();
private:
MessageLoop* message_loop_;
OMX_HANDLETYPE component_handle_;
+ // Common initialization code for Assign{GLES,Sysmem}Buffers.
+ void AssignBuffersHelper(const std::vector<media::BaseBuffer*>& buffers);
+
// Create the Component for OMX. Handles all OMX initialization.
bool CreateComponent();
// Buffer allocation/free methods for input and output buffers.
@@ -102,18 +106,13 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
std::queue<OMX_BUFFERHEADERTYPE*> free_input_buffers_;
// For output buffer recycling cases.
- std::vector<media::VideoDecodeAccelerator::PictureBuffer*>
- assigned_picture_buffers_;
- typedef std::pair<PictureBuffer*,
- OMX_BUFFERHEADERTYPE*> OutputPicture;
+ std::vector<media::BaseBuffer*> assigned_picture_buffers_;
+ typedef std::pair<int32, OMX_BUFFERHEADERTYPE*> OutputPicture;
std::vector<OutputPicture> output_pictures_;
// To expose client callbacks from VideoDecodeAccelerator.
Client* client_;
- media::VideoDecodeAcceleratorCallback flush_done_callback_;
- media::VideoDecodeAcceleratorCallback abort_done_callback_;
-
std::vector<uint32> texture_ids_;
std::vector<uint32> context_ids_;
// Method to handle events
@@ -127,14 +126,10 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
// Method to receive buffers from component's output port
void FillBufferDoneTask(OMX_BUFFERHEADERTYPE* buffer);
typedef std::pair<OMX_BUFFERHEADERTYPE*, uint32> OMXbufferTexture;
- // void pointer to hold EGLImage handle.
- void* egl_image_;
- typedef std::map<
- OMX_BUFFERHEADERTYPE*,
- std::pair<base::SharedMemory*,
- media::VideoDecodeAcceleratorCallback> > OMXBufferCallbackMap;
- OMXBufferCallbackMap omx_buff_cb_;
+ typedef std::map<OMX_BUFFERHEADERTYPE*,
+ std::pair<base::SharedMemory*, int32> > OMXBufferIdMap;
+ OMXBufferIdMap omx_buff_ids_;
// Method used the change the state of the port.
void ChangePort(OMX_COMMANDTYPE cmd, int port_index);
@@ -162,4 +157,4 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
OMX_BUFFERHEADERTYPE* buffer);
};
-#endif // CONTENT_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_
+#endif // CONTENT_COMMON_GPU_OMX_VIDEO_DECODE_ACCELERATOR_H_

Powered by Google App Engine
This is Rietveld 408576698