summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngela Stegmaier <angelabaker@ti.com>2018-03-15 17:14:10 -0500
committerAngela Stegmaier <angelabaker@ti.com>2018-03-23 15:09:32 -0600
commit023de4b4505db0dd8b9359a904f89665eed7ff6e (patch)
tree27c00f060e58d45668773f03490c49c53ea8038d
parent67c3e9944d660ae7891cea21cd78f915867820ed (diff)
downloaddra7xx-023de4b4505db0dd8b9359a904f89665eed7ff6e.tar.gz
OMX: Video Encoder: Fix for metadatabufmodes NV12 format case
If the input is in metadata buffer mode, only the case where the input format wasn't NV12 was being handled, and not the case for when the input was NV12. This caused a failure for the vts test case for metadata buffer modes. The handling for the case where the input format is NV12 is now handled in this patch. Also the vts test case failed if we returned an error during setParamter for invalid framerate on output port. Change this error to a warning to pass the vts test case and ignore the invalid framerate that is passed. Change-Id: I518ff826bc89dc13a63614e05d84724145aafa68 Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
-rw-r--r--omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c b/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c
index 7aa67f4..b3721ab 100644
--- a/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c
+++ b/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c
@@ -655,9 +655,8 @@ static OMX_ERRORTYPE OMXH264VE_SetParameter(OMX_HANDLETYPE hComponent,
OMX_ErrorUnsupportedSetting);
if( pPortDef->format.video.xFramerate != 0 ) {
- OSAL_ErrorTrace("Non-zero framerate rate set on o/p port. Setting frame rate is supported only on i/p port");
- eError = OMX_ErrorUnsupportedSetting;
- goto EXIT;
+ OSAL_WarningTrace("Non-zero framerate rate set on o/p port. Setting frame rate is supported only on i/p port");
+ pPortDef->format.video.xFramerate = 0;
}
eError = OMXH264VE_CheckBitRateCap(pPortDef->format.video.nBitrate, hComponent);
OMX_CHECK((eError == OMX_ErrorNone), OMX_ErrorUnsupportedSetting);
@@ -1858,39 +1857,48 @@ static OMX_ERRORTYPE OMXH264VE_DataNotify(OMX_HANDLETYPE hComponent)
pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_TILEDPAGE;
}
+ else {
+ pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[0].dma_buf_fd = (OMX_U32)(pGrallocHandle->fd[0]);
+ pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[0].offset = (pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->nOffset);
+
+ pH264VEComp->pVedEncInBufs->planeDesc[i].buf =
+ (XDAS_Int8 *)&(pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[0]);
+
+ pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_TILEDPAGE;
+ }
}
} else {
- ((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[0].offset = (pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->nOffset);
+ ((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[0].offset = (pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->nOffset);
- pH264VEComp->pVedEncInBufs->planeDesc[i].buf = (XDAS_Int8 *)&(((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[0]);
+ pH264VEComp->pVedEncInBufs->planeDesc[i].buf = (XDAS_Int8 *)&(((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[0]);
- pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_RAW;
+ pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_RAW;
}
pH264VEComp->pVedEncInBufs->imagePitch[0] = pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nStride;
pH264VEComp->pVedEncInBufs->planeDesc[i].bufSize.bytes = (pH264VEComp->pVedEncInBufs->imagePitch[0]) * (pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nFrameHeight);
} else if( i == 1 ) {
if (pH264VEComp->bInputMetaDataBufferMode) {
- //Nothing to be done; color conversion and fd xlation is done during the plane0 processing
- memcpy(&(pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[1]), &(pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[0]), sizeof(MemHeader));
+ //Nothing to be done; color conversion and fd xlation is done during the plane0 processing
+ memcpy(&(pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[1]), &(pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[0]), sizeof(MemHeader));
- pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[1].offset =
+ pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[1].offset =
((pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nStride) *
(pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nFrameHeight));
- pH264VEComp->pVedEncInBufs->planeDesc[i].buf =
- (XDAS_Int8 *)&(pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[1]);
+ pH264VEComp->pVedEncInBufs->planeDesc[i].buf =
+ (XDAS_Int8 *)&(pH264VEComp->pCodecInBufferBackupArray[InBufferHdrIndex].sMemHdr[1]);
- pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_TILEDPAGE;
+ pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_TILEDPAGE;
} else {
- memcpy(&((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[1], &((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[0], sizeof(MemHeader));
+ memcpy(&((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[1], &((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[0], sizeof(MemHeader));
- ((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[1].offset = ((pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nStride) * (pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nFrameHeight));
+ ((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[1].offset = ((pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nStride) * (pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nFrameHeight));
- pH264VEComp->pVedEncInBufs->planeDesc[i].buf = (XDAS_Int8 *)&(((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[1]);
+ pH264VEComp->pVedEncInBufs->planeDesc[i].buf = (XDAS_Int8 *)&(((OMXBase_BufHdrPvtData *)(pH264VEComp->pCodecInBufferArray[InBufferHdrIndex]->pPlatformPrivate))->sMemHdr[1]);
- pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_RAW;
- }
+ pH264VEComp->pVedEncInBufs->planeDesc[i].memType = XDM_MEMTYPE_RAW;
+ }
pH264VEComp->pVedEncInBufs->imagePitch[1] = pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nStride;
pH264VEComp->pVedEncInBufs->planeDesc[i].bufSize.bytes = (pH264VEComp->pVedEncInBufs->imagePitch[1]) * (pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.format.video.nFrameHeight) / 2;