Lines Matching defs:context

44  *          - initializes PCM context,
48 * @param pContext: (OUT) Pointer on the PCM Reader context
66 M4PCMR_Context *context;
76 /* Allocates the context */
77 context = M4OSA_NULL;
78 context = (M4PCMR_Context *)M4OSA_32bitAlignedMalloc(sizeof(M4PCMR_Context), M4WAV_READER,
80 if (M4OSA_NULL == context)
84 *pContext = (M4OSA_Context)context;
86 /* Initialize the context */
87 context->m_offset = 0;
89 context->m_state = M4PCMR_kInit;
90 context->m_microState = M4PCMR_kInit;
91 context->m_pFileReadFunc = M4OSA_NULL;
92 context->m_fileContext = M4OSA_NULL;
93 context->m_pAuBuffer = M4OSA_NULL;
94 context->m_pDecoderSpecInfo = M4OSA_NULL;
99 M4OSA_chrGetUInt32(pTempURL, &(context->m_decoderConfig.SampleFrequency),
105 M4OSA_chrGetUInt16(pTempURL, &(context->m_decoderConfig.nbChannels),
110 context->m_fileContext = M4OSA_NULL;
111 err = pFileFunction->openRead(&(context->m_fileContext), pUrl, M4OSA_kFileRead);
116 context->m_decoderConfig.BitsPerSample = 16;
117 context->m_decoderConfig.AvgBytesPerSec = context->m_decoderConfig.SampleFrequency * 2 \
118 * context->m_decoderConfig.nbChannels;
119 err = pFileFunction->getOption(context->m_fileContext, M4OSA_kFileReadGetFileSize,
120 (M4OSA_DataOption*)&(context->m_decoderConfig.DataLength));
125 context->m_blockSize = 2048 * context->m_decoderConfig.nbChannels; // Raw PCM. Hence, get a
128 if(context->m_decoderConfig.SampleFrequency == 8000)
131 context->m_blockSize = context->m_decoderConfig.nbChannels *\
132 (context->m_decoderConfig.SampleFrequency / 50) * \
133 (context->m_decoderConfig.BitsPerSample / 8);
135 if(context->m_decoderConfig.SampleFrequency == 16000)
138 context->m_blockSize = 2048 * context->m_decoderConfig.nbChannels;
140 context->m_dataStartOffset = 0;
141 context->m_pFileReadFunc = pFileFunction;
143 context->m_pAuBuffer = (M4OSA_MemAddr32)M4OSA_32bitAlignedMalloc(context->m_blockSize, M4WAV_READER,
145 if (M4OSA_NULL == context->m_pAuBuffer)
152 context->m_state = M4PCMR_kOpening;
159 if(context->m_pFileReadFunc != M4OSA_NULL)
160 context->m_pFileReadFunc->closeRead(context->m_fileContext);
162 /* Free internal context */
163 free(context);
171 * M4OSA_ERR M4PCMR_getNextStream(M4OSA_Context context, M4SYS_StreamDescription* pStreamDesc)
177 * @param context: (IN/OUT) PCM Reader context
178 * @param pStreamDesc: (IN) Stream Description context
186 M4OSA_ERR M4PCMR_getNextStream(M4OSA_Context context, M4SYS_StreamDescription* pStreamDesc)
188 M4PCMR_Context *c = (M4PCMR_Context *)context;
191 if((M4OSA_NULL == context)|| (M4OSA_NULL == pStreamDesc))
278 * M4OSA_ERR M4PCMR_startReading(M4OSA_Context context, M4SYS_StreamID* pStreamIDs)
286 * @param context: (IN/OUT) PCM Reader context
295 M4OSA_ERR M4PCMR_startReading(M4OSA_Context context, M4SYS_StreamID* pStreamIDs)
297 M4PCMR_Context *c = (M4PCMR_Context *)context;
300 if((M4OSA_NULL == context) || (M4OSA_NULL == pStreamIDs))
328 * M4OSA_ERR M4PCMR_nextAU(M4OSA_Context context, M4SYS_StreamID streamID, M4SYS_AccessUnit* pAU)
339 * @param context: (IN/OUT) PCM Reader context
351 M4OSA_ERR M4PCMR_nextAU(M4OSA_Context context, M4SYS_StreamID streamID, M4SYS_AccessUnit* pAU)
353 M4PCMR_Context *c = (M4PCMR_Context *)context;
358 if((M4OSA_NULL == context) || (M4OSA_NULL == pAU))
418 * M4OSA_ERR M4PCMR_freeAU(M4OSA_Context context, M4SYS_StreamID streamID, M4SYS_AccessUnit* pAU)
425 * @param context: (IN/OUT) PCM Reader context
433 M4OSA_ERR M4PCMR_freeAU(M4OSA_Context context, M4SYS_StreamID streamID, M4SYS_AccessUnit* pAU)
435 M4PCMR_Context *c = (M4PCMR_Context *)context;
438 if((M4OSA_NULL == context ) || (M4OSA_NULL == pAU))
460 * M4OSA_ERR M4PCMR_seek(M4OSA_Context context, M4SYS_StreamID* pStreamID,
468 * - Update new m_offset in PCM reader context
469 * @param context: (IN/OUT) PCM Reader context
482 M4OSA_ERR M4PCMR_seek(M4OSA_Context context, M4SYS_StreamID* pStreamID, M4OSA_Time time,
485 M4PCMR_Context *c = (M4PCMR_Context *)context;
492 if((M4OSA_NULL == context) || (M4OSA_NULL == pStreamID))
546 * M4OSA_ERR M4PCMR_closeRead(M4OSA_Context context)
547 * @brief This function closes PCM file, and frees context
552 * @param context: (IN/OUT) PCM Reader context
558 M4OSA_ERR M4PCMR_closeRead(M4OSA_Context context)
560 M4PCMR_Context *c = (M4PCMR_Context *)context;
564 if(M4OSA_NULL == context)
595 /* Free internal context */
606 * M4OSA_ERR M4PCMR_getOption(M4OSA_Context context, M4PCMR_OptionID optionID,
612 * @param context: (IN/OUT) PCM Reader context
622 M4OSA_ERR M4PCMR_getOption(M4OSA_Context context, M4PCMR_OptionID optionID,
625 M4PCMR_Context *c =(M4PCMR_Context *)context;
628 if(M4OSA_NULL == context)
656 * M4OSA_ERR M4PCMR_setOption(M4OSA_Context context, M4PCMR_OptionID optionID,
662 * @param context: (IN/OUT) PCM Reader context
672 M4OSA_ERR M4PCMR_setOption(M4OSA_Context context, M4PCMR_OptionID optionID, M4OSA_DataOption Value)
674 M4PCMR_Context *c =(M4PCMR_Context *)context;
677 if(context == M4OSA_NULL)