summaryrefslogtreecommitdiffstats
path: root/media/omx/omx_codec.h
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-14 21:03:36 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-14 21:03:36 +0000
commit7b1e54ab705914db175a849176d231be09ecfcf5 (patch)
tree84170fcc6298b671fcf184eba867ecd7e8e58fe6 /media/omx/omx_codec.h
parentf93ff3f54183a9268b536eba606f63060c67dd50 (diff)
downloadchromium_src-7b1e54ab705914db175a849176d231be09ecfcf5.zip
chromium_src-7b1e54ab705914db175a849176d231be09ecfcf5.tar.gz
chromium_src-7b1e54ab705914db175a849176d231be09ecfcf5.tar.bz2
Remove 2 memcpy() for omx video decode input
Some refactoring to remove 2 memcpy() for encoded video data for OpenMAX. Submitted for: wjia@google.com Reviewer: http://codereview.chromium.org/1574024/show Review URL: http://codereview.chromium.org/1572037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44537 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/omx/omx_codec.h')
-rw-r--r--media/omx/omx_codec.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/media/omx/omx_codec.h b/media/omx/omx_codec.h
index d1c3e4b..f558827 100644
--- a/media/omx/omx_codec.h
+++ b/media/omx/omx_codec.h
@@ -151,7 +151,7 @@ class MessageLoop;
namespace media {
-class OmxInputBuffer;
+class Buffer;
class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
public:
@@ -159,7 +159,7 @@ class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
typedef Callback2<
const OmxConfigurator::MediaFormat&,
const OmxConfigurator::MediaFormat&>::Type FormatCallback;
- typedef Callback1<OmxInputBuffer*>::Type FeedCallback;
+ typedef Callback1<Buffer*>::Type FeedCallback;
typedef Callback2<int,
OmxOutputSink::BufferUsedCallback*>::Type ReadCallback;
typedef Callback0::Type Callback;
@@ -201,7 +201,7 @@ class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
// Feed the decoder with |buffer|. When the decoder has consumed the
// buffer |callback| is called with |buffer| being the parameter.
- void Feed(OmxInputBuffer* buffer, FeedCallback* callback);
+ void Feed(Buffer* buffer, FeedCallback* callback);
// Flush the decoder and reset its end-of-stream state.
void Flush(Callback* callback);
@@ -233,7 +233,7 @@ class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
void StartTask();
void StopTask(Callback* callback);
void ReadTask(ReadCallback* callback);
- void FeedTask(scoped_refptr<OmxInputBuffer> buffer,
+ void FeedTask(scoped_refptr<Buffer> buffer,
FeedCallback* callback);
// Helper method to perform tasks when this object is stopped.
@@ -380,9 +380,19 @@ class OmxCodec : public base::RefCountedThreadSafe<OmxCodec> {
scoped_ptr<Callback> stop_callback_;
scoped_ptr<Callback> error_callback_;
- // Input and output queue for encoded data and decoded frames.
- typedef std::pair<scoped_refptr<OmxInputBuffer>, FeedCallback*> InputUnit;
- std::queue<InputUnit> input_queue_;
+ typedef std::pair<scoped_refptr<Buffer>, FeedCallback*> InputUnit;
+
+ // Input queue for encoded data.
+ // The input buffers will be sent to OMX component via OMX_EmptyThisBuffer()
+ std::queue<InputUnit> pending_input_queue_;
+
+ // Input queue for encoded data.
+ // Those buffers have been sent to OMX component, but not returned
+ // by EmptyBufferDone callback. Once returned from OMX component, they
+ // will be returned to owner.
+ std::queue<InputUnit> processing_input_queue_;
+
+ // Output queue for decoded frames.
std::queue<ReadCallback*> output_queue_;
// Available input OpenMAX buffers that we can use to issue