Lines Matching refs:pC
83 static M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC);
159 M4PTO3GPP_InternalContext *pC;
171 pC = (M4PTO3GPP_InternalContext*)M4OSA_32bitAlignedMalloc(sizeof(M4PTO3GPP_InternalContext), M4PTO3GPP,
173 *pContext = pC;
174 if (M4OSA_NULL == pC)
184 pC->m_State = M4PTO3GPP_kState_CREATED;
185 pC->m_VideoState = M4PTO3GPP_kStreamState_NOSTREAM;
186 pC->m_AudioState = M4PTO3GPP_kStreamState_NOSTREAM;
190 pC->m_pReaderAudioAU = M4OSA_NULL;
191 pC->m_pReaderAudioStream = M4OSA_NULL;
195 pC->m_pEncoderHeader = M4OSA_NULL;
196 pC->m_pWriterVideoStream = M4OSA_NULL;
197 pC->m_pWriterAudioStream = M4OSA_NULL;
198 pC->m_pWriterVideoStreamInfo= M4OSA_NULL;
199 pC->m_pWriterAudioStreamInfo= M4OSA_NULL;
203 pC->m_pAudioReaderContext = M4OSA_NULL;
204 pC->m_p3gpWriterContext = M4OSA_NULL;
205 pC->m_pMp4EncoderContext = M4OSA_NULL;
206 pC->m_eEncoderState = M4PTO3GPP_kNoEncoder;
210 pC->m_pReaderGlobInt = M4OSA_NULL;
211 pC->m_pReaderDataInt = M4OSA_NULL;
212 pC->m_pWriterGlobInt = M4OSA_NULL;
213 pC->m_pWriterDataInt = M4OSA_NULL;
214 pC->m_pEncoderInt = M4OSA_NULL;
215 pC->m_pEncoderExternalAPI = M4OSA_NULL;
216 pC->m_pEncoderUserData = M4OSA_NULL;
220 pC->pOsalFileRead = pFileReadPtrFct;
221 pC->pOsalFileWrite = pFileWritePtrFct;
225 pC->m_mtCts = 0.0F;
226 pC->m_mtNextCts = 0.0F;
227 pC->m_mtAudioCts = 0.0F;
228 pC->m_AudioOffSet = 0.0F;
229 pC->m_dLastVideoRegulCts= 0.0F;
230 pC->m_PrevAudioCts = 0.0F;
231 pC->m_DeltaAudioCts = 0.0F;
233 pC->m_MaxFileSize = 0;
234 pC->m_CurrentFileSize = 0;
236 pC->m_IsLastPicture = M4OSA_FALSE;
237 pC->m_bAudioPaddingSilence = M4OSA_FALSE;
238 pC->m_bLastInternalCallBack = M4OSA_FALSE;
239 pC->m_NbCurrentFrame = 0;
241 pC->pSavedPlane = M4OSA_NULL;
242 pC->uiSavedDuration = 0;
282 M4PTO3GPP_InternalContext *pC = (M4PTO3GPP_InternalContext*)(pContext);
301 M4ERR_PARAMETER, "M4PTO3GPP_Open: pC->m_Params.pPictureCallbackFct is M4OSA_NULL");
304 "M4PTO3GPP_Open: pC->m_Params.pPictureCallbackCtxt is M4OSA_NULL");
306 M4ERR_PARAMETER, "M4PTO3GPP_Open: pC->m_Params.pOutput3gppFile is M4OSA_NULL");
308 M4ERR_PARAMETER, "M4PTO3GPP_Open: pC->m_Params.pTemporaryFile is M4OSA_NULL");
402 if (M4PTO3GPP_kState_CREATED != pC->m_State) {
403 M4OSA_TRACE1_1("M4PTO3GPP_Open(): Wrong State (%d), returning M4ERR_STATE", pC->m_State);
409 memcpy((void *)(&pC->m_Params),
411 M4OSA_TRACE1_1("M4PTO3GPP_Open: outputVideoBitrate = %d", pC->m_Params.OutputVideoBitrate);
416 if (M4OSA_NULL != pC->m_Params.pInputAudioTrackFile) {
419 switch(pC->m_Params.AudioFileFormat)
423 err = M4READER_AMR_getInterfaces( &readerMediaType, &pC->m_pReaderGlobInt,
424 &pC->m_pReaderDataInt);
435 err = M4READER_3GP_getInterfaces( &readerMediaType, &pC->m_pReaderGlobInt,
436 &pC->m_pReaderDataInt);
451 err = pC->m_pReaderGlobInt->m_pFctCreate(&pC->m_pAudioReaderContext);
458 pC->m_pReaderDataInt->m_readerContext = pC->m_pAudioReaderContext;
463 err = pC->m_pReaderGlobInt->m_pFctSetOption(pC->m_pAudioReaderContext,
464 M4READER_kOptionID_SetOsaFileReaderFctsPtr, (M4OSA_DataOption)pC->pOsalFileRead);
473 err = pC->m_pReaderGlobInt->m_pFctOpen(pC->m_pAudioReaderContext,
474 pC->m_Params.pInputAudioTrackFile);
478 pC->m_pReaderGlobInt->m_pFctDestroy(pC->m_pAudioReaderContext);
479 pC->m_pAudioReaderContext = M4OSA_NULL;
488 err = pC->m_pReaderGlobInt->m_pFctGetNextStream(pC->m_pAudioReaderContext,
502 && (M4OSA_NULL == pC->m_pReaderAudioStream))
504 pC->m_pReaderAudioStream = (M4_AudioStreamHandler*)pStreamHandler;
511 pC->m_pReaderAudioAU = (M4_AccessUnit*)M4OSA_32bitAlignedMalloc(sizeof(M4_AccessUnit),
513 if (M4OSA_NULL == pC->m_pReaderAudioAU)
522 err = pC->m_pReaderGlobInt->m_pFctFillAuStruct(pC->m_pAudioReaderContext,
523 pStreamHandler, pC->m_pReaderAudioAU);
544 } /*if (M4OSA_NULL != pC->m_Params.pInputAudioTrackFile)*/
546 pC->m_VideoState = M4PTO3GPP_kStreamState_STARTED;
550 if (M4OSA_NULL != pC->m_pReaderAudioStream)
552 pC->m_AudioState = M4PTO3GPP_kStreamState_STARTED;
553 err = pC->m_pReaderGlobInt->m_pFctReset(pC->m_pAudioReaderContext,
554 (M4_StreamHandler*)pC->m_pReaderAudioStream);
565 pC->m_State = M4PTO3GPP_kState_OPENED;
569 switch(pC->m_Params.OutputFileMaxSize)
571 case M4PTO3GPP_k50_KB: pC->m_MaxFileSize = 50000; break;
572 case M4PTO3GPP_k75_KB: pC->m_MaxFileSize = 75000; break;
573 case M4PTO3GPP_k100_KB: pC->m_MaxFileSize = 100000; break;
574 case M4PTO3GPP_k150_KB: pC->m_MaxFileSize = 150000; break;
575 case M4PTO3GPP_k200_KB: pC->m_MaxFileSize = 200000; break;
576 case M4PTO3GPP_k300_KB: pC->m_MaxFileSize = 300000; break;
577 case M4PTO3GPP_k400_KB: pC->m_MaxFileSize = 400000; break;
578 case M4PTO3GPP_k500_KB: pC->m_MaxFileSize = 500000; break;
604 M4PTO3GPP_InternalContext *pC = (M4PTO3GPP_InternalContext*)(pContext);
617 if ( !((M4PTO3GPP_kState_OPENED == pC->m_State) || (M4PTO3GPP_kState_READY == pC->m_State)) )
619 M4OSA_TRACE1_1("M4PTO3GPP_Step(): Wrong State (%d), returning M4ERR_STATE", pC->m_State);
626 if (M4PTO3GPP_kState_OPENED == pC->m_State)
633 err = M4PTO3GPP_Ready4Processing(pC);
642 pC->m_State = M4PTO3GPP_kState_READY;
654 err = pC->m_pWriterGlobInt->pFctGetOption(pC->m_p3gpWriterContext,
655 M4WRITER_kFileSizeAudioEstimated, (M4OSA_DataOption) &pC->m_CurrentFileSize);
656 if ((0 != pC->m_MaxFileSize) &&
658 ((pC->m_CurrentFileSize + M4PTO3GPP_MARGE_OF_FILE_SIZE) >= pC->m_MaxFileSize))
660 pC->m_IsLastPicture = M4OSA_TRUE;
669 if (M4PTO3GPP_kStreamState_STARTED == pC->m_VideoState) /**<If the video encoding is going on*/
672 pC->m_NbCurrentFrame++;
675 if((pC->m_Params.NbVideoFrames > 0) \
676 && (pC->m_NbCurrentFrame >= pC->m_Params.NbVideoFrames))
678 pC->m_IsLastPicture = M4OSA_TRUE;
682 nb = %lu", pC->m_mtCts, pC->m_NbCurrentFrame);
684 err = pC->m_pEncoderInt->pFctEncode(pC->m_pMp4EncoderContext, M4OSA_NULL,
687 pC->m_mtCts,
688 (pC->m_IsLastPicture ?
694 err, pC->m_Params.OutputVideoFormat);
695 if((M4NO_ERROR == err) && (M4VIDEOEDITING_kH264 == pC->m_Params.OutputVideoFormat))
699 if(M4OSA_TRUE == pC->m_IsLastPicture)
702 pC->m_VideoState = M4PTO3GPP_kStreamState_FINISHED;
710 pC->m_VideoState = M4PTO3GPP_kStreamState_FINISHED;
731 if (M4PTO3GPP_kStreamState_STARTED == pC->m_AudioState)
733 while ( (M4PTO3GPP_kStreamState_STARTED == pC->m_AudioState) &&
734 (pC->m_mtAudioCts < pC->m_mtNextCts))
738 if (M4OSA_FALSE == pC->m_bAudioPaddingSilence)
741 err = pC->m_pReaderDataInt->m_pFctGetNextAu(pC->m_pAudioReaderContext,
742 (M4_StreamHandler*)pC->m_pReaderAudioStream, pC->m_pReaderAudioAU);
743 pC->m_mtAudioCts = pC->m_pReaderAudioAU->m_CTS + pC->m_AudioOffSet;
750 switch(pC->m_Params.AudioPaddingMode)
754 pC->m_AudioState = M4PTO3GPP_kStreamState_FINISHED;
760 != pC->m_pReaderAudioStream->m_basicProperties.m_streamType)
763 pC->m_AudioState = M4PTO3GPP_kStreamState_FINISHED;
767 pC->m_bAudioPaddingSilence = M4OSA_TRUE;
774 err = pC->m_pReaderGlobInt->m_pFctJump(pC->m_pAudioReaderContext,
775 (M4_StreamHandler*)pC->m_pReaderAudioStream, &JumpToTime);
786 == pC->m_pReaderAudioStream->m_basicProperties.m_streamType)
788 pC->m_mtAudioCts += 20; /*< SEMC bug fixed at Lund */
789 pC->m_AudioOffSet = pC->m_mtAudioCts;
794 mtIncCts = (M4OSA_Time)((pC->m_mtAudioCts) *
795 (pC->m_pWriterAudioStream->timeScale / 1000.0));
796 err = M4PTO3GPP_writeAmrSilence122Frame(pC->m_pWriterDataInt,
797 pC->m_p3gpWriterContext, &pC->m_WriterAudioAU, mtIncCts);
808 pC->m_AudioOffSet = pC->m_mtAudioCts + pC->m_DeltaAudioCts;
823 pC->m_DeltaAudioCts = pC->m_pReaderAudioAU->m_CTS - pC->m_PrevAudioCts;
824 pC->m_PrevAudioCts = pC->m_pReaderAudioAU->m_CTS;
828 err = pC->m_pWriterDataInt->pStartAU(pC->m_p3gpWriterContext, 1,
829 &pC->m_WriterAudioAU);
840 pC->m_pReaderAudioAU->m_size);
841 memcpy((void *)pC->m_WriterAudioAU.dataAddress,
842 (void *)pC->m_pReaderAudioAU->m_dataAddress,
843 pC->m_pReaderAudioAU->m_size);
844 pC->m_WriterAudioAU.size = pC->m_pReaderAudioAU->m_size;
849 != pC->m_pReaderAudioStream->m_basicProperties.m_streamType)
851 pC->m_WriterAudioAU.CTS = (M4OSA_Time)
852 ((pC->m_AudioOffSet + pC->m_pReaderAudioAU->m_CTS)
853 * pC->m_pWriterAudioStream->timeScale / 1000.0);
857 pC->m_WriterAudioAU.CTS = (M4OSA_Time)(pC->m_mtAudioCts *
858 (pC->m_pWriterAudioStream->timeScale / 1000.0));
860 pC->m_WriterAudioAU.nbFrag = 0;
861 M4OSA_TRACE2_1("M4PTO3GPP_Step(): audio AU: CTS=%d ms", pC->m_mtAudioCts
862 /*pC->m_pReaderAudioAU->m_CTS*/);
866 err = pC->m_pWriterDataInt->pProcessAU(pC->m_p3gpWriterContext, 1,
867 &pC->m_WriterAudioAU);
877 else /**< M4OSA_TRUE == pC->m_bAudioPaddingSilence */
880 pC->m_pReaderAudioStream->m_basicProperties.m_streamType)
884 pC->m_mtAudioCts += 20;
888 mtIncCts = (M4OSA_Time)(pC->m_mtAudioCts
889 * (pC->m_pWriterAudioStream->timeScale / 1000.0));
890 err = M4PTO3GPP_writeAmrSilence048Frame(pC->m_pWriterDataInt,
891 pC->m_p3gpWriterContext, &pC->m_WriterAudioAU, mtIncCts);
902 pC->m_AudioState = M4PTO3GPP_kStreamState_FINISHED;
909 pC->m_mtCts = pC->m_mtNextCts;
913 if (M4PTO3GPP_kStreamState_FINISHED == pC->m_VideoState)
915 pC->m_State = M4PTO3GPP_kState_FINISHED;
939 M4PTO3GPP_InternalContext *pC = (M4PTO3GPP_InternalContext*)(pContext);
953 if ((pC->m_State != M4PTO3GPP_kState_OPENED) &&
954 (pC->m_State != M4PTO3GPP_kState_READY) &&
955 (pC->m_State != M4PTO3GPP_kState_FINISHED))
957 M4OSA_TRACE1_1("M4PTO3GPP_Close(): Wrong State (%d), returning M4ERR_STATE", pC->m_State);
964 if (M4PTO3GPP_kState_READY == pC->m_State)
966 pC->m_State = M4PTO3GPP_kState_FINISHED;
969 if (M4PTO3GPP_kEncoderRunning == pC->m_eEncoderState)
971 if (pC->m_pEncoderInt->pFctStop != M4OSA_NULL)
973 osaErr = pC->m_pEncoderInt->pFctStop(pC->m_pMp4EncoderContext);
981 pC->m_eEncoderState = M4PTO3GPP_kEncoderStopped;
985 if (M4PTO3GPP_kEncoderStopped == pC->m_eEncoderState)
987 osaErr = pC->m_pEncoderInt->pFctClose(pC->m_pMp4EncoderContext);
994 pC->m_eEncoderState = M4PTO3GPP_kEncoderClosed;
1001 if (M4OSA_NULL != pC->m_p3gpWriterContext) /* happens in state _SET */
1005 if ((M4VIDEOEDITING_kMPEG4 == pC->m_Params.OutputVideoFormat)
1006 || (M4VIDEOEDITING_kH264 == pC->m_Params.OutputVideoFormat))
1008 osaErr = pC->m_pEncoderInt->pFctGetOption(pC->m_pMp4EncoderContext,
1024 osaErr = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext,
1035 lastCTS = (M4OSA_UInt32)pC->m_mtCts;
1037 osaErr = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext,
1046 osaErr = pC->m_pWriterGlobInt->pFctCloseWrite(pC->m_p3gpWriterContext);
1052 pC->m_p3gpWriterContext = M4OSA_NULL;
1057 pC->m_State = M4PTO3GPP_kState_CLOSED;
1079 M4PTO3GPP_InternalContext *pC = (M4PTO3GPP_InternalContext*)(pContext);
1091 if ((M4PTO3GPP_kState_OPENED == pC->m_State) || (M4PTO3GPP_kState_READY == pC->m_State)
1092 || (M4PTO3GPP_kState_FINISHED == pC->m_State))
1105 if (M4OSA_NULL != pC->m_pAudioReaderContext) /**< may be M4OSA_NULL if M4PTO3GPP_Open was not\
1109 err = pC->m_pReaderGlobInt->m_pFctClose(pC->m_pAudioReaderContext);
1115 err = pC->m_pReaderGlobInt->m_pFctDestroy(pC->m_pAudioReaderContext);
1116 pC->m_pAudioReaderContext = M4OSA_NULL;
1124 if (M4OSA_NULL != pC->m_pReaderAudioAU)
1126 free(pC->m_pReaderAudioAU);
1127 pC->m_pReaderAudioAU = M4OSA_NULL;
1132 if (M4OSA_NULL != pC->m_pMp4EncoderContext)
1134 err = pC->m_pEncoderInt->pFctCleanup(pC->m_pMp4EncoderContext);
1135 pC->m_pMp4EncoderContext = M4OSA_NULL;
1143 if (M4OSA_NULL != pC->m_pWriterVideoStream)
1145 free(pC->m_pWriterVideoStream);
1146 pC->m_pWriterVideoStream = M4OSA_NULL;
1148 if (M4OSA_NULL != pC
1150 free(pC->m_pWriterAudioStream);
1151 pC->m_pWriterAudioStream = M4OSA_NULL;
1153 if (M4OSA_NULL != pC->m_pWriterVideoStreamInfo)
1155 free(pC->m_pWriterVideoStreamInfo);
1156 pC->m_pWriterVideoStreamInfo = M4OSA_NULL;
1158 if (M4OSA_NULL != pC->m_pWriterAudioStreamInfo)
1160 free(pC->m_pWriterAudioStreamInfo);
1161 pC->m_pWriterAudioStreamInfo = M4OSA_NULL;
1167 if (M4OSA_NULL != pC->m_pReaderGlobInt)
1169 free(pC->m_pReaderGlobInt);
1170 pC->m_pReaderGlobInt = M4OSA_NULL;
1172 if (M4OSA_NULL != pC->m_pReaderDataInt)
1174 free(pC->m_pReaderDataInt);
1175 pC->m_pReaderDataInt = M4OSA_NULL;
1178 if(M4OSA_NULL != pC->m_pEncoderInt)
1180 free(pC->m_pEncoderInt);
1181 pC->m_pEncoderInt = M4OSA_NULL;
1183 if(M4OSA_NULL != pC->m_pWriterGlobInt)
1185 free(pC->m_pWriterGlobInt);
1186 pC->m_pWriterGlobInt = M4OSA_NULL;
1188 if(M4OSA_NULL != pC->m_pWriterDataInt)
1190 free(pC->m_pWriterDataInt);
1191 pC->m_pWriterDataInt = M4OSA_NULL;
1193 /**< Do not free pC->pOsaMemoryPtrFct and pC->pOsaMemoryPtrFct, because it's owned by the \
1198 free(pC);
1199 pC = M4OSA_NULL;
1209 * M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC);
1212 * @param pC (IN) M4PTO3GPP private context
1218 M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
1228 M4OSA_TRACE3_1("M4PTO3GPP_Ready4Processing called with pC=0x%x", pC);
1241 switch(pC->m_Params.OutputVideoFormat)
1245 err = VideoEditorVideoEncoder_getInterface_MPEG4(&encFormat, &pC->m_pEncoderInt,
1254 err = VideoEditorVideoEncoder_getInterface_H263(&encFormat, &pC->m_pEncoderInt,
1263 err = VideoEditorVideoEncoder_getInterface_H264(&encFormat, &pC->m_pEncoderInt,
1274 pC->m_Params.OutputVideoFormat);
1279 M4OSA_TRACE1_1("switch(pC->m_Params.OutputVideoFormat): getInterfaces returns 0x%x", err);
1288 switch(pC->m_Params.OutputVideoFrameSize)
1358 pC->m_Params.OutputVideoFrameSize);
1366 switch(pC->m_Params.OutputVideoBitrate)
1386 EncParams.Bitrate = pC->m_Params.OutputVideoBitrate;
1398 pC->m_Params.OutputVideoBitrate);
1404 switch(pC->m_Params.OutputVideoFormat)
1418 pC->m_Params.OutputVideoFormat);
1435 err = M4WRITER_3GP_getInterfaces(&outputFileType, &pC->m_pWriterGlobInt, &pC->m_pWriterDataInt);
1443 err = pC->m_pWriterGlobInt->pFctOpen(&pC->m_p3gpWriterContext, pC->m_Params.pOutput3gppFile,
1444 pC->pOsalFileWrite, pC->m_Params.pTemporaryFile, pC->pOsalFileRead);
1453 pC->m_pWriterDataInt->pWriterContext = pC->m_p3gpWriterContext;
1457 err = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext, M4WRITER_kEmbeddedString,
1470 err = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext, M4WRITER_kEmbeddedVersion,
1481 pC->m_pWriterVideoStream =
1484 if (M4OSA_NULL == pC->m_pWriterVideoStream)
1490 pC->m_pWriterVideoStreamInfo =
1493 if (M4OSA_NULL == pC->m_pWriterVideoStreamInfo)
1502 pC->m_pWriterVideoStreamInfo->height = EncParams.FrameHeight;
1503 pC->m_pWriterVideoStreamInfo->width = EncParams.FrameWidth;
1504 pC->m_pWriterVideoStreamInfo->fps = 0; /**< Not used by the core writer */
1505 pC->m_pWriterVideoStreamInfo->Header.pBuf = M4OSA_NULL;
1507 pC->m_pWriterVideoStreamInfo->Header.Size = 0;
1511 pC->m_pWriterVideoStream->streamID = M4PTO3GPP_WRITER_VIDEO_STREAM_ID;
1515 switch(pC->m_Params.OutputVideoFormat)
1518 pC->m_pWriterVideoStream->streamType = M4SYS_kMPEG_4; break;
1520 pC->m_pWriterVideoStream->streamType = M4SYS_kH263; break;
1522 pC->m_pWriterVideoStream->streamType = M4SYS_kH264; break;
1526 pC->m_Params.OutputVideoFormat);
1532 switch(pC->m_Params.OutputVideoBitrate)
1552 pC->m_pWriterVideoStream->averageBitrate = pC->m_Params.OutputVideoBitrate;
1556 pC->m_pWriterVideoStream->averageBitrate = 0;
1562 pC->m_Params.OutputVideoBitrate);
1566 pC->m_pWriterVideoStream->duration = 0; /**< Duration is not known */
1567 pC->m_pWriterVideoStream->timeScale = 0; /**< Not used by the core writer */
1568 pC->m_pWriterVideoStream->maxBitrate = pC->m_pWriterVideoStream->averageBitrate;
1569 pC->m_pWriterVideoStream->profileLevel = 0; /**< Not used by the core writer */
1570 pC->m_pWriterVideoStream->decoderSpecificInfo = (M4OSA_MemAddr32)
1571 (pC->m_pWriterVideoStreamInfo);
1572 pC->m_pWriterVideoStream->decoderSpecificInfoSize = sizeof(M4WRITER_StreamVideoInfos);
1576 pC->m_WriterVideoAU.CTS = pC
1577 pC->m_WriterVideoAU.size = 0;
1578 pC->m_WriterVideoAU.frag = M4OSA_NULL;
1579 pC->m_WriterVideoAU.nbFrag = 0; /** No fragment */
1580 pC->m_WriterVideoAU.stream = pC->m_pWriterVideoStream;
1581 pC->m_WriterVideoAU.attribute = AU_RAP;
1582 pC->m_WriterVideoAU.dataAddress = M4OSA_NULL;
1586 if(M4OSA_NULL != pC->m_pReaderAudioStream)
1588 pC->m_pWriterAudioStream =
1591 if (M4OSA_NULL == pC->m_pWriterAudioStream)
1597 pC->m_pWriterAudioStreamInfo =
1600 if (M4OSA_NULL == pC->m_pWriterAudioStreamInfo)
1607 pC->m_pWriterAudioStreamInfo->nbSamplesPerSec = 0; /**< unused by our shell writer */
1608 pC->m_pWriterAudioStreamInfo->nbBitsPerSample = 0; /**< unused by our shell writer */
1609 pC->m_pWriterAudioStreamInfo->nbChannels = 1; /**< unused by our shell writer */
1611 if( (M4OSA_NULL != pC->m_pReaderAudioStream) && /* audio could have been discarded */
1612 (M4OSA_NULL != pC->m_pReaderAudioStream->m_basicProperties.m_pDecoderSpecificInfo) )
1615 pC->m_pWriterAudioStreamInfo->Header.Size =
1616 pC->m_pReaderAudioStream->m_basicProperties.m_decoderSpecificInfoSize;
1617 pC->m_pWriterAudioStreamInfo->Header.pBuf =
1618 (M4OSA_MemAddr8)pC->m_pReaderAudioStream->m_basicProperties.m_pDecoderSpecificInfo;
1623 pC->m_pWriterAudioStreamInfo->Header.Size = 0;
1624 pC->m_pWriterAudioStreamInfo->Header.pBuf = M4OSA_NULL;
1629 switch (pC->m_pReaderAudioStream->m_basicProperties.m_streamType)
1632 pC->m_pWriterAudioStream->streamType = M4SYS_kAMR;
1635 pC->m_pWriterAudioStream->streamType = M4SYS_kAAC;
1638 pC->m_pWriterAudioStream->streamType = M4SYS_kEVRC;
1643 pC->m_pReaderAudioStream->m_basicProperties.m_streamType);
1649 pC->m_pWriterAudioStream->streamID = M4PTO3GPP_WRITER_AUDIO_STREAM_ID;
1650 pC->m_pWriterAudioStream->duration = 0;/**< Duration is not known yet */
1651 pC->m_pWriterAudioStream->timeScale = M4PTO3GPP_WRITER_AUDIO_AMR_TIME_SCALE;
1652 pC->m_pWriterAudioStream->profileLevel = M4PTO3GPP_WRITER_AUDIO_PROFILE_LEVEL;
1653 pC->m_pWriterAudioStream->averageBitrate =
1654 pC->m_pReaderAudioStream->m_basicProperties.m_averageBitRate;
1655 pC->m_pWriterAudioStream->maxBitrate =
1656 pC->m_pWriterAudioStream->averageBitrate;
1661 pC->m_pWriterAudioStream->decoderSpecificInfo =
1662 (M4OSA_MemAddr32)pC->m_pWriterAudioStreamInfo;
1666 pC->m_WriterAudioAU.CTS = pC->m_WriterAudioAU.DTS = 0; /** Reset time */
1667 pC->m_WriterAudioAU.size = 0;
1668 pC->m_WriterAudioAU.frag = M4OSA_NULL;
1669 pC->m_WriterAudioAU.nbFrag = 0; /** No fragment */
1670 pC->m_WriterAudioAU.stream = pC->m_pWriterAudioStream;
1671 pC->m_WriterAudioAU.attribute = AU_RAP;
1672 pC->m_WriterAudioAU.dataAddress = M4OSA_NULL;
1684 EncParams.videoProfile = pC->m_Params.videoProfile;
1685 EncParams.videoLevel = pC->m_Params.videoLevel;
1701 err = pC->m_pEncoderInt->pFctInit(&pC->m_pMp4EncoderContext, pC->m_pWriterDataInt,
1702 M4PTO3GPP_applyVPP, pC, pC->m_pEncoderExternalAPI,
1703 pC->m_pEncoderUserData);
1710 pC->m_eEncoderState = M4PTO3GPP_kEncoderClosed;
1712 err = pC->m_pEncoderInt->pFctOpen(pC->m_pMp4EncoderContext, &pC->m_WriterVideoAU, &EncParams);
1719 pC->m_eEncoderState = M4PTO3GPP_kEncoderStopped;
1721 if (M4OSA_NULL != pC->m_pEncoderInt->pFctStart)
1723 err = pC->m_pEncoderInt->pFctStart(pC->m_pMp4EncoderContext);
1732 pC->m_eEncoderState = M4PTO3GPP_kEncoderRunning;
1742 err = pC->m_pWriterGlobInt->pFctAddStream(pC->m_p3gpWriterContext, pC->m_pWriterVideoStream);
1753 optionValue.value = (M4OSA_UInt32)(1.5F * (M4OSA_Float)(pC->m_pWriterVideoStreamInfo->width
1754 * pC->m_pWriterVideoStreamInfo->height)
1757 err = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext,
1771 err = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext,
1780 if (M4OSA_NULL != pC->m_pReaderAudioStream)
1782 err = pC->m_pWriterGlobInt->pFctAddStream(pC->m_p3gpWriterContext, pC->m_pWriterAudioStream);
1794 err = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext,
1806 err = pC->m_pWriterGlobInt->pFctSetOption(pC->m_p3gpWriterContext,
1818 err = pC->m_pWriterGlobInt->pFctStartWriting(pC->m_p3gpWriterContext);