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

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: . 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
« no previous file with comments | « content/common/gpu/gpu_video_service.cc ('k') | content/common/gpu/omx_video_decode_accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 80%
rename from content/gpu/omx_video_decode_accelerator.h
rename to content/common/gpu/omx_video_decode_accelerator.h
index ea4e6c25f1814ccb268ffab1133b4c185b9062cb..5f8e324c69deeecc6de9f037c457b966b889fe33 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,25 @@ class OmxVideoDecodeAccelerator : public media::VideoDecodeAccelerator {
virtual ~OmxVideoDecodeAccelerator();
// media::VideoDecodeAccelerator implementation.
- const std::vector<uint32>& GetConfig(
- const std::vector<uint32>& prototype_config);
- 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);
- void ReusePictureBuffer(int32 picture_buffer_id);
- bool Flush(const media::VideoDecodeAcceleratorCallback& callback);
- bool Abort(const media::VideoDecodeAcceleratorCallback& callback);
+ void GetConfigs(const std::vector<uint32>& requested_configs,
+ std::vector<uint32>* matched_configs) OVERRIDE;
+ bool Initialize(const std::vector<uint32>& config) OVERRIDE;
+ bool Decode(const media::BitstreamBuffer& bitstream_buffer) OVERRIDE;
+ virtual void AssignGLESBuffers(
+ const std::vector<media::GLESBuffer>& buffers) OVERRIDE;
+ virtual void AssignSysmemBuffers(
+ const std::vector<media::SysmemBuffer>& buffers) OVERRIDE;
+ void ReusePictureBuffer(int32 picture_buffer_id) OVERRIDE;
+ bool Flush() OVERRIDE;
+ bool Abort() OVERRIDE;
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 +107,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 +127,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 +158,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_
« no previous file with comments | « content/common/gpu/gpu_video_service.cc ('k') | content/common/gpu/omx_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698