diff options
-rwxr-xr-x | libvideoeditor/lvpp/DummyAudioSource.cpp | 3 | ||||
-rw-r--r--[-rwxr-xr-x] | libvideoeditor/lvpp/DummyVideoSource.cpp | 2 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp | 4 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorPreviewController.cpp | 56 | ||||
-rwxr-xr-x | libvideoeditor/vss/common/inc/VideoEditorResampler.h | 10 | ||||
-rw-r--r--[-rwxr-xr-x] | libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | libvideoeditor/vss/mcs/src/M4MCS_API.c | 22 | ||||
-rw-r--r--[-rwxr-xr-x] | libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c | 8 | ||||
-rwxr-xr-x | libvideoeditor/vss/src/VideoEditorResampler.cpp | 14 |
11 files changed, 67 insertions, 58 deletions
diff --git a/libvideoeditor/lvpp/DummyAudioSource.cpp b/libvideoeditor/lvpp/DummyAudioSource.cpp index 70f5944..4eca3aa 100755 --- a/libvideoeditor/lvpp/DummyAudioSource.cpp +++ b/libvideoeditor/lvpp/DummyAudioSource.cpp @@ -76,9 +76,10 @@ DummyAudioSource::DummyAudioSource (int32_t samplingRate, mSamplingRate(samplingRate), mChannelCount(channelCount), mFrameDurationUs(frameDurationUs), + mNumberOfSamplePerFrame(0), mAudioDurationUs(audioDurationUs), mTimeStampUs(0) , - mNumberOfSamplePerFrame(0), + mBufferGroup(NULL){ LOG2("DummyAudioSource::DummyAudioSource constructor START"); /* Do nothing here? */ diff --git a/libvideoeditor/lvpp/DummyVideoSource.cpp b/libvideoeditor/lvpp/DummyVideoSource.cpp index 58487b2..42a732b 100755..100644 --- a/libvideoeditor/lvpp/DummyVideoSource.cpp +++ b/libvideoeditor/lvpp/DummyVideoSource.cpp @@ -136,7 +136,7 @@ status_t DummyVideoSource::read( M4OSA_clockGetTime(&mImagePlayStartTime, 1000); //1000 time scale for time in ms
}
- if ((mImageSeekTime == mImageClipDuration) || (mFrameTimeUs == mImageClipDuration)) {
+ if ((mImageSeekTime == mImageClipDuration) || (mFrameTimeUs == (int64_t)mImageClipDuration)) {
LOG2("DummyVideoSource::read() End of stream reached; return NULL buffer");
*out = NULL;
return ERROR_END_OF_STREAM;
diff --git a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp index 3c9ffa3..c9ff690 100755 --- a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp +++ b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp @@ -418,7 +418,7 @@ size_t VideoEditorAudioPlayer::fillBuffer(void *data, size_t size) { int64_t startTimeForBT = 0; M4OSA_Float fPTVolLevel = ((M4OSA_Float)mBGAudioStoryBoardCurrentMediaVolumeVal)/100; - M4OSA_Int16 *pPTMdata; + M4OSA_Int16 *pPTMdata=NULL; M4OSA_UInt32 uiPCMsize = 0; while ((size_remaining > 0)&&(err==M4NO_ERROR)) { @@ -534,7 +534,7 @@ size_t VideoEditorAudioPlayer::fillBuffer(void *data, size_t size) { mBGAudioPCMFileSeekPoint = tmp32; if (err != M4NO_ERROR){ - LOGE("M4OSA_fileReadSeek err %d", err); + LOGE("M4OSA_fileReadSeek err %d",(int)err); } err = M4OSA_fileReadData(mBGAudioPCMFileHandle, diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp index 8ad92da..3e3d161 100755 --- a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp +++ b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp @@ -25,7 +25,6 @@ namespace android { VideoEditorPreviewController::VideoEditorPreviewController()
: mCurrentPlayer(0),
- mActivePlayerIndex(0),
mThreadContext(NULL),
mPlayerState(VePlayerIdle),
mPrepareReqest(M4OSA_FALSE),
@@ -40,18 +39,19 @@ VideoEditorPreviewController::VideoEditorPreviewController() mCurrentClipNumber(-1),
mClipTotalDuration(0),
mCurrentVideoEffect(VIDEO_EFFECT_NONE),
+ mBackgroundAudioSetting(NULL),
+ mAudioMixPCMFileHandle(NULL),
mTarget(NULL),
mJniCookie(NULL),
mJniCallback(NULL),
- mBackgroundAudioSetting(NULL),
- mAudioMixPCMFileHandle(NULL),
- mVideoStoryBoardTimeMsUptoFirstPreviewClip(0),
mCurrentPlayedDuration(0),
mCurrentClipDuration(0),
+ mVideoStoryBoardTimeMsUptoFirstPreviewClip(0),
+ mOverlayState(OVERLAY_CLEAR),
+ mActivePlayerIndex(0),
mOutputVideoWidth(0),
mOutputVideoHeight(0),
bStopThreadInProgress(false),
- mOverlayState(OVERLAY_CLEAR),
mSemThreadWait(NULL) {
LOGV("VideoEditorPreviewController");
mRenderingMode = M4xVSS_kBlackBorders;
@@ -79,7 +79,7 @@ VideoEditorPreviewController::~VideoEditorPreviewController() { err = M4OSA_threadSyncClose(mThreadContext);
if(err != M4NO_ERROR) {
LOGE("~VideoEditorPreviewController: error 0x%x \
- in trying to close thread", err);
+ in trying to close thread", (unsigned int) err);
// Continue even if error
}
@@ -229,7 +229,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings( if(mClipList[i] == NULL) {
- LOGE("loadEditSettings: Allocation error for mClipList[%d]", i);
+ LOGE("loadEditSettings: Allocation error for mClipList[%d]", (int)i);
return M4ERR_ALLOC;
}
// Copy plain structure
@@ -293,7 +293,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings( sizeof(M4VSS3GPP_EffectSettings));
if(pSettings->Effects[i].VideoEffectType ==
- M4xVSS_kVideoEffectType_Framing) {
+ (M4VSS3GPP_VideoEffectType)M4xVSS_kVideoEffectType_Framing) {
// Allocate the pFraming RGB buffer
mEffectsSettings[i].xVSS.pFramingBuffer =
(M4VIFI_ImagePlane *)M4OSA_malloc(sizeof(M4VIFI_ImagePlane),
@@ -435,7 +435,7 @@ M4OSA_ERR VideoEditorPreviewController::startPreview( M4OSA_UInt32 i = 0, iIncrementedDuration = 0;
LOGV("startPreview");
- if(fromMS > toMs) {
+ if(fromMS > (M4OSA_UInt32)toMs) {
LOGE("startPreview: fromMS > toMs");
return M4ERR_PARAMETER;
}
@@ -569,7 +569,7 @@ M4OSA_ERR VideoEditorPreviewController::startPreview( }
else {
LOGV("startPreview: toMs=%d", toMs);
- if(toMs > mClipTotalDuration) {
+ if((M4OSA_UInt32)toMs > mClipTotalDuration) {
LOGE("startPreview: toMs > mClipTotalDuration");
return M4ERR_PARAMETER;
}
@@ -577,7 +577,7 @@ M4OSA_ERR VideoEditorPreviewController::startPreview( iIncrementedDuration = 0;
for(i=0;i<mNumberClipsInStoryBoard;i++) {
- if(toMs <= (iIncrementedDuration +
+ if((M4OSA_UInt32)toMs <= (iIncrementedDuration +
(mClipList[i]->uiEndCutTime - mClipList[i]->uiBeginCutTime))) {
// Save original value
mLastPreviewClipEndTime = mClipList[i]->uiEndCutTime;
@@ -602,7 +602,7 @@ M4OSA_ERR VideoEditorPreviewController::startPreview( // Open the preview process thread
err = M4OSA_threadSyncOpen(&mThreadContext, (M4OSA_ThreadDoIt)threadProc);
if (M4NO_ERROR != err) {
- LOGE("VideoEditorPreviewController:M4OSA_threadSyncOpen error %d", err);
+ LOGE("VideoEditorPreviewController:M4OSA_threadSyncOpen error %d", (int) err);
return err;
}
@@ -611,7 +611,7 @@ M4OSA_ERR VideoEditorPreviewController::startPreview( (M4OSA_DataOption)PREVIEW_THREAD_STACK_SIZE);
if (M4NO_ERROR != err) {
- LOGE("VideoEditorPreviewController: threadSyncSetOption error %d", err);
+ LOGE("VideoEditorPreviewController: threadSyncSetOption error %d", (int) err);
M4OSA_threadSyncClose(mThreadContext);
mThreadContext = NULL;
return err;
@@ -620,7 +620,7 @@ M4OSA_ERR VideoEditorPreviewController::startPreview( // Start the thread
err = M4OSA_threadSyncStart(mThreadContext, (M4OSA_Void*)this);
if (M4NO_ERROR != err) {
- LOGE("VideoEditorPreviewController: threadSyncStart error %d", err);
+ LOGE("VideoEditorPreviewController: threadSyncStart error %d", (int) err);
M4OSA_threadSyncClose(mThreadContext);
mThreadContext = NULL;
return err;
@@ -654,7 +654,7 @@ M4OSA_UInt32 VideoEditorPreviewController::stopPreview() { err = M4OSA_threadSyncClose(mThreadContext);
if(err != M4NO_ERROR) {
- LOGE("stopPreview: error 0x%x in trying to close thread", err);
+ LOGE("stopPreview: error 0x%x in trying to close thread", (unsigned int)err);
// Continue even if error
}
@@ -851,13 +851,13 @@ M4OSA_ERR VideoEditorPreviewController::renderPreviewFrame( //Provide the overlay Update indication when there is an overlay effect
if (mCurrentVideoEffect & VIDEO_EFFECT_FRAMING) {
- int index;
+ M4OSA_UInt32 index;
mCurrentVideoEffect &= ~VIDEO_EFFECT_FRAMING; //never apply framing here.
// Find the effect in effectSettings array
for (index = 0; index < mNumberEffects; index++) {
if(mEffectsSettings[index].VideoEffectType ==
- M4xVSS_kVideoEffectType_Framing) {
+ (M4VSS3GPP_VideoEffectType)M4xVSS_kVideoEffectType_Framing) {
if((mEffectsSettings[index].uiStartTime <= pFrameInfo->timeMs) &&
((mEffectsSettings[index].uiStartTime+
@@ -882,7 +882,7 @@ M4OSA_ERR VideoEditorPreviewController::renderPreviewFrame( (M4OSA_Void *)pixelArray);
if(err != M4NO_ERROR) {
- LOGE("renderPreviewFrame: applyVideoEffect error 0x%x", err);
+ LOGE("renderPreviewFrame: applyVideoEffect error 0x%x", (unsigned int)err);
delete mTarget;
mTarget = NULL;
M4OSA_free((M4OSA_MemAddr32)pixelArray);
@@ -898,7 +898,7 @@ M4OSA_ERR VideoEditorPreviewController::renderPreviewFrame( pFrameStr->uiFrameHeight, (M4OSA_Void *)pixelArray);
if(err != M4NO_ERROR) {
- LOGE("renderPreviewFrame:doImageRenderingMode error 0x%x", err);
+ LOGE("renderPreviewFrame:doImageRenderingMode error 0x%x", (unsigned int)err);
delete mTarget;
mTarget = NULL;
M4OSA_free((M4OSA_MemAddr32)pixelArray);
@@ -914,7 +914,7 @@ M4OSA_ERR VideoEditorPreviewController::renderPreviewFrame( pFrameStr->uiFrameHeight, (M4OSA_Void *)pixelArray);
if(err != M4NO_ERROR) {
- LOGE("renderPreviewFrame: doImageRenderingMode error 0x%x", err);
+ LOGE("renderPreviewFrame: doImageRenderingMode error 0x%x", (unsigned int)err);
delete mTarget;
mTarget = NULL;
M4OSA_free((M4OSA_MemAddr32)pixelArray);
@@ -961,7 +961,7 @@ M4OSA_ERR VideoEditorPreviewController::preparePlayer( pController->mOutputVideoSize);
LOGV("preparePlayer: setMediaRenderingMode");
- if(index == pController->mStartingClipIndex) {
+ if((M4OSA_UInt32)index == pController->mStartingClipIndex) {
pController->mVePlayer[playerInstance]->setPlaybackBeginTime(
pController->mFirstPreviewClipBeginTime);
}
@@ -1015,7 +1015,7 @@ M4OSA_ERR VideoEditorPreviewController::threadProc(M4OSA_Void* param) { LOGV("threadProc: playing file index %d total clips %d",
pController->mCurrentClipNumber, pController->mNumberClipsToPreview);
- if(pController->mCurrentClipNumber >=
+ if((M4OSA_UInt32)pController->mCurrentClipNumber >=
pController->mNumberClipsToPreview) {
LOGV("All clips previewed");
@@ -1059,7 +1059,7 @@ M4OSA_ERR VideoEditorPreviewController::threadProc(M4OSA_Void* param) { }
index=pController->mCurrentClipNumber;
- if(pController->mCurrentClipNumber == pController->mStartingClipIndex) {
+ if((M4OSA_UInt32)pController->mCurrentClipNumber == pController->mStartingClipIndex) {
pController->mCurrentPlayedDuration +=
pController->mVideoStoryBoardTimeMsUptoFirstPreviewClip;
@@ -1083,7 +1083,7 @@ M4OSA_ERR VideoEditorPreviewController::threadProc(M4OSA_Void* param) { LOGV("threadProc: setStoryboardStartTime");
// Set the next clip duration for Audio mix here
- if(pController->mCurrentClipNumber != pController->mStartingClipIndex) {
+ if((M4OSA_UInt32)pController->mCurrentClipNumber != pController->mStartingClipIndex) {
pController->mVePlayer[pController->mCurrentPlayer]->setAudioMixStoryBoardParam(
pController->mCurrentPlayedDuration,
@@ -1151,7 +1151,7 @@ void VideoEditorPreviewController::notify( pController->mPlayerState = VePlayerIdle;
//send progress callback with last frame timestamp
- if(pController->mCurrentClipNumber ==
+ if((M4OSA_UInt32)pController->mCurrentClipNumber ==
pController->mStartingClipIndex) {
clipDuration =
pController->mClipList[pController->mCurrentClipNumber]->uiEndCutTime
@@ -1169,7 +1169,7 @@ void VideoEditorPreviewController::notify( &playedDuration);
if ((pController->mOverlayState == OVERLAY_UPDATE) &&
- (pController->mCurrentClipNumber !=
+ ((M4OSA_UInt32)pController->mCurrentClipNumber !=
(pController->mNumberClipsToPreview-1))) {
VideoEditorCurretEditInfo *pEditInfo =
(VideoEditorCurretEditInfo*)M4OSA_malloc(sizeof(VideoEditorCurretEditInfo),
@@ -1230,7 +1230,7 @@ void VideoEditorPreviewController::notify( LOGV("VIDEO PLAYBACK ALMOST over, prepare next player");
// Select next player and prepare it
// If there is a clip after this one
- if ((pController->mCurrentClipNumber+1) <
+ if ((M4OSA_UInt32)(pController->mCurrentClipNumber+1) <
pController->mNumberClipsToPreview) {
pController->mPrepareReqest = M4OSA_TRUE;
pController->mCurrentPlayer++;
@@ -1512,7 +1512,7 @@ M4OSA_ERR VideoEditorPreviewController::doImageRenderingMode( err = applyRenderingMode(planeIn, planeOut, mRenderingMode);
if(err != M4NO_ERROR) {
- LOGE("doImageRenderingMode: applyRenderingMode returned err=0x%x", err);
+ LOGE("doImageRenderingMode: applyRenderingMode returned err=0x%x", (unsigned int)err);
}
return err;
}
diff --git a/libvideoeditor/vss/common/inc/VideoEditorResampler.h b/libvideoeditor/vss/common/inc/VideoEditorResampler.h index fe9876c..c4e3a89 100755 --- a/libvideoeditor/vss/common/inc/VideoEditorResampler.h +++ b/libvideoeditor/vss/common/inc/VideoEditorResampler.h @@ -23,13 +23,13 @@ extern "C" { #include "M4OSA_Types.h" -M4OSA_Int32 LVAudioResamplerCreate(M4OSA_Int32 bitDepth, M4OSA_Int32 inChannelCount, +M4OSA_Context LVAudioResamplerCreate(M4OSA_Int32 bitDepth, M4OSA_Int32 inChannelCount, M4OSA_Int32 sampleRate, M4OSA_Int32 quality); -void LVAudiosetSampleRate(M4OSA_Int32 resamplerContext,M4OSA_Int32 inSampleRate); -void LVAudiosetVolume(M4OSA_Int32 resamplerContext, M4OSA_Int16 left, M4OSA_Int16 right) ; +void LVAudiosetSampleRate(M4OSA_Context resamplerContext,M4OSA_Int32 inSampleRate); +void LVAudiosetVolume(M4OSA_Context resamplerContext, M4OSA_Int16 left, M4OSA_Int16 right) ; void LVAudioresample_LowQuality(M4OSA_Int16* out, M4OSA_Int16* input, - M4OSA_Int32 outFrameCount, M4OSA_Int32 resamplerContext); -void LVDestroy(M4OSA_Int32 resamplerContext); + M4OSA_Int32 outFrameCount, M4OSA_Context resamplerContext); +void LVDestroy(M4OSA_Context resamplerContext); void MonoTo2I_16( const M4OSA_Int16 *src, M4OSA_Int16 *dst, diff --git a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h index 570b654..bf627c7 100755..100644 --- a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h +++ b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h @@ -725,7 +725,7 @@ typedef struct M4OSA_Bool bDoDucking; M4OSA_Bool bLoop; M4OSA_Bool bNoLooping; - M4OSA_Int32 pLVAudioResampler; + M4OSA_Context pLVAudioResampler; M4OSA_Bool bjumpflag; } M4VSS3GPP_InternalAudioMixingContext; diff --git a/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h b/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h index 9611fcf..68d2448 100755..100644 --- a/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h +++ b/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h @@ -511,7 +511,7 @@ typedef struct M4OSA_MemAddr8 pPosInSsrcBufferIn; /**< Position into the SSRC in buffer */ M4OSA_MemAddr8 pPosInSsrcBufferOut;/**< Position into the SSRC out buffer */ - M4OSA_Int32 *pLVAudioResampler; + M4OSA_Context pLVAudioResampler; /** diff --git a/libvideoeditor/vss/mcs/src/M4MCS_API.c b/libvideoeditor/vss/mcs/src/M4MCS_API.c index a327426..e5b9367 100755..100644 --- a/libvideoeditor/vss/mcs/src/M4MCS_API.c +++ b/libvideoeditor/vss/mcs/src/M4MCS_API.c @@ -3380,7 +3380,7 @@ M4OSA_ERR M4MCS_cleanUp( M4MCS_Context pContext ) if (pC->pLVAudioResampler != M4OSA_NULL) { - LVDestroy((M4OSA_Int32)pC->pLVAudioResampler); + LVDestroy(pC->pLVAudioResampler); pC->pLVAudioResampler = M4OSA_NULL; } @@ -6413,18 +6413,22 @@ static M4OSA_ERR M4MCS_intPrepareAudioProcessing( M4MCS_InternalContext *pC ) } - pC->pLVAudioResampler = (M4OSA_Int32)LVAudioResamplerCreate( + pC->pLVAudioResampler = LVAudioResamplerCreate( 16, /*gInputParams.lvBTChannelCount*/ - /*pC->pAddedClipCtxt->pSettings->ClipProperties.uiNbChannels*/ (M4OSA_Int16)pC->InputFileProperties.uiNbChannels/*ssrcParams.SSRC_NrOfChannels*/, - /* gInputParams.lvOutSampleRate*//*pSettings->outputASF*/ - pC->AudioEncParams.Frequency/*ssrcParams.SSRC_Fs_Out*/, 1); - LVAudiosetSampleRate((M4OSA_Int32)pC->pLVAudioResampler, + (M4OSA_Int32)(pC->AudioEncParams.Frequency)/*ssrcParams.SSRC_Fs_Out*/, 1); + + if( M4OSA_NULL == pC->pLVAudioResampler) + { + return M4ERR_ALLOC; + } + + LVAudiosetSampleRate(pC->pLVAudioResampler, /*gInputParams.lvInSampleRate*/ /*pC->pAddedClipCtxt->pSettings->ClipProperties.uiSamplingFrequency*/ pC->InputFileProperties.uiSamplingFrequency/*ssrcParams.SSRC_Fs_In*/); - LVAudiosetVolume((M4OSA_Int32)pC->pLVAudioResampler, (M4OSA_Int16)(0x1000 /* 0x7fff */), + LVAudiosetVolume(pC->pLVAudioResampler, (M4OSA_Int16)(0x1000 /* 0x7fff */), (M4OSA_Int16)(0x1000/*0x7fff*/)); @@ -8471,7 +8475,7 @@ m4mcs_intaudiotranscoding_do_resampling: * ((*pC).InputFileProperties).uiNbChannels), 0); LVAudioresample_LowQuality((short *)tempBuffOut, (short *)pSsrcInput, - pC->iSsrcNbSamplOut, (M4OSA_Int32)pC->pLVAudioResampler); + pC->iSsrcNbSamplOut, pC->pLVAudioResampler); } else { @@ -8479,7 +8483,7 @@ m4mcs_intaudiotranscoding_do_resampling: * ((*pC).InputFileProperties).uiNbChannels), 0); LVAudioresample_LowQuality((short *)pC->pSsrcBufferOut, - (short *)pSsrcInput, pC->iSsrcNbSamplOut, (M4OSA_Int32)pC->pLVAudioResampler); + (short *)pSsrcInput, pC->iSsrcNbSamplOut, pC->pLVAudioResampler); } if( pC->pReaderAudioStream->m_nbChannels == 1 ) diff --git a/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c b/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c index 009f495..5ea6d46 100755..100644 --- a/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c +++ b/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c @@ -122,7 +122,7 @@ M4OSA_ERR M4DECODER_EXTERNAL_getInterface(M4DECODER_VideoInterface **pDecoderInt (*pDecoderInterface)->m_pFctCreate = M4DECODER_EXTERNAL_create; (*pDecoderInterface)->m_pFctDestroy = M4DECODER_EXTERNAL_destroy; - (*pDecoderInterface)->m_pFctGetOption = M4DECODER_EXTERNAL_getOption; + (*pDecoderInterface)->m_pFctGetOption = (M4DECODER_getOption_fct*)M4DECODER_EXTERNAL_getOption; (*pDecoderInterface)->m_pFctSetOption = M4DECODER_EXTERNAL_setOption; (*pDecoderInterface)->m_pFctDecode = M4DECODER_EXTERNAL_decode; (*pDecoderInterface)->m_pFctRender = M4DECODER_EXTERNAL_render; diff --git a/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c b/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c index c943513..1e05aa3 100755..100644 --- a/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c +++ b/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c @@ -232,9 +232,13 @@ M4OSA_ERR M4VSS3GPP_audioMixingInit( M4VSS3GPP_AudioMixingContext *pContext, pC->ewc.iOutputDuration = (M4OSA_Int32)pC->pInputClipCtxt->pSettings-> ClipProperties.uiClipDuration; /*gInputParams.lvBTChannelCount*/ - pC->pLVAudioResampler = (M4OSA_Int32)LVAudioResamplerCreate(16, + pC->pLVAudioResampler = LVAudioResamplerCreate(16, pC->pAddedClipCtxt->pSettings->ClipProperties.uiNbChannels, - /* gInputParams.lvOutSampleRate*/pSettings->outputASF, 1); + /* gInputParams.lvOutSampleRate*/(M4OSA_Int32)pSettings->outputASF, 1); + if( M4OSA_NULL == pC->pLVAudioResampler ) + { + return M4ERR_ALLOC; + } LVAudiosetSampleRate(pC->pLVAudioResampler, /*gInputParams.lvInSampleRate*/ pC->pAddedClipCtxt->pSettings->ClipProperties.uiSamplingFrequency); diff --git a/libvideoeditor/vss/src/VideoEditorResampler.cpp b/libvideoeditor/vss/src/VideoEditorResampler.cpp index 81709df..c967aaf 100755 --- a/libvideoeditor/vss/src/VideoEditorResampler.cpp +++ b/libvideoeditor/vss/src/VideoEditorResampler.cpp @@ -75,14 +75,14 @@ void VideoEditorResampler::releaseBuffer(AudioBufferProvider::Buffer *pBuffer) { extern "C" { -M4OSA_Int32 LVAudioResamplerCreate(M4OSA_Int32 bitDepth, M4OSA_Int32 inChannelCount, +M4OSA_Context LVAudioResamplerCreate(M4OSA_Int32 bitDepth, M4OSA_Int32 inChannelCount, M4OSA_Int32 sampleRate, M4OSA_Int32 quality) { VideoEditorResampler *context = new VideoEditorResampler(); context->mResampler = AudioResampler::create( bitDepth, inChannelCount, sampleRate, AudioResampler::DEFAULT); if (context->mResampler == NULL) { - return NO_MEMORY; + return NULL; } context->mResampler->setSampleRate(android::VideoEditorResampler::kFreq32000Hz); context->mResampler->setVolume(0x1000, 0x1000); @@ -91,11 +91,11 @@ M4OSA_Int32 LVAudioResamplerCreate(M4OSA_Int32 bitDepth, M4OSA_Int32 inChannelCo context->mInput = NULL; context->mTmpInBuffer = NULL; - return ((M4OSA_Int32)context); + return ((M4OSA_Context )context); } -void LVAudiosetSampleRate(M4OSA_Int32 resamplerContext, M4OSA_Int32 inSampleRate) { +void LVAudiosetSampleRate(M4OSA_Context resamplerContext, M4OSA_Int32 inSampleRate) { VideoEditorResampler *context = (VideoEditorResampler *)resamplerContext; @@ -110,14 +110,14 @@ void LVAudiosetSampleRate(M4OSA_Int32 resamplerContext, M4OSA_Int32 inSampleRate context->nbChannels * sizeof(int16_t)) / 1000); } -void LVAudiosetVolume(M4OSA_Int32 resamplerContext, M4OSA_Int16 left, M4OSA_Int16 right) { +void LVAudiosetVolume(M4OSA_Context resamplerContext, M4OSA_Int16 left, M4OSA_Int16 right) { VideoEditorResampler *context = (VideoEditorResampler *)resamplerContext; context->mResampler->setVolume(left,right); } -void LVDestroy(M4OSA_Int32 resamplerContext) { +void LVDestroy(M4OSA_Context resamplerContext) { VideoEditorResampler *context = (VideoEditorResampler *)resamplerContext; @@ -144,7 +144,7 @@ void LVDestroy(M4OSA_Int32 resamplerContext) { } void LVAudioresample_LowQuality(M4OSA_Int16* out, M4OSA_Int16* input, - M4OSA_Int32 outFrameCount, M4OSA_Int32 resamplerContext) { + M4OSA_Int32 outFrameCount, M4OSA_Context resamplerContext) { VideoEditorResampler *context = (VideoEditorResampler *)resamplerContext; |