summaryrefslogtreecommitdiffstats
path: root/libvideoeditor/vss/mcs/src/M4MCS_API.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvideoeditor/vss/mcs/src/M4MCS_API.c')
-rwxr-xr-xlibvideoeditor/vss/mcs/src/M4MCS_API.c296
1 files changed, 0 insertions, 296 deletions
diff --git a/libvideoeditor/vss/mcs/src/M4MCS_API.c b/libvideoeditor/vss/mcs/src/M4MCS_API.c
index 91e3b96..db6d92f 100755
--- a/libvideoeditor/vss/mcs/src/M4MCS_API.c
+++ b/libvideoeditor/vss/mcs/src/M4MCS_API.c
@@ -10799,299 +10799,3 @@ M4OSA_ERR M4MCS_open_normalMode(M4MCS_Context pContext, M4OSA_Void* pFileIn,
return M4NO_ERROR;
}
-
-M4OSA_ERR M4MCS_registerExternalVideoDecoder( M4MCS_Context pContext,
- M4VD_VideoType decoderType,
- M4VD_Interface *pDecoderInterface,
- M4OSA_Void *pUserData )
-{
-#ifdef M4VSS_ENABLE_EXTERNAL_DECODERS
-
- M4OSA_ERR err = M4NO_ERROR;
- M4DECODER_VideoInterface *shellInterface;
- M4DECODER_VideoType nativeType;
- M4DECODER_EXTERNAL_UserDataType shellUserData;
-
- switch( decoderType )
- {
- case M4VD_kMpeg4VideoDec:
- case M4VD_kH263VideoDec:
- nativeType = M4DECODER_kVideoTypeMPEG4;
- break;
-
- case M4VD_kH264VideoDec:
- nativeType = M4DECODER_kVideoTypeAVC;
- break;
-
- default:
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalVideoDecoder: unknown decoderType %d",
- decoderType);
- return M4ERR_PARAMETER;
- break;
- }
-
- shellUserData =
- (M4DECODER_EXTERNAL_UserDataType)M4OSA_32bitAlignedMalloc(sizeof(*shellUserData),
- M4MCS,
- (M4OSA_Char *)"userData structure for the external shell decoder");
-
- if( M4OSA_NULL == shellUserData )
- {
- M4OSA_TRACE1_0(
- "M4MCS_registerExternalVideoDecoder:\
- failed to allocate userData structure for the external shell decoder");
- return M4ERR_ALLOC;
- }
-
- shellUserData->externalFuncs = pDecoderInterface;
- shellUserData->externalUserData = pUserData;
-
- err = M4DECODER_EXTERNAL_getInterface(&shellInterface);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalVideoDecoder:\
- M4DECODER_EXTERNAL_getInterface failed with error 0x%08X",
- err);
- free(shellUserData);
- return err;
- }
-
- err = M4MCS_registerVideoDecoder(pContext, nativeType, shellInterface);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalVideoDecoder:\
- M4MCS_registerVideoDecoder failed with error 0x%08X",
- err);
- free(shellInterface);
- free(shellUserData);
- return err;
- }
-
- ( (M4MCS_InternalContext
- *)pContext)->m_pVideoDecoderUserDataTable[nativeType] = shellUserData;
-
- return M4NO_ERROR;
-#else
-
- return M4ERR_NOT_IMPLEMENTED;
-
-#endif /* M4VSS_ENABLE_EXTERNAL_DECODERS */
-
-}
-
-M4OSA_ERR M4MCS_registerExternalVideoEncoder( M4MCS_Context pContext,
- M4VE_EncoderType encoderType,
- M4VE_Interface *pEncoderInterface,
- M4OSA_Void *pUserData )
-{
-#ifdef M4VSS_ENABLE_EXTERNAL_ENCODERS
-
- M4OSA_ERR err = M4NO_ERROR;
- M4ENCODER_GlobalInterface *shellInterface;
- M4ENCODER_Format nativeType;
-
- switch( encoderType )
- {
- case M4VE_kH263VideoEnc:
- err = M4EGE_H263_getInterfaces(&nativeType, &shellInterface,
- M4ENCODER_OPEN_ADVANCED);
-
- break;
-
- case M4VE_kMpeg4VideoEnc:
- err = M4EGE_MPEG4_getInterfaces(&nativeType, &shellInterface,
- M4ENCODER_OPEN_ADVANCED);
- break;
-
- case M4VE_kH264VideoEnc:
- M4OSA_TRACE1_0(
- "M4MCS_registerExternalVideoEncoder: H264 encoder type not implemented yet");
- return M4ERR_NOT_IMPLEMENTED;
- break;
-
- default:
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalVideoEncoder: unknown encoderType %d",
- encoderType);
- return M4ERR_PARAMETER;
- break;
- }
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalVideoDecoder: M4EGE_getInterface failed with error 0x%08X",
- err);
- return err;
- }
-
- err = M4MCS_registerVideoEncoder(pContext, nativeType, shellInterface);
-
- if( M4NO_ERROR != err )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalVideoEncoder:\
- M4MCS_registerVideoEncoder failed with error 0x%08X",
- err);
- free(shellInterface);
- return err;
- }
-
- ( (M4MCS_InternalContext
- *)pContext)->pVideoEncoderExternalAPITable[nativeType]
- = pEncoderInterface;
- ( (M4MCS_InternalContext
- *)pContext)->pVideoEncoderUserDataTable[nativeType] = pUserData;
-
- return M4NO_ERROR;
-
-#else
-
- return M4ERR_NOT_IMPLEMENTED;
-
-#endif
-
-}
-
-/**
- ************************************************************************
- * M4OSA_ERR M4MCS_registerExternalAudioDecoder(M4MCS_Context pContext,
- * M4AD_Type decoderType,
- * M4AD_Interface *pDecoderInterface);
- * @brief This function will register a specific external audio decoder.
- * @note According to the decoderType, this function will store in the internal context the
- * decoder interface.
- * @param context (IN/OUT) MCS context.
- * @param decoderType (IN) Audio decoder type
- * @param pDecoderInterface (IN) Audio decoder interface.
- * @return M4NO_ERROR: No error
- * @return M4ERR_PARAMETER: A parameter is null, or the decoder type is invalid
- * (in DEBUG only)
- ************************************************************************
- */
-M4OSA_ERR M4MCS_registerExternalAudioDecoder( M4MCS_Context pContext,
- M4AD_Type decoderType,
- M4AD_Interface *pDecoderInterface )
-{
- M4MCS_InternalContext *pC = (M4MCS_InternalContext *)pContext;
-
- M4OSA_DEBUG_IF1((M4OSA_NULL == pC), M4ERR_PARAMETER,
- "M4MCS_registerExternalAudioDecoder: invalid context pointer");
- M4OSA_DEBUG_IF1((M4OSA_NULL == pDecoderInterface), M4ERR_PARAMETER,
- "M4MCS_registerExternalAudioDecoder: invalid pointer on decoder interface");
-
- if( M4MCS_kState_CREATED != pC->State )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalAudioDecoder(): Wrong State (%d), returning M4ERR_STATE",
- pC->State);
- return M4ERR_STATE;
- }
-
- if( decoderType >= M4AD_kType_NB )
- {
- M4OSA_DEBUG_IF1(M4OSA_TRUE, M4ERR_PARAMETER,
- "M4MCS_registerExternalAudioDecoder: Invalid audio decoder type");
- return M4ERR_PARAMETER;
- }
-
- if( pC->m_pAudioDecoderFlagTable[decoderType] == M4OSA_TRUE
- && pC->m_pAudioDecoderItTable[decoderType] != M4OSA_NULL )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalAudioDecoder: error parameter: an external decoder of type\
- %i is already registered",
- decoderType);
- return M4ERR_PARAMETER;
- }
-
- if( pC->m_pAudioDecoderItTable[decoderType] != M4OSA_NULL )
- {
- free(pC->m_pAudioDecoderItTable[decoderType]);
- pC->m_pAudioDecoderItTable[decoderType] = M4OSA_NULL;
- }
-
- pC->m_pAudioDecoderItTable[decoderType] = pDecoderInterface;
- pC->m_pAudioDecoderFlagTable[decoderType] =
- M4OSA_TRUE; /* external decoder */
-
- return M4NO_ERROR;
-}
-
-/**
- ******************************************************************************
- * M4OSA_ERR M4MCS_registerExternalAudioEncoder(M4MCS_Context pContext,
- * M4ENCODER_AudioFormat mediaType,
- * M4ENCODER_AudioGlobalInterface *pEncGlobalInterface)
- * @brief This function will register a specific external audio encoder.
- * @note According to the Mediatype, this function will store in the internal context the
- * encoder context.
- * @param pContext: (IN) Execution context.
- * @param mediaType: (IN) The media type.
- * @param pEncGlobalInterface: (OUT) the encoder interface functions.
- * @return M4NO_ERROR: there is no error
- * @return M4ERR_PARAMETER: pContext or pEncGlobalInterface is M4OSA_NULL (debug only)
- ******************************************************************************
- */
-M4OSA_ERR M4MCS_registerExternalAudioEncoder( M4MCS_Context pContext,
- M4ENCODER_AudioFormat MediaType,
- M4ENCODER_AudioGlobalInterface *pEncGlobalInterface )
-{
- M4MCS_InternalContext *pC = (M4MCS_InternalContext *)pContext;
-
- /**
- * Check input parameters */
- M4OSA_DEBUG_IF2((pC == M4OSA_NULL), M4ERR_PARAMETER,
- "MCS: context is M4OSA_NULL in M4MCS_registerExternalAudioEncoder");
- M4OSA_DEBUG_IF2((pEncGlobalInterface == M4OSA_NULL), M4ERR_PARAMETER,
- "pEncGlobalInterface is M4OSA_NULL in M4MCS_registerExternalAudioEncoder");
-
- M4OSA_TRACE3_2(
- "MCS: M4MCS_registerExternalAudioEncoder called with pContext=0x%x, \
- pEncGlobalInterface=0x%x",
- pC, pEncGlobalInterface);
-
- if( M4MCS_kState_CREATED != pC->State )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalAudioEncoder(): Wrong State (%d), returning M4ERR_STATE",
- pC->State);
- return M4ERR_STATE;
- }
-
- if( MediaType >= M4ENCODER_kAudio_NB )
- {
- M4OSA_DEBUG_IF1(M4OSA_TRUE, M4ERR_PARAMETER,
- "M4MCS_registerExternalAudioEncoder(): Invalid audio encoder type");
- return M4ERR_PARAMETER;
- }
-
- if( pC->pAudioEncoderFlag[MediaType] == M4OSA_TRUE
- && pC->pAudioEncoderInterface[MediaType] != M4OSA_NULL )
- {
- M4OSA_TRACE1_1(
- "M4MCS_registerExternalAudioEncoder: error parameter:\
- an external encoder of type %i is already registered",
- MediaType);
- return M4ERR_PARAMETER;
- }
-
- if( pC->pAudioEncoderInterface[MediaType] != M4OSA_NULL )
- {
- free(pC->pAudioEncoderInterface[MediaType]);
- pC->pAudioEncoderInterface[MediaType] = M4OSA_NULL;
- }
-
- /*
- * Save encoder interface in context */
- pC->pAudioEncoderInterface[MediaType] = pEncGlobalInterface;
- pC->pAudioEncoderFlag[MediaType] = M4OSA_TRUE; /* external encoder */
-
- return M4NO_ERROR;
-}
-