summaryrefslogtreecommitdiffstats
path: root/media/omx/omx_codec.cc
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 21:15:00 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 21:15:00 +0000
commit0d7cef4d19826157be5d8ee93a5a85a8a3d2fe5c (patch)
tree768113ab7d376c80ebf1a8e36e654ebccf2f1cf3 /media/omx/omx_codec.cc
parentd7313ce9aecaed59829e57bf12521eaf135e5f74 (diff)
downloadchromium_src-0d7cef4d19826157be5d8ee93a5a85a8a3d2fe5c.zip
chromium_src-0d7cef4d19826157be5d8ee93a5a85a8a3d2fe5c.tar.gz
chromium_src-0d7cef4d19826157be5d8ee93a5a85a8a3d2fe5c.tar.bz2
Refactor media::InputBuffer to consolidate it with media::Buffer
Rename media::InputBuffer to media::OmxInputBuffer and inherit from media::Buffer. Also provide the timestamp to media::OmxCodec. TEST=omx_test BUG=32753 Review URL: http://codereview.chromium.org/577012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/omx/omx_codec.cc')
-rw-r--r--media/omx/omx_codec.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/media/omx/omx_codec.cc b/media/omx/omx_codec.cc
index 71387d1..6b8d95e 100644
--- a/media/omx/omx_codec.cc
+++ b/media/omx/omx_codec.cc
@@ -8,8 +8,8 @@
#include "base/message_loop.h"
#include "base/stl_util-inl.h"
#include "base/string_util.h"
-#include "media/omx/input_buffer.h"
#include "media/omx/omx_codec.h"
+#include "media/omx/omx_input_buffer.h"
namespace media {
@@ -82,7 +82,7 @@ void OmxCodec::Read(ReadCallback* callback) {
NewRunnableMethod(this, &OmxCodec::ReadTask, callback));
}
-void OmxCodec::Feed(InputBuffer* buffer, FeedCallback* callback) {
+void OmxCodec::Feed(OmxInputBuffer* buffer, FeedCallback* callback) {
message_loop_->PostTask(
FROM_HERE,
NewRunnableMethod(this, &OmxCodec::FeedTask, buffer, callback));
@@ -159,7 +159,8 @@ void OmxCodec::ReadTask(ReadCallback* callback) {
FillBufferTask();
}
-void OmxCodec::FeedTask(InputBuffer* buffer, FeedCallback* callback) {
+void OmxCodec::FeedTask(OmxInputBuffer* buffer,
+ FeedCallback* callback) {
DCHECK_EQ(message_loop_, MessageLoop::current());
if (!CanAcceptInput()) {
@@ -246,7 +247,7 @@ void OmxCodec::FreeInputQueue() {
DCHECK_EQ(message_loop_, MessageLoop::current());
while (!input_queue_.empty()) {
- InputBuffer* buffer = input_queue_.front().first;
+ OmxInputBuffer* buffer = input_queue_.front().first;
FeedCallback* callback = input_queue_.front().second;
callback->Run(buffer);
delete callback;
@@ -964,7 +965,7 @@ void OmxCodec::EmptyBufferTask() {
while (!input_queue_.empty() &&
!available_input_buffers_.empty() &&
!input_eos_) {
- InputBuffer* buffer = input_queue_.front().first;
+ OmxInputBuffer* buffer = input_queue_.front().first;
FeedCallback* callback = input_queue_.front().second;
OMX_BUFFERHEADERTYPE* omx_buffer = available_input_buffers_.front();
available_input_buffers_.pop();
@@ -984,7 +985,7 @@ void OmxCodec::EmptyBufferTask() {
omx_buffer->nFilledLen = filled;
omx_buffer->pAppPrivate = this;
omx_buffer->nFlags |= input_eos_ ? OMX_BUFFERFLAG_EOS : 0;
- // TODO(hclam): Get timestamp from the input buffer and fill in here.
+ omx_buffer->nTimeStamp = buffer->GetTimestamp().InMilliseconds();
// Give this buffer to OMX.
OMX_ERRORTYPE ret = OMX_EmptyThisBuffer(component_handle_, omx_buffer);