summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rwxr-xr-xmedia/libstagefright/OMXCodec.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 27dfeab..7f09319 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -808,7 +808,7 @@ status_t OMXCodec::setVideoPortFormatType(
}
if (format.eCompressionFormat == compressionFormat
- && format.eColorFormat == colorFormat) {
+ && format.eColorFormat == colorFormat) {
found = true;
break;
}
@@ -838,6 +838,15 @@ static size_t getFrameSize(
case OMX_COLOR_FormatYUV420Planar:
case OMX_COLOR_FormatYUV420SemiPlanar:
case OMX_TI_COLOR_FormatYUV420PackedSemiPlanar:
+ /*
+ * FIXME: For the Opaque color format, the frame size does not
+ * need to be (w*h*3)/2. It just needs to
+ * be larger than certain minimum buffer size. However,
+ * currently, this opaque foramt has been tested only on
+ * YUV420 formats. If that is changed, then we need to revisit
+ * this part in the future
+ */
+ case OMX_COLOR_FormatAndroidOpaque:
return (width * height * 3) / 2;
default:
@@ -887,7 +896,7 @@ status_t OMXCodec::isColorFormatSupported(
// Make sure that omx component does not overwrite
// the incremented index (bug 2897413).
CHECK_EQ(index, portFormat.nIndex);
- if ((portFormat.eColorFormat == colorFormat)) {
+ if (portFormat.eColorFormat == colorFormat) {
LOGV("Found supported color format: %d", portFormat.eColorFormat);
return OK; // colorFormat is supported!
}
@@ -2316,6 +2325,7 @@ void OMXCodec::onEvent(OMX_EVENTTYPE event, OMX_U32 data1, OMX_U32 data2) {
{
CODEC_LOGV("OMX_EventPortSettingsChanged(port=%ld, data2=0x%08lx)",
data1, data2);
+ CHECK(mFilledBuffers.empty());
if (data2 == 0 || data2 == OMX_IndexParamPortDefinition) {
onPortSettingsChanged(data1);
@@ -2923,6 +2933,7 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) {
size_t offset = 0;
int32_t n = 0;
+
for (;;) {
MediaBuffer *srcBuffer;
if (mSeekTimeUs >= 0) {
@@ -3021,6 +3032,7 @@ bool OMXCodec::drainInputBuffer(BufferInfo *info) {
CHECK(info->mMediaBuffer == NULL);
info->mMediaBuffer = srcBuffer;
} else {
+ CHECK(srcBuffer->data() != NULL) ;
memcpy((uint8_t *)info->mData + offset,
(const uint8_t *)srcBuffer->data()
+ srcBuffer->range_offset(),