Lines Matching refs:pC
65 M4VSS3GPP_InternalEditContext *pC );
67 M4VSS3GPP_intCheckVideoEffects( M4VSS3GPP_InternalEditContext *pC,
70 M4VSS3GPP_InternalEditContext *pC, M4VIFI_ImagePlane *pPlaneIn,
74 M4VSS3GPP_intVideoTransition( M4VSS3GPP_InternalEditContext *pC,
78 M4VSS3GPP_intUpdateTimeInfo( M4VSS3GPP_InternalEditContext *pC,
93 M4VSS3GPP_InternalEditContext *pC,
99 M4VSS3GPP_InternalEditContext *pC,
102 M4VSS3GPP_InternalEditContext *pC,
117 M4VSS3GPP_InternalEditContext *pC,
125 * @param pC (IN/OUT) Internal edit context
128 M4OSA_ERR M4VSS3GPP_intEditStepVideo( M4VSS3GPP_InternalEditContext *pC )
140 if ( ((M4OSA_Int32)(pC->ewc.dInputVidCts) - pC->pC1->iVoffset
141 + pC->iInOutTimeOffset) >= pC->pC1->iEndTime )
144 pC->iInOutTimeOffset = ((M4OSA_Int32)(pC->ewc.dInputVidCts))
145 - pC->pC1->iVoffset + pC->iInOutTimeOffset - pC->pC1->iEndTime;
146 if ( pC->iInOutTimeOffset < 0 ) {
147 pC->iInOutTimeOffset = 0;
152 err = M4VSS3GPP_intReachedEndOfVideo(pC);
166 if ( (M4VSS3GPP_kClipStatus_DECODE_UP_TO != pC->pC1->Vstatus)
167 && (( pC->pC2 == M4OSA_NULL)
168 || (M4VSS3GPP_kClipStatus_DECODE_UP_TO != pC->pC2->Vstatus)) )
173 pC); /**< This function change the pC->Vstate variable! */
185 switch( pC->Vstate )
202 if( M4VSS3GPP_kClipStatus_READ != pC->pC1->Vstatus )
207 iCts = (M4OSA_Int32)(pC->ewc.dInputVidCts) - pC->pC1->iVoffset;
208 err = pC->pC1->ShellAPI.m_pReader->m_pFctJump(
209 pC->pC1->pReaderContext,
210 (M4_StreamHandler *)pC->pC1->pVideoStream, &iCts);
221 err = pC->pC1->ShellAPI.m_pReaderDataIt->m_pFctGetNextAu(
222 pC->pC1->pReaderContext,
223 (M4_StreamHandler *)pC->pC1->pVideoStream,
224 &pC->pC1->VideoAU);
236 pC->pC1->VideoAU.m_CTS, pC->pC1->iVoffset,
237 pC->pC1->VideoAU.m_size);
240 if( pC->pC1->VideoAU.m_CTS == iCts
241 && pC->pC1->iVideoRenderCts >= iCts )
248 if( ( pC->Vstate == M4VSS3GPP_kEditVideoState_AFTER_CUT)
249 && (pC->pC1->VideoAU.m_CTS
250 + pC->pC1->iVoffset <= pC->ewc.WriterVideoAU.CTS) )
257 pC->pC1->Vstatus = M4VSS3GPP_kClipStatus_READ;
260 iCts = ((M4OSA_Int32)pC->ewc.dInputVidCts) - pC->pC1->iVoffset - 1;
261 iNextCts = iCts + ((M4OSA_Int32)pC->dOutputFrameDuration) + 1;
263 if( iNextCts > pC->pC1->iEndTime )
264 iNextCts = pC->pC1->iEndTime;
269 && (( pC->pC1->VideoAU.m_CTS >= iCts)
270 && (pC->pC1->VideoAU.m_CTS < iNextCts)
271 && (pC->pC1->VideoAU.m_size > 0)) )
275 err = pC->ShellAPI.pWriterDataFcts->pStartAU(
276 pC->ewc.p3gpWriterContext,
278 &pC->ewc.WriterVideoAU);
291 pC->ewc.WriterVideoAU.attribute = pC->pC1->VideoAU.m_attribute;
293 pC->ewc.WriterVideoAU.CTS = (M4OSA_Time)pC->pC1->VideoAU.m_CTS +
294 (M4OSA_Time)pC->pC1->iVoffset;
295 pC->ewc.dInputVidCts += pC->dOutputFrameDuration;
299 if( pC->pC1->pVideoStream->m_basicProperties.m_streamType
303 pC->ewc.WriterVideoAU.size = pC->pC1->VideoAU.m_size - offset;
304 if( pC->ewc.WriterVideoAU.size > pC->ewc.uiVideoMaxAuSize )
309 pC->ewc.WriterVideoAU.size, pC->ewc.uiVideoMaxAuSize);
313 memcpy((void *)pC->ewc.WriterVideoAU.dataAddress,
314 (void *)(pC->pC1->VideoAU.m_dataAddress + offset),
315 (pC->ewc.WriterVideoAU.size));
320 M4VSS3GPP_intUpdateTimeInfo(pC, &pC->ewc.WriterVideoAU);
322 pC->ewc.WriterVideoAU.CTS, pC->ewc.WriterVideoAU.size);
326 err = pC->ShellAPI.pWriterDataFcts->pProcessAU(
327 pC->ewc.p3gpWriterContext,
329 &pC->ewc.WriterVideoAU);
355 err = pC->pC1->ShellAPI.m_pReaderDataIt->m_pFctGetNextAu(
356 pC->pC1->pReaderContext,
357 (M4_StreamHandler *)pC->pC1->pVideoStream,
358 &pC->pC1->VideoAU);
370 pC->pC1->VideoAU.m_CTS, pC->pC1->iVoffset,
371 pC->pC1->VideoAU.m_size);
377 if( ( pC->pC1->VideoAU.m_size == 0)
378 || (pC->pC1->VideoAU.m_CTS >= iNextCts) )
382 pC->ewc.dInputVidCts += pC->dOutputFrameDuration;
386 pC->Vstate = M4VSS3GPP_kEditVideoState_READ_WRITE;
391 pC->ewc.dVTo */
392 err = pC->pC1->ShellAPI.m_pReaderDataIt->m_pFctGetNextAu(
393 pC->pC1->pReaderContext,
394 (M4_StreamHandler *)pC->pC1->pVideoStream,
395 &pC->pC1->VideoAU);
407 pC->pC1->VideoAU.m_CTS, pC->pC1->iVoffset,
408 pC->pC1->VideoAU.m_size);
426 if ((pC->pC1->pSettings->FileType ==
429 pC->pC1->pSettings->ClipProperties.bSetImageData)) {
431 err = M4VSS3GPP_intSetYuv420PlaneFromARGB888(pC, pC->pC1);
443 err = M4VSS3GPP_intClipDecodeVideoUpToCts(pC->pC1, (M4OSA_Int32)pC->ewc.dInputVidCts);
454 if( M4VSS3GPP_kClipStatus_DECODE_UP_TO == pC->pC1->Vstatus )
461 pC->ewc.VppError = M4NO_ERROR;
468 if( pC->Vstate == M4VSS3GPP_kEditVideoState_BEGIN_CUT )
474 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctEncode(pC->ewc.pEncContext, M4OSA_NULL,
475 pC->ewc.dInputVidCts, FrameMode);
478 if( M4NO_ERROR != pC->ewc.VppError )
483 pC->ewc.VppError);
486 if( M4WAR_VIDEORENDERER_NO_NEW_FRAME != pC->ewc.VppError )
490 return pC->ewc.VppError;
529 if( M4VSS3GPP_kEditVideoState_DECODE_ENCODE == pC->Vstate )
532 pC->ewc.dInputVidCts += pC->dOutputFrameDuration;
547 if( !(( M4VSS3GPP_kClipStatus_DECODE_UP_TO != pC->pC1->Vstatus)
548 && (M4VSS3GPP_kClipStatus_DECODE_UP_TO == pC->pC2->Vstatus)) )
553 if ((pC->pC1->pSettings->FileType ==
556 pC->pC1->pSettings->ClipProperties.bSetImageData)) {
558 err = M4VSS3GPP_intSetYuv420PlaneFromARGB888(pC, pC->pC1);
567 err = M4VSS3GPP_intClipDecodeVideoUpToCts(pC->pC1,
568 (M4OSA_Int32)pC->ewc.dInputVidCts);
579 if( M4VSS3GPP_kClipStatus_DECODE_UP_TO == pC->pC1->Vstatus )
586 if( !(( M4VSS3GPP_kClipStatus_DECODE_UP_TO != pC->pC2->Vstatus)
587 && (M4VSS3GPP_kClipStatus_DECODE_UP_TO == pC->pC1->Vstatus)) )
592 if ((pC->pC2->pSettings->FileType ==
595 pC->pC2->pSettings->ClipProperties.bSetImageData)) {
597 err = M4VSS3GPP_intSetYuv420PlaneFromARGB888(pC, pC->pC2);
607 err = M4VSS3GPP_intClipDecodeVideoUpToCts(pC->pC2,
608 (M4OSA_Int32)pC->ewc.dInputVidCts);
619 if( M4VSS3GPP_kClipStatus_DECODE_UP_TO == pC->pC2->Vstatus )
627 pC->ewc.VppError = M4NO_ERROR;
635 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctEncode(pC->ewc.pEncContext, M4OSA_NULL,
636 pC->ewc.dInputVidCts, M4ENCODER_kNormalFrame);
640 if( M4NO_ERROR != pC->ewc.VppError )
645 pC->ewc.VppError);
648 if( M4WAR_VIDEORENDERER_NO_NEW_FRAME != pC->ewc.VppError )
653 return pC->ewc.VppError;
693 pC->ewc.dInputVidCts += pC->dOutputFrameDuration;
706 pC->Vstate);
720 * @param pC (IN/OUT) Internal edit context
724 M4VSS3GPP_InternalEditContext *pC )
728 const M4OSA_Int32 t = (M4OSA_Int32)pC->ewc.dInputVidCts;
730 const M4OSA_Int32 TD = pC->pTransitionList[pC->uiCurrentClip].uiTransitionDuration;
734 const M4VSS3GPP_EditVideoState previousVstate = pC->Vstate;
738 M4VSS3GPP_intCheckVideoEffects(pC, 1);
742 if( ( TD > 0) && (( t - pC->pC1->iVoffset) >= (pC->pC1->iEndTime - TD)) )
746 pC->Vstate = M4VSS3GPP_kEditVideoState_TRANSITION;
747 pC->bTransitionEffect = M4OSA_TRUE;
751 if( M4OSA_NULL == pC->pC2 )
753 pC->pC1->bGetYuvDataFromDecoder = M4OSA_TRUE;
755 err = M4VSS3GPP_intOpenClip(pC, &pC->pC2,
756 &pC->pClipList[pC->uiCurrentClip + 1]);
771 pC->pC2->iVoffset += (M4OSA_UInt32)pC->ewc.dInputVidCts;
778 iTmp = ((M4OSA_Int32)pC->ewc.dInputVidCts)\
779 - (pC->pC1->iEndTime - TD + pC->pC1->iVoffset);
780 if (iTmp < (M4OSA_Int32)pC->pTransitionList[pC->uiCurrentClip].uiTransitionDuration)
783 pC->pTransitionList[pC->
789 pC->ewc.iOutputDuration += iTmp;
796 M4VSS3GPP_intCheckVideoEffects(pC, 2);
802 pC->bTransitionEffect = M4OSA_FALSE;
805 if((pC->nbActiveEffects > 0) || (pC->nbActiveEffects1 > 0) ||
806 (pC->pC1->pSettings->FileType ==
808 (pC->pC1->pSettings->bTranscodingRequired == M4OSA_TRUE)) {
809 pC->Vstate = M4VSS3GPP_kEditVideoState_DECODE_ENCODE;
813 else if( M4OSA_TRUE == pC->bClip1AtBeginCut )
815 if(pC->pC1->pSettings->ClipProperties.VideoStreamType == M4VIDEOEDITING_kH264) {
816 pC->Vstate = M4VSS3GPP_kEditVideoState_DECODE_ENCODE;
817 pC->bEncodeTillEoF = M4OSA_TRUE;
820 pC->Vstate = M4VSS3GPP_kEditVideoState_AFTER_CUT;
822 pC->Vstate = M4VSS3GPP_kEditVideoState_BEGIN_CUT;
831 pC->Vstate = M4VSS3GPP_kEditVideoState_AFTER_CUT;
833 else if( pC->bIsMMS == M4OSA_TRUE )
840 err = pC->pC1->ShellAPI.m_pReader->m_pFctGetOption(
841 pC->pC1->pReaderContext,
857 if( currentBitrate > pC->uiMMSVideoBitrate )
859 pC->Vstate = M4VSS3GPP_kEditVideoState_DECODE_ENCODE;
863 pC->Vstate = M4VSS3GPP_kEditVideoState_READ_WRITE;
866 else if(!((pC->m_bClipExternalHasStarted == M4OSA_TRUE) &&
867 (pC->Vstate == M4VSS3GPP_kEditVideoState_DECODE_ENCODE)) &&
868 pC->bEncodeTillEoF == M4OSA_FALSE)
876 pC->Vstate = M4VSS3GPP_kEditVideoState_READ_WRITE;
886 && (( M4VSS3GPP_kEditVideoState_DECODE_ENCODE == pC->Vstate)
887 || (M4VSS3GPP_kEditVideoState_BEGIN_CUT == pC->Vstate)
889 == pC->Vstate)) /**< encode mode */
890 && pC->bIsMMS == M4OSA_FALSE )
894 if (pC->ewc.encoderState == M4VSS3GPP_kNoEncoder) {
895 err = M4VSS3GPP_intCreateVideoEncoder(pC);
906 else if( pC->bIsMMS == M4OSA_TRUE && pC->ewc.pEncContext == M4OSA_NULL )
910 err = M4VSS3GPP_intCreateVideoEncoder(pC);
927 && (M4VSS3GPP_kEditVideoState_READ_WRITE == pC->Vstate) /**< read mode */
928 && (pC->bEncodeTillEoF == M4OSA_FALSE) )
930 pC->Vstate = M4VSS3GPP_kEditVideoState_BEGIN_CUT;
939 && (( M4VSS3GPP_kEditVideoState_READ_WRITE == pC->Vstate)
941 == pC->Vstate)) /**< read mode */
942 && pC->bIsMMS == M4OSA_FALSE )
946 err = M4VSS3GPP_intDestroyVideoEncoder(pC);
981 M4VSS3GPP_InternalEditContext *pC =
986 err = pC->ShellAPI.pWriterDataFcts->pStartAU(pC->ewc.p3gpWriterContext,
1020 M4VSS3GPP_InternalEditContext *pC =
1026 pC->ewc.dOutputVidCts = pAU->CTS;
1029 M4VSS3GPP_intUpdateTimeInfo(pC, pAU);
1033 err = pC->ShellAPI.pWriterDataFcts->pProcessAU(pC->ewc.p3gpWriterContext,
1076 M4VSS3GPP_InternalEditContext *pC =
1086 pC->ewc.VppError = M4NO_ERROR;
1091 if( M4OSA_NULL == pC->pC1 )
1109 if( M4OSA_TRUE == pC->bTransitionEffect )
1112 err = M4VSS3GPP_intAllocateYUV420(pTemp1, pC->ewc.uiVideoWidth,
1113 pC->ewc.uiVideoHeight);
1118 pC->ewc.VppError = err;
1123 err = M4VSS3GPP_intAllocateYUV420(pTemp2, pC->ewc.uiVideoWidth,
1124 pC->ewc.uiVideoHeight);
1129 pC->ewc.VppError = err;
1134 err = M4VSS3GPP_intAllocateYUV420(pC->yuv1, pC->ewc.uiVideoWidth,
1135 pC->ewc.uiVideoHeight);
1142 pC->ewc.VppError = err;
1148 err = M4VSS3GPP_intAllocateYUV420(pC->yuv2, pC->ewc.uiVideoWidth,
1149 pC->ewc.uiVideoHeight);
1156 pC->ewc.VppError = err;
1162 err = M4VSS3GPP_intAllocateYUV420(pC->yuv3, pC->ewc.uiVideoWidth,
1163 pC->ewc.uiVideoHeight);
1170 pC->ewc.VppError = err;
1179 ts = pC->ewc.dInputVidCts - pC->pC1->iVoffset;
1183 if( pC->pC1->isRenderDup == M4OSA_FALSE )
1185 err = M4VSS3GPP_intRenderFrameWithEffect(pC, pC
1192 pC->ewc.VppError = err;
1198 if ((pC->pC1->isRenderDup == M4OSA_TRUE) ||
1200 pTmp = pC->yuv1;
1201 if (pC->pC1->lastDecodedPlane != M4OSA_NULL) {
1204 (void *)pC->pC1->lastDecodedPlane[0].pac_data,
1207 (void *)pC->pC1->lastDecodedPlane[1].pac_data,
1210 (void *)pC->pC1->lastDecodedPlane[2].pac_data,
1216 pC->ewc.VppError = err;
1219 pC->pC1->lastDecodedPlane = pTmp;
1225 ts = pC->ewc.dInputVidCts - pC->pC2->iVoffset;
1228 if( pC->pC2->isRenderDup == M4OSA_FALSE )
1231 err = M4VSS3GPP_intRenderFrameWithEffect(pC, pC->pC2, ts, M4OSA_FALSE,
1238 pC->ewc.VppError = err;
1244 if ((pC->pC2->isRenderDup == M4OSA_TRUE) ||
1246 pTmp = pC->yuv2;
1247 if (pC->pC2->lastDecodedPlane != M4OSA_NULL) {
1250 (void *)pC->pC2->lastDecodedPlane[0].pac_data,
1253 (void *)pC->pC2->lastDecodedPlane[1].pac_data,
1256 (void *)pC->pC2->lastDecodedPlane[2].pac_data,
1262 pC->ewc.VppError = err;
1265 pC->pC2->lastDecodedPlane = pTmp;
1270 err = M4VSS3GPP_intVideoTransition(pC, pTmp);
1278 pC->ewc.VppError = err;
1312 ts = pC->ewc.dInputVidCts - pC->pC1->iVoffset;
1313 pC->bIssecondClip = M4OSA_FALSE;
1316 if (pC->pC1->isRenderDup == M4OSA_FALSE) {
1320 if (M4OSA_NULL != pC->pC1->m_pPreResizeFrame) {
1321 if ((pC->pC1->pSettings->FileType ==
1323 (pC->nbActiveEffects == 0) &&
1324 (pC->pC1->bGetYuvDataFromDecoder == M4OSA_FALSE)) {
1325 err = pC->pC1->ShellAPI.m_pVideoDecoder->m_pFctSetOption(
1326 pC->pC1->pViDecCtxt,
1330 err = pC->pC1->ShellAPI.m_pVideoDecoder->m_pFctRender(
1331 pC->pC1->pViDecCtxt, &ts,
1335 if (pC->pC1->pSettings->FileType ==
1337 err = pC->pC1->ShellAPI.m_pVideoDecoder->m_pFctSetOption(
1338 pC->pC1->pViDecCtxt,
1343 err = pC->pC1->ShellAPI.m_pVideoDecoder->m_pFctRender(
1344 pC->pC1->pViDecCtxt, &ts,
1345 pC->pC1->m_pPreResizeFrame, M4OSA_TRUE);
1351 pC->ewc.VppError = err;
1354 if (pC->pC1->pSettings->FileType !=
1356 if (0 != pC->pC1->pSettings->ClipProperties.videoRotationDegrees) {
1358 yuvFrameWidth = pC->pC1->m_pPreResizeFrame[0].u_width;
1359 yuvFrameHeight = pC->pC1->m_pPreResizeFrame[0].u_height;
1360 err = M4VSS3GPP_intRotateVideo(pC->pC1->m_pPreResizeFrame,
1361 pC->pC1->pSettings->ClipProperties.videoRotationDegrees);
1365 pC->ewc.VppError = err;
1371 if (pC->nbActiveEffects > 0) {
1372 pC->pC1->bGetYuvDataFromDecoder = M4OSA_TRUE;
1377 pC->pC1->m_pPreResizeFrame[0].u_width,
1378 pC->pC1->m_pPreResizeFrame[0].u_height);
1382 pC->ewc.VppError = err;
1389 err = M4VSS3GPP_intApplyVideoEffect(pC,
1390 pC->pC1->m_pPreResizeFrame, pTemp1, bSkipFrameEffect);
1394 pC->ewc.VppError = err;
1400 pDecoderRenderFrame = pC->pC1->m_pPreResizeFrame;
1403 if (pC->bClip1ActiveFramingEffect) {
1409 pC->ewc.VppError = err;
1418 if ((pC->pC1->bGetYuvDataFromDecoder == M4OSA_TRUE) ||
1419 (pC->pC1->pSettings->FileType !=
1422 err = M4VSS3GPP_intApplyRenderingMode(pC,
1423 pC->pC1->pSettings->xVSS.MediaRendering,
1428 pC->ewc.VppError = err;
1434 if (pC->bClip1ActiveFramingEffect) {
1437 err = M4VSS3GPP_intApplyVideoOverlay(pC,
1442 pC->ewc.VppError = err;
1447 if ((pC->pC1->pSettings->FileType ==
1449 (pC->nbActiveEffects == 0) &&
1450 (pC->pC1->bGetYuvDataFromDecoder == M4OSA_TRUE)) {
1452 err = pC->pC1->ShellAPI.m_pVideoDecoder->m_pFctSetOption(
1453 pC->pC1->pViDecCtxt,
1457 pC->ewc.VppError = err;
1460 pC->pC1->bGetYuvDataFromDecoder = M4OSA_FALSE;
1464 if (0 != pC->pC1->pSettings->ClipProperties.videoRotationDegrees &&
1465 180 != pC->pC1->pSettings->ClipProperties.videoRotationDegrees) {
1467 M4VSS3GPP_intSetYUV420Plane(pC->pC1->m_pPreResizeFrame,
1474 if (pC->nbActiveEffects > 0) {
1478 pC->ewc.uiVideoWidth,
1479 pC->ewc.uiVideoHeight);
1481 pC->ewc.VppError = err;
1491 err = pC->pC1->ShellAPI.m_pVideoDecoder->m_pFctRender(
1492 pC->pC1->pViDecCtxt, &ts,
1495 pC->ewc.VppError = err;
1499 if (pC->nbActiveEffects > 0) {
1503 err = M4VSS3GPP_intApplyVideoEffect(pC,
1507 pC->ewc.VppError = err;
1511 pC->pC1->lastDecodedPlane = pTmp;
1512 pC->pC1->iVideoRenderCts = (M4OSA_Int32)ts;
1517 if (M4OSA_NULL != pC->pC1->m_pPreResizeFrame) {
1520 if (pC->pC1->lastDecodedPlane != M4OSA_NULL) {
1522 memcpy((void *)pC->pC1->m_pPreResizeFrame[0].pac_data,
1523 (void *)pC->pC1->lastDecodedPlane[0].pac_data,
1524 (pC->pC1->m_pPreResizeFrame[0].u_height * \
1525 pC->pC1->m_pPreResizeFrame[0].u_width));
1527 memcpy((void *)pC->pC1->m_pPreResizeFrame[1].pac_data,
1528 (void *)pC->pC1->lastDecodedPlane[1].pac_data,
1529 (pC->pC1->m_pPreResizeFrame[1].u_height * \
1530 pC->pC1->m_pPreResizeFrame[1].u_width));
1532 memcpy((void *)pC->pC1->m_pPreResizeFrame[2].pac_data,
1533 (void *)pC->pC1->lastDecodedPlane[2].pac_data,
1534 (pC->pC1->m_pPreResizeFrame[2].u_height * \
1535 pC->pC1->m_pPreResizeFrame[2].u_width));
1540 pC->ewc.VppError = err;
1544 if(pC->nbActiveEffects > 0) {
1549 pC->pC1->m_pPreResizeFrame[0].u_width,
1550 pC->pC1->m_pPreResizeFrame[0].u_height);
1552 pC->ewc.VppError = err;
1559 err = M4VSS3GPP_intApplyVideoEffect(pC,
1560 pC->pC1->m_pPreResizeFrame,pTemp1, bSkipFrameEffect);
1562 pC->ewc.VppError = err;
1567 pDecoderRenderFrame = pC->pC1->m_pPreResizeFrame;
1570 if (pC->bClip1ActiveFramingEffect) {
1572 pTemp2, pC->ewc.uiVideoWidth, pC->ewc.uiVideoHeight);
1576 pC->ewc.VppError = err;
1584 err = M4VSS3GPP_intApplyRenderingMode(pC,
1585 pC->pC1->pSettings->xVSS.MediaRendering,
1588 pC->ewc.VppError = err;
1593 if (pC->bClip1ActiveFramingEffect) {
1594 err = M4VSS3GPP_intApplyVideoOverlay(pC,
1599 pC->ewc.VppError = err;
1606 pC->ewc.uiVideoWidth,
1607 pC->ewc.uiVideoHeight);
1609 pC->ewc.VppError = err;
1614 if (pC->pC1->lastDecodedPlane != M4OSA_NULL &&
1617 (void *)pC->pC1->lastDecodedPlane[0].pac_data,
1621 (void *)pC->pC1->lastDecodedPlane[1].pac_data,
1625 (void *)pC->pC1->lastDecodedPlane[2].pac_data,
1631 pC->ewc.VppError = err;
1638 if(pC->nbActiveEffects > 0) {
1642 err = M4VSS3GPP_intApplyVideoEffect(pC,
1645 pC->ewc.VppError = err;
1650 pC->pC1->lastDecodedPlane = pTmp;
1678 * @param pC (IN/OUT) Internal edit context
1685 M4VSS3GPP_intApplyVideoOverlay (M4VSS3GPP_InternalEditContext *pC,
1700 pClip = pC->pC1;
1701 if (pC->bIssecondClip == M4OSA_TRUE) {
1702 NumActiveEffects = pC->nbActiveEffects1;
1704 NumActiveEffects = pC->nbActiveEffects;
1707 if (pC->bIssecondClip == M4OSA_TRUE) {
1708 pFx = &(pC->pEffectsList[pC->pActiveEffectsList1[i]]);
1711 VideoEffectTime = ((M4OSA_Int32)pC->ewc.dInputVidCts) +
1712 pC->pTransitionList[pC->uiCurrentClip].uiTransitionDuration - pFx->uiStartTime;
1714 pFx = &(pC->pEffectsList[pC->pActiveEffectsList[i]]);
1717 VideoEffectTime = ((M4OSA_Int32)pC->ewc.dInputVidCts) - pFx->uiStartTime;
1743 extProgress.uiOutputTime = (M4OSA_UInt32)pC->ewc.dInputVidCts;
1747 nextEffectTime = (M4OSA_Int32)(pC->ewc.dInputVidCts \
1748 + pC->dOutputFrameDuration);
1774 * @param pC (IN/OUT) Internal edit context
1783 M4VSS3GPP_intApplyVideoEffect (M4VSS3GPP_InternalEditContext *pC,
1804 pClip = pC->pC1;
1805 if (pC->bIssecondClip == M4OSA_TRUE)
1807 NumActiveEffects = pC->nbActiveEffects1;
1811 NumActiveEffects = pC->nbActiveEffects;
1828 pC->ewc.VppError = err;
1848 if (pC->bIssecondClip == M4OSA_TRUE)
1852 pFx = &(pC->pEffectsList[pC->pActiveEffectsList1[i]]);
1855 VideoEffectTime = ((M4OSA_Int32)pC->ewc.dInputVidCts) +
1856 pC->pTransitionList[pC->uiCurrentClip].
1861 pFx = &(pC->pEffectsList[pC->pActiveEffectsList[i]]);
1864 VideoEffectTime = ((M4OSA_Int32)pC->ewc.dInputVidCts) - pFx->uiStartTime;
1872 / ((M4OSA_Float)pFx->uiDuration/*- pC->dOutputFrameDuration*/);
1941 extProgress.uiOutputTime = (M4OSA_UInt32)pC->ewc.dInputVidCts;
1945 nextEffectTime = (M4OSA_Int32)(pC->ewc.dInputVidCts \
1946 + pC->dOutputFrameDuration);
2019 * @param pC (IN/OUT) Internal edit context
2025 M4VSS3GPP_intVideoTransition( M4VSS3GPP_InternalEditContext *pC,
2033 const M4OSA_Int32 iDur = (M4OSA_Int32)pC->
2034 pTransitionList[pC->uiCurrentClip].uiTransitionDuration;
2040 iProgress = (M4OSA_Int32)((M4OSA_Double)pC->pC1->iEndTime) - pC->ewc.dInputVidCts +
2041 ((M4OSA_Double)pC->pC1->iVoffset);
2045 iProgress -= (M4OSA_Int32)pC->dOutputFrameDuration;
2067 switch( pC->pTransitionList[pC->uiCurrentClip].TransitionBehaviour )
2110 switch( pC->pTransitionList[pC->uiCurrentClip].VideoTransitionType )
2116 (M4ViComImagePlane *)pC->yuv1,
2117 (M4ViComImagePlane *)pC->yuv2,
2137 pPlane = pC->yuv1;
2141 pPlane = pC->yuv2;
2156 if( pC->pTransitionList[pC->uiCurrentClip].VideoTransitionType
2163 extProgress.uiOutputTime = (M4OSA_UInt32)pC->ewc.dInputVidCts;
2164 extProgress.uiClipTime = extProgress.uiOutputTime - pC->pC1->iVoffset;
2166 err = pC->pTransitionList[pC->
2168 pC->pTransitionList[pC->
2170 pC->yuv1, pC->yuv2, pPlaneOut, &extProgress,
2171 pC->pTransitionList[pC->
2190 pC->pTransitionList[pC->uiCurrentClip].VideoTransitionType);
2208 * @param pC (IN/OUT) returns time updated video AU,
2215 M4VSS3GPP_intUpdateTimeInfo( M4VSS3GPP_InternalEditContext *pC,
2225 M4VSS3GPP_ClipContext *pClipCtxt = pC->pC1;
2226 M4OSA_Int32 *pOffset = &(pC->ewc.iMpeg4GovOffset);
2321 M4VSS3GPP_intCheckVideoEffects( M4VSS3GPP_InternalEditContext *pC,
2330 M4OSA_Int32 t = (M4OSA_Int32)pC->ewc.dInputVidCts;
2332 uiClipIndex = pC->uiCurrentClip;
2334 pClip = pC->pC1;
2335 pC->bClip1ActiveFramingEffect = M4OSA_FALSE;
2337 pClip = pC->pC2;
2338 pC->bClip2ActiveFramingEffect = M4OSA_FALSE;
2348 for ( uiFxIndex = 0; uiFxIndex < pC->nbEffects; uiFxIndex++ )
2351 pFx = &(pC->pEffectsList[pC->nbEffects - 1 - uiFxIndex]);
2367 pC->pActiveEffectsList[i] = pC->nbEffects-1-uiFxIndex;
2373 pC->bClip1ActiveFramingEffect = M4OSA_TRUE;
2380 pC->m_bClipExternalHasStarted = M4OSA_TRUE;
2388 if ( ((M4OSA_Int32)(t + pC->pTransitionList[uiClipIndex].uiTransitionDuration)
2390 && ( (M4OSA_Int32)(t + pC->pTransitionList[uiClipIndex].uiTransitionDuration)
2394 pC->pActiveEffectsList1[i] = pC->nbEffects-1-uiFxIndex;
2400 pC->bClip2ActiveFramingEffect = M4OSA_TRUE;
2406 pC->m_bClipExternalHasStarted = M4OSA_TRUE;
2415 pC->pC1->pSettings->ClipProperties.VideoStreamType) {
2418 pC->m_bClipExternalHasStarted = M4OSA_FALSE;
2426 pC->nbActiveEffects = i;
2430 pC->nbActiveEffects1 = i;
2441 pC->bClip1AtBeginCut = M4OSA_TRUE;
2445 pC->bClip1AtBeginCut = M4OSA_FALSE;
2458 M4OSA_ERR M4VSS3GPP_intCreateVideoEncoder( M4VSS3GPP_InternalEditContext *pC )
2465 pC->ewc.OurWriterDataInterface.pProcessAU =
2468 pC->ewc.OurWriterDataInterface.pStartAU =
2471 pC->ewc.OurWriterDataInterface.pWriterContext =
2473 pC; /**< We give the internal context as writer context */
2477 if( M4OSA_NULL == pC->ShellAPI.pVideoEncoderGlobalFcts )
2479 err = M4VSS3GPP_setCurrentVideoEncoder(&pC->ShellAPI,
2480 pC->ewc.VideoStreamType);
2492 EncParams.FrameWidth = pC->ewc.uiVideoWidth;
2493 EncParams.FrameHeight = pC->ewc.uiVideoHeight;
2494 EncParams.uiTimeScale = pC->ewc.uiVideoTimeScale;
2496 if( pC->bIsMMS == M4OSA_FALSE )
2511 EncParams.FrameRate = pC->MMSvideoFramerate;
2527 EncParams.videoProfile = pC->ewc.outputVideoProfile;
2528 EncParams.videoLevel= pC->ewc.outputVideoLevel;
2530 switch ( pC->ewc.VideoStreamType )
2548 EncParams.uiRateFactor = (M4OSA_UInt8)(( pC->dOutputFrameDuration
2549 * pC->ewc.uiVideoTimeScale) / 1000.0 + 0.5);
2554 if( M4OSA_FALSE == pC->ewc.bVideoDataPartitioning )
2582 pC->ewc.VideoStreamType);
2586 if( pC->bIsMMS == M4OSA_FALSE )
2588 EncParams.Bitrate = pC->xVSS.outputVideoBitrate;
2593 EncParams.Bitrate = pC->uiMMSVideoBitrate; /* RC */
2600 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctInit(&pC->ewc.pEncContext,
2601 &pC->ewc.OurWriterDataInterface, M4VSS3GPP_intVPP, pC,
2602 pC->ShellAPI.pCurrentVideoEncoderExternalAPI,
2603 pC->ShellAPI.pCurrentVideoEncoderUserData);
2613 pC->ewc.encoderState = M4VSS3GPP_kEncoderClosed;
2616 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctOpen(pC->ewc.pEncContext,
2617 &pC->ewc.WriterVideoAU, &EncParams);
2627 pC->ewc.encoderState = M4VSS3GPP_kEncoderStopped;
2631 if( M4OSA_NULL != pC->ShellAPI.pVideoEncoderGlobalFcts->pFctStart )
2633 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctStart(
2634 pC->ewc.pEncContext);
2645 pC->ewc.encoderState = M4VSS3GPP_kEncoderRunning;
2660 M4OSA_ERR M4VSS3GPP_intDestroyVideoEncoder( M4VSS3GPP_InternalEditContext *pC )
2664 if( M4OSA_NULL != pC->ewc.pEncContext )
2666 if( M4VSS3GPP_kEncoderRunning == pC->ewc.encoderState )
2668 if( pC->ShellAPI.pVideoEncoderGlobalFcts->pFctStop != M4OSA_NULL )
2670 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctStop(
2671 pC->ewc.pEncContext);
2683 pC->ewc.encoderState = M4VSS3GPP_kEncoderStopped;
2687 if( M4VSS3GPP_kEncoderStopped == pC->ewc.encoderState )
2689 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctClose(
2690 pC->ewc.pEncContext);
2701 pC->ewc.encoderState = M4VSS3GPP_kEncoderClosed;
2704 err = pC->ShellAPI.pVideoEncoderGlobalFcts->pFctCleanup(
2705 pC->ewc.pEncContext);
2716 pC->ewc.encoderState = M4VSS3GPP_kNoEncoder;
2719 pC->ewc.pEncContext = M4OSA_NULL;
3118 M4OSA_ERR M4VSS3GPP_intApplyRenderingMode(M4VSS3GPP_InternalEditContext *pC,
3347 if (M4OSA_NULL == pC->m_air_context) {
3348 err = M4AIR_create(&pC->m_air_context, M4AIR_kYUV420P);
3356 err = M4AIR_configure(pC->m_air_context, &airParams);
3360 M4AIR_cleanUp(pC->m_air_context);
3364 err = M4AIR_get(pC->m_air_context, pInplane, pPlaneTemp);
3368 M4AIR_cleanUp(pC->m_air_context);
3406 M4VSS3GPP_InternalEditContext *pC,
3455 pC->pOsaFileReadPtr,
3489 pClipCtxt->pPlaneYuvWithEffect[0].u_height = pC->ewc.uiVideoHeight;
3490 pClipCtxt->pPlaneYuvWithEffect[0].u_width = pC->ewc.uiVideoWidth;
3491 pClipCtxt->pPlaneYuvWithEffect[0].u_stride = pC->ewc.uiVideoWidth;
3496 pC->ewc.uiVideoHeight * pC->ewc.uiVideoWidth * 1.5,
3540 M4OSA_ERR M4VSS3GPP_intRenderFrameWithEffect(M4VSS3GPP_InternalEditContext *pC,
3573 (pC->nbActiveEffects == 0) &&
3628 pC->bIssecondClip = M4OSA_FALSE;
3629 numEffects = pC->nbActiveEffects;
3631 numEffects = pC->nbActiveEffects1;
3632 pC->bIssecondClip = M4OSA_TRUE;
3641 err = M4VSS3GPP_intApplyVideoEffect(pC,
3657 if (pC->bClip1ActiveFramingEffect == M4OSA_TRUE) {
3663 pC->ewc.VppError = err;
3668 pTmp = pC->yuv1;
3670 err = M4VSS3GPP_intApplyRenderingMode (pC,
3674 if (pC->bClip2ActiveFramingEffect == M4OSA_TRUE) {
3680 pC->ewc.VppError = err;
3685 pTmp = pC->yuv2;
3687 err = M4VSS3GPP_intApplyRenderingMode (pC,
3704 if (pC->bClip1ActiveFramingEffect == M4OSA_TRUE) {
3705 err = M4VSS3GPP_intApplyVideoOverlay(pC,
3706 pTemp, pC->yuv1);
3708 pClipCtxt->lastDecodedPlane = pC->yuv1;
3710 if (pC->bClip2ActiveFramingEffect == M4OSA_TRUE) {
3711 err = M4VSS3GPP_intApplyVideoOverlay(pC,
3712 pTemp, pC->yuv2);
3714 pClipCtxt->lastDecodedPlane = pC->yuv2;
3719 pC->ewc.VppError = err;
3741 (pC->nbActiveEffects == 0) &&
3747 (M4OSA_DataOption)pC->yuv1);
3752 (M4OSA_DataOption)pC->yuv2);
3773 numEffects = pC->nbActiveEffects;
3775 numEffects = pC->nbActiveEffects1;
3789 pC->bIssecondClip = M4OSA_FALSE;
3790 err = M4VSS3GPP_intApplyVideoEffect(pC, pPlaneNoResize,
3791 pC->yuv1, bSkipFramingEffect);
3792 pClipCtxt->lastDecodedPlane = pC->yuv1;
3794 pC->bIssecondClip = M4OSA_TRUE;
3795 err = M4VSS3GPP_intApplyVideoEffect(pC, pPlaneNoResize,
3796 pC->yuv2, bSkipFramingEffect);
3797 pClipCtxt->lastDecodedPlane = pC->yuv2;
3808 pTmp = pC->yuv1;
3810 pTmp = pC->yuv2;