| 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 84%
|
| rename from content/gpu/omx_video_decode_accelerator.h
|
| rename to content/common/gpu/omx_video_decode_accelerator.h
|
| index ea4e6c25f1814ccb268ffab1133b4c185b9062cb..f54c84f64946659e1520a91e2a6e7b654639825f 100644
|
| --- a/content/gpu/omx_video_decode_accelerator.h
|
| +++ b/content/common/gpu/omx_video_decode_accelerator.h
|
| @@ -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);
|
|
|