summaryrefslogtreecommitdiffstats
path: root/libvideoeditor
diff options
context:
space:
mode:
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-x[-rw-r--r--]libvideoeditor/lvpp/DummyVideoSource.cpp2
-rwxr-xr-xlibvideoeditor/lvpp/PreviewPlayer.cpp4
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorAudioPlayer.cpp8
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorPreviewController.cpp71
-rwxr-xr-xlibvideoeditor/lvpp/VideoEditorTools.cpp88
-rwxr-xr-xlibvideoeditor/osal/inc/LV_Macros.h2
-rwxr-xr-xlibvideoeditor/osal/inc/LV_Types.h4
-rwxr-xr-xlibvideoeditor/osal/inc/M4OSA_Memory.h5
-rwxr-xr-xlibvideoeditor/osal/src/LVOSA_FileReader_optim.c15
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_CharStar.c4
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_FileCache.c30
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_FileCommon.c28
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_FileExtra.c16
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_FileReader_RAM.c6
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_FileWriter_RAM.c6
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_Mutex.c6
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_Semaphore.c6
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_String.c28
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_String_priv.c38
-rwxr-xr-xlibvideoeditor/osal/src/M4OSA_Thread.c10
-rwxr-xr-xlibvideoeditor/osal/src/M4PSW_MemoryInterface.c41
-rwxr-xr-xlibvideoeditor/vss/3gpwriter/src/M4MP4W_Interface.c10
-rwxr-xr-xlibvideoeditor/vss/3gpwriter/src/M4MP4W_Utils.c54
-rwxr-xr-xlibvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c83
-rwxr-xr-x[-rw-r--r--]libvideoeditor/vss/common/inc/M4VD_Tools.h0
-rwxr-xr-x[-rw-r--r--]libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h0
-rwxr-xr-x[-rw-r--r--]libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h0
-rwxr-xr-xlibvideoeditor/vss/mcs/src/M4MCS_API.c118
-rwxr-xr-xlibvideoeditor/vss/mcs/src/M4MCS_Codecs.c30
-rwxr-xr-xlibvideoeditor/vss/mcs/src/M4MCS_VideoPreProcessing.c8
-rwxr-xr-xlibvideoeditor/vss/src/M4AD_Null.c6
-rwxr-xr-xlibvideoeditor/vss/src/M4AIR_API.c6
-rwxr-xr-xlibvideoeditor/vss/src/M4AMRR_CoreReader.c30
-rwxr-xr-xlibvideoeditor/vss/src/M4PCMR_CoreReader.c14
-rwxr-xr-xlibvideoeditor/vss/src/M4PTO3GPP_API.c34
-rwxr-xr-xlibvideoeditor/vss/src/M4READER_Amr.c16
-rwxr-xr-xlibvideoeditor/vss/src/M4READER_Pcm.c14
-rwxr-xr-x[-rw-r--r--]libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c10
-rwxr-xr-x[-rw-r--r--]libvideoeditor/vss/src/M4VD_Tools.c0
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c28
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_Clip.c22
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_Codecs.c33
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_Edit.c80
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_EditAudio.c2
-rwxr-xr-xlibvideoeditor/vss/src/M4VSS3GPP_EditVideo.c10
-rwxr-xr-xlibvideoeditor/vss/src/M4xVSS_API.c297
-rwxr-xr-xlibvideoeditor/vss/src/M4xVSS_internal.c300
-rwxr-xr-xlibvideoeditor/vss/stagefrightshells/inc/VideoEditorUtils.h4
-rwxr-xr-xlibvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp62
-rwxr-xr-xlibvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c14
-rwxr-xr-xlibvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp12
-rwxr-xr-xlibvideoeditor/vss/stagefrightshells/src/VideoEditorVideoDecoder.cpp4
-rwxr-xr-x[-rw-r--r--]libvideoeditor/vss/video_filters/src/M4VIFI_RGB565toYUV420.c0
-rwxr-xr-x[-rw-r--r--]libvideoeditor/vss/video_filters/src/M4VIFI_ResizeRGB565toRGB565.c0
54 files changed, 872 insertions, 847 deletions
diff --git a/libvideoeditor/lvpp/DummyVideoSource.cpp b/libvideoeditor/lvpp/DummyVideoSource.cpp
index 42a732b..8081660 100644..100755
--- a/libvideoeditor/lvpp/DummyVideoSource.cpp
+++ b/libvideoeditor/lvpp/DummyVideoSource.cpp
@@ -96,7 +96,7 @@ status_t DummyVideoSource::stop() {
LOG2("DummyVideoSource::stop START");
if (mImageBuffer != NULL) {
- M4OSA_free((M4OSA_MemAddr32)mImageBuffer);
+ free(mImageBuffer);
mImageBuffer = NULL;
}
LOG2("DummyVideoSource::stop END");
diff --git a/libvideoeditor/lvpp/PreviewPlayer.cpp b/libvideoeditor/lvpp/PreviewPlayer.cpp
index 2064004..552e1cd 100755
--- a/libvideoeditor/lvpp/PreviewPlayer.cpp
+++ b/libvideoeditor/lvpp/PreviewPlayer.cpp
@@ -230,7 +230,7 @@ PreviewPlayer::~PreviewPlayer() {
reset();
if(mResizedVideoBuffer != NULL) {
- M4OSA_free((M4OSA_MemAddr32)(mResizedVideoBuffer->data()));
+ free((mResizedVideoBuffer->data()));
mResizedVideoBuffer = NULL;
}
@@ -450,7 +450,7 @@ void PreviewPlayer::reset_l() {
mIsVideoSourceJpg = false;
mFrameRGBBuffer = NULL;
if(mFrameYUVBuffer != NULL) {
- M4OSA_free((M4OSA_MemAddr32)mFrameYUVBuffer);
+ free(mFrameYUVBuffer);
mFrameYUVBuffer = NULL;
}
}
diff --git a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
index 2fbb573..a83e7b6 100755
--- a/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
+++ b/libvideoeditor/lvpp/VideoEditorAudioPlayer.cpp
@@ -496,7 +496,7 @@ size_t VideoEditorAudioPlayer::fillBuffer(void *data, size_t size) {
LOGV("mix with background malloc to do len %d", len);
- bgFrame.m_dataAddress = (M4OSA_UInt16*)M4OSA_malloc( len, 1,
+ bgFrame.m_dataAddress = (M4OSA_UInt16*)M4OSA_32bitAlignedMalloc( len, 1,
(M4OSA_Char*)"bgFrame");
if (NULL == bgFrame.m_dataAddress) {
LOGE("mBackgroundAudioSetting Malloc failed");
@@ -504,7 +504,7 @@ size_t VideoEditorAudioPlayer::fillBuffer(void *data, size_t size) {
bgFrame.m_bufferSize = len;
- mixFrame.m_dataAddress = (M4OSA_UInt16*)M4OSA_malloc(len, 1,
+ mixFrame.m_dataAddress = (M4OSA_UInt16*)M4OSA_32bitAlignedMalloc(len, 1,
(M4OSA_Char*)"mixFrame");
if (NULL == mixFrame.m_dataAddress) {
LOGE("mBackgroundAudioSetting Malloc failed");
@@ -602,10 +602,10 @@ size_t VideoEditorAudioPlayer::fillBuffer(void *data, size_t size) {
}
}
if (bgFrame.m_dataAddress) {
- M4OSA_free((M4OSA_MemAddr32)bgFrame.m_dataAddress);
+ free(bgFrame.m_dataAddress);
}
if (mixFrame.m_dataAddress) {
- M4OSA_free((M4OSA_MemAddr32)mixFrame.m_dataAddress);
+ free(mixFrame.m_dataAddress);
}
} else {
// No mixing;
diff --git a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
index 164e2b3..b12d8fe 100755
--- a/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
+++ b/libvideoeditor/lvpp/VideoEditorPreviewController.cpp
@@ -99,29 +99,27 @@ VideoEditorPreviewController::~VideoEditorPreviewController() {
for(i=0;i<mNumberClipsInStoryBoard;i++)
{
if(mClipList[i]->pFile != NULL) {
- M4OSA_free((M4OSA_MemAddr32)mClipList[i]->pFile);
+ free(mClipList[i]->pFile);
mClipList[i]->pFile = NULL;
}
- M4OSA_free((M4OSA_MemAddr32)mClipList[i]);
+ free(mClipList[i]);
}
- M4OSA_free((M4OSA_MemAddr32)mClipList);
+ free(mClipList);
mClipList = NULL;
}
if(mEffectsSettings) {
for(i=0;i<mNumberEffects;i++) {
if(mEffectsSettings[i].xVSS.pFramingBuffer != NULL) {
- M4OSA_free(
- (M4OSA_MemAddr32)mEffectsSettings[i].xVSS.pFramingBuffer->pac_data);
+ free(mEffectsSettings[i].xVSS.pFramingBuffer->pac_data);
- M4OSA_free(
- (M4OSA_MemAddr32)mEffectsSettings[i].xVSS.pFramingBuffer);
+ free(mEffectsSettings[i].xVSS.pFramingBuffer);
mEffectsSettings[i].xVSS.pFramingBuffer = NULL;
}
}
- M4OSA_free((M4OSA_MemAddr32)mEffectsSettings);
+ free(mEffectsSettings);
mEffectsSettings = NULL;
}
@@ -131,7 +129,7 @@ VideoEditorPreviewController::~VideoEditorPreviewController() {
}
if (mBackgroundAudioSetting != NULL) {
- M4OSA_free((M4OSA_MemAddr32)mBackgroundAudioSetting);
+ free(mBackgroundAudioSetting);
mBackgroundAudioSetting = NULL;
}
@@ -170,7 +168,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
}
if(mBackgroundAudioSetting != NULL) {
- M4OSA_free((M4OSA_MemAddr32)mBackgroundAudioSetting);
+ free(mBackgroundAudioSetting);
mBackgroundAudioSetting = NULL;
}
@@ -179,29 +177,27 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
for(i=0;i<mNumberClipsInStoryBoard;i++)
{
if(mClipList[i]->pFile != NULL) {
- M4OSA_free((M4OSA_MemAddr32)mClipList[i]->pFile);
+ free(mClipList[i]->pFile);
mClipList[i]->pFile = NULL;
}
- M4OSA_free((M4OSA_MemAddr32)mClipList[i]);
+ free(mClipList[i]);
}
- M4OSA_free((M4OSA_MemAddr32)mClipList);
+ free(mClipList);
mClipList = NULL;
}
if(mEffectsSettings) {
for(i=0;i<mNumberEffects;i++) {
if(mEffectsSettings[i].xVSS.pFramingBuffer != NULL) {
- M4OSA_free(
- (M4OSA_MemAddr32)mEffectsSettings[i].xVSS.pFramingBuffer->pac_data);
+ free(mEffectsSettings[i].xVSS.pFramingBuffer->pac_data);
- M4OSA_free(
- (M4OSA_MemAddr32)mEffectsSettings[i].xVSS.pFramingBuffer);
+ free(mEffectsSettings[i].xVSS.pFramingBuffer);
mEffectsSettings[i].xVSS.pFramingBuffer = NULL;
}
}
- M4OSA_free((M4OSA_MemAddr32)mEffectsSettings);
+ free(mEffectsSettings);
mEffectsSettings = NULL;
}
@@ -209,7 +205,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
mNumberClipsInStoryBoard = pSettings->uiClipNumber;
LOGV("loadEditSettings: # of Clips = %d", mNumberClipsInStoryBoard);
- mClipList = (M4VSS3GPP_ClipSettings**)M4OSA_malloc(
+ mClipList = (M4VSS3GPP_ClipSettings**)M4OSA_32bitAlignedMalloc(
sizeof(M4VSS3GPP_ClipSettings*)*pSettings->uiClipNumber, M4VS,
(M4OSA_Char*)"LvPP, copy of pClipList");
@@ -224,7 +220,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
// Allocate current clip
mClipList[i] =
- (M4VSS3GPP_ClipSettings*)M4OSA_malloc(
+ (M4VSS3GPP_ClipSettings*)M4OSA_32bitAlignedMalloc(
sizeof(M4VSS3GPP_ClipSettings),M4VS,(M4OSA_Char*)"clip settings");
if(mClipList[i] == NULL) {
@@ -238,7 +234,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
sizeof(M4VSS3GPP_ClipSettings));
if(NULL != pSettings->pClipList[i]->pFile) {
- mClipList[i]->pFile = (M4OSA_Char*)M4OSA_malloc(
+ mClipList[i]->pFile = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(
pSettings->pClipList[i]->filePathSize, M4VS,
(M4OSA_Char*)"pClipSettingsDest->pFile");
@@ -270,7 +266,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
LOGV("loadEditSettings: mNumberEffects = %d", mNumberEffects);
if(mNumberEffects != 0) {
- mEffectsSettings = (M4VSS3GPP_EffectSettings*)M4OSA_malloc(
+ mEffectsSettings = (M4VSS3GPP_EffectSettings*)M4OSA_32bitAlignedMalloc(
mNumberEffects*sizeof(M4VSS3GPP_EffectSettings),
M4VS, (M4OSA_Char*)"effects settings");
@@ -296,12 +292,12 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
(M4VSS3GPP_VideoEffectType)M4xVSS_kVideoEffectType_Framing) {
// Allocate the pFraming RGB buffer
mEffectsSettings[i].xVSS.pFramingBuffer =
- (M4VIFI_ImagePlane *)M4OSA_malloc(sizeof(M4VIFI_ImagePlane),
+ (M4VIFI_ImagePlane *)M4OSA_32bitAlignedMalloc(sizeof(M4VIFI_ImagePlane),
M4VS, (M4OSA_Char*)"lvpp framing buffer");
if(mEffectsSettings[i].xVSS.pFramingBuffer == NULL) {
LOGE("loadEffectsSettings:Alloc error for pFramingBuf");
- M4OSA_free((M4OSA_MemAddr32)mEffectsSettings);
+ free(mEffectsSettings);
mEffectsSettings = NULL;
return M4ERR_ALLOC;
}
@@ -320,20 +316,19 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
}
else {
LOGE("loadEffectsSettings: wrong RGB type");
- M4OSA_free((M4OSA_MemAddr32)mEffectsSettings);
+ free(mEffectsSettings);
mEffectsSettings = NULL;
return M4ERR_PARAMETER;
}
- tmp = (M4VIFI_UInt8 *)M4OSA_malloc(rgbSize, M4VS,
+ tmp = (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(rgbSize, M4VS,
(M4OSA_Char*)"framing buffer pac_data");
if(tmp == NULL) {
LOGE("loadEffectsSettings:Alloc error pFramingBuf pac");
- M4OSA_free((M4OSA_MemAddr32)mEffectsSettings);
+ free(mEffectsSettings);
mEffectsSettings = NULL;
- M4OSA_free(
- (M4OSA_MemAddr32)mEffectsSettings[i].xVSS.pFramingBuffer);
+ free(mEffectsSettings[i].xVSS.pFramingBuffer);
mEffectsSettings[i].xVSS.pFramingBuffer = NULL;
return M4ERR_ALLOC;
@@ -381,7 +376,7 @@ M4OSA_ERR VideoEditorPreviewController::loadEditSettings(
if (mBackgroundAudioSetting == NULL) {
- mBackgroundAudioSetting = (M4xVSS_AudioMixingSettings*)M4OSA_malloc(
+ mBackgroundAudioSetting = (M4xVSS_AudioMixingSettings*)M4OSA_32bitAlignedMalloc(
sizeof(M4xVSS_AudioMixingSettings), M4VS,
(M4OSA_Char*)"LvPP, copy of bgmSettings");
@@ -699,7 +694,7 @@ M4OSA_UInt32 VideoEditorPreviewController::stopPreview() {
// If image file playing, then free the buffer pointer
if(mFrameStr.pBuffer != M4OSA_NULL) {
- M4OSA_free((M4OSA_MemAddr32)mFrameStr.pBuffer);
+ free(mFrameStr.pBuffer);
mFrameStr.pBuffer = M4OSA_NULL;
}
@@ -883,7 +878,7 @@ M4OSA_ERR VideoEditorPreviewController::renderPreviewFrame(
LOGE("renderPreviewFrame: applyVideoEffect error 0x%x", (unsigned int)err);
delete mTarget;
mTarget = NULL;
- M4OSA_free((M4OSA_MemAddr32)pixelArray);
+ free(pixelArray);
pixelArray = NULL;
return err;
}
@@ -899,7 +894,7 @@ M4OSA_ERR VideoEditorPreviewController::renderPreviewFrame(
LOGE("renderPreviewFrame:doImageRenderingMode error 0x%x", (unsigned int)err);
delete mTarget;
mTarget = NULL;
- M4OSA_free((M4OSA_MemAddr32)pixelArray);
+ free(pixelArray);
pixelArray = NULL;
return err;
}
@@ -915,7 +910,7 @@ M4OSA_ERR VideoEditorPreviewController::renderPreviewFrame(
LOGE("renderPreviewFrame: doImageRenderingMode error 0x%x", (unsigned int)err);
delete mTarget;
mTarget = NULL;
- M4OSA_free((M4OSA_MemAddr32)pixelArray);
+ free(pixelArray);
pixelArray = NULL;
return err;
}
@@ -1166,7 +1161,7 @@ void VideoEditorPreviewController::notify(
((M4OSA_UInt32)pController->mCurrentClipNumber !=
(pController->mNumberClipsToPreview-1))) {
VideoEditorCurretEditInfo *pEditInfo =
- (VideoEditorCurretEditInfo*)M4OSA_malloc(sizeof(VideoEditorCurretEditInfo),
+ (VideoEditorCurretEditInfo*)M4OSA_32bitAlignedMalloc(sizeof(VideoEditorCurretEditInfo),
M4VS, (M4OSA_Char*)"Current Edit info");
pEditInfo->overlaySettingsIndex = ext2;
pEditInfo->clipIndex = pController->mCurrentClipNumber;
@@ -1175,7 +1170,7 @@ void VideoEditorPreviewController::notify(
pController->mJniCallback(pController->mJniCookie,
MSG_TYPE_OVERLAY_CLEAR, pEditInfo);
}
- M4OSA_free((M4OSA_MemAddr32)pEditInfo);
+ free(pEditInfo);
}
{
Mutex::Autolock autoLock(pController->mLockSem);
@@ -1246,7 +1241,7 @@ void VideoEditorPreviewController::notify(
LOGV("VIDEO PLAYBACK, Update Overlay");
int overlayIndex = ext2;
VideoEditorCurretEditInfo *pEditInfo =
- (VideoEditorCurretEditInfo*)M4OSA_malloc(sizeof(VideoEditorCurretEditInfo),
+ (VideoEditorCurretEditInfo*)M4OSA_32bitAlignedMalloc(sizeof(VideoEditorCurretEditInfo),
M4VS, (M4OSA_Char*)"Current Edit info");
//ext1 = 1; start the overlay display
// = 2; Clear the overlay.
@@ -1264,7 +1259,7 @@ void VideoEditorPreviewController::notify(
MSG_TYPE_OVERLAY_CLEAR, pEditInfo);
}
}
- M4OSA_free((M4OSA_MemAddr32)pEditInfo);
+ free(pEditInfo);
break;
}
default:
diff --git a/libvideoeditor/lvpp/VideoEditorTools.cpp b/libvideoeditor/lvpp/VideoEditorTools.cpp
index 6e86139..9a43896 100755
--- a/libvideoeditor/lvpp/VideoEditorTools.cpp
+++ b/libvideoeditor/lvpp/VideoEditorTools.cpp
@@ -1063,7 +1063,7 @@ M4OSA_ERR M4xVSS_internalConvertRGBtoYUV(M4xVSS_FramingStruct* framingCtx)
/**
* Allocate output YUV planes */
- framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_malloc(3*sizeof(M4VIFI_ImagePlane), M4VS, (M4OSA_Char*)"M4xVSS_internalConvertRGBtoYUV: Output plane YUV");
+ framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(3*sizeof(M4VIFI_ImagePlane), M4VS, (M4OSA_Char*)"M4xVSS_internalConvertRGBtoYUV: Output plane YUV");
if(framingCtx->FramingYuv == M4OSA_NULL)
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_internalConvertRGBtoYUV");
@@ -1073,7 +1073,7 @@ M4OSA_ERR M4xVSS_internalConvertRGBtoYUV(M4xVSS_FramingStruct* framingCtx)
framingCtx->FramingYuv[0].u_height = framingCtx->FramingRgb->u_height;
framingCtx->FramingYuv[0].u_topleft = 0;
framingCtx->FramingYuv[0].u_stride = framingCtx->FramingRgb->u_width;
- framingCtx->FramingYuv[0].pac_data = (M4VIFI_UInt8*)M4OSA_malloc((framingCtx->FramingYuv[0].u_width*framingCtx->FramingYuv[0].u_height*3)>>1, M4VS, (M4OSA_Char*)"Alloc for the Convertion output YUV");;
+ framingCtx->FramingYuv[0].pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc((framingCtx->FramingYuv[0].u_width*framingCtx->FramingYuv[0].u_height*3)>>1, M4VS, (M4OSA_Char*)"Alloc for the Convertion output YUV");;
if(framingCtx->FramingYuv[0].pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_internalConvertRGBtoYUV");
@@ -1128,7 +1128,7 @@ M4OSA_ERR M4xVSS_internalConvertRGB888toYUV(M4xVSS_FramingStruct* framingCtx)
/**
* Allocate output YUV planes */
- framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_malloc(3*sizeof(M4VIFI_ImagePlane), M4VS, (M4OSA_Char*)"M4xVSS_internalConvertRGBtoYUV: Output plane YUV");
+ framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(3*sizeof(M4VIFI_ImagePlane), M4VS, (M4OSA_Char*)"M4xVSS_internalConvertRGBtoYUV: Output plane YUV");
if(framingCtx->FramingYuv == M4OSA_NULL)
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_internalConvertRGBtoYUV");
@@ -1138,7 +1138,7 @@ M4OSA_ERR M4xVSS_internalConvertRGB888toYUV(M4xVSS_FramingStruct* framingCtx)
framingCtx->FramingYuv[0].u_height = framingCtx->FramingRgb->u_height;
framingCtx->FramingYuv[0].u_topleft = 0;
framingCtx->FramingYuv[0].u_stride = framingCtx->FramingRgb->u_width;
- framingCtx->FramingYuv[0].pac_data = (M4VIFI_UInt8*)M4OSA_malloc((framingCtx->FramingYuv[0].u_width*framingCtx->FramingYuv[0].u_height*3)>>1, M4VS, (M4OSA_Char*)"Alloc for the Convertion output YUV");;
+ framingCtx->FramingYuv[0].pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc((framingCtx->FramingYuv[0].u_width*framingCtx->FramingYuv[0].u_height*3)>>1, M4VS, (M4OSA_Char*)"Alloc for the Convertion output YUV");;
if(framingCtx->FramingYuv[0].pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_internalConvertRGBtoYUV");
@@ -1900,20 +1900,20 @@ M4OSA_ERR applyRenderingMode(M4VIFI_ImagePlane* pPlaneIn, M4VIFI_ImagePlane* pPl
pImagePlanesTemp[2].pac_data = M4OSA_NULL;
/* Allocates plan in local image plane structure */
- pImagePlanesTemp[0].pac_data = (M4OSA_UInt8*)M4OSA_malloc(pImagePlanesTemp[0].u_width * pImagePlanesTemp[0].u_height, M4VS, (M4OSA_Char*)"applyRenderingMode: temporary plane bufferY") ;
+ pImagePlanesTemp[0].pac_data = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(pImagePlanesTemp[0].u_width * pImagePlanesTemp[0].u_height, M4VS, (M4OSA_Char*)"applyRenderingMode: temporary plane bufferY") ;
if(pImagePlanesTemp[0].pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Error alloc in applyRenderingMode");
return M4ERR_ALLOC;
}
- pImagePlanesTemp[1].pac_data = (M4OSA_UInt8*)M4OSA_malloc(pImagePlanesTemp[1].u_width * pImagePlanesTemp[1].u_height, M4VS, (M4OSA_Char*)"applyRenderingMode: temporary plane bufferU") ;
+ pImagePlanesTemp[1].pac_data = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(pImagePlanesTemp[1].u_width * pImagePlanesTemp[1].u_height, M4VS, (M4OSA_Char*)"applyRenderingMode: temporary plane bufferU") ;
if(pImagePlanesTemp[1].pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Error alloc in applyRenderingMode");
return M4ERR_ALLOC;
}
- pImagePlanesTemp[2].pac_data = (M4OSA_UInt8*)M4OSA_malloc(pImagePlanesTemp[2].u_width * pImagePlanesTemp[2].u_height, M4VS, (M4OSA_Char*)"applyRenderingMode: temporary plane bufferV") ;
+ pImagePlanesTemp[2].pac_data = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(pImagePlanesTemp[2].u_width * pImagePlanesTemp[2].u_height, M4VS, (M4OSA_Char*)"applyRenderingMode: temporary plane bufferV") ;
if(pImagePlanesTemp[2].pac_data == M4OSA_NULL)
{
@@ -2016,7 +2016,7 @@ M4OSA_ERR applyRenderingMode(M4VIFI_ImagePlane* pPlaneIn, M4VIFI_ImagePlane* pPl
{
if(pImagePlanesTemp[i].pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pImagePlanesTemp[i].pac_data);
+ free(pImagePlanesTemp[i].pac_data);
pImagePlanesTemp[i].pac_data = M4OSA_NULL;
}
}
@@ -2034,7 +2034,7 @@ M4OSA_ERR applyRenderingMode(M4VIFI_ImagePlane* pPlaneIn, M4VIFI_ImagePlane* pPl
{
if(pImagePlanesTemp[i].pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pImagePlanesTemp[i].pac_data);
+ free(pImagePlanesTemp[i].pac_data);
pImagePlanesTemp[i].pac_data = M4OSA_NULL;
}
}
@@ -2050,7 +2050,7 @@ M4OSA_ERR applyRenderingMode(M4VIFI_ImagePlane* pPlaneIn, M4VIFI_ImagePlane* pPl
{
if(pImagePlanesTemp[i].pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pImagePlanesTemp[i].pac_data);
+ free(pImagePlanesTemp[i].pac_data);
pImagePlanesTemp[i].pac_data = M4OSA_NULL;
}
}
@@ -2082,7 +2082,7 @@ M4OSA_ERR applyRenderingMode(M4VIFI_ImagePlane* pPlaneIn, M4VIFI_ImagePlane* pPl
{
if(pImagePlanesTemp[i].pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pImagePlanesTemp[i].pac_data);
+ free(pImagePlanesTemp[i].pac_data);
pImagePlanesTemp[i].pac_data = M4OSA_NULL;
}
}
@@ -2186,7 +2186,7 @@ M4OSA_ERR M4AIR_create(M4OSA_Context* pContext,M4AIR_InputFormatType inputFormat
*pContext = M4OSA_NULL ;
/* Internal Context creation */
- pC = (M4AIR_InternalContext*)M4OSA_malloc(sizeof(M4AIR_InternalContext), M4AIR, (M4OSA_Char*)"AIR internal context") ;
+ pC = (M4AIR_InternalContext*)M4OSA_32bitAlignedMalloc(sizeof(M4AIR_InternalContext), M4AIR, (M4OSA_Char*)"AIR internal context") ;
M4ERR_CHECK_NULL_RETURN_VALUE(M4ERR_ALLOC, pC) ;
@@ -2219,7 +2219,7 @@ M4AIR_create_cleanup:
/* Error management : we destroy the context if needed */
if(M4OSA_NULL != pC)
{
- M4OSA_free((M4OSA_MemAddr32)pC) ;
+ free(pC) ;
}
*pContext = M4OSA_NULL ;
@@ -2251,7 +2251,7 @@ M4OSA_ERR M4AIR_cleanUp(M4OSA_Context pContext)
{
return M4ERR_STATE;
}
- M4OSA_free((M4OSA_MemAddr32)pC) ;
+ free(pC) ;
return M4NO_ERROR ;
@@ -3029,7 +3029,7 @@ M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_U
M4OSA_Context lImageFileFp = M4OSA_NULL;
M4OSA_ERR err = M4NO_ERROR;
- M4OSA_UInt8 *pTmpData = (M4OSA_UInt8*) M4OSA_malloc(frameSize_argb, M4VS, (M4OSA_Char*)"Image argb data");
+ M4OSA_UInt8 *pTmpData = (M4OSA_UInt8*) M4OSA_32bitAlignedMalloc(frameSize_argb, M4VS, (M4OSA_Char*)"Image argb data");
if(pTmpData == M4OSA_NULL) {
LOGE("Failed to allocate memory for Image clip");
return M4ERR_ALLOC;
@@ -3041,7 +3041,7 @@ M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_U
if((lerr != M4NO_ERROR) || (lImageFileFp == M4OSA_NULL))
{
LOGE("LVPreviewController: Can not open the file ");
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
return M4ERR_FILE_NOT_FOUND;
}
lerr = M4OSA_fileReadData(lImageFileFp, (M4OSA_MemAddr8)pTmpData, &frameSize_argb);
@@ -3049,17 +3049,17 @@ M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_U
{
LOGE("LVPreviewController: can not read the data ");
M4OSA_fileReadClose(lImageFileFp);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
return lerr;
}
M4OSA_fileReadClose(lImageFileFp);
M4OSA_UInt32 frameSize = (width * height * 3); //Size of YUV420 data.
- rgbPlane.pac_data = (M4VIFI_UInt8*)M4OSA_malloc(frameSize, M4VS, (M4OSA_Char*)"Image clip RGB888 data");
+ rgbPlane.pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(frameSize, M4VS, (M4OSA_Char*)"Image clip RGB888 data");
if(rgbPlane.pac_data == M4OSA_NULL)
{
LOGE("Failed to allocate memory for Image clip");
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
return M4ERR_ALLOC;
}
@@ -3069,7 +3069,7 @@ M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_U
rgbPlane.pac_data[j] = pTmpData[i];
j++;
}
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
#ifdef FILE_DUMP
FILE *fp = fopen("/sdcard/Input/test_rgb.raw", "wb");
@@ -3085,13 +3085,13 @@ M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_U
rgbPlane.u_stride = width*3;
rgbPlane.u_topleft = 0;
- yuvPlane = (M4VIFI_ImagePlane*)M4OSA_malloc(3*sizeof(M4VIFI_ImagePlane),
+ yuvPlane = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(3*sizeof(M4VIFI_ImagePlane),
M4VS, (M4OSA_Char*)"M4xVSS_internalConvertRGBtoYUV: Output plane YUV");
yuvPlane[0].u_height = height;
yuvPlane[0].u_width = width;
yuvPlane[0].u_stride = width;
yuvPlane[0].u_topleft = 0;
- yuvPlane[0].pac_data = (M4VIFI_UInt8*)M4OSA_malloc(yuvPlane[0].u_height * yuvPlane[0].u_width * 1.5, M4VS, (M4OSA_Char*)"imageClip YUV data");
+ yuvPlane[0].pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(yuvPlane[0].u_height * yuvPlane[0].u_width * 1.5, M4VS, (M4OSA_Char*)"imageClip YUV data");
yuvPlane[1].u_height = yuvPlane[0].u_height >>1;
yuvPlane[1].u_width = yuvPlane[0].u_width >> 1;
@@ -3112,7 +3112,7 @@ M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_U
{
LOGE("error when converting from RGB to YUV: 0x%x\n", (unsigned int)err);
}
- M4OSA_free((M4OSA_MemAddr32)rgbPlane.pac_data);
+ free(rgbPlane.pac_data);
//LOGE("RGB to YUV done");
#ifdef FILE_DUMP
@@ -3125,7 +3125,7 @@ M4OSA_ERR LvGetImageThumbNail(const char *fileName, M4OSA_UInt32 height, M4OSA_U
}
#endif
*pBuffer = yuvPlane[0].pac_data;
- M4OSA_free((M4OSA_MemAddr32)yuvPlane);
+ free(yuvPlane);
return M4NO_ERROR;
}
@@ -3292,7 +3292,7 @@ M4OSA_ERR prepareFramingStructure(
framingCtx->previousClipTime = -1;
framingCtx->alphaBlendingStruct =
- (M4xVSS_internalEffectsAlphaBlending*)M4OSA_malloc(
+ (M4xVSS_internalEffectsAlphaBlending*)M4OSA_32bitAlignedMalloc(
sizeof(M4xVSS_internalEffectsAlphaBlending), M4VS,
(M4OSA_Char*)"alpha blending struct");
@@ -3316,7 +3316,7 @@ M4OSA_ERR prepareFramingStructure(
// If YUV buffer exists, delete it
if(overlayYUV != NULL) {
- M4OSA_free((M4OSA_MemAddr32)overlayYUV);
+ free(overlayYUV);
overlayYUV = NULL;
}
if(effectsSettings[index].xVSS.rgbType == M4VSS3GPP_kRGB565) {
@@ -3338,7 +3338,7 @@ M4OSA_ERR prepareFramingStructure(
}
else {
LOGV(" YUV buffer reuse");
- framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_malloc(
+ framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(
3*sizeof(M4VIFI_ImagePlane), M4VS, (M4OSA_Char*)"YUV");
if(framingCtx->FramingYuv == M4OSA_NULL) {
@@ -3392,11 +3392,11 @@ M4OSA_ERR applyColorEffect(M4xVSS_VideoEffectType colorEffect,
colorEffect, err);
if(NULL != buffer1) {
- M4OSA_free((M4OSA_MemAddr32)buffer1);
+ free(buffer1);
buffer1 = NULL;
}
if(NULL != buffer2) {
- M4OSA_free((M4OSA_MemAddr32)buffer2);
+ free(buffer2);
buffer2 = NULL;
}
return err;
@@ -3422,11 +3422,11 @@ M4OSA_ERR applyLumaEffect(M4VSS3GPP_VideoEffectType videoEffect,
LOGE("M4VFL_modifyLumaWithScale(%d) error %d", videoEffect, (int)err);
if(NULL != buffer1) {
- M4OSA_free((M4OSA_MemAddr32)buffer1);
+ free(buffer1);
buffer1= NULL;
}
if(NULL != buffer2) {
- M4OSA_free((M4OSA_MemAddr32)buffer2);
+ free(buffer2);
buffer2= NULL;
}
return err;
@@ -3453,11 +3453,11 @@ M4OSA_ERR applyCurtainEffect(M4VSS3GPP_VideoEffectType videoEffect,
LOGE("M4VFL_applyCurtain(%d) error %d", videoEffect, (int)err);
if(NULL != buffer1) {
- M4OSA_free((M4OSA_MemAddr32)buffer1);
+ free(buffer1);
buffer1= NULL;
}
if(NULL != buffer2) {
- M4OSA_free((M4OSA_MemAddr32)buffer2);
+ free(buffer2);
buffer2 = NULL;
}
return err;
@@ -3485,7 +3485,7 @@ M4OSA_ERR applyEffectsAndRenderingMode(vePostProcessParams *params,
frameSize = (params->videoWidth*params->videoHeight*3) >> 1;
- finalOutputBuffer = (M4VIFI_UInt8*)M4OSA_malloc(frameSize, M4VS,
+ finalOutputBuffer = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(frameSize, M4VS,
(M4OSA_Char*)("lvpp finalOutputBuffer"));
if(finalOutputBuffer == NULL) {
@@ -3494,13 +3494,13 @@ M4OSA_ERR applyEffectsAndRenderingMode(vePostProcessParams *params,
}
// allocate the tempOutputBuffer
- tempOutputBuffer = (M4VIFI_UInt8*)M4OSA_malloc(
+ tempOutputBuffer = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(
((params->videoHeight*params->videoWidth*3)>>1), M4VS, (M4OSA_Char*)("lvpp colorBuffer"));
if(tempOutputBuffer == NULL) {
LOGE("applyEffectsAndRenderingMode: malloc error tempOutputBuffer");
if(NULL != finalOutputBuffer) {
- M4OSA_free((M4OSA_MemAddr32)finalOutputBuffer);
+ free(finalOutputBuffer);
finalOutputBuffer = NULL;
}
return M4ERR_ALLOC;
@@ -3625,11 +3625,11 @@ M4OSA_ERR applyEffectsAndRenderingMode(vePostProcessParams *params,
LOGE("M4VSS3GPP_externalVideoEffectFifties error 0x%x", (unsigned int)err);
if(NULL != finalOutputBuffer) {
- M4OSA_free((M4OSA_MemAddr32)finalOutputBuffer);
+ free(finalOutputBuffer);
finalOutputBuffer = NULL;
}
if(NULL != tempOutputBuffer) {
- M4OSA_free((M4OSA_MemAddr32)tempOutputBuffer);
+ free(tempOutputBuffer);
tempOutputBuffer = NULL;
}
return err;
@@ -3671,10 +3671,10 @@ M4OSA_ERR applyEffectsAndRenderingMode(vePostProcessParams *params,
M4xVSS_kVideoEffectType_Framing);
}
- M4OSA_free((M4OSA_MemAddr32)framingCtx.alphaBlendingStruct);
+ free(framingCtx.alphaBlendingStruct);
if(framingCtx.FramingYuv != NULL) {
- M4OSA_free((M4OSA_MemAddr32)framingCtx.FramingYuv);
+ free(framingCtx.FramingYuv);
framingCtx.FramingYuv = NULL;
}
//If prepareFramingStructure / M4VSS3GPP_externalVideoEffectFraming
@@ -3682,11 +3682,11 @@ M4OSA_ERR applyEffectsAndRenderingMode(vePostProcessParams *params,
if(err != M4NO_ERROR) {
if(NULL != finalOutputBuffer) {
- M4OSA_free((M4OSA_MemAddr32)finalOutputBuffer);
+ free(finalOutputBuffer);
finalOutputBuffer = NULL;
}
if(NULL != tempOutputBuffer) {
- M4OSA_free((M4OSA_MemAddr32)tempOutputBuffer);
+ free(tempOutputBuffer);
tempOutputBuffer = NULL;
}
return err;
@@ -3825,11 +3825,11 @@ M4OSA_ERR applyEffectsAndRenderingMode(vePostProcessParams *params,
err = applyRenderingMode(planeIn, planeOut, params->renderingMode);
if(M4OSA_NULL != finalOutputBuffer) {
- M4OSA_free((M4OSA_MemAddr32)finalOutputBuffer);
+ free(finalOutputBuffer);
finalOutputBuffer= M4OSA_NULL;
}
if(M4OSA_NULL != tempOutputBuffer) {
- M4OSA_free((M4OSA_MemAddr32)tempOutputBuffer);
+ free(tempOutputBuffer);
tempOutputBuffer = M4OSA_NULL;
}
if(err != M4NO_ERROR) {
diff --git a/libvideoeditor/osal/inc/LV_Macros.h b/libvideoeditor/osal/inc/LV_Macros.h
index d6312cc..fa927b7 100755
--- a/libvideoeditor/osal/inc/LV_Macros.h
+++ b/libvideoeditor/osal/inc/LV_Macros.h
@@ -97,7 +97,7 @@
{ \
if(M4OSA_NULL != (p)) \
{ \
- M4OSA_free((M4OSA_MemAddr32)(p)) ; \
+ free((p)) ; \
(p) = M4OSA_NULL ; \
} \
}
diff --git a/libvideoeditor/osal/inc/LV_Types.h b/libvideoeditor/osal/inc/LV_Types.h
index 534ea3a..5a45182 100755
--- a/libvideoeditor/osal/inc/LV_Types.h
+++ b/libvideoeditor/osal/inc/LV_Types.h
@@ -43,7 +43,7 @@ extern "C"
* @note This function converts a string from UTF8 format which is the default
* encoding in the engines and application logics to the character encoding
* supported by the OS or platform. The memory will be allocated within this
-* function and then, caller will have to free *targetStart thanks to M4OSA_free.
+* function and then, caller will have to free *targetStart thanks to free.
* Both strings must be NULL-terminateed.
* @param pStart (IN): String to convert.
* @param pOut (OUT): This pointer will be filled by this function. It contains the
@@ -61,7 +61,7 @@ typedef M4OSA_UInt32 (*LV_fromUTF8ToNative_Fct)(const M4OSA_Char* pStart,
* @note This function converts a string in the character encoding supported by the
* OS or platform to from UTF8 format which is the default encoding in the
* engines and application logics. The memory will be allocated within this
-* function and then, caller will have to free *targetStart thanks to M4OSA_free.
+* function and then, caller will have to free *targetStart thanks to free.
* Both strings must be NULL-terminateed.
* @param pStart (IN): String to convert.
* @param pOut (OUT): This pointer will be filled by this function. It contains the
diff --git a/libvideoeditor/osal/inc/M4OSA_Memory.h b/libvideoeditor/osal/inc/M4OSA_Memory.h
index d060602..7cb3d91 100755
--- a/libvideoeditor/osal/inc/M4OSA_Memory.h
+++ b/libvideoeditor/osal/inc/M4OSA_Memory.h
@@ -39,13 +39,16 @@ extern "C"
{
#endif
+M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_MemAddr32 M4OSA_32bitAlignedMalloc (M4OSA_UInt32 size,
+ M4OSA_CoreID coreID,
+ M4OSA_Char* string);
+
M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_MemAddr32 M4OSA_malloc (M4OSA_UInt32 size,
M4OSA_CoreID coreID,
M4OSA_Char* string);
M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_Void M4OSA_free (M4OSA_MemAddr32 address);
-
M4OSAL_MEMORY_EXPORT_TYPE extern M4OSA_ERR M4OSA_randInit(void);
diff --git a/libvideoeditor/osal/src/LVOSA_FileReader_optim.c b/libvideoeditor/osal/src/LVOSA_FileReader_optim.c
index dd4d269..14da016 100755
--- a/libvideoeditor/osal/src/LVOSA_FileReader_optim.c
+++ b/libvideoeditor/osal/src/LVOSA_FileReader_optim.c
@@ -167,7 +167,8 @@ M4OSA_ERR M4OSA_FileReader_BufferInit(M4OSA_FileReader_Context_optim* apContext)
for(i=0; i<M4OSA_READBUFFER_NB; i++)
{
- apContext->buffer[i].data = (M4OSA_MemAddr8) M4OSA_malloc(M4OSA_READBUFFER_SIZE, M4OSA_FILE_READER, (M4OSA_Char *)"M4OSA_FileReader_BufferInit");
+ apContext->buffer[i].data = (M4OSA_MemAddr8) M4OSA_32bitAlignedMalloc(M4OSA_READBUFFER_SIZE,
+ M4OSA_FILE_READER, (M4OSA_Char *)"M4OSA_FileReader_BufferInit");
M4ERR_CHECK_NULL_RETURN_VALUE(M4ERR_ALLOC, apContext->buffer[i].data);
}
@@ -182,7 +183,7 @@ M4OSA_Void M4OSA_FileReader_BufferFree(M4OSA_FileReader_Context_optim* apContext
for(i=0; i<M4OSA_READBUFFER_NB; i++)
if(apContext->buffer[i].data != M4OSA_NULL)
- M4OSA_free((M4OSA_MemAddr32)apContext->buffer[i].data);
+ free(apContext->buffer[i].data);
}
/**************************************************************/
@@ -544,7 +545,7 @@ M4OSA_ERR M4OSA_FileReader_CalculateSize(M4OSA_FileReader_Context_optim* apConte
*pContext = M4OSA_NULL;
/* Allocate memory for the File reader context. */
- apContext = (M4OSA_FileReader_Context_optim *)M4OSA_malloc(sizeof(M4OSA_FileReader_Context_optim),
+ apContext = (M4OSA_FileReader_Context_optim *)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_FileReader_Context_optim),
M4OSA_FILE_READER, (M4OSA_Char *)"M4OSA_FileReader_Context_optim");
M4ERR_CHECK_NULL_RETURN_VALUE(M4ERR_ALLOC, apContext);
@@ -554,7 +555,7 @@ M4OSA_ERR M4OSA_FileReader_CalculateSize(M4OSA_FileReader_Context_optim* apConte
/*Set the optimized functions, to be called by the user*/
- apContext->FS = (M4OSA_FileReadPointer*) M4OSA_malloc(sizeof(M4OSA_FileReadPointer),
+ apContext->FS = (M4OSA_FileReadPointer*) M4OSA_32bitAlignedMalloc(sizeof(M4OSA_FileReadPointer),
M4OSA_FILE_READER, (M4OSA_Char *)"M4OSA_FileReaderOptim_init");
if (M4OSA_NULL==apContext->FS)
{
@@ -661,7 +662,7 @@ cleanup:
M4OSA_FileReader_BufferFree(apContext);
}
- M4OSA_free((M4OSA_MemAddr32) apContext);
+ free( apContext);
*pContext = M4OSA_NULL;
}
@@ -976,12 +977,12 @@ M4OSA_ERR M4OSA_fileReadClose_optim(M4OSA_Context pContext)
//>>>> GLM20090212 : set the low level function statically
if (apContext->FS != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32) apContext->FS);
+ free( apContext->FS);
}
//<<<< GLM20090212 : set the low level function statically
/* Free the context */
- M4OSA_free((M4OSA_MemAddr32)apContext);
+ free(apContext);
/* Return without error */
return err;
diff --git a/libvideoeditor/osal/src/M4OSA_CharStar.c b/libvideoeditor/osal/src/M4OSA_CharStar.c
index 083e3f2..a9461e2 100755
--- a/libvideoeditor/osal/src/M4OSA_CharStar.c
+++ b/libvideoeditor/osal/src/M4OSA_CharStar.c
@@ -413,7 +413,7 @@ M4OSA_ERR M4OSA_chrSPrintf(M4OSA_Char *pStrOut, M4OSA_UInt32 strOutMaxLen,
return M4ERR_NOT_IMPLEMENTED;
#endif
- newFormat =(M4OSA_Char*)M4OSA_malloc(newFormatLength,
+ newFormat =(M4OSA_Char*)M4OSA_32bitAlignedMalloc(newFormatLength,
M4OSA_CHARSTAR,(M4OSA_Char*)"M4OSA_chrPrintf: newFormat");
if(M4OSA_NULL == newFormat)
return M4ERR_ALLOC;
@@ -522,7 +522,7 @@ M4OSA_ERR M4OSA_chrSPrintf(M4OSA_Char *pStrOut, M4OSA_UInt32 strOutMaxLen,
err = vsnprintf((char *)pStrOut, (size_t)strOutMaxLen + 1, (const char *)newFormat, marker);
va_end(marker);
- M4OSA_free((M4OSA_MemAddr32)newFormat);
+ free(newFormat);
if ((err<0) || ((M4OSA_UInt32)err>strOutMaxLen))
{
pStrOut[strOutMaxLen] = '\0';
diff --git a/libvideoeditor/osal/src/M4OSA_FileCache.c b/libvideoeditor/osal/src/M4OSA_FileCache.c
index 0f66f96..718c0fb 100755
--- a/libvideoeditor/osal/src/M4OSA_FileCache.c
+++ b/libvideoeditor/osal/src/M4OSA_FileCache.c
@@ -281,7 +281,7 @@ M4OSA_Void M4OSA_FileCache_internalQuicksort(M4OSA_Int32* const table,
M4OSA_Int32* cursor;
M4OSA_Int32* indexc;
- queue = (M4OSA_Int32*)M4OSA_malloc(capacity*sizeof(M4OSA_Int32), 0,
+ queue = (M4OSA_Int32*)M4OSA_32bitAlignedMalloc(capacity*sizeof(M4OSA_Int32), 0,
(M4OSA_Char*) "quicksort FIFO of FileCache");
if(queue == M4OSA_NULL)
@@ -334,7 +334,7 @@ M4OSA_Void M4OSA_FileCache_internalQuicksort(M4OSA_Int32* const table,
while(index<size);
cursor = NULL;
indexc = NULL;
- M4OSA_free(queue);
+ free(queue);
}
M4OSA_Void M4OSA_FileCache_internalQuicksort64(M4OSA_Int64* const table,
@@ -354,7 +354,7 @@ M4OSA_Void M4OSA_FileCache_internalQuicksort64(M4OSA_Int64* const table,
M4OSA_Int32* cursor;
M4OSA_Int32* indexc;
- queue = (M4OSA_Int32*)M4OSA_malloc(capacity*sizeof(M4OSA_Int32), 0,
+ queue = (M4OSA_Int32*)M4OSA_32bitAlignedMalloc(capacity*sizeof(M4OSA_Int32), 0,
(M4OSA_Char*) "quicksort FIFO of FileCache");
if(queue == M4OSA_NULL)
@@ -407,7 +407,7 @@ M4OSA_Void M4OSA_FileCache_internalQuicksort64(M4OSA_Int64* const table,
while(index<size);
cursor = NULL;
indexc = NULL;
- M4OSA_free(queue);
+ free(queue);
}
/* Sorts an array of size size */
@@ -454,7 +454,7 @@ M4OSA_ERR M4OSA_FileCache_BuffersInit(M4OSA_FileCache_Context* apContext)
for(i=0; i<M4OSA_CACHEBUFFER_NB; i++)
{
- apContext->buffer[i].data = (M4OSA_MemAddr8) M4OSA_malloc(M4OSA_CACHEBUFFER_SIZE,
+ apContext->buffer[i].data = (M4OSA_MemAddr8) M4OSA_32bitAlignedMalloc(M4OSA_CACHEBUFFER_SIZE,
M4OSA_FILE_READER, (M4OSA_Char*)"M4OSA_FileCache_BufferInit");
M4ERR_CHECK_NULL_RETURN_VALUE(M4ERR_ALLOC, apContext->buffer[i].data);
apContext->buffer[i].filepos = M4OSA_EOF;
@@ -474,7 +474,7 @@ M4OSA_Void M4OSA_FileCache_BuffersFree(M4OSA_FileCache_Context* apContext)
{
if(apContext->buffer[i].data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)apContext->buffer[i].data);
+ free(apContext->buffer[i].data);
apContext->buffer[i].data = M4OSA_NULL;
}
}
@@ -1563,7 +1563,7 @@ M4OSA_Void* M4OSA_FileSystem_FFS_Open_cache( M4OSA_Void* pFileDescriptor,
fp = fopen((const char *) pFileDescriptor, (const char *)mode); /* Open in rb or in r+b*/
if( fp != NULL )
{
- pC = (M4OSA_FileSystem_FFS_t_cache *) M4OSA_malloc(sizeof * pC, M4OSA_FILE_READER, (M4OSA_Char*)"M4OSA_FileSystem_FFS_Open_cache");
+ pC = (M4OSA_FileSystem_FFS_t_cache *) M4OSA_32bitAlignedMalloc(sizeof * pC, M4OSA_FILE_READER, (M4OSA_Char*)"M4OSA_FileSystem_FFS_Open_cache");
if (pC == M4OSA_NULL) return M4OSA_NULL; /*error occured => return NULL pointer*/
@@ -1776,7 +1776,7 @@ M4OSA_ERR M4OSA_fileOpen_cache(M4OSA_Context* pContext,
M4OSA_FileSystem_FctPtr_cache *FS;
/* Allocate memory for the File System interface */
- FS = (M4OSA_FileSystem_FctPtr_cache *)M4OSA_malloc(sizeof * FS,
+ FS = (M4OSA_FileSystem_FctPtr_cache *)M4OSA_32bitAlignedMalloc(sizeof * FS,
M4OSA_FILE_READER,(M4OSA_Char*)"M4OSA_FileSystem_FctPtr_cache");
if(M4OSA_NULL == FS)
@@ -1836,7 +1836,7 @@ M4OSA_ERR M4OSA_fileOpen_cache_internal(M4OSA_Context* pContext,
*pContext = M4OSA_NULL;
/* Allocate memory for the File reader context. */
- apContext = (M4OSA_FileCache_Context *)M4OSA_malloc(sizeof(M4OSA_FileCache_Context),
+ apContext = (M4OSA_FileCache_Context *)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_FileCache_Context),
M4OSA_FILE_READER, (M4OSA_Char*)"M4OSA_FileCache_Context");
M4ERR_CHECK_NULL_RETURN_VALUE(M4ERR_ALLOC, apContext);
@@ -1879,10 +1879,10 @@ M4OSA_ERR M4OSA_fileOpen_cache_internal(M4OSA_Context* pContext,
{
if (M4OSA_NULL != apContext->FS) /*should never be null*/
{
- M4OSA_free((M4OSA_MemAddr32)apContext->FS);
+ free(apContext->FS);
}
- M4OSA_free((M4OSA_MemAddr32)apContext);
+ free(apContext);
apContext = M4OSA_NULL;
}
@@ -1961,7 +1961,7 @@ cleanup:
if (M4OSA_NULL != apContext)
{
- M4OSA_free((M4OSA_MemAddr32)apContext);
+ free(apContext);
apContext = M4OSA_NULL;
}
*pContext = M4OSA_NULL;
@@ -2669,8 +2669,8 @@ LOCK
apContext->IsOpened = M4OSA_FALSE;
/* Free the context */
- M4OSA_free((M4OSA_MemAddr32)apContext->FS);
- M4OSA_free((M4OSA_MemAddr32)apContext->aFileDesc);
+ free(apContext->FS);
+ free(apContext->aFileDesc);
#ifdef FILECACHE_STATS
{
@@ -2719,7 +2719,7 @@ LOCK
M4OSA_memset((M4OSA_MemAddr8)apContext, sizeof(M4OSA_FileCache_Context), 0);
- M4OSA_free((M4OSA_MemAddr32)apContext);
+ free(apContext);
M4OSA_TRACE2_1("M4OSA_fileClose_cache leaving with err = 0x%x", err);
diff --git a/libvideoeditor/osal/src/M4OSA_FileCommon.c b/libvideoeditor/osal/src/M4OSA_FileCommon.c
index 8731a3d..a012ec0 100755
--- a/libvideoeditor/osal/src/M4OSA_FileCommon.c
+++ b/libvideoeditor/osal/src/M4OSA_FileCommon.c
@@ -96,7 +96,7 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
M4OSA_Void* tempConversionBuf;
M4OSA_UInt32 tempConversionSize = 1000;
- tempConversionBuf = (M4OSA_Char*)M4OSA_malloc(tempConversionSize +1, 0, "conversion buf");
+ tempConversionBuf = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(tempConversionSize +1, 0, "conversion buf");
if(tempConversionBuf == M4OSA_NULL)
{
M4OSA_TRACE1_0("Error when allocating conversion buffer\n");
@@ -140,7 +140,7 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
M4ERR_FILE_BAD_MODE_ACCESS, "M4OSA_fileCommonOpen: M4OSA_kFileWrite");
#ifdef FILE_LOWER_CASE
- tmpLowerCaseUrl = (M4OSA_Char*)M4OSA_malloc(strlen(pUrl) +1, 0, "conversion buf");
+ tmpLowerCaseUrl = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(strlen(pUrl) +1, 0, "conversion buf");
for(i=0; i<strlen(pUrl); i++)
{
tmpLowerCaseUrl[i] = M4OSA_chrToLower(pUrl[i]);
@@ -187,11 +187,11 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
/*Open the converted path*/
pFileHandler = fopen((const char *)tempConversionBuf, (const char *)mode);
/*Free the temporary decoded buffer*/
- M4OSA_free((M4OSA_MemAddr32)tempConversionBuf);
+ free(tempConversionBuf);
#else /* UTF_CONVERSION */
#ifdef FILE_LOWER_CASE
pFileHandler = fopen((const char *)tmpLowerCaseUrl, (const char *)mode);
- M4OSA_free((M4OSA_MemAddr32)tmpLowerCaseUrl);
+ free(tmpLowerCaseUrl);
#else
pFileHandler = fopen((const char *)pUrl, (const char *)mode);
#endif
@@ -233,7 +233,7 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
}
/* Allocate the file context */
- pFileContext = (M4OSA_FileContext*) M4OSA_malloc(sizeof(M4OSA_FileContext),
+ pFileContext = (M4OSA_FileContext*) M4OSA_32bitAlignedMalloc(sizeof(M4OSA_FileContext),
core_id, (M4OSA_Char*)"M4OSA_fileCommonOpen: file context");
if (M4OSA_NULL == pFileContext)
{
@@ -272,12 +272,12 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
M4OSA_INT_TO_FILE_POSITION(0, pFileContext->write_position);
/* Allocate the memory to store the URL string */
- pFileContext->url_name = (M4OSA_Char*) M4OSA_malloc(strlen((const char *)pUrl)+1,
+ pFileContext->url_name = (M4OSA_Char*) M4OSA_32bitAlignedMalloc(strlen((const char *)pUrl)+1,
core_id, (M4OSA_Char*)"M4OSA_fileCommonOpen: URL name");
if (M4OSA_NULL == pFileContext->url_name)
{
fclose(pFileHandler);
- M4OSA_free((M4OSA_MemAddr32)pFileContext);
+ free(pFileContext);
M4OSA_DEBUG(M4ERR_ALLOC, "M4OSA_fileCommonOpen");
return M4ERR_ALLOC;
}
@@ -288,8 +288,8 @@ M4OSA_ERR M4OSA_fileCommonOpen(M4OSA_UInt16 core_id, M4OSA_Context* pContext,
if(M4NO_ERROR != err)
{
fclose(pFileHandler);
- M4OSA_free((M4OSA_MemAddr32)pFileContext->url_name);
- M4OSA_free((M4OSA_MemAddr32)pFileContext);
+ free(pFileContext->url_name);
+ free(pFileContext);
M4OSA_DEBUG(err, "M4OSA_fileCommonOpen");
return err;
}
@@ -509,10 +509,10 @@ M4OSA_ERR M4OSA_fileCommonClose(M4OSA_UInt16 core_id, M4OSA_Context pContext)
"M4OSA_fileCommonClose: semaphore_context is M4OSA_NULL");
#endif /* M4OSA_FILE_BLOCK_WITH_SEMAPHORE */
- M4OSA_free((M4OSA_MemAddr32)pFileContext->url_name);
+ free(pFileContext->url_name);
pFileContext->url_name = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)pFileContext->file_name);
+ free(pFileContext->file_name);
pFileContext->file_name = M4OSA_NULL;
i32_err_code = fclose(pFileContext->file_desc);
@@ -523,7 +523,7 @@ M4OSA_ERR M4OSA_fileCommonClose(M4OSA_UInt16 core_id, M4OSA_Context pContext)
M4OSA_semaphoreClose(pFileContext->semaphore_context);/* free the semaphore */
#endif /* M4OSA_FILE_BLOCK_WITH_SEMAPHORE */
- M4OSA_free((M4OSA_MemAddr32)pFileContext);
+ free(pFileContext);
if (i32_err_code != 0)
{
@@ -611,7 +611,7 @@ M4OSA_ERR M4OSA_fileCommonGetURL(M4OSA_Context pContext, M4OSA_Char** pUrl)
uiLength = strlen((const char *)pFileContext->url_name)+1;
/* Allocate the memory to store the url_name */
- *pUrl = (M4OSA_Char*)M4OSA_malloc(uiLength, M4OSA_FILE_COMMON,
+ *pUrl = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(uiLength, M4OSA_FILE_COMMON,
(M4OSA_Char*)"M4OSA_fileCommonGetURL: url");
if(M4OSA_NULL == *pUrl)
{
@@ -673,7 +673,7 @@ M4OSA_ERR M4OSA_fileCommonGetFilename(M4OSA_Char* pUrl, M4OSA_Char** pFileName)
}
}
- ptrFilename = (M4OSA_Char*) M4OSA_malloc(FileNameLen+1, M4OSA_FILE_COMMON,
+ ptrFilename = (M4OSA_Char*) M4OSA_32bitAlignedMalloc(FileNameLen+1, M4OSA_FILE_COMMON,
(M4OSA_Char*)"M4OSA_fileCommonGetFilename: Filename string");
if (ptrFilename == M4OSA_NULL)
{
diff --git a/libvideoeditor/osal/src/M4OSA_FileExtra.c b/libvideoeditor/osal/src/M4OSA_FileExtra.c
index 4a7b532..bcac97c 100755
--- a/libvideoeditor/osal/src/M4OSA_FileExtra.c
+++ b/libvideoeditor/osal/src/M4OSA_FileExtra.c
@@ -67,7 +67,7 @@ M4OSA_ERR M4OSA_fileExtraDelete(const M4OSA_Char* pUrl)
#ifdef UTF_CONVERSION
/*FB: to test the UTF16->UTF8 conversion into Video Artist*/
/*Convert the URL from UTF16 to UTF8*/
- tempConversionBuf = (M4OSA_Char*)M4OSA_malloc(tempConversionSize +1, 0,
+ tempConversionBuf = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(tempConversionSize +1, 0,
(M4OSA_Char*)"conversion buf");
if(tempConversionBuf == M4OSA_NULL)
{
@@ -82,7 +82,7 @@ M4OSA_ERR M4OSA_fileExtraDelete(const M4OSA_Char* pUrl)
/*Open the converted path*/
err = remove (tempConversionBuf);
/*Free the temporary decoded buffer*/
- M4OSA_free((M4OSA_MemAddr32)tempConversionBuf);
+ free(tempConversionBuf);
#else
err = remove((const char *)pUrl);
#endif /* UTF_CONVERSION */
@@ -144,7 +144,7 @@ M4OSA_ERR M4OSA_fileExtraCopy(M4OSA_Char* pSrcUrl, M4OSA_Char* pDstUrl)
}
/* Allocate buffer */
- copy_buffer = M4OSA_malloc(BUFFER_COPY_SIZE, M4OSA_FILE_EXTRA,
+ copy_buffer = M4OSA_32bitAlignedMalloc(BUFFER_COPY_SIZE, M4OSA_FILE_EXTRA,
(M4OSA_Char*)"M4OSA_fileExtraCopy: copy buffer");
if(M4OSA_NULL == copy_buffer)
{
@@ -182,7 +182,7 @@ M4OSA_ERR M4OSA_fileExtraCopy(M4OSA_Char* pSrcUrl, M4OSA_Char* pDstUrl)
}
/* Free copy buffer */
- M4OSA_free(copy_buffer);
+ free(copy_buffer);
err = M4OSA_fileWriteClose(pOutputFileContext);
if(M4NO_ERROR != err)
@@ -238,7 +238,7 @@ M4OSA_ERR M4OSA_fileExtraRename(M4OSA_Char* pSrcUrl, M4OSA_Char* pDstUrl)
err = M4OSA_fileCommonGetFilename(pDstUrl, &pDstFilename);
if(M4NO_ERROR != err)
{
- M4OSA_free((M4OSA_MemAddr32)pSrcFilename);
+ free(pSrcFilename);
M4OSA_DEBUG(err, "M4OSA_fileExtraRename: M4OSA_fileCommonGetFilename");
return err;
}
@@ -263,8 +263,8 @@ M4OSA_ERR M4OSA_fileExtraRename(M4OSA_Char* pSrcUrl, M4OSA_Char* pDstUrl)
return M4ERR_PARAMETER;
}
- M4OSA_free((M4OSA_MemAddr32)pDstFilename);
- M4OSA_free((M4OSA_MemAddr32)pSrcFilename);
+ free(pDstFilename);
+ free(pSrcFilename);
return M4NO_ERROR;
}
@@ -317,7 +317,7 @@ M4OSA_ERR M4OSA_fileExtraChangeCurrentDir(const M4OSA_Char* pUrl)
return(M4ERR_PARAMETER);
}
- M4OSA_free((M4OSA_MemAddr32)pFileName);
+ free(pFileName);
return M4NO_ERROR;
}
diff --git a/libvideoeditor/osal/src/M4OSA_FileReader_RAM.c b/libvideoeditor/osal/src/M4OSA_FileReader_RAM.c
index 24acfaa..0cfc006 100755
--- a/libvideoeditor/osal/src/M4OSA_FileReader_RAM.c
+++ b/libvideoeditor/osal/src/M4OSA_FileReader_RAM.c
@@ -86,7 +86,7 @@ M4OSA_ERR M4OSA_fileReadRamOpen( M4OSA_Context* context,
}
/* Allocates memory for the context */
- pContext = (M4OSA_FileReaderRam_Context*)M4OSA_malloc(sizeof(M4OSA_FileReaderRam_Context),
+ pContext = (M4OSA_FileReaderRam_Context*)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_FileReaderRam_Context),
M4OSA_FILE_READER, (M4OSA_Char*)"Context allocation");
if(pContext == M4OSA_NULL)
{
@@ -126,7 +126,7 @@ cleanup:
{
if(pContext != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pContext);
+ free(pContext);
*context = M4OSA_NULL;
}
}
@@ -310,7 +310,7 @@ M4OSA_ERR M4OSA_fileReadRamClose(M4OSA_Context context)
pContext->IsOpened = M4OSA_FALSE;
- M4OSA_free((M4OSA_MemAddr32)pContext);
+ free(pContext);
return M4NO_ERROR;
}
diff --git a/libvideoeditor/osal/src/M4OSA_FileWriter_RAM.c b/libvideoeditor/osal/src/M4OSA_FileWriter_RAM.c
index 9341ca9..4a8ff6f 100755
--- a/libvideoeditor/osal/src/M4OSA_FileWriter_RAM.c
+++ b/libvideoeditor/osal/src/M4OSA_FileWriter_RAM.c
@@ -80,7 +80,7 @@ M4OSA_ERR M4OSA_fileWriteRamOpen(M4OSA_Context* context, M4OSA_Void* fileDescrip
}
/* Allocate memory for the File writer context. */
- pContext = (M4OSA_FileWriterRam_Context *)M4OSA_malloc(sizeof(M4OSA_FileWriterRam_Context),
+ pContext = (M4OSA_FileWriterRam_Context *)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_FileWriterRam_Context),
M4OSA_FILE_WRITER, (M4OSA_Char*)"Context allocation");
if(pContext == M4OSA_NULL)
{
@@ -103,7 +103,7 @@ M4OSA_ERR M4OSA_fileWriteRamOpen(M4OSA_Context* context, M4OSA_Void* fileDescrip
{
if (M4OSA_NULL != pContext)
{
- M4OSA_free((M4OSA_MemAddr32)pContext);
+ free(pContext);
}
*context=M4OSA_NULL;
}
@@ -301,7 +301,7 @@ M4OSA_ERR M4OSA_fileWriteRamClose(M4OSA_Context context)
pContext->IsOpened = M4OSA_FALSE;
/* Free the context */
- M4OSA_free((M4OSA_MemAddr32)pContext);
+ free(pContext);
/* Return error */
return err;
diff --git a/libvideoeditor/osal/src/M4OSA_Mutex.c b/libvideoeditor/osal/src/M4OSA_Mutex.c
index 0d857f6..8db3e2a 100755
--- a/libvideoeditor/osal/src/M4OSA_Mutex.c
+++ b/libvideoeditor/osal/src/M4OSA_Mutex.c
@@ -67,7 +67,7 @@ M4OSA_ERR M4OSA_mutexOpen(M4OSA_Context* pContext)
*pContext = M4OSA_NULL;
- pMutexContext = (M4OSA_MutexContext*)M4OSA_malloc(sizeof(M4OSA_MutexContext),
+ pMutexContext = (M4OSA_MutexContext*)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_MutexContext),
M4OSA_MUTEX, (M4OSA_Char*)"M4OSA_mutexOpen: mutex context");
if(M4OSA_NULL == pMutexContext)
@@ -96,7 +96,7 @@ M4OSA_ERR M4OSA_mutexOpen(M4OSA_Context* pContext)
if(!opened)
{
M4OSA_DEBUG(M4ERR_CONTEXT_FAILED, "M4OSA_mutexOpen: OS mutex creation failed");
- M4OSA_free((M4OSA_MemAddr32)pMutexContext);
+ free(pMutexContext);
return M4ERR_CONTEXT_FAILED ;
}
@@ -269,7 +269,7 @@ M4OSA_ERR M4OSA_mutexClose(M4OSA_Context context)
pthread_mutex_destroy(&pMutexContext->mutex);
- M4OSA_free((M4OSA_MemAddr32) pMutexContext);
+ free( pMutexContext);
return M4NO_ERROR;
}
diff --git a/libvideoeditor/osal/src/M4OSA_Semaphore.c b/libvideoeditor/osal/src/M4OSA_Semaphore.c
index a99b136..aeac0a9 100755
--- a/libvideoeditor/osal/src/M4OSA_Semaphore.c
+++ b/libvideoeditor/osal/src/M4OSA_Semaphore.c
@@ -77,7 +77,7 @@ M4OSA_ERR M4OSA_semaphoreOpen(M4OSA_Context* context,
*context = M4OSA_NULL;
- semaphoreContext = (M4OSA_SemaphoreContext*) M4OSA_malloc(
+ semaphoreContext = (M4OSA_SemaphoreContext*) M4OSA_32bitAlignedMalloc(
sizeof(M4OSA_SemaphoreContext), M4OSA_SEMAPHORE,
(M4OSA_Char*)"M4OSA_semaphoreOpen: semaphore context");
@@ -90,7 +90,7 @@ M4OSA_ERR M4OSA_semaphoreOpen(M4OSA_Context* context,
if (0 != sem_init(&semaphoreContext->semaphore, 0, initial_count))
{
- M4OSA_free((M4OSA_MemAddr32)semaphoreContext);
+ free(semaphoreContext);
M4OSA_DEBUG(M4ERR_CONTEXT_FAILED,
"M4OSA_semaphoreOpen: OS semaphore creation failed");
@@ -257,7 +257,7 @@ M4OSA_ERR M4OSA_semaphoreClose(M4OSA_Context context)
sem_destroy(&semaphoreContext->semaphore);
- M4OSA_free((M4OSA_MemAddr32)semaphoreContext);
+ free(semaphoreContext);
return M4NO_ERROR;
}
diff --git a/libvideoeditor/osal/src/M4OSA_String.c b/libvideoeditor/osal/src/M4OSA_String.c
index af98b4b..7cf7801 100755
--- a/libvideoeditor/osal/src/M4OSA_String.c
+++ b/libvideoeditor/osal/src/M4OSA_String.c
@@ -49,7 +49,7 @@ M4OSA_ERR M4OSA_strCreate(M4OSA_String* pStrOut)
"M4OSA_strCreate");
/* Allocate the output M4OSA_String */
- pStr = (M4OSA_strStruct*)M4OSA_malloc(sizeof(M4OSA_strStruct), M4OSA_STRING,
+ pStr = (M4OSA_strStruct*)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_strStruct), M4OSA_STRING,
(M4OSA_Char*)"M4OSA_strPrivCreate: output string");
/* Check memory allocation error */
@@ -98,7 +98,7 @@ M4OSA_ERR M4OSA_strReset(M4OSA_String str_in)
if(M4OSA_NULL != pBuffer)
{
- M4OSA_free((M4OSA_MemAddr32)pBuffer);
+ free(pBuffer);
pStr->pui8_buffer = M4OSA_NULL;
}
@@ -133,10 +133,10 @@ M4OSA_ERR M4OSA_strDestroy(M4OSA_String str_in)
/* Free M4OSA_String buffer */
- M4OSA_free((M4OSA_MemAddr32)(pStr->pui8_buffer));
+ free((pStr->pui8_buffer));
/* Free M4OSA_String structure memory */
- M4OSA_free((M4OSA_MemAddr32)pStr);
+ free(pStr);
return M4NO_ERROR;
@@ -1249,7 +1249,7 @@ M4OSA_ERR M4OSA_strCompare(M4OSA_String str_in1, M4OSA_String str_in2,
length = (length1 < length2) ? length1 : length2;
- pTmp1 = (M4OSA_Char*)M4OSA_malloc(2 * length * sizeof(M4OSA_Char),
+ pTmp1 = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(2 * length * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strCompare");
M4OSA_CHECK_MALLOC(pTmp1, "M4OSA_strCompare");
@@ -1268,7 +1268,7 @@ M4OSA_ERR M4OSA_strCompare(M4OSA_String str_in1, M4OSA_String str_in2,
M4OSA_chrNCompare(pTmp1, pTmp2, length, &result);
- M4OSA_free((M4OSA_MemAddr32)pTmp1);
+ free(pTmp1);
if(result != 0)
{
@@ -1352,7 +1352,7 @@ M4OSA_ERR M4OSA_strCompareSubStr(M4OSA_String str_in1,
return_code = M4WAR_STR_OVERFLOW;
}
- pTmp1 = (M4OSA_Char*)M4OSA_malloc(2 * (*pui32_num) * sizeof(M4OSA_Char),
+ pTmp1 = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(2 * (*pui32_num) * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strCompareSubStr");
M4OSA_CHECK_MALLOC(pTmp1, "M4OSA_strCompareSubStr");
@@ -1374,7 +1374,7 @@ M4OSA_ERR M4OSA_strCompareSubStr(M4OSA_String str_in1,
M4OSA_DEBUG_IF2((M4OSA_ERR)M4ERR_PARAMETER == err_code, M4ERR_PARAMETER,
"M4OSA_strCompareSubStr: M4OSA_chrNCompare");
- M4OSA_free((M4OSA_MemAddr32)pTmp1);
+ free(pTmp1);
return return_code;
}
@@ -2124,14 +2124,14 @@ M4OSA_ERR M4OSA_strReplaceSubStr(M4OSA_String str_in, M4OSA_String str_old,
if(ostr2free == M4OSA_TRUE)
{
- M4OSA_free((M4OSA_MemAddr32)pOstr->pui8_buffer);
- M4OSA_free((M4OSA_MemAddr32)pOstr);
+ free(pOstr->pui8_buffer);
+ free(pOstr);
}
if(nstr2free == M4OSA_TRUE)
{
- M4OSA_free((M4OSA_MemAddr32)pNstr->pui8_buffer);
- M4OSA_free((M4OSA_MemAddr32)pNstr);
+ free(pNstr->pui8_buffer);
+ free(pNstr);
}
return err_code;
@@ -2396,7 +2396,7 @@ M4OSA_ERR M4OSA_strSetMinAllocationSize(M4OSA_String str_in, M4OSA_UInt32 ui32_n
}
/* Allocate the actual M4OSA_String content */
- pBuffer = (M4OSA_Char*)M4OSA_malloc(ui32_size * sizeof(M4OSA_Char),
+ pBuffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(ui32_size * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strSetMinAllocationSize");
M4OSA_CHECK_MALLOC(pBuffer, "M4OSA_strSetMinAllocationSize");
@@ -2405,7 +2405,7 @@ M4OSA_ERR M4OSA_strSetMinAllocationSize(M4OSA_String str_in, M4OSA_UInt32 ui32_n
{
M4OSA_memcpy(pBuffer, pIbuffer, pStr->ui32_length+1);
- M4OSA_free((M4OSA_MemAddr32)pIbuffer);
+ free(pIbuffer);
}
pStr->pui8_buffer = pBuffer;
diff --git a/libvideoeditor/osal/src/M4OSA_String_priv.c b/libvideoeditor/osal/src/M4OSA_String_priv.c
index 07cef33..79a26a0 100755
--- a/libvideoeditor/osal/src/M4OSA_String_priv.c
+++ b/libvideoeditor/osal/src/M4OSA_String_priv.c
@@ -65,11 +65,11 @@ M4OSA_ERR M4OSA_strPrivRealloc(M4OSA_strStruct* str,
if(buffer != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)buffer);
+ free(buffer);
}
/* Allocate the actual M4OSA_String content */
- buffer = (M4OSA_Char*)M4OSA_malloc(ui32_size * sizeof(M4OSA_Char),
+ buffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(ui32_size * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivRealloc");
/* Check memory allocation error */
@@ -128,7 +128,7 @@ M4OSA_ERR M4OSA_strPrivReallocCopy(M4OSA_strStruct* str,
}
/* Allocate the actual M4OSA_String content */
- buffer = (M4OSA_Char*)M4OSA_malloc(ui32_size * sizeof(M4OSA_Char),
+ buffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(ui32_size * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivReallocCopy");
/* Check memory allocation error */
@@ -149,7 +149,7 @@ M4OSA_ERR M4OSA_strPrivReallocCopy(M4OSA_strStruct* str,
{
M4OSA_memcpy(buffer, pui8_buffer, str->ui32_length + 1);
- M4OSA_free((M4OSA_MemAddr32)pui8_buffer);
+ free(pui8_buffer);
}
str->pui8_buffer = buffer;
@@ -170,7 +170,7 @@ M4OSA_ERR M4OSA_strPrivDuplicate(M4OSA_strStruct** ostr,
"M4OSA_strStruct** 0x%x", ostr, istr);
/* Allocate the output M4OSA_String */
- str = (M4OSA_strStruct*)M4OSA_malloc(sizeof(M4OSA_strStruct), M4OSA_STRING,
+ str = (M4OSA_strStruct*)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_strStruct), M4OSA_STRING,
(M4OSA_Char*)"M4OSA_strPrivDuplicate: output string");
/* Check memory allocation error */
@@ -372,13 +372,13 @@ M4OSA_ERR M4OSA_strPrivSetAndRepleceStr(M4OSA_strStruct* istr,
}
else
{
- buffer = (M4OSA_Char*)M4OSA_malloc(ui32_lend * sizeof(M4OSA_Char),
+ buffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(ui32_lend * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivSetAndRepleceStr");
M4OSA_CHECK_MALLOC(buffer, "M4OSA_strPrivSetAndRepleceStr");
M4OSA_memcpy(buffer, ibuffer + ui32_poso, ui32_lend);
M4OSA_memcpy(ibuffer + ui32_posn, buffer, ui32_lend);
- M4OSA_free((M4OSA_MemAddr32)buffer);
+ free(buffer);
}
}
/* string to replace is smaller that new string */
@@ -399,7 +399,7 @@ M4OSA_ERR M4OSA_strPrivSetAndRepleceStr(M4OSA_strStruct* istr,
ui32_size <<= 1;
}
- buffer = (M4OSA_Char*)M4OSA_malloc(ui32_size * sizeof(M4OSA_Char),
+ buffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(ui32_size * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivSetAndRepleceStr");
M4OSA_CHECK_MALLOC(buffer, "M4OSA_strPrivSetAndRepleceStr");
@@ -410,7 +410,7 @@ M4OSA_ERR M4OSA_strPrivSetAndRepleceStr(M4OSA_strStruct* istr,
M4OSA_memcpy(buffer + ui32_posn, ibuffer + ui32_poso, ui32_lend);
- M4OSA_free((M4OSA_MemAddr32)ibuffer);
+ free(ibuffer);
istr->pui8_buffer = buffer;
@@ -418,7 +418,7 @@ M4OSA_ERR M4OSA_strPrivSetAndRepleceStr(M4OSA_strStruct* istr,
}
else
{
- buffer = (M4OSA_Char*)M4OSA_malloc(ui32_lend * sizeof(M4OSA_Char),
+ buffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(ui32_lend * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivSetAndRepleceStr");
M4OSA_CHECK_MALLOC(buffer, "M4OSA_strPrivSetAndRepleceStr");
@@ -429,7 +429,7 @@ M4OSA_ERR M4OSA_strPrivSetAndRepleceStr(M4OSA_strStruct* istr,
M4OSA_memcpy(ibuffer + ui32_posn, buffer, ui32_lend);
- M4OSA_free((M4OSA_MemAddr32)buffer);
+ free(buffer);
}
}
}
@@ -574,7 +574,7 @@ M4OSA_ERR M4OSA_strPrivReplaceSmallerStr(M4OSA_strStruct* istr,
}
/* Allocate the actual M4OSA_String content */
- buffer = (M4OSA_Char*)M4OSA_malloc(istr->ui32_size * sizeof(M4OSA_Char),
+ buffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(istr->ui32_size * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivReplaceSmallerStr");
M4OSA_CHECK_MALLOC(buffer, "M4OSA_strPrivReplaceSmallerStr");
@@ -608,7 +608,7 @@ M4OSA_ERR M4OSA_strPrivReplaceSmallerStr(M4OSA_strStruct* istr,
M4OSA_memcpy(ptr_dest, ibuffer, size);
- M4OSA_free((M4OSA_MemAddr32)istr->pui8_buffer);
+ free(istr->pui8_buffer);
istr->ui32_length = length ;
@@ -704,7 +704,7 @@ M4OSA_ERR M4OSA_strPrivReplaceBiggerStr(M4OSA_strStruct* istr,
M4OSA_Char* dest;
/* Allocate the actual M4OSA_String content */
- patterns = (M4OSA_Int32*)M4OSA_malloc(max_pattern * sizeof(M4OSA_UInt32),
+ patterns = (M4OSA_Int32*)M4OSA_32bitAlignedMalloc(max_pattern * sizeof(M4OSA_UInt32),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivReplaceBiggerStr");
M4OSA_CHECK_MALLOC(patterns, (M4OSA_Char*)"M4OSA_strPrivReplaceBiggerStr");
@@ -746,7 +746,7 @@ M4OSA_ERR M4OSA_strPrivReplaceBiggerStr(M4OSA_strStruct* istr,
}
/* Allocate the actual M4OSA_String content */
- buffer = (M4OSA_Char*)M4OSA_malloc(ui32_size * sizeof(M4OSA_Char),
+ buffer = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(ui32_size * sizeof(M4OSA_Char),
M4OSA_STRING, (M4OSA_Char*)"M4OSA_strPrivReplaceBiggerStr");
M4OSA_CHECK_MALLOC(buffer, "M4OSA_strPrivReplaceBiggerStr");
@@ -775,9 +775,9 @@ M4OSA_ERR M4OSA_strPrivReplaceBiggerStr(M4OSA_strStruct* istr,
M4OSA_memcpy(dest, src, size);
- M4OSA_free((M4OSA_MemAddr32)patterns);
+ free(patterns);
- M4OSA_free((M4OSA_MemAddr32)ibuffer);
+ free(ibuffer);
istr->ui32_length = length;
@@ -975,7 +975,7 @@ M4OSA_ERR M4OSA_strPrivSPrintf(M4OSA_strStruct* str,
return M4ERR_NOT_IMPLEMENTED;
#endif
- newFormat =(M4OSA_Char*)M4OSA_malloc(newFormatLength,
+ newFormat =(M4OSA_Char*)M4OSA_32bitAlignedMalloc(newFormatLength,
M4OSA_CHARSTAR, (M4OSA_Char*)"M4OSA_chrPrintf: newFormat");
if(newFormat == M4OSA_NULL) return M4ERR_ALLOC;
newFormat[newFormatLength-1] = '\0';
@@ -1122,7 +1122,7 @@ M4OSA_ERR M4OSA_strPrivSPrintf(M4OSA_strStruct* str,
err = M4OSA_chrSPrintf(strOut,strOutMaxLen,newFormat,marker);
- M4OSA_free((M4OSA_MemAddr32)newFormat);
+ free(newFormat);
if (M4ERR_CHR_STR_OVERFLOW == err)
{
diff --git a/libvideoeditor/osal/src/M4OSA_Thread.c b/libvideoeditor/osal/src/M4OSA_Thread.c
index c17ddf4..aa7666c 100755
--- a/libvideoeditor/osal/src/M4OSA_Thread.c
+++ b/libvideoeditor/osal/src/M4OSA_Thread.c
@@ -141,7 +141,7 @@ M4OSA_ERR M4OSA_threadSyncOpen(M4OSA_Context* context,
*context = M4OSA_NULL;
threadContext =
- (M4OSA_ThreadContext*)M4OSA_malloc(sizeof(M4OSA_ThreadContext),
+ (M4OSA_ThreadContext*)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_ThreadContext),
M4OSA_THREAD, (M4OSA_Char*)"M4OSA_threadSyncOpen: thread context");
if(threadContext == M4OSA_NULL)
@@ -475,10 +475,10 @@ M4OSA_ERR M4OSA_threadSyncClose(M4OSA_Context context)
if(threadContext->name != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)threadContext->name);
+ free(threadContext->name);
}
- M4OSA_free((M4OSA_MemAddr32)threadContext);
+ free(threadContext);
return M4NO_ERROR;
}
@@ -629,7 +629,7 @@ M4OSA_ERR M4OSA_SetThreadSyncName(M4OSA_Context context,
if(threadContext->name != NULL)
{
- M4OSA_free((M4OSA_MemAddr32)threadContext->name);
+ free(threadContext->name);
threadContext->name = M4OSA_NULL;
}
@@ -638,7 +638,7 @@ M4OSA_ERR M4OSA_SetThreadSyncName(M4OSA_Context context,
nameSize = strlen((const char *)name)+1;
threadContext->name =
- (M4OSA_Char*)M4OSA_malloc(nameSize, M4OSA_THREAD,
+ (M4OSA_Char*)M4OSA_32bitAlignedMalloc(nameSize, M4OSA_THREAD,
(M4OSA_Char*)"M4OSA_SetThreadSyncName: thread name");
if(threadContext == M4OSA_NULL)
diff --git a/libvideoeditor/osal/src/M4PSW_MemoryInterface.c b/libvideoeditor/osal/src/M4PSW_MemoryInterface.c
index 3128de2..a069b9b 100755
--- a/libvideoeditor/osal/src/M4PSW_MemoryInterface.c
+++ b/libvideoeditor/osal/src/M4PSW_MemoryInterface.c
@@ -30,6 +30,46 @@
#ifndef M4VPS_ADVANCED_MEMORY_MANAGER
/**
************************************************************************
+ * @fn M4OSA_MemAddr32 M4OSA_32bitAlignedMalloc(M4OSA_UInt32 size,
+ * M4OSA_CoreID coreID,
+ * M4OSA_Char* string)
+ * @brief this function allocates a memory block (at least 32 bits aligned)
+ * @note
+ * @param size (IN): size of allocated block in bytes
+ * @param coreID (IN): identification of the caller component
+ * @param string (IN): description of the allocated block (null terminated)
+ * @return address of the allocated block, M4OSA_NULL if no memory available
+ ************************************************************************
+*/
+
+M4OSA_MemAddr32 M4OSA_32bitAlignedMalloc(M4OSA_UInt32 size,
+ M4OSA_CoreID coreID,
+ M4OSA_Char* string)
+{
+ M4OSA_MemAddr32 Address = M4OSA_NULL;
+
+ /**
+ * If size is 0, malloc on WIN OS allocates a zero-length item in
+ * the heap and returns a valid pointer to that item.
+ * On other platforms, malloc could returns an invalid pointer
+ * So, DON'T allocate memory of 0 byte */
+ if (size == 0)
+ {
+ return Address;
+ }
+
+ if (size%4 != 0)
+ {
+ size = size + 4 - (size%4);
+ }
+
+ Address = (M4OSA_MemAddr32) malloc(size);
+
+ return Address;
+}
+
+/**
+ ************************************************************************
* @fn M4OSA_MemAddr32 M4OSA_malloc(M4OSA_UInt32 size,
* M4OSA_CoreID coreID,
* M4OSA_Char* string)
@@ -83,6 +123,5 @@ M4OSA_Void M4OSA_free (M4OSA_MemAddr32 address)
{
free(address);
}
-
#endif
diff --git a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Interface.c b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Interface.c
index 993f369..7fde1f1 100755
--- a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Interface.c
+++ b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Interface.c
@@ -106,7 +106,7 @@ M4OSA_ERR M4WRITER_3GP_openWrite( M4WRITER_Context* pContext,
/**
* Allocate memory for the context */
*pContext=M4OSA_NULL;
- apContext = (M4WRITER_3GP_InternalContext*)M4OSA_malloc(
+ apContext = (M4WRITER_3GP_InternalContext*)M4OSA_32bitAlignedMalloc(
sizeof(M4WRITER_3GP_InternalContext),
M4WRITER_3GP,
(M4OSA_Char *)"M4WRITER_3GP_InternalContext");
@@ -365,7 +365,7 @@ M4OSA_ERR M4WRITER_3GP_closeWrite(M4WRITER_Context pContext)
/**
* Deallocate our own context */
- M4OSA_free((M4OSA_MemAddr32)apContext);
+ free(apContext);
M4OSA_TRACE2_1("M4WRITER_3GP_closeWrite: returning 0x%x", err);
return err;
@@ -863,7 +863,7 @@ M4OSA_ERR M4WRITER_3GP_getInterfaces(
/**
* Allocate the global interface structure */
- pGlobal = (M4WRITER_GlobalInterface*)M4OSA_malloc(
+ pGlobal = (M4WRITER_GlobalInterface*)M4OSA_32bitAlignedMalloc(
sizeof(M4WRITER_GlobalInterface),
M4WRITER_3GP, (M4OSA_Char *)"M4WRITER_GlobalInterface");
if (M4OSA_NULL == pGlobal)
@@ -878,13 +878,13 @@ M4OSA_ERR M4WRITER_3GP_getInterfaces(
/**
* Allocate the data interface structure */
pData =
- (M4WRITER_DataInterface *)M4OSA_malloc(sizeof(M4WRITER_DataInterface),
+ (M4WRITER_DataInterface *)M4OSA_32bitAlignedMalloc(sizeof(M4WRITER_DataInterface),
M4WRITER_3GP, (M4OSA_Char *)"M4WRITER_DataInterface");
if (M4OSA_NULL == pData)
{
M4OSA_TRACE1_0("unable to allocate M4WRITER_DataInterface,\
returning M4ERR_ALLOC");
- M4OSA_free((M4OSA_MemAddr32)pGlobal);
+ free(pGlobal);
*SrcGlobalInterface = M4OSA_NULL;
*SrcDataInterface = M4OSA_NULL;
return (M4OSA_ERR)M4ERR_ALLOC;
diff --git a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Utils.c b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Utils.c
index 55ddc4c..4ec4f64 100755
--- a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Utils.c
+++ b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Utils.c
@@ -119,13 +119,13 @@ void M4MP4W_table32ToBE(M4OSA_UInt32* tab, M4OSA_UInt32 nb)
void* M4MP4W_realloc(M4OSA_MemAddr32 ptr, M4OSA_UInt32 oldSize, M4OSA_UInt32 newSize)
/*******************************************************************************/
{
- M4OSA_MemAddr32 ptr2 = (M4OSA_MemAddr32)M4OSA_malloc(newSize, M4MP4_WRITER,
+ M4OSA_MemAddr32 ptr2 = (M4OSA_MemAddr32)M4OSA_32bitAlignedMalloc(newSize, M4MP4_WRITER,
(M4OSA_Char *)"realloc");
if (M4OSA_NULL != ptr2)
{
memcpy((void *)ptr2, (void *)ptr, oldSize);
}
- M4OSA_free(ptr);
+ free(ptr);
return ptr2;
}
@@ -151,55 +151,55 @@ M4OSA_ERR M4MP4W_freeContext(M4OSA_Context context)
#ifdef _M4MP4W_MOOV_FIRST
for (i=0; i<=mMp4FileDataPtr->audioTrackPtr->LastAllocatedChunk; i++)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->Chunk[i]);
+ free(mMp4FileDataPtr->audioTrackPtr->Chunk[i]);
}
#else
if ((M4OSA_NULL != mMp4FileDataPtr->audioTrackPtr->Chunk) &&
(M4OSA_NULL != mMp4FileDataPtr->audioTrackPtr->Chunk[0]))
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->Chunk[0]);
+ free(mMp4FileDataPtr->audioTrackPtr->Chunk[0]);
}
if (M4OSA_NULL != mMp4FileDataPtr->audioTrackPtr->chunkOffsetTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->chunkOffsetTable);
+ free(mMp4FileDataPtr->audioTrackPtr->chunkOffsetTable);
}
#endif /*_M4MP4W_MOOV_FIRST*/
/*now dynamic*/
if (M4OSA_NULL != mMp4FileDataPtr->audioTrackPtr->Chunk)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->Chunk);
+ free(mMp4FileDataPtr->audioTrackPtr->Chunk);
}
if (M4OSA_NULL != mMp4FileDataPtr->audioTrackPtr->chunkSizeTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->chunkSizeTable);
+ free(mMp4FileDataPtr->audioTrackPtr->chunkSizeTable);
}
if (M4OSA_NULL != mMp4FileDataPtr->audioTrackPtr->chunkSampleNbTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->chunkSampleNbTable);
+ free(mMp4FileDataPtr->audioTrackPtr->chunkSampleNbTable);
}
if (M4OSA_NULL != mMp4FileDataPtr->audioTrackPtr->chunkTimeMsTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->chunkTimeMsTable);
+ free(mMp4FileDataPtr->audioTrackPtr->chunkTimeMsTable);
}
if (mMp4FileDataPtr->audioTrackPtr->TABLE_STTS != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->TABLE_STTS);
+ free(mMp4FileDataPtr->audioTrackPtr->TABLE_STTS);
}
if (mMp4FileDataPtr->audioTrackPtr->TABLE_STSZ != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->TABLE_STSZ);
+ free(mMp4FileDataPtr->audioTrackPtr->TABLE_STSZ);
}
if (mMp4FileDataPtr->audioTrackPtr->DSI != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr->DSI);
+ free(mMp4FileDataPtr->audioTrackPtr->DSI);
mMp4FileDataPtr->audioTrackPtr->DSI = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->audioTrackPtr);
+ free(mMp4FileDataPtr->audioTrackPtr);
mMp4FileDataPtr->audioTrackPtr = M4OSA_NULL;
}
if (mMp4FileDataPtr->videoTrackPtr != M4OSA_NULL)
@@ -210,69 +210,69 @@ M4OSA_ERR M4MP4W_freeContext(M4OSA_Context context)
#ifdef _M4MP4W_MOOV_FIRST
for (i=0; i<=mMp4FileDataPtr->videoTrackPtr->LastAllocatedChunk; i++)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->Chunk[i]);
+ free(mMp4FileDataPtr->videoTrackPtr->Chunk[i]);
}
#else
if ((M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->Chunk) &&
(M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->Chunk[0]))
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->Chunk[0]);
+ free(mMp4FileDataPtr->videoTrackPtr->Chunk[0]);
}
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->chunkOffsetTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->chunkOffsetTable);
+ free(mMp4FileDataPtr->videoTrackPtr->chunkOffsetTable);
}
#endif /*_M4MP4W_MOOV_FIRST*/
/*now dynamic*/
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->Chunk)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->Chunk);
+ free(mMp4FileDataPtr->videoTrackPtr->Chunk);
}
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->chunkSizeTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->chunkSizeTable);
+ free(mMp4FileDataPtr->videoTrackPtr->chunkSizeTable);
}
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->chunkSampleNbTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->chunkSampleNbTable);
+ free(mMp4FileDataPtr->videoTrackPtr->chunkSampleNbTable);
}
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->chunkTimeMsTable)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->chunkTimeMsTable);
+ free(mMp4FileDataPtr->videoTrackPtr->chunkTimeMsTable);
}
if (mMp4FileDataPtr->videoTrackPtr->DSI != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->DSI);
+ free(mMp4FileDataPtr->videoTrackPtr->DSI);
mMp4FileDataPtr->videoTrackPtr->DSI = M4OSA_NULL;
}
/*now dynamic*/
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->TABLE_STTS)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->TABLE_STTS);
+ free(mMp4FileDataPtr->videoTrackPtr->TABLE_STTS);
}
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->TABLE_STSZ)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->TABLE_STSZ);
+ free(mMp4FileDataPtr->videoTrackPtr->TABLE_STSZ);
}
if (M4OSA_NULL != mMp4FileDataPtr->videoTrackPtr->TABLE_STSS)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->TABLE_STSS);
+ free(mMp4FileDataPtr->videoTrackPtr->TABLE_STSS);
}
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr);
+ free(mMp4FileDataPtr->videoTrackPtr);
mMp4FileDataPtr->videoTrackPtr = M4OSA_NULL;
}
if (mMp4FileDataPtr->embeddedString != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->embeddedString);
+ free(mMp4FileDataPtr->embeddedString);
mMp4FileDataPtr->embeddedString = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr);
+ free(mMp4FileDataPtr);
return M4NO_ERROR;
}
diff --git a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c
index 9c2ee1d..209198b 100755
--- a/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c
+++ b/libvideoeditor/vss/3gpwriter/src/M4MP4W_Writer.c
@@ -560,7 +560,7 @@ M4OSA_ERR M4MP4W_openWrite(M4OSA_Context *contextPtr,
/* The context reuse mode was suppressed*/
mMp4FileDataPtr =
- (M4MP4W_Mp4FileData *)M4OSA_malloc(sizeof(M4MP4W_Mp4FileData),
+ (M4MP4W_Mp4FileData *)M4OSA_32bitAlignedMalloc(sizeof(M4MP4W_Mp4FileData),
M4MP4_WRITER, (M4OSA_Char *)"MP4 writer context");
ERR_CHECK(mMp4FileDataPtr != M4OSA_NULL, M4ERR_ALLOC);
mMp4FileDataPtr->url = outputFileDescriptor;
@@ -656,7 +656,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
if (mMp4FileDataPtr->audioTrackPtr == M4OSA_NULL)
{
mMp4FileDataPtr->audioTrackPtr = (M4MP4W_AudioTrackData
- *)M4OSA_malloc(sizeof(M4MP4W_AudioTrackData),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4MP4W_AudioTrackData),
M4MP4_WRITER, (M4OSA_Char *)"M4MP4W_AudioTrackData");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr != M4OSA_NULL,
M4ERR_ALLOC);
@@ -677,7 +677,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
#ifdef _M4MP4W_MOOV_FIRST
mMp4FileDataPtr->audioTrackPtr->Chunk =
- (M4OSA_UChar ** )M4OSA_malloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
+ (M4OSA_UChar ** )M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
* sizeof(M4OSA_UChar *),
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->Chunk");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->Chunk != M4OSA_NULL,
@@ -686,14 +686,14 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
#else
mMp4FileDataPtr->audioTrackPtr->Chunk =
- (M4OSA_UChar ** )M4OSA_malloc(sizeof(M4OSA_UChar *),
+ (M4OSA_UChar ** )M4OSA_32bitAlignedMalloc(sizeof(M4OSA_UChar *),
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->Chunk");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->Chunk != M4OSA_NULL,
M4ERR_ALLOC);
mMp4FileDataPtr->audioTrackPtr->Chunk[0] = M4OSA_NULL;
mMp4FileDataPtr->audioTrackPtr->chunkOffsetTable =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
* sizeof(M4OSA_UInt32),
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->chunkOffsetTable");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->chunkOffsetTable
@@ -702,26 +702,26 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
#endif /*_M4MP4W_MOOV_FIRST*/
mMp4FileDataPtr->audioTrackPtr->TABLE_STTS =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_STTS_AUDIO_ALLOC_SIZE,
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_STTS_AUDIO_ALLOC_SIZE,
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->TABLE_STTS");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->TABLE_STTS
!= M4OSA_NULL, M4ERR_ALLOC);
mMp4FileDataPtr->audioTrackPtr->nbOfAllocatedSttsBlocks = 1;
mMp4FileDataPtr->audioTrackPtr->chunkSizeTable =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
* sizeof(M4OSA_UInt32),
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->chunkSizeTable");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->chunkSizeTable
!= M4OSA_NULL, M4ERR_ALLOC);
mMp4FileDataPtr->audioTrackPtr->chunkSampleNbTable =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
* sizeof(M4OSA_UInt32),
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->chunkSampleNbTable");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->chunkSampleNbTable
!= M4OSA_NULL, M4ERR_ALLOC);
mMp4FileDataPtr->audioTrackPtr->chunkTimeMsTable =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_AUDIO_ALLOC_NB
* sizeof(M4OSA_UInt32),
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->chunkTimeMsTable");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->chunkTimeMsTable
@@ -780,7 +780,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
ERR_CHECK(streamDescPtr->decoderSpecificInfoSize == 9,
M4ERR_PARAMETER);
mMp4FileDataPtr->audioTrackPtr->DSI =
- (M4OSA_UChar *)M4OSA_malloc(9, M4MP4_WRITER,
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(9, M4MP4_WRITER,
(M4OSA_Char *)"audioTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->DSI != M4OSA_NULL,
M4ERR_ALLOC);
@@ -815,7 +815,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
ERR_CHECK(streamDescPtr->decoderSpecificInfoSize == 6,
M4ERR_PARAMETER);
mMp4FileDataPtr->audioTrackPtr->DSI =
- (M4OSA_UChar *)M4OSA_malloc(6, M4MP4_WRITER,
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(6, M4MP4_WRITER,
(M4OSA_Char *)"audioTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->DSI != M4OSA_NULL,
M4ERR_ALLOC);
@@ -849,7 +849,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
if (mMp4FileDataPtr->audioTrackPtr->dsiSize != 0)
{
mMp4FileDataPtr->audioTrackPtr->DSI =
- (M4OSA_UChar *)M4OSA_malloc(
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(
streamDescPtr->decoderSpecificInfoSize,
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->DSI != M4OSA_NULL,
@@ -883,7 +883,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
if (mMp4FileDataPtr->videoTrackPtr == M4OSA_NULL)
{
mMp4FileDataPtr->videoTrackPtr = (M4MP4W_VideoTrackData
- *)M4OSA_malloc(sizeof(M4MP4W_VideoTrackData),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4MP4W_VideoTrackData),
M4MP4_WRITER, (M4OSA_Char *)"M4MP4W_VideoTrackData");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr != M4OSA_NULL,
M4ERR_ALLOC);
@@ -905,7 +905,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
#ifdef _M4MP4W_MOOV_FIRST
mMp4FileDataPtr->videoTrackPtr->Chunk =
- (M4OSA_UChar ** )M4OSA_malloc(M4MP4W_CHUNK_ALLOC_NB
+ (M4OSA_UChar ** )M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_ALLOC_NB
* sizeof(M4OSA_UChar *),
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->Chunk");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->Chunk != M4OSA_NULL,
@@ -915,14 +915,14 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
/*re-use the same chunk and flush it when full*/
mMp4FileDataPtr->videoTrackPtr->Chunk =
- (M4OSA_UChar ** )M4OSA_malloc(sizeof(M4OSA_UChar *),
+ (M4OSA_UChar ** )M4OSA_32bitAlignedMalloc(sizeof(M4OSA_UChar *),
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->Chunk");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->Chunk != M4OSA_NULL,
M4ERR_ALLOC);
mMp4FileDataPtr->videoTrackPtr->Chunk[0] = M4OSA_NULL;
mMp4FileDataPtr->videoTrackPtr->chunkOffsetTable =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_CHUNK_ALLOC_NB
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_ALLOC_NB
* sizeof(M4OSA_UInt32),
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->chunkOffsetTable");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->chunkOffsetTable
@@ -933,19 +933,19 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->Chunk != M4OSA_NULL,
M4ERR_ALLOC);
mMp4FileDataPtr->videoTrackPtr->chunkSizeTable =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_CHUNK_ALLOC_NB
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_ALLOC_NB
* sizeof(M4OSA_UInt32),
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->chunkSizeTable");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->chunkSizeTable
!= M4OSA_NULL, M4ERR_ALLOC);
mMp4FileDataPtr->videoTrackPtr->chunkSampleNbTable =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_CHUNK_ALLOC_NB
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_ALLOC_NB
* sizeof(M4OSA_UInt32),
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->chunkSampleNbTable");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->chunkSampleNbTable
!= M4OSA_NULL, M4ERR_ALLOC);
mMp4FileDataPtr->videoTrackPtr->chunkTimeMsTable =
- (M4MP4W_Time32 *)M4OSA_malloc(M4MP4W_CHUNK_ALLOC_NB
+ (M4MP4W_Time32 *)M4OSA_32bitAlignedMalloc(M4MP4W_CHUNK_ALLOC_NB
* sizeof(M4MP4W_Time32),
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->chunkTimeMsTable");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->chunkTimeMsTable
@@ -954,7 +954,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
mMp4FileDataPtr->videoTrackPtr->LastAllocatedChunk = 0;
/*tables are now dynamic*/
mMp4FileDataPtr->videoTrackPtr->TABLE_STTS =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_STTS_ALLOC_SIZE,
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_STTS_ALLOC_SIZE,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->TABLE_STTS");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->TABLE_STTS
!= M4OSA_NULL, M4ERR_ALLOC);
@@ -962,13 +962,13 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
#ifdef _M4MP4W_OPTIMIZE_FOR_PHONE
mMp4FileDataPtr->videoTrackPtr->TABLE_STSZ =
- (M4OSA_UInt16 *)M4OSA_malloc(M4MP4W_STSZ_ALLOC_SIZE,
+ (M4OSA_UInt16 *)M4OSA_32bitAlignedMalloc(M4MP4W_STSZ_ALLOC_SIZE,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->TABLE_STSZ");
#else
mMp4FileDataPtr->videoTrackPtr->TABLE_STSZ =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_STSZ_ALLOC_SIZE,
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_STSZ_ALLOC_SIZE,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->TABLE_STSZ");
#endif
@@ -977,7 +977,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
!= M4OSA_NULL, M4ERR_ALLOC);
mMp4FileDataPtr->videoTrackPtr->nbOfAllocatedStszBlocks = 1;
mMp4FileDataPtr->videoTrackPtr->TABLE_STSS =
- (M4OSA_UInt32 *)M4OSA_malloc(M4MP4W_STSS_ALLOC_SIZE,
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(M4MP4W_STSS_ALLOC_SIZE,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->TABLE_STSS");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->TABLE_STSS
!= M4OSA_NULL, M4ERR_ALLOC);
@@ -1050,7 +1050,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
mMp4FileDataPtr->videoTrackPtr->dsiSize =
(M4OSA_UInt8)streamDescPtr->decoderSpecificInfoSize;
mMp4FileDataPtr->videoTrackPtr->DSI =
- (M4OSA_UChar *)M4OSA_malloc(
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(
streamDescPtr->decoderSpecificInfoSize,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI != M4OSA_NULL,
@@ -1090,7 +1090,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
mMp4FileDataPtr->videoTrackPtr->dsiSize =
(M4OSA_UInt8)streamDescPtr->decoderSpecificInfoSize;
mMp4FileDataPtr->videoTrackPtr->DSI =
- (M4OSA_UChar *)M4OSA_malloc(
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(
streamDescPtr->decoderSpecificInfoSize,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI != M4OSA_NULL,
@@ -1133,7 +1133,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
/* Copy the DSI (SPS + PPS) */
mMp4FileDataPtr->videoTrackPtr->DSI =
- (M4OSA_UChar *)M4OSA_malloc(
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(
streamDescPtr->decoderSpecificInfoSize,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI
@@ -1173,7 +1173,7 @@ M4OSA_ERR M4MP4W_addStream(M4OSA_Context context,
/* Copy the DSI (SPS + PPS) */
mMp4FileDataPtr->videoTrackPtr->DSI =
- (M4OSA_UChar *)M4OSA_malloc(
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(
streamDescPtr->decoderSpecificInfoSize,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI
@@ -1224,7 +1224,7 @@ M4OSA_ERR M4MP4W_startWriting( M4OSA_Context context )
/* First audio chunk allocation */
mMp4FileDataPtr->audioTrackPtr->Chunk[0] = (M4OSA_UChar
- *)M4OSA_malloc(mMp4FileDataPtr->audioTrackPtr->MaxChunkSize,
+ *)M4OSA_32bitAlignedMalloc(mMp4FileDataPtr->audioTrackPtr->MaxChunkSize,
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->Chunk[0]");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->Chunk[0] != M4OSA_NULL,
M4ERR_ALLOC);
@@ -1240,7 +1240,7 @@ M4OSA_ERR M4MP4W_startWriting( M4OSA_Context context )
/* First video chunk allocation */
mMp4FileDataPtr->videoTrackPtr->Chunk[0] = (M4OSA_UChar
- *)M4OSA_malloc(mMp4FileDataPtr->videoTrackPtr->MaxChunkSize,
+ *)M4OSA_32bitAlignedMalloc(mMp4FileDataPtr->videoTrackPtr->MaxChunkSize,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->Chunk[0]");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->Chunk[0] != M4OSA_NULL,
M4ERR_ALLOC);
@@ -1573,7 +1573,7 @@ M4OSA_ERR M4MP4W_newAudioChunk( M4OSA_Context context,
mMp4FileDataPtr->audioTrackPtr->
Chunk[mMp4FileDataPtr->audioTrackPtr->currentChunk] = (M4OSA_UChar
- *)M4OSA_malloc(mMp4FileDataPtr->audioTrackPtr->MaxChunkSize,
+ *)M4OSA_32bitAlignedMalloc(mMp4FileDataPtr->audioTrackPtr->MaxChunkSize,
M4MP4_WRITER, (M4OSA_Char *)"audioTrackPtr->currentChunk");
ERR_CHECK(mMp4FileDataPtr->audioTrackPtr->
Chunk[mMp4FileDataPtr->audioTrackPtr->currentChunk]
@@ -1814,7 +1814,7 @@ M4OSA_ERR M4MP4W_newVideoChunk( M4OSA_Context context,
mMp4FileDataPtr->videoTrackPtr->
Chunk[mMp4FileDataPtr->videoTrackPtr->currentChunk] = (M4OSA_UChar
- *)M4OSA_malloc(mMp4FileDataPtr->videoTrackPtr->MaxChunkSize,
+ *)M4OSA_32bitAlignedMalloc(mMp4FileDataPtr->videoTrackPtr->MaxChunkSize,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->MaxChunkSize");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->
Chunk[mMp4FileDataPtr->videoTrackPtr->currentChunk]
@@ -2236,7 +2236,7 @@ M4OSA_ERR M4MP4W_processAU( M4OSA_Context context, M4SYS_StreamID streamID,
CommonData.sampleNb
* 4 / M4MP4W_STSZ_AUDIO_ALLOC_SIZE;
mMp4FileDataPtr->audioTrackPtr->TABLE_STSZ =
- (M4OSA_UInt32 *)M4OSA_malloc(
+ (M4OSA_UInt32 *)M4OSA_32bitAlignedMalloc(
mMp4FileDataPtr->audioTrackPtr->
nbOfAllocatedStszBlocks
* M4MP4W_STSZ_AUDIO_ALLOC_SIZE,
@@ -4578,14 +4578,14 @@ cleanup:
if (M4OSA_NULL != mMp4FileDataPtr->embeddedString)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->embeddedString);
+ free(mMp4FileDataPtr->embeddedString);
mMp4FileDataPtr->embeddedString = M4OSA_NULL;
}
/* Delete integration tag */
if (M4OSA_NULL != mMp4FileDataPtr->integrationTag)
{
- M4OSA_free((M4OSA_MemAddr32)mMp4FileDataPtr->integrationTag);
+ free(mMp4FileDataPtr->integrationTag);
mMp4FileDataPtr->integrationTag = M4OSA_NULL;
}
@@ -4955,7 +4955,7 @@ M4OSA_ERR M4MP4W_setOption( M4OSA_Context context, M4OSA_OptionID option,
if (mMp4FileDataPtr->embeddedString == M4OSA_NULL)
{
mMp4FileDataPtr->embeddedString =
- (M4OSA_UChar *)M4OSA_malloc(16, M4MP4_WRITER,
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(16, M4MP4_WRITER,
(M4OSA_Char *)"embeddedString");
ERR_CHECK(mMp4FileDataPtr->embeddedString != M4OSA_NULL,
M4ERR_ALLOC);
@@ -4974,7 +4974,7 @@ M4OSA_ERR M4MP4W_setOption( M4OSA_Context context, M4OSA_OptionID option,
if (mMp4FileDataPtr->integrationTag == M4OSA_NULL)
{
mMp4FileDataPtr->integrationTag =
- (M4OSA_UChar *)M4OSA_malloc(60, M4MP4_WRITER,
+ (M4OSA_UChar *)M4OSA_32bitAlignedMalloc(60, M4MP4_WRITER,
(M4OSA_Char *)"integrationTag");
ERR_CHECK(mMp4FileDataPtr->integrationTag != M4OSA_NULL,
M4ERR_ALLOC);
@@ -5179,7 +5179,7 @@ M4OSA_ERR M4MP4W_setOption( M4OSA_Context context, M4OSA_OptionID option,
mMp4FileDataPtr->videoTrackPtr->dsiSize =
(M4OSA_UInt8)streamIDmemAddrPtr->size;
mMp4FileDataPtr->videoTrackPtr->DSI = (M4OSA_UChar
- *)M4OSA_malloc(streamIDmemAddrPtr->size,
+ *)M4OSA_32bitAlignedMalloc(streamIDmemAddrPtr->size,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI
!= M4OSA_NULL, M4ERR_ALLOC);
@@ -5215,7 +5215,7 @@ M4OSA_ERR M4MP4W_setOption( M4OSA_Context context, M4OSA_OptionID option,
mMp4FileDataPtr->videoTrackPtr->dsiSize =
(M4OSA_UInt8)streamIDmemAddrPtr->size;
mMp4FileDataPtr->videoTrackPtr->DSI = (M4OSA_UChar
- *)M4OSA_malloc(streamIDmemAddrPtr->size,
+ *)M4OSA_32bitAlignedMalloc(streamIDmemAddrPtr->size,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI
!= M4OSA_NULL, M4ERR_ALLOC);
@@ -5237,8 +5237,7 @@ M4OSA_ERR M4MP4W_setOption( M4OSA_Context context, M4OSA_OptionID option,
/* + H.264 trimming */
if (M4OSA_TRUE == mMp4FileDataPtr->bMULPPSSPS)
{
- M4OSA_free(
- (M4OSA_MemAddr32)mMp4FileDataPtr->videoTrackPtr->DSI);
+ free(mMp4FileDataPtr->videoTrackPtr->DSI);
// Do not strip the DSI
/* Store the DSI size */
@@ -5248,7 +5247,7 @@ M4OSA_ERR M4MP4W_setOption( M4OSA_Context context, M4OSA_OptionID option,
,mMp4FileDataPtr->videoTrackPtr->dsiSize);
/* Copy the DSI (SPS + PPS) */
mMp4FileDataPtr->videoTrackPtr->DSI =
- (M4OSA_UChar*)M4OSA_malloc(
+ (M4OSA_UChar*)M4OSA_32bitAlignedMalloc(
streamIDmemAddrPtr->size, M4MP4_WRITER,
(M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI !=
@@ -5283,7 +5282,7 @@ M4OSA_ERR M4MP4W_setOption( M4OSA_Context context, M4OSA_OptionID option,
/* Copy the DSI (SPS + PPS) */
mMp4FileDataPtr->videoTrackPtr->DSI = (M4OSA_UChar
- *)M4OSA_malloc(streamIDmemAddrPtr->size,
+ *)M4OSA_32bitAlignedMalloc(streamIDmemAddrPtr->size,
M4MP4_WRITER, (M4OSA_Char *)"videoTrackPtr->DSI");
ERR_CHECK(mMp4FileDataPtr->videoTrackPtr->DSI
!= M4OSA_NULL, M4ERR_ALLOC);
diff --git a/libvideoeditor/vss/common/inc/M4VD_Tools.h b/libvideoeditor/vss/common/inc/M4VD_Tools.h
index 83e036a..83e036a 100644..100755
--- a/libvideoeditor/vss/common/inc/M4VD_Tools.h
+++ b/libvideoeditor/vss/common/inc/M4VD_Tools.h
diff --git a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h
index bf627c7..bf627c7 100644..100755
--- a/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h
+++ b/libvideoeditor/vss/inc/M4VSS3GPP_InternalTypes.h
diff --git a/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h b/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h
index 68d2448..68d2448 100644..100755
--- a/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h
+++ b/libvideoeditor/vss/mcs/inc/M4MCS_InternalTypes.h
diff --git a/libvideoeditor/vss/mcs/src/M4MCS_API.c b/libvideoeditor/vss/mcs/src/M4MCS_API.c
index a4c3ed7..819ea68 100755
--- a/libvideoeditor/vss/mcs/src/M4MCS_API.c
+++ b/libvideoeditor/vss/mcs/src/M4MCS_API.c
@@ -151,7 +151,7 @@ M4OSA_ERR H264MCS_Getinstance( NSWAVC_MCS_t ** instance )
{
NSWAVC_MCS_t *p_bs = M4OSA_NULL;
M4OSA_ERR err = M4NO_ERROR;
- p_bs = (NSWAVC_MCS_t *)M4OSA_malloc(sizeof(NSWAVC_MCS_t), M4MCS,
+ p_bs = (NSWAVC_MCS_t *)M4OSA_32bitAlignedMalloc(sizeof(NSWAVC_MCS_t), M4MCS,
(M4OSA_Char *)"NSWAVC_MCS_t");
if( M4OSA_NULL == p_bs )
@@ -768,7 +768,7 @@ M4OSA_ERR H264MCS_ProcessEncodedNALU( M4OSA_Void *ainstance,
}
// StageFright encoder does not provide the size in the first 4 bytes of the AU, add it
- pTmpBuff1 = (M4OSA_Int8 *)M4OSA_malloc(inbuf_size + 4, M4MCS,
+ pTmpBuff1 = (M4OSA_Int8 *)M4OSA_32bitAlignedMalloc(inbuf_size + 4, M4MCS,
(M4OSA_Char *)"tmpNALU");
memcpy((void *)(pTmpBuff1 + 4), (void *)inbuff,
inbuf_size);
@@ -1006,7 +1006,7 @@ M4OSA_ERR H264MCS_ProcessEncodedNALU( M4OSA_Void *ainstance,
// StageFright encoder does not provide the size in the first 4 bytes of the AU, add it
- M4OSA_free((M4OSA_MemAddr32)pTmpBuff1);
+ free(pTmpBuff1);
pTmpBuff1 = M4OSA_NULL;
inbuff = (M4OSA_UInt8 *)pTmpBuff2;
@@ -1566,7 +1566,7 @@ M4OSA_ERR H264MCS_ProcessSPS_PPS( NSWAVC_MCS_t *instance, M4OSA_UInt8 *inbuff,
instance->final_PPS_ID = Clip_PPSID[cnt];
instance->m_pFinalDSI =
- (M4OSA_UInt8 *)M4OSA_malloc(instance->m_decoderSpecificInfoSize,
+ (M4OSA_UInt8 *)M4OSA_32bitAlignedMalloc(instance->m_decoderSpecificInfoSize,
M4MCS, (M4OSA_Char *)"instance->m_pFinalDSI");
if( instance->m_pFinalDSI == M4OSA_NULL )
@@ -1596,7 +1596,7 @@ M4OSA_ERR H264MCS_ProcessSPS_PPS( NSWAVC_MCS_t *instance, M4OSA_UInt8 *inbuff,
size = instance->m_decoderSpecificInfoSize + instance->m_encoderPPSSize
+ 10;
- instance->m_pFinalDSI = (M4OSA_UInt8 *)M4OSA_malloc(size, M4MCS,
+ instance->m_pFinalDSI = (M4OSA_UInt8 *)M4OSA_32bitAlignedMalloc(size, M4MCS,
(M4OSA_Char *)"instance->m_pFinalDSI");
if( instance->m_pFinalDSI == M4OSA_NULL )
@@ -2036,30 +2036,30 @@ M4OSA_ERR H264MCS_Freeinstance( NSWAVC_MCS_t *instance )
if( M4OSA_NULL != instance->encoder_pps.slice_group_id )
{
- M4OSA_free((M4OSA_MemAddr32)instance->encoder_pps.slice_group_id);
+ free(instance->encoder_pps.slice_group_id);
}
if( M4OSA_NULL != instance->p_encoder_sps )
{
- M4OSA_free((M4OSA_MemAddr32)instance->p_encoder_sps);
+ free(instance->p_encoder_sps);
instance->p_encoder_sps = M4OSA_NULL;
}
if( M4OSA_NULL != instance->p_encoder_pps )
{
- M4OSA_free((M4OSA_MemAddr32)instance->p_encoder_pps);
+ free(instance->p_encoder_pps);
instance->p_encoder_pps = M4OSA_NULL;
}
if( M4OSA_NULL != instance->m_pFinalDSI )
{
- M4OSA_free((M4OSA_MemAddr32)instance->m_pFinalDSI);
+ free(instance->m_pFinalDSI);
instance->m_pFinalDSI = M4OSA_NULL;
}
if( M4OSA_NULL != instance )
{
- M4OSA_free((M4OSA_MemAddr32)instance);
+ free(instance);
instance = M4OSA_NULL;
}
@@ -2130,7 +2130,7 @@ M4OSA_ERR M4MCS_init( M4MCS_Context *pContext,
/**
* Allocate the MCS context and return it to the user */
- pC = (M4MCS_InternalContext *)M4OSA_malloc(sizeof(M4MCS_InternalContext),
+ pC = (M4MCS_InternalContext *)M4OSA_32bitAlignedMalloc(sizeof(M4MCS_InternalContext),
M4MCS, (M4OSA_Char *)"M4MCS_InternalContext");
*pContext = pC;
@@ -3164,7 +3164,7 @@ M4OSA_ERR M4MCS_close( M4MCS_Context pContext )
(M4OSA_MemAddr8)pC->m_pInstance->m_pDecoderSpecificInfo);
pC->m_pInstance->m_pFinalDSI =
- (M4OSA_UInt8 *)M4OSA_malloc(pC->m_pInstance-> \
+ (M4OSA_UInt8 *)M4OSA_32bitAlignedMalloc(pC->m_pInstance-> \
m_decoderSpecificInfoSize, M4MCS,
(M4OSA_Char *)"instance->m_pFinalDSI");
@@ -3222,7 +3222,7 @@ M4OSA_ERR M4MCS_close( M4MCS_Context pContext )
free effects list*/
if( M4OSA_NULL != pC->pEffects )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pEffects);
+ free(pC->pEffects);
pC->pEffects = M4OSA_NULL;
}
pC->nbEffects = 0;
@@ -3234,7 +3234,7 @@ M4OSA_ERR M4MCS_close( M4MCS_Context pContext )
if( M4OSA_NULL != pC->H264MCSTempBuffer )
{
- M4OSA_free((M4OSA_MemAddr32)pC->H264MCSTempBuffer);
+ free(pC->H264MCSTempBuffer);
}
M4OSA_TRACE3_0("M4MCS_close(): returning M4NO_ERROR");
@@ -3331,7 +3331,7 @@ M4OSA_ERR M4MCS_cleanUp( M4MCS_Context pContext )
if( ( M4ENCODER_kH263 == pC->EncodingVideoFormat)
&& (M4OSA_NULL != pC->WriterVideoStreamInfo.Header.pBuf) )
{
- M4OSA_free((M4OSA_MemAddr32)pC->WriterVideoStreamInfo.Header.pBuf);
+ free(pC->WriterVideoStreamInfo.Header.pBuf);
pC->WriterVideoStreamInfo.Header.pBuf = M4OSA_NULL;
}
@@ -3339,22 +3339,22 @@ M4OSA_ERR M4MCS_cleanUp( M4MCS_Context pContext )
{
if( M4OSA_NULL != pC->pPreResizeFrame[0].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pPreResizeFrame[0].pac_data);
+ free(pC->pPreResizeFrame[0].pac_data);
pC->pPreResizeFrame[0].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->pPreResizeFrame[1].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pPreResizeFrame[1].pac_data);
+ free(pC->pPreResizeFrame[1].pac_data);
pC->pPreResizeFrame[1].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->pPreResizeFrame[2].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pPreResizeFrame[2].pac_data);
+ free(pC->pPreResizeFrame[2].pac_data);
pC->pPreResizeFrame[2].pac_data = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)pC->pPreResizeFrame);
+ free(pC->pPreResizeFrame);
pC->pPreResizeFrame = M4OSA_NULL;
}
@@ -3362,19 +3362,19 @@ M4OSA_ERR M4MCS_cleanUp( M4MCS_Context pContext )
if( M4OSA_NULL != pC->SsrcScratch )
{
- M4OSA_free((M4OSA_MemAddr32)pC->SsrcScratch);
+ free(pC->SsrcScratch);
pC->SsrcScratch = M4OSA_NULL;
}
if( M4OSA_NULL != pC->pSsrcBufferIn )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pSsrcBufferIn);
+ free(pC->pSsrcBufferIn);
pC->pSsrcBufferIn = M4OSA_NULL;
}
if( M4OSA_NULL != pC->pSsrcBufferOut )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pSsrcBufferOut);
+ free(pC->pSsrcBufferOut);
pC->pSsrcBufferOut = M4OSA_NULL;
}
@@ -3413,7 +3413,7 @@ M4OSA_ERR M4MCS_cleanUp( M4MCS_Context pContext )
if( M4OSA_NULL != pC->pAudioEncoderBuffer )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pAudioEncoderBuffer);
+ free(pC->pAudioEncoderBuffer);
pC->pAudioEncoderBuffer = M4OSA_NULL;
}
@@ -3441,7 +3441,7 @@ M4OSA_ERR M4MCS_cleanUp( M4MCS_Context pContext )
/**
* Free the context itself */
- M4OSA_free((M4OSA_MemAddr32)pC);
+ free(pC);
pC = M4OSA_NULL;
M4OSA_TRACE3_0("M4MCS_cleanUp(): returning M4NO_ERROR");
@@ -4306,7 +4306,7 @@ M4OSA_ERR M4MCS_setOutputParams( M4MCS_Context pContext,
{
M4OSA_UInt32 j = 0;
pC->nbEffects = pParams->nbEffects;
- pC->pEffects = (M4MCS_EffectSettings *)M4OSA_malloc(pC->nbEffects \
+ pC->pEffects = (M4MCS_EffectSettings *)M4OSA_32bitAlignedMalloc(pC->nbEffects \
*sizeof(M4MCS_EffectSettings), M4MCS,
(M4OSA_Char *)"Allocation of effects list");
@@ -5907,7 +5907,7 @@ static M4OSA_ERR M4MCS_intPrepareVideoEncoder( M4MCS_InternalContext *pC )
* Allocate the intermediate video plane that will receive the decoded image before
resizing */
pC->pPreResizeFrame =
- (M4VIFI_ImagePlane *)M4OSA_malloc(3 * sizeof(M4VIFI_ImagePlane),
+ (M4VIFI_ImagePlane *)M4OSA_32bitAlignedMalloc(3 * sizeof(M4VIFI_ImagePlane),
M4MCS, (M4OSA_Char *)"m_pPreResizeFrame");
if( M4OSA_NULL == pC->pPreResizeFrame )
@@ -5932,7 +5932,7 @@ static M4OSA_ERR M4MCS_intPrepareVideoEncoder( M4MCS_InternalContext *pC )
pPreResizeFrame[0].u_width; /**< simple case: stride equals width */
pC->pPreResizeFrame[0].pac_data =
- (M4VIFI_UInt8 *)M4OSA_malloc(pC->pPreResizeFrame[0].u_stride \
+ (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(pC->pPreResizeFrame[0].u_stride \
*pC->pPreResizeFrame[0].u_height, M4MCS,
(M4OSA_Char *)"m_pPreResizeFrame[0].pac_data");
@@ -5955,7 +5955,7 @@ static M4OSA_ERR M4MCS_intPrepareVideoEncoder( M4MCS_InternalContext *pC )
pPreResizeFrame[1].u_width; /**< simple case: stride equals width */
pC->pPreResizeFrame[1].pac_data =
- (M4VIFI_UInt8 *)M4OSA_malloc(pC->pPreResizeFrame[1].u_stride \
+ (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(pC->pPreResizeFrame[1].u_stride \
*pC->pPreResizeFrame[1].u_height, M4MCS,
(M4OSA_Char *)"m_pPreResizeFrame[1].pac_data");
@@ -5978,7 +5978,7 @@ static M4OSA_ERR M4MCS_intPrepareVideoEncoder( M4MCS_InternalContext *pC )
pPreResizeFrame[2].u_width; /**< simple case: stride equals width */
pC->pPreResizeFrame[2].pac_data =
- (M4VIFI_UInt8 *)M4OSA_malloc(pC->pPreResizeFrame[2].u_stride \
+ (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(pC->pPreResizeFrame[2].u_stride \
*pC->pPreResizeFrame[2].u_height, M4MCS,
(M4OSA_Char *)"m_pPreResizeFrame[1].pac_data");
@@ -6135,7 +6135,7 @@ static M4OSA_ERR M4MCS_intPrepareAudioProcessing( M4MCS_InternalContext *pC )
pC->AudioDecBufferOut.m_bufferSize =
pC->InputFileProperties.uiDecodedPcmSize;
pC->AudioDecBufferOut.m_dataAddress =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->AudioDecBufferOut.m_bufferSize \
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->AudioDecBufferOut.m_bufferSize \
*sizeof(short), M4MCS, (M4OSA_Char *)"AudioDecBufferOut.m_bufferSize");
}
@@ -6384,7 +6384,7 @@ static M4OSA_ERR M4MCS_intPrepareAudioProcessing( M4MCS_InternalContext *pC )
/**
* Allocate buffer for the input of the SSRC */
pC->pSsrcBufferIn =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->iSsrcNbSamplIn * sizeof(short) \
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->iSsrcNbSamplIn * sizeof(short) \
*pC->pReaderAudioStream->m_nbChannels, M4MCS,
(M4OSA_Char *)"pSsrcBufferIn");
@@ -6400,7 +6400,7 @@ static M4OSA_ERR M4MCS_intPrepareAudioProcessing( M4MCS_InternalContext *pC )
/**
* Allocate buffer for the output of the SSRC */
pC->pSsrcBufferOut =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->iSsrcNbSamplOut * sizeof(short) \
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->iSsrcNbSamplOut * sizeof(short) \
*pC->pReaderAudioStream->m_nbChannels, M4MCS,
(M4OSA_Char *)"pSsrcBufferOut");
@@ -6490,7 +6490,7 @@ static M4OSA_ERR M4MCS_intPrepareAudioProcessing( M4MCS_InternalContext *pC )
pC->pPosInAudioEncoderBuffer = M4OSA_NULL;
pC->pAudioEncoderBuffer =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->audioEncoderGranularity, M4MCS,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->audioEncoderGranularity, M4MCS,
(M4OSA_Char *)"pC->pAudioEncoderBuffer");
/**
@@ -6684,7 +6684,7 @@ static M4OSA_ERR M4MCS_intPrepareWriter( M4MCS_InternalContext *pC )
* Creates the H263 DSI */
pC->WriterVideoStreamInfo.Header.Size =
7; /**< H263 output DSI is always 7 bytes */
- pDSI = (M4OSA_MemAddr8)M4OSA_malloc(7, M4MCS, (M4OSA_Char
+ pDSI = (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(7, M4MCS, (M4OSA_Char
*)"pC->WriterVideoStreamInfo.Header.pBuf (DSI H263)");
if( M4OSA_NULL == pDSI )
@@ -6790,7 +6790,7 @@ static M4OSA_ERR M4MCS_intPrepareWriter( M4MCS_InternalContext *pC )
m_basicProperties.m_decoderSpecificInfoSize;
pC->WriterVideoStreamInfo.Header.pBuf =
(M4OSA_Void
- *)M4OSA_malloc(pC->WriterVideoStreamInfo.Header.Size,
+ *)M4OSA_32bitAlignedMalloc(pC->WriterVideoStreamInfo.Header.Size,
M4MCS,
(M4OSA_Char
*)
@@ -7932,7 +7932,7 @@ static M4OSA_ERR M4MCS_intAudioNullEncoding( M4MCS_InternalContext *pC )
}
pC->m_pDataAddress1 =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->ReaderAudioAU1.m_maxsize,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->ReaderAudioAU1.m_maxsize,
M4MCS, (M4OSA_Char *)"Temporary AU1 buffer");
if( pC->m_pDataAddress1 == M4OSA_NULL )
@@ -8007,7 +8007,7 @@ static M4OSA_ERR M4MCS_intAudioNullEncoding( M4MCS_InternalContext *pC )
return err;
}
pC->m_pDataAddress2 =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->ReaderAudioAU2.m_maxsize,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->ReaderAudioAU2.m_maxsize,
M4MCS, (M4OSA_Char *)"Temporary AU buffer");
if( pC->m_pDataAddress2 == M4OSA_NULL )
@@ -8468,7 +8468,7 @@ m4mcs_intaudiotranscoding_do_resampling:
if( pC->pReaderAudioStream->m_nbChannels == 1 )
{
tempBuffOut =
- (short *)M4OSA_malloc((pC->iSsrcNbSamplOut * sizeof(short) * 2
+ (short *)M4OSA_32bitAlignedMalloc((pC->iSsrcNbSamplOut * sizeof(short) * 2
* ((*pC).InputFileProperties).uiNbChannels),
M4VSS3GPP,(M4OSA_Char *) "tempBuffOut");
memset((void *)tempBuffOut, 0,(pC->iSsrcNbSamplOut * sizeof(short) * 2
@@ -8490,7 +8490,7 @@ m4mcs_intaudiotranscoding_do_resampling:
{
From2iToMono_16((short *)tempBuffOut, (short *)pC->pSsrcBufferOut,
(short)pC->iSsrcNbSamplOut);
- M4OSA_free((M4OSA_MemAddr32)tempBuffOut);
+ free(tempBuffOut);
}
@@ -8839,8 +8839,8 @@ static M4OSA_ERR M4MCS_intReallocTemporaryAU( M4OSA_MemAddr8 *addr,
{
if( *addr != M4OSA_NULL )
{
- M4OSA_free(( M4OSA_MemAddr32) * addr);
- *addr = (M4OSA_MemAddr8)M4OSA_malloc(newSize, M4MCS,
+ free(*addr);
+ *addr = (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(newSize, M4MCS,
(M4OSA_Char *)"Reallocation of temporary AU buffer");
if( *addr == M4OSA_NULL )
@@ -9031,7 +9031,7 @@ static M4OSA_ERR M4MCS_intVideoNullEncoding( M4MCS_InternalContext *pC )
}
pC->m_pDataVideoAddress1 =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->ReaderVideoAU1.m_maxsize, M4MCS,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->ReaderVideoAU1.m_maxsize, M4MCS,
(M4OSA_Char *)"Temporary video AU1 buffer");
if( pC->m_pDataVideoAddress1 == M4OSA_NULL )
@@ -9102,7 +9102,7 @@ static M4OSA_ERR M4MCS_intVideoNullEncoding( M4MCS_InternalContext *pC )
return err;
}
pC->m_pDataVideoAddress2 =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->ReaderVideoAU2.m_maxsize, M4MCS,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->ReaderVideoAU2.m_maxsize, M4MCS,
(M4OSA_Char *)"Temporary video AU buffer");
if( pC->m_pDataVideoAddress2 == M4OSA_NULL )
@@ -9255,10 +9255,10 @@ static M4OSA_ERR M4MCS_intVideoNullEncoding( M4MCS_InternalContext *pC )
if( pC->H264MCSTempBuffer != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->H264MCSTempBuffer);
+ free(pC->H264MCSTempBuffer);
}
pC->H264MCSTempBuffer =
- (M4OSA_UInt8 *)M4OSA_malloc(pC->H264MCSTempBufferSize,
+ (M4OSA_UInt8 *)M4OSA_32bitAlignedMalloc(pC->H264MCSTempBufferSize,
M4MCS, (M4OSA_Char *)"pC->H264MCSTempBuffer");
if( pC->H264MCSTempBuffer == M4OSA_NULL )
@@ -10507,25 +10507,25 @@ static M4OSA_ERR M4MCS_intCleanUp_ReadersDecoders( M4MCS_InternalContext *pC )
if( pC->m_pDataAddress1 != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDataAddress1);
+ free(pC->m_pDataAddress1);
pC->m_pDataAddress1 = M4OSA_NULL;
}
if( pC->m_pDataAddress2 != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDataAddress2);
+ free(pC->m_pDataAddress2);
pC->m_pDataAddress2 = M4OSA_NULL;
}
/*Bug fix 11/12/2008 (to obtain more precise video end cut)*/
if( pC->m_pDataVideoAddress1 != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDataVideoAddress1);
+ free(pC->m_pDataVideoAddress1);
pC->m_pDataVideoAddress1 = M4OSA_NULL;
}
if( pC->m_pDataVideoAddress2 != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDataVideoAddress2);
+ free(pC->m_pDataVideoAddress2);
pC->m_pDataVideoAddress2 = M4OSA_NULL;
}
/**/
@@ -10563,7 +10563,7 @@ static M4OSA_ERR M4MCS_intCleanUp_ReadersDecoders( M4MCS_InternalContext *pC )
if( M4OSA_NULL != pC->AudioDecBufferOut.m_dataAddress )
{
- M4OSA_free((M4OSA_MemAddr32)pC->AudioDecBufferOut.m_dataAddress);
+ free(pC->AudioDecBufferOut.m_dataAddress);
pC->AudioDecBufferOut.m_dataAddress = M4OSA_NULL;
}
@@ -10942,7 +10942,7 @@ M4OSA_ERR M4MCS_registerExternalVideoDecoder( M4MCS_Context pContext,
}
shellUserData =
- (M4DECODER_EXTERNAL_UserDataType)M4OSA_malloc(sizeof(*shellUserData),
+ (M4DECODER_EXTERNAL_UserDataType)M4OSA_32bitAlignedMalloc(sizeof(*shellUserData),
M4MCS,
(M4OSA_Char *)"userData structure for the external shell decoder");
@@ -10965,7 +10965,7 @@ M4OSA_ERR M4MCS_registerExternalVideoDecoder( M4MCS_Context pContext,
"M4MCS_registerExternalVideoDecoder:\
M4DECODER_EXTERNAL_getInterface failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)shellUserData);
+ free(shellUserData);
return err;
}
@@ -10977,8 +10977,8 @@ M4OSA_ERR M4MCS_registerExternalVideoDecoder( M4MCS_Context pContext,
"M4MCS_registerExternalVideoDecoder:\
M4MCS_registerVideoDecoder failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)shellInterface);
- M4OSA_free((M4OSA_MemAddr32)shellUserData);
+ free(shellInterface);
+ free(shellUserData);
return err;
}
@@ -11048,7 +11048,7 @@ M4OSA_ERR M4MCS_registerExternalVideoEncoder( M4MCS_Context pContext,
"M4MCS_registerExternalVideoEncoder:\
M4MCS_registerVideoEncoder failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)shellInterface);
+ free(shellInterface);
return err;
}
@@ -11122,7 +11122,7 @@ M4OSA_ERR M4MCS_registerExternalAudioDecoder( M4MCS_Context pContext,
if( pC->m_pAudioDecoderItTable[decoderType] != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioDecoderItTable[decoderType]);
+ free(pC->m_pAudioDecoderItTable[decoderType]);
pC->m_pAudioDecoderItTable[decoderType] = M4OSA_NULL;
}
@@ -11193,7 +11193,7 @@ M4OSA_ERR M4MCS_registerExternalAudioEncoder( M4MCS_Context pContext,
if( pC->pAudioEncoderInterface[MediaType] != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pAudioEncoderInterface[MediaType]);
+ free(pC->pAudioEncoderInterface[MediaType]);
pC->pAudioEncoderInterface[MediaType] = M4OSA_NULL;
}
@@ -11492,7 +11492,7 @@ M4OSA_ERR M4MCS_registerAudioEncoderExtended( M4MCS_Context pContext,
"M4MCS_registerAudioEncoderExtended: \
M4MCS_registerAudioEncoder failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)pEncoderInterface);
+ free(pEncoderInterface);
return err;
}
@@ -11597,7 +11597,7 @@ M4OSA_ERR M4MCS_registerAudioDecoderExtended( M4MCS_Context pContext,
"M4MCS_registerAudioDecoderExtended:\
M4MCS_registerAudioDecoder failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)pDecoderInterface);
+ free(pDecoderInterface);
return err;
}
diff --git a/libvideoeditor/vss/mcs/src/M4MCS_Codecs.c b/libvideoeditor/vss/mcs/src/M4MCS_Codecs.c
index 9dffaad..cbff66c 100755
--- a/libvideoeditor/vss/mcs/src/M4MCS_Codecs.c
+++ b/libvideoeditor/vss/mcs/src/M4MCS_Codecs.c
@@ -211,7 +211,7 @@ M4OSA_ERR M4MCS_registerVideoEncoder (
/* can be legitimate, in cases where we have one version that can use external encoders
but which still has the built-in one to be able to work without an external encoder; in
this case the new encoder simply replaces the old one (i.e. we unregister it first). */
- M4OSA_free((M4OSA_MemAddr32)pC->pVideoEncoderInterface[MediaType]);
+ free(pC->pVideoEncoderInterface[MediaType]);
pC->pVideoEncoderInterface[MediaType] = M4OSA_NULL;
}
@@ -265,12 +265,12 @@ M4OSA_ERR M4MCS_registerAudioEncoder(
if(M4OSA_NULL != pC->pAudioEncoderInterface[MediaType])
{
- M4OSA_free((M4OSA_MemAddr32)pC->pAudioEncoderInterface[MediaType]);
+ free(pC->pAudioEncoderInterface[MediaType]);
pC->pAudioEncoderInterface[MediaType] = M4OSA_NULL;
if(M4OSA_NULL != pC->pAudioEncoderUserDataTable[MediaType])
{
- M4OSA_free((M4OSA_MemAddr32)pC->pAudioEncoderUserDataTable[MediaType]);
+ free(pC->pAudioEncoderUserDataTable[MediaType]);
pC->pAudioEncoderUserDataTable[MediaType] = M4OSA_NULL;
}
}
@@ -366,12 +366,12 @@ M4OSA_ERR M4MCS_registerVideoDecoder(
/* can be legitimate, in cases where we have one version that can use external decoders
but which still has the built-in one to be able to work without an external decoder; in
this case the new decoder simply replaces the old one (i.e. we unregister it first). */
- M4OSA_free((M4OSA_MemAddr32)pC->m_pVideoDecoderItTable[decoderType]);
+ free(pC->m_pVideoDecoderItTable[decoderType]);
pC->m_pVideoDecoderItTable[decoderType] = M4OSA_NULL;
/* oh, and don't forget the user data, too. */
if (pC->m_pVideoDecoderUserDataTable[decoderType] != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pVideoDecoderUserDataTable[decoderType]);
+ free(pC->m_pVideoDecoderUserDataTable[decoderType]);
pC->m_pVideoDecoderUserDataTable[decoderType] = M4OSA_NULL;
}
#endif /* are external decoders possible? */
@@ -420,12 +420,12 @@ M4OSA_ERR M4MCS_registerAudioDecoder(
if(M4OSA_NULL != pC->m_pAudioDecoderItTable[decoderType])
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioDecoderItTable[decoderType]);
+ free(pC->m_pAudioDecoderItTable[decoderType]);
pC->m_pAudioDecoderItTable[decoderType] = M4OSA_NULL;
if(M4OSA_NULL != pC->m_pAudioDecoderUserDataTable[decoderType])
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioDecoderUserDataTable[decoderType]);
+ free(pC->m_pAudioDecoderUserDataTable[decoderType]);
pC->m_pAudioDecoderUserDataTable[decoderType] = M4OSA_NULL;
}
}
@@ -455,12 +455,12 @@ M4OSA_ERR M4MCS_unRegisterAllWriters(M4MCS_Context pContext)
{
if (pC->WriterInterface[i].pGlobalFcts != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pC->WriterInterface[i].pGlobalFcts );
+ free(pC->WriterInterface[i].pGlobalFcts );
pC->WriterInterface[i].pGlobalFcts = M4OSA_NULL;
}
if (pC->WriterInterface[i].pDataFcts != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pC->WriterInterface[i].pDataFcts );
+ free(pC->WriterInterface[i].pDataFcts );
pC->WriterInterface[i].pDataFcts = M4OSA_NULL;
}
}
@@ -491,7 +491,7 @@ M4OSA_ERR M4MCS_unRegisterAllEncoders(M4MCS_Context pContext)
{
if (pC->pVideoEncoderInterface[i] != M4OSA_NULL)
{
- M4OSA_free( (M4OSA_MemAddr32)pC->pVideoEncoderInterface[i] );
+ free(pC->pVideoEncoderInterface[i] );
pC->pVideoEncoderInterface[i] = M4OSA_NULL;
}
}
@@ -503,7 +503,7 @@ M4OSA_ERR M4MCS_unRegisterAllEncoders(M4MCS_Context pContext)
/*Don't free external audio encoders interfaces*/
if (M4OSA_FALSE == pC->pAudioEncoderFlag[i])
{
- M4OSA_free( (M4OSA_MemAddr32)pC->pAudioEncoderInterface[i] );
+ free(pC->pAudioEncoderInterface[i] );
}
pC->pAudioEncoderInterface[i] = M4OSA_NULL;
}
@@ -535,12 +535,12 @@ M4OSA_ERR M4MCS_unRegisterAllReaders(M4MCS_Context pContext)
{
if (pC->m_pReaderGlobalItTable[i] != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pReaderGlobalItTable[i] );
+ free(pC->m_pReaderGlobalItTable[i] );
pC->m_pReaderGlobalItTable[i] = M4OSA_NULL;
}
if (pC->m_pReaderDataItTable[i] != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pReaderDataItTable[i] );
+ free(pC->m_pReaderDataItTable[i] );
pC->m_pReaderDataItTable[i] = M4OSA_NULL;
}
}
@@ -572,7 +572,7 @@ M4OSA_ERR M4MCS_unRegisterAllDecoders(M4MCS_Context pContext)
{
if (pC->m_pVideoDecoderItTable[i] != M4OSA_NULL)
{
- M4OSA_free( (M4OSA_MemAddr32)pC->m_pVideoDecoderItTable[i] );
+ free(pC->m_pVideoDecoderItTable[i] );
pC->m_pVideoDecoderItTable[i] = M4OSA_NULL;
}
}
@@ -584,7 +584,7 @@ M4OSA_ERR M4MCS_unRegisterAllDecoders(M4MCS_Context pContext)
/*Don't free external audio decoders interfaces*/
if (M4OSA_FALSE == pC->m_pAudioDecoderFlagTable[i])
{
- M4OSA_free( (M4OSA_MemAddr32)pC->m_pAudioDecoderItTable[i] );
+ free(pC->m_pAudioDecoderItTable[i] );
}
pC->m_pAudioDecoderItTable[i] = M4OSA_NULL;
}
diff --git a/libvideoeditor/vss/mcs/src/M4MCS_VideoPreProcessing.c b/libvideoeditor/vss/mcs/src/M4MCS_VideoPreProcessing.c
index de78ded..36ad9d9 100755
--- a/libvideoeditor/vss/mcs/src/M4MCS_VideoPreProcessing.c
+++ b/libvideoeditor/vss/mcs/src/M4MCS_VideoPreProcessing.c
@@ -197,7 +197,7 @@ M4OSA_ERR M4MCS_intApplyVPP(M4VPP_Context pContext, M4VIFI_ImagePlane* pPlaneIn,
/* Allocates plan in local image plane structure */
pImagePlanesTemp[0].pac_data =
- (M4OSA_UInt8*)M4OSA_malloc(pImagePlanesTemp[0]\
+ (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(pImagePlanesTemp[0]\
.u_width * pImagePlanesTemp[0].u_height, M4VS,
(M4OSA_Char *)"M4xVSS_PictureCallbackFct: temporary plane bufferY") ;
if(pImagePlanesTemp[0].pac_data == M4OSA_NULL)
@@ -206,7 +206,7 @@ M4OSA_ERR M4MCS_intApplyVPP(M4VPP_Context pContext, M4VIFI_ImagePlane* pPlaneIn,
return M4ERR_ALLOC;
}
pImagePlanesTemp[1].pac_data =
- (M4OSA_UInt8*)M4OSA_malloc(pImagePlanesTemp[1]\
+ (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(pImagePlanesTemp[1]\
.u_width * pImagePlanesTemp[1].u_height, M4VS,
(M4OSA_Char *)"M4xVSS_PictureCallbackFct: temporary plane bufferU") ;
if(pImagePlanesTemp[1].pac_data == M4OSA_NULL)
@@ -215,7 +215,7 @@ M4OSA_ERR M4MCS_intApplyVPP(M4VPP_Context pContext, M4VIFI_ImagePlane* pPlaneIn,
return M4ERR_ALLOC;
}
pImagePlanesTemp[2].pac_data =
- (M4OSA_UInt8*)M4OSA_malloc(pImagePlanesTemp[2]\
+ (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(pImagePlanesTemp[2]\
.u_width * pImagePlanesTemp[2].u_height,
M4VS,(M4OSA_Char *)"M4xVSS_PictureCallbackFct: temporary plane bufferV") ;
if(pImagePlanesTemp[2].pac_data == M4OSA_NULL)
@@ -410,7 +410,7 @@ M4OSA_ERR M4MCS_intApplyVPP(M4VPP_Context pContext, M4VIFI_ImagePlane* pPlaneIn,
{
if(pImagePlanesTemp[i].pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)
+ free(
pImagePlanesTemp[i].pac_data);
pImagePlanesTemp[i].pac_data = M4OSA_NULL;
}
diff --git a/libvideoeditor/vss/src/M4AD_Null.c b/libvideoeditor/vss/src/M4AD_Null.c
index 61ef4c0..5620358 100755
--- a/libvideoeditor/vss/src/M4AD_Null.c
+++ b/libvideoeditor/vss/src/M4AD_Null.c
@@ -86,7 +86,7 @@ M4OSA_ERR M4AD_NULL_create( M4AD_Context* pContext,
M4OSA_DEBUG_IF1((pStreamHandler == 0), M4ERR_PARAMETER,
"M4AD_NULL_create: invalid pointer pStreamHandler");
- pC = (M4AD_NullContext*)M4OSA_malloc(sizeof(M4AD_NullContext),
+ pC = (M4AD_NullContext*)M4OSA_32bitAlignedMalloc(sizeof(M4AD_NullContext),
M4DECODER_AUDIO, (M4OSA_Char *)"M4AD_NullContext");
if (pC == (M4AD_NullContext*)0)
{
@@ -118,7 +118,7 @@ M4OSA_ERR M4AD_NULL_destroy(M4AD_Context context)
M4OSA_DEBUG_IF1((context == M4OSA_NULL), M4ERR_PARAMETER, "M4AD_NULL_destroy: invalid context");
- M4OSA_free((M4OSA_MemAddr32)pC);
+ free(pC);
return M4NO_ERROR;
}
@@ -234,7 +234,7 @@ M4OSA_ERR M4AD_NULL_getVersion(M4_VersionInfo* pVersionInfo)
*/
M4OSA_ERR M4AD_NULL_getInterface( M4AD_Type *pDecoderType, M4AD_Interface **pDecoderInterface)
{
- *pDecoderInterface = ( M4AD_Interface*)M4OSA_malloc( sizeof(M4AD_Interface),
+ *pDecoderInterface = ( M4AD_Interface*)M4OSA_32bitAlignedMalloc( sizeof(M4AD_Interface),
M4DECODER_AUDIO, (M4OSA_Char *)"M4AD_Interface" );
if (M4OSA_NULL == *pDecoderInterface)
{
diff --git a/libvideoeditor/vss/src/M4AIR_API.c b/libvideoeditor/vss/src/M4AIR_API.c
index a4ac9dd..cb423e0 100755
--- a/libvideoeditor/vss/src/M4AIR_API.c
+++ b/libvideoeditor/vss/src/M4AIR_API.c
@@ -128,7 +128,7 @@ M4OSA_ERR M4AIR_create(M4OSA_Context* pContext,M4AIR_InputFormatType inputFormat
*pContext = M4OSA_NULL ;
/* Internal Context creation */
- pC = (M4AIR_InternalContext*)M4OSA_malloc(sizeof(M4AIR_InternalContext),
+ pC = (M4AIR_InternalContext*)M4OSA_32bitAlignedMalloc(sizeof(M4AIR_InternalContext),
M4AIR,(M4OSA_Char *)"AIR internal context") ;
M4ERR_CHECK_NULL_RETURN_VALUE(M4ERR_ALLOC, pC) ;
@@ -162,7 +162,7 @@ M4AIR_create_cleanup:
/* Error management : we destroy the context if needed */
if(M4OSA_NULL != pC)
{
- M4OSA_free((M4OSA_MemAddr32)pC) ;
+ free(pC) ;
}
*pContext = M4OSA_NULL ;
@@ -193,7 +193,7 @@ M4OSA_ERR M4AIR_cleanUp(M4OSA_Context pContext)
{
return M4ERR_STATE;
}
- M4OSA_free((M4OSA_MemAddr32)pC) ;
+ free(pC) ;
return M4NO_ERROR ;
diff --git a/libvideoeditor/vss/src/M4AMRR_CoreReader.c b/libvideoeditor/vss/src/M4AMRR_CoreReader.c
index 14f5271..8871e75 100755
--- a/libvideoeditor/vss/src/M4AMRR_CoreReader.c
+++ b/libvideoeditor/vss/src/M4AMRR_CoreReader.c
@@ -178,7 +178,7 @@ M4OSA_ERR M4AMRR_openRead(M4OSA_Context* pContext, M4OSA_Void* pFileDescriptor,
M4OSA_DEBUG_IF2((M4OSA_NULL == pContext),M4ERR_PARAMETER,"Context M4OSA_NULL");
M4OSA_DEBUG_IF2((M4OSA_NULL == pFileDescriptor),M4ERR_PARAMETER,"File Desc. M4OSA_NULL");
- M4_Token = (M4OSA_Char*)M4OSA_malloc(sizeof(M4OSA_MemAddr32)*3, M4AMR_READER,
+ M4_Token = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_MemAddr32)*3, M4AMR_READER,
(M4OSA_Char *)("M4_Token"));
if(M4OSA_NULL == M4_Token)
{
@@ -186,11 +186,11 @@ M4OSA_ERR M4AMRR_openRead(M4OSA_Context* pContext, M4OSA_Void* pFileDescriptor,
return M4ERR_ALLOC ;
}
- pStreamContext= (M4_AMRR_Context*)M4OSA_malloc(sizeof(M4_AMRR_Context), M4AMR_READER,
+ pStreamContext= (M4_AMRR_Context*)M4OSA_32bitAlignedMalloc(sizeof(M4_AMRR_Context), M4AMR_READER,
(M4OSA_Char *)("pStreamContext"));
if(M4OSA_NULL == pStreamContext)
{
- M4OSA_free((M4OSA_MemAddr32)M4_Token);
+ free(M4_Token);
*pContext = M4OSA_NULL ;
return M4ERR_ALLOC ;
}
@@ -211,8 +211,8 @@ M4OSA_ERR M4AMRR_openRead(M4OSA_Context* pContext, M4OSA_Void* pFileDescriptor,
if ( err != M4NO_ERROR )
{
/* M4OSA_DEBUG_IF3((err != M4NO_ERROR),err,"File open failed"); */
- M4OSA_free((M4OSA_MemAddr32)pStreamContext);
- M4OSA_free((M4OSA_MemAddr32)M4_Token);
+ free(pStreamContext);
+ free(M4_Token);
*pContext = M4OSA_NULL ;
return err ;
}
@@ -266,7 +266,7 @@ M4OSA_ERR M4AMRR_openRead(M4OSA_Context* pContext, M4OSA_Void* pFileDescriptor,
/* No Profile level defined */
pStreamContext->m_status = M4AMRR_kOpened;
- M4OSA_free((M4OSA_MemAddr32)M4_Token);
+ free(M4_Token);
*pContext = pStreamContext ;
return M4NO_ERROR;
@@ -277,8 +277,8 @@ cleanup:
pStreamContext->m_pOsaFilePtrFct->closeRead(pStreamContext->m_pAMRFile);
}
- M4OSA_free((M4OSA_MemAddr32)M4_Token);
- M4OSA_free((M4OSA_MemAddr32)pStreamContext);
+ free(M4_Token);
+ free(pStreamContext);
*pContext = M4OSA_NULL ;
@@ -350,7 +350,7 @@ M4OSA_ERR M4AMRR_getNextStream(M4OSA_Context Context, M4SYS_StreamDescription* p
M4OSA_TIME_SET_UNKNOWN(pStreamDesc->duration);
pStreamContext->m_pStreamHandler =
- (M4SYS_StreamDescription*)M4OSA_malloc(sizeof(M4SYS_StreamDescription),
+ (M4SYS_StreamDescription*)M4OSA_32bitAlignedMalloc(sizeof(M4SYS_StreamDescription),
M4AMR_READER, (M4OSA_Char *)("pStreamContext->m_pStreamHandler"));
if(M4OSA_NULL == pStreamContext->m_pStreamHandler)
{
@@ -441,7 +441,7 @@ M4OSA_ERR M4AMRR_startReading(M4OSA_Context Context, M4SYS_StreamID* pStreamIDs
{
size = pStreamContext->m_maxAuSize ;
/* dataAddress is owned by Parser, application should not delete or free it */
- pStreamContext->m_pdataAddress =(M4OSA_MemAddr32)M4OSA_malloc(size + (4 - size % 4),
+ pStreamContext->m_pdataAddress =(M4OSA_MemAddr32)M4OSA_32bitAlignedMalloc(size + (4 - size % 4),
M4AMR_READER, (M4OSA_Char *)("pStreamContext->m_pdataAddress"));
if(M4OSA_NULL == pStreamContext->m_pdataAddress)
{
@@ -611,7 +611,7 @@ M4OSA_ERR M4AMRR_seek(M4OSA_Context Context, M4SYS_StreamID* pStreamID, M4OSA_Ti
count = 0 ;
pStreamContext->m_pSeekIndex =
- (M4OSA_UInt32*)M4OSA_malloc(M4AMRR_NUM_SEEK_ENTRIES * sizeof(M4OSA_UInt32),
+ (M4OSA_UInt32*)M4OSA_32bitAlignedMalloc(M4AMRR_NUM_SEEK_ENTRIES * sizeof(M4OSA_UInt32),
M4AMR_READER, (M4OSA_Char *)("pStreamContext->m_pSeekIndex"));
if(M4OSA_NULL == pStreamContext->m_pSeekIndex)
@@ -834,23 +834,23 @@ M4OSA_ERR M4AMRR_closeRead(M4OSA_Context Context)
/* Check if AU data Address is allocated memory and free it */
if(M4OSA_NULL != pStreamContext->m_pdataAddress)
{
- M4OSA_free((M4OSA_MemAddr32)pStreamContext->m_pdataAddress);
+ free(pStreamContext->m_pdataAddress);
}
/* Check if the stream handler is allocated memory */
if(M4OSA_NULL != pStreamContext->m_pStreamHandler)
{
- M4OSA_free((M4OSA_MemAddr32)pStreamContext->m_pStreamHandler);
+ free(pStreamContext->m_pStreamHandler);
}
/* Seek table is created only when seek is used, so check if memory is allocated */
if(M4OSA_NULL != pStreamContext->m_pSeekIndex)
{
- M4OSA_free((M4OSA_MemAddr32)pStreamContext->m_pSeekIndex);
+ free(pStreamContext->m_pSeekIndex);
}
/* Free the context */
- M4OSA_free((M4OSA_MemAddr32)pStreamContext);
+ free(pStreamContext);
return M4NO_ERROR ;
}
diff --git a/libvideoeditor/vss/src/M4PCMR_CoreReader.c b/libvideoeditor/vss/src/M4PCMR_CoreReader.c
index b64b3c7..efde770 100755
--- a/libvideoeditor/vss/src/M4PCMR_CoreReader.c
+++ b/libvideoeditor/vss/src/M4PCMR_CoreReader.c
@@ -76,7 +76,7 @@ M4OSA_ERR M4PCMR_openRead(M4OSA_Context* pContext, M4OSA_Void* pUrl,
/* Allocates the context */
context = M4OSA_NULL;
- context = (M4PCMR_Context *)M4OSA_malloc(sizeof(M4PCMR_Context), M4WAV_READER,
+ context = (M4PCMR_Context *)M4OSA_32bitAlignedMalloc(sizeof(M4PCMR_Context), M4WAV_READER,
(M4OSA_Char *)"M4PCMR_openRead");
if (M4OSA_NULL == context)
{
@@ -141,7 +141,7 @@ M4OSA_ERR M4PCMR_openRead(M4OSA_Context* pContext, M4OSA_Void* pUrl,
context->m_dataStartOffset = 0;
context->m_pFileReadFunc = pFileFunction;
- context->m_pAuBuffer = (M4OSA_MemAddr32)M4OSA_malloc(context->m_blockSize, M4WAV_READER,
+ context->m_pAuBuffer = (M4OSA_MemAddr32)M4OSA_32bitAlignedMalloc(context->m_blockSize, M4WAV_READER,
(M4OSA_Char *)"Core PCM reader Access Unit");
if (M4OSA_NULL == context->m_pAuBuffer)
{
@@ -161,7 +161,7 @@ cleanup:
context->m_pFileReadFunc->closeRead(context->m_fileContext);
/* Free internal context */
- M4OSA_free((M4OSA_MemAddr32)context);
+ free(context);
*pContext = M4OSA_NULL;
return err;
@@ -213,7 +213,7 @@ M4OSA_ERR M4PCMR_getNextStream(M4OSA_Context context, M4SYS_StreamDescription* p
/* Allocates decoder specific info structure */
pStreamDesc->decoderSpecificInfo = M4OSA_NULL;
pStreamDesc->decoderSpecificInfo =
- (M4OSA_MemAddr32)M4OSA_malloc( sizeof(M4PCMC_DecoderSpecificInfo), M4WAV_READER,
+ (M4OSA_MemAddr32)M4OSA_32bitAlignedMalloc( sizeof(M4PCMC_DecoderSpecificInfo), M4WAV_READER,
(M4OSA_Char *)"M4PCMR_getNextStream");
if(pStreamDesc->decoderSpecificInfo == M4OSA_NULL)
{
@@ -569,7 +569,7 @@ M4OSA_ERR M4PCMR_closeRead(M4OSA_Context context)
if(c->m_pDecoderSpecInfo != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)c->m_pDecoderSpecInfo);
+ free(c->m_pDecoderSpecInfo);
}
/* Check Reader's state */
@@ -584,7 +584,7 @@ M4OSA_ERR M4PCMR_closeRead(M4OSA_Context context)
if (M4OSA_NULL != c->m_pAuBuffer)
{
- M4OSA_free((M4OSA_MemAddr32)c->m_pAuBuffer);
+ free(c->m_pAuBuffer);
}
/* Close the file */
@@ -596,7 +596,7 @@ M4OSA_ERR M4PCMR_closeRead(M4OSA_Context context)
/* Free internal context */
if (M4OSA_NULL != c)
{
- M4OSA_free((M4OSA_MemAddr32)c);
+ free(c);
}
return err;
diff --git a/libvideoeditor/vss/src/M4PTO3GPP_API.c b/libvideoeditor/vss/src/M4PTO3GPP_API.c
index b45fb64..c6cb3c2 100755
--- a/libvideoeditor/vss/src/M4PTO3GPP_API.c
+++ b/libvideoeditor/vss/src/M4PTO3GPP_API.c
@@ -169,7 +169,7 @@ M4OSA_ERR M4PTO3GPP_Init( M4PTO3GPP_Context* pContext,
/**
* Allocate the M4PTO3GPP context and return it to the user */
- pC = (M4PTO3GPP_InternalContext*)M4OSA_malloc(sizeof(M4PTO3GPP_InternalContext), M4PTO3GPP,
+ pC = (M4PTO3GPP_InternalContext*)M4OSA_32bitAlignedMalloc(sizeof(M4PTO3GPP_InternalContext), M4PTO3GPP,
(M4OSA_Char *)"M4PTO3GPP_InternalContext");
*pContext = pC;
if (M4OSA_NULL == pC)
@@ -527,7 +527,7 @@ M4OSA_ERR M4PTO3GPP_Open(M4PTO3GPP_Context pContext, M4PTO3GPP_Params* pParams)
/**
* Allocate audio AU used for read operations */
- pC->m_pReaderAudioAU = (M4_AccessUnit*)M4OSA_malloc(sizeof(M4_AccessUnit),
+ pC->m_pReaderAudioAU = (M4_AccessUnit*)M4OSA_32bitAlignedMalloc(sizeof(M4_AccessUnit),
M4PTO3GPP,(M4OSA_Char *)"pReaderAudioAU");
if (M4OSA_NULL == pC->m_pReaderAudioAU)
{
@@ -1143,7 +1143,7 @@ M4OSA_ERR M4PTO3GPP_CleanUp(M4PTO3GPP_Context pContext)
if (M4OSA_NULL != pC->m_pReaderAudioAU)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pReaderAudioAU);
+ free(pC->m_pReaderAudioAU);
pC->m_pReaderAudioAU = M4OSA_NULL;
}
@@ -1162,22 +1162,22 @@ M4OSA_ERR M4PTO3GPP_CleanUp(M4PTO3GPP_Context pContext)
if (M4OSA_NULL != pC->m_pWriterVideoStream)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pWriterVideoStream);
+ free(pC->m_pWriterVideoStream);
pC->m_pWriterVideoStream = M4OSA_NULL;
}
if (M4OSA_NULL != pC->m_pWriterAudioStream)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pWriterAudioStream);
+ free(pC->m_pWriterAudioStream);
pC->m_pWriterAudioStream = M4OSA_NULL;
}
if (M4OSA_NULL != pC->m_pWriterVideoStreamInfo)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pWriterVideoStreamInfo);
+ free(pC->m_pWriterVideoStreamInfo);
pC->m_pWriterVideoStreamInfo = M4OSA_NULL;
}
if (M4OSA_NULL != pC->m_pWriterAudioStreamInfo)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pWriterAudioStreamInfo);
+ free(pC->m_pWriterAudioStreamInfo);
pC->m_pWriterAudioStreamInfo = M4OSA_NULL;
}
@@ -1186,28 +1186,28 @@ M4OSA_ERR M4PTO3GPP_CleanUp(M4PTO3GPP_Context pContext)
* Free the shells interfaces */
if (M4OSA_NULL != pC->m_pReaderGlobInt)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pReaderGlobInt);
+ free(pC->m_pReaderGlobInt);
pC->m_pReaderGlobInt = M4OSA_NULL;
}
if (M4OSA_NULL != pC->m_pReaderDataInt)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pReaderDataInt);
+ free(pC->m_pReaderDataInt);
pC->m_pReaderDataInt = M4OSA_NULL;
}
if(M4OSA_NULL != pC->m_pEncoderInt)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pEncoderInt);
+ free(pC->m_pEncoderInt);
pC->m_pEncoderInt = M4OSA_NULL;
}
if(M4OSA_NULL != pC->m_pWriterGlobInt)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pWriterGlobInt);
+ free(pC->m_pWriterGlobInt);
pC->m_pWriterGlobInt = M4OSA_NULL;
}
if(M4OSA_NULL != pC->m_pWriterDataInt)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pWriterDataInt);
+ free(pC->m_pWriterDataInt);
pC->m_pWriterDataInt = M4OSA_NULL;
}
/**< Do not free pC->pOsaMemoryPtrFct and pC->pOsaMemoryPtrFct, because it's owned by the \
@@ -1215,7 +1215,7 @@ M4OSA_ERR M4PTO3GPP_CleanUp(M4PTO3GPP_Context pContext)
/**
* Free the context itself */
- M4OSA_free((M4OSA_MemAddr32)pC);
+ free(pC);
pC = M4OSA_NULL;
M4OSA_TRACE3_0("M4PTO3GPP_CleanUp(): returning M4NO_ERROR");
@@ -1564,7 +1564,7 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
/**
* Allocate and fill the video stream structures for the writer */
pC->m_pWriterVideoStream =
- (M4SYS_StreamDescription*)M4OSA_malloc(sizeof(M4SYS_StreamDescription), M4PTO3GPP,
+ (M4SYS_StreamDescription*)M4OSA_32bitAlignedMalloc(sizeof(M4SYS_StreamDescription), M4PTO3GPP,
(M4OSA_Char *)"pWriterVideoStream");
if (M4OSA_NULL == pC->m_pWriterVideoStream)
{
@@ -1573,7 +1573,7 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
return M4ERR_ALLOC;
}
pC->m_pWriterVideoStreamInfo =
- (M4WRITER_StreamVideoInfos*)M4OSA_malloc(sizeof(M4WRITER_StreamVideoInfos), M4PTO3GPP,
+ (M4WRITER_StreamVideoInfos*)M4OSA_32bitAlignedMalloc(sizeof(M4WRITER_StreamVideoInfos), M4PTO3GPP,
(M4OSA_Char *)"pWriterVideoStreamInfo");
if (M4OSA_NULL == pC->m_pWriterVideoStreamInfo)
{
@@ -1672,7 +1672,7 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
if(M4OSA_NULL != pC->m_pReaderAudioStream)
{
pC->m_pWriterAudioStream =
- (M4SYS_StreamDescription*)M4OSA_malloc(sizeof(M4SYS_StreamDescription), M4PTO3GPP,
+ (M4SYS_StreamDescription*)M4OSA_32bitAlignedMalloc(sizeof(M4SYS_StreamDescription), M4PTO3GPP,
(M4OSA_Char *)"pWriterAudioStream");
if (M4OSA_NULL == pC->m_pWriterAudioStream)
{
@@ -1681,7 +1681,7 @@ M4OSA_ERR M4PTO3GPP_Ready4Processing(M4PTO3GPP_InternalContext* pC)
return M4ERR_ALLOC;
}
pC->m_pWriterAudioStreamInfo =
- (M4WRITER_StreamAudioInfos*)M4OSA_malloc(sizeof(M4WRITER_StreamAudioInfos), M4PTO3GPP,
+ (M4WRITER_StreamAudioInfos*)M4OSA_32bitAlignedMalloc(sizeof(M4WRITER_StreamAudioInfos), M4PTO3GPP,
(M4OSA_Char *)"pWriterAudioStreamInfo");
if (M4OSA_NULL == pC->m_pWriterAudioStreamInfo)
{
diff --git a/libvideoeditor/vss/src/M4READER_Amr.c b/libvideoeditor/vss/src/M4READER_Amr.c
index 32bf9cf..9d4af88 100755
--- a/libvideoeditor/vss/src/M4READER_Amr.c
+++ b/libvideoeditor/vss/src/M4READER_Amr.c
@@ -71,7 +71,7 @@ M4OSA_ERR M4READER_AMR_create(M4OSA_Context *pContext)
M4OSA_DEBUG_IF1((pContext == 0), M4ERR_PARAMETER,
"M4READER_AMR_create: invalid context pointer");
- pReaderContext = (M4READER_AMR_Context*)M4OSA_malloc(sizeof(M4READER_AMR_Context),
+ pReaderContext = (M4READER_AMR_Context*)M4OSA_32bitAlignedMalloc(sizeof(M4READER_AMR_Context),
M4READER_AMR, (M4OSA_Char *)"M4READER_AMR_Context");
if (pReaderContext == M4OSA_NULL)
{
@@ -117,7 +117,7 @@ M4OSA_ERR M4READER_AMR_destroy(M4OSA_Context context)
return M4ERR_PARAMETER;
}
- M4OSA_free((M4OSA_MemAddr32)pC);
+ free(pC);
return M4NO_ERROR;
}
@@ -205,7 +205,7 @@ M4OSA_ERR M4READER_AMR_close(M4OSA_Context context)
/* Delete the DSI if needed */
if(M4OSA_NULL != pC->m_pAudioStream->m_basicProperties.m_pDecoderSpecificInfo)
{
- M4OSA_free((M4OSA_MemAddr32)\
+ free(\
pC->m_pAudioStream->m_basicProperties.m_pDecoderSpecificInfo);
pC->m_pAudioStream->m_basicProperties.m_decoderSpecificInfoSize = 0;
@@ -213,7 +213,7 @@ M4OSA_ERR M4READER_AMR_close(M4OSA_Context context)
}
/* Finally destroy the stream handler */
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioStream);
+ free(pC->m_pAudioStream);
pC->m_pAudioStream = M4OSA_NULL;
}
@@ -279,7 +279,7 @@ M4OSA_ERR M4READER_AMR_getNextStream(M4OSA_Context context, M4READER_MediaFamily
*pMediaFamily = M4READER_kMediaFamilyAudio;
- pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_malloc(sizeof(M4_AudioStreamHandler),
+ pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_32bitAlignedMalloc(sizeof(M4_AudioStreamHandler),
M4READER_AMR, (M4OSA_Char *)"M4_AudioStreamHandler");
if (pAudioStreamHandler == M4OSA_NULL)
{
@@ -758,18 +758,18 @@ M4OSA_ERR M4READER_AMR_getInterfaces(M4READER_MediaType *pMediaType,
"M4READER_AMR_getInterfaces: invalid pointer to M4READER_DataInterface");
*pRdrGlobalInterface =
- (M4READER_GlobalInterface*)M4OSA_malloc( sizeof(M4READER_GlobalInterface),
+ (M4READER_GlobalInterface*)M4OSA_32bitAlignedMalloc( sizeof(M4READER_GlobalInterface),
M4READER_AMR, (M4OSA_Char *)"M4READER_GlobalInterface" );
if (M4OSA_NULL == *pRdrGlobalInterface)
{
*pRdrDataInterface = M4OSA_NULL;
return M4ERR_ALLOC;
}
- *pRdrDataInterface = (M4READER_DataInterface*)M4OSA_malloc( sizeof(M4READER_DataInterface),
+ *pRdrDataInterface = (M4READER_DataInterface*)M4OSA_32bitAlignedMalloc( sizeof(M4READER_DataInterface),
M4READER_AMR, (M4OSA_Char *)"M4READER_DataInterface");
if (M4OSA_NULL == *pRdrDataInterface)
{
- M4OSA_free((M4OSA_MemAddr32)*pRdrGlobalInterface);
+ free(*pRdrGlobalInterface);
*pRdrGlobalInterface = M4OSA_NULL;
return M4ERR_ALLOC;
}
diff --git a/libvideoeditor/vss/src/M4READER_Pcm.c b/libvideoeditor/vss/src/M4READER_Pcm.c
index 5604983..627d135 100755
--- a/libvideoeditor/vss/src/M4READER_Pcm.c
+++ b/libvideoeditor/vss/src/M4READER_Pcm.c
@@ -66,7 +66,7 @@ M4OSA_ERR M4READER_PCM_create(M4OSA_Context* pContext)
M4OSA_DEBUG_IF1((pContext == 0), M4ERR_PARAMETER,
"M4READER_PCM_create: invalid context pointer");
- pReaderContext = (M4READER_PCM_Context*)M4OSA_malloc(sizeof(M4READER_PCM_Context),
+ pReaderContext = (M4READER_PCM_Context*)M4OSA_32bitAlignedMalloc(sizeof(M4READER_PCM_Context),
M4READER_WAV, (M4OSA_Char *)"M4READER_PCM_Context");
if (pReaderContext == M4OSA_NULL)
{
@@ -100,7 +100,7 @@ M4OSA_ERR M4READER_PCM_destroy(M4OSA_Context context)
M4OSA_DEBUG_IF1((M4OSA_NULL == pC), M4ERR_PARAMETER,
"M4READER_PCM_destroy: invalid context pointer");
- M4OSA_free((M4OSA_MemAddr32)pC);
+ free(pC);
return M4NO_ERROR;
}
@@ -163,7 +163,7 @@ M4OSA_ERR M4READER_PCM_close(M4OSA_Context context)
return err;
}
}
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioStream);
+ free(pC->m_pAudioStream);
pC->m_pAudioStream = M4OSA_NULL;
}
@@ -348,7 +348,7 @@ M4OSA_ERR M4READER_PCM_getNextStream(M4OSA_Context context, M4READER_MediaFamily
return M4NO_ERROR;
}
- pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_malloc(sizeof(M4_AudioStreamHandler),
+ pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_32bitAlignedMalloc(sizeof(M4_AudioStreamHandler),
M4READER_WAV, (M4OSA_Char *)"M4_AudioStreamHandler");
if (pAudioStreamHandler == M4OSA_NULL)
{
@@ -680,18 +680,18 @@ M4OSA_ERR M4READER_PCM_getInterfaces(M4READER_MediaType *pMediaType,
"M4READER_PCM_getInterfaces: invalid pointer to M4READER_DataInterface");
*pRdrGlobalInterface =
- (M4READER_GlobalInterface*)M4OSA_malloc( sizeof(M4READER_GlobalInterface), M4READER_WAV,
+ (M4READER_GlobalInterface*)M4OSA_32bitAlignedMalloc( sizeof(M4READER_GlobalInterface), M4READER_WAV,
(M4OSA_Char *)"M4READER_PCM GlobalInterface");
if (M4OSA_NULL == *pRdrGlobalInterface)
{
return M4ERR_ALLOC;
}
*pRdrDataInterface =
- (M4READER_DataInterface*)M4OSA_malloc( sizeof(M4READER_DataInterface), M4READER_WAV,
+ (M4READER_DataInterface*)M4OSA_32bitAlignedMalloc( sizeof(M4READER_DataInterface), M4READER_WAV,
(M4OSA_Char *) "M4READER_PCM DataInterface");
if (M4OSA_NULL == *pRdrDataInterface)
{
- M4OSA_free((M4OSA_MemAddr32)*pRdrGlobalInterface);
+ free(*pRdrGlobalInterface);
return M4ERR_ALLOC;
}
diff --git a/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c b/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c
index 5ea6d46..21ed89d 100644..100755
--- a/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c
+++ b/libvideoeditor/vss/src/M4VD_EXTERNAL_Interface.c
@@ -111,7 +111,7 @@ M4OSA_ERR M4DECODER_EXTERNAL_getInterface(M4DECODER_VideoInterface **pDecoderInt
{
/* Allocates memory for the decoder shell pointer to function */
*pDecoderInterface =
- (M4DECODER_VideoInterface*)M4OSA_malloc( sizeof(M4DECODER_VideoInterface),
+ (M4DECODER_VideoInterface*)M4OSA_32bitAlignedMalloc( sizeof(M4DECODER_VideoInterface),
M4DECODER_EXTERNAL, (M4OSA_Char *)"M4DECODER_VideoInterface" );
if (M4OSA_NULL == *pDecoderInterface)
{
@@ -282,7 +282,7 @@ static M4OSA_ERR M4DECODER_EXTERNAL_destroy(M4OSA_Context pVS_Context)
if(M4OSA_NULL != pStreamContext->m_pStreamInfo)
{
- M4OSA_free((M4OSA_MemAddr32)pStreamContext->m_pStreamInfo);
+ free(pStreamContext->m_pStreamInfo);
pStreamContext->m_pStreamInfo = M4OSA_NULL;
}
@@ -293,7 +293,7 @@ static M4OSA_ERR M4DECODER_EXTERNAL_destroy(M4OSA_Context pVS_Context)
}
#endif /* not M4DECODER_EXTERNAL_SYNC_EXT_DECODE */
- M4OSA_free((M4OSA_MemAddr32)pStreamContext);
+ free(pStreamContext);
pStreamContext = M4OSA_NULL;
}
@@ -659,7 +659,7 @@ static M4OSA_ERR M4DECODER_EXTERNAL_Init(M4OSA_Context* pVS_Context,
/* Allocate the internal context */
*pVS_Context = M4OSA_NULL;
- pStreamContext = (M4VS_VideoDecoder_Context*)M4OSA_malloc(sizeof(M4VS_VideoDecoder_Context),
+ pStreamContext = (M4VS_VideoDecoder_Context*)M4OSA_32bitAlignedMalloc(sizeof(M4VS_VideoDecoder_Context),
M4DECODER_EXTERNAL,(M4OSA_Char *) "M4VS_VideoDecoder_Context");
if (M4OSA_NULL == pStreamContext)
{
@@ -746,7 +746,7 @@ static M4OSA_ERR M4DECODER_EXTERNAL_StreamDescriptionInit(M4VD_StreamInfo** ppSt
pVideoStreamHandler = (M4_VideoStreamHandler*)pStreamHandler;
/* M4VD_StreamInfo allocation */
- *ppStreamInfo = (M4VD_StreamInfo*)M4OSA_malloc(sizeof(M4VD_StreamInfo),
+ *ppStreamInfo = (M4VD_StreamInfo*)M4OSA_32bitAlignedMalloc(sizeof(M4VD_StreamInfo),
M4DECODER_EXTERNAL, (M4OSA_Char *)"M4VD_StreamInfo");
if(M4OSA_NULL == *ppStreamInfo)
{
diff --git a/libvideoeditor/vss/src/M4VD_Tools.c b/libvideoeditor/vss/src/M4VD_Tools.c
index 4a737b2..4a737b2 100644..100755
--- a/libvideoeditor/vss/src/M4VD_Tools.c
+++ b/libvideoeditor/vss/src/M4VD_Tools.c
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c b/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c
index d948f4d..786ccbb 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_AudioMixing.c
@@ -135,7 +135,7 @@ M4OSA_ERR M4VSS3GPP_audioMixingInit( M4VSS3GPP_AudioMixingContext *pContext,
/**
* Allocate the VSS audio mixing context and return it to the user */
pC = (M4VSS3GPP_InternalAudioMixingContext
- *)M4OSA_malloc(sizeof(M4VSS3GPP_InternalAudioMixingContext),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_InternalAudioMixingContext),
M4VSS3GPP,(M4OSA_Char *)"M4VSS3GPP_InternalAudioMixingContext");
*pContext = pC;
@@ -574,26 +574,26 @@ M4OSA_ERR M4VSS3GPP_audioMixingCleanUp( M4VSS3GPP_AudioMixingContext pContext )
if( M4OSA_NULL != pC->SsrcScratch )
{
- M4OSA_free((M4OSA_MemAddr32)pC->SsrcScratch);
+ free(pC->SsrcScratch);
pC->SsrcScratch = M4OSA_NULL;
}
if( M4OSA_NULL != pC->pSsrcBufferIn )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pSsrcBufferIn);
+ free(pC->pSsrcBufferIn);
pC->pSsrcBufferIn = M4OSA_NULL;
}
if( M4OSA_NULL != pC->pSsrcBufferOut
&& (M4OSA_TRUE == pC->b_SSRCneeded || pC->ChannelConversion > 0) )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pSsrcBufferOut);
+ free(pC->pSsrcBufferOut);
pC->pSsrcBufferOut = M4OSA_NULL;
}
if( M4OSA_NULL != pC->pTempBuffer )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pTempBuffer);
+ free(pC->pTempBuffer);
pC->pTempBuffer = M4OSA_NULL;
}
@@ -612,7 +612,7 @@ M4OSA_ERR M4VSS3GPP_audioMixingCleanUp( M4VSS3GPP_AudioMixingContext pContext )
/**
* Free the context */
- M4OSA_free((M4OSA_MemAddr32)pContext);
+ free(pContext);
pContext = M4OSA_NULL;
/**
@@ -996,7 +996,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
/**
* Allocate and copy the new DSI */
pC->ewc.pVideoOutputDsi =
- (M4OSA_MemAddr8)M4OSA_malloc(encHeader->Size, M4VSS3GPP,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(encHeader->Size, M4VSS3GPP,
(M4OSA_Char *)"pC->ewc.pVideoOutputDsi (H264)");
if( M4OSA_NULL == pC->ewc.pVideoOutputDsi )
@@ -1073,7 +1073,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
{
/*
- M4OSA_free((M4OSA_MemAddr32)pC->pAddedClipCtxt->pAudioStream->\
+ free(pC->pAddedClipCtxt->pAudioStream->\
m_basicProperties.m_pDecoderSpecificInfo);
*/
pC->pAddedClipCtxt->pAudioStream->
@@ -1708,7 +1708,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
/**
* Allocate buffer for the input of the SSRC */
pC->pSsrcBufferIn =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->minimumBufferIn
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->minimumBufferIn
+ pC->pAddedClipCtxt->
AudioDecBufferOut.
m_bufferSize,
@@ -1727,7 +1727,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
* Allocate buffer for the output of the SSRC */
/* The "3" value below should be optimized ... one day ... */
pC->pSsrcBufferOut =
- (M4OSA_MemAddr8)M4OSA_malloc(3 * pC->iSsrcNbSamplOut * sizeof(short)
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(3 * pC->iSsrcNbSamplOut * sizeof(short)
* pC->ewc.uiNbChannels, M4VSS3GPP, (M4OSA_Char *)"pSsrcBufferOut");
if( M4OSA_NULL == pC->pSsrcBufferOut )
@@ -1745,7 +1745,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
{
/* The "3" value below should be optimized ... one day ... */
pC->pTempBuffer =
- (M4OSA_MemAddr8)M4OSA_malloc(3 * pC->iSsrcNbSamplOut
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(3 * pC->iSsrcNbSamplOut
* sizeof(short) * pC->pAddedClipCtxt->pSettings->
ClipProperties.uiNbChannels, M4VSS3GPP, (M4OSA_Char *)"pSsrcBufferOut");
@@ -1767,7 +1767,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
/**
* Allocate buffer for the input of the SSRC */
pC->pSsrcBufferIn =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->minimumBufferIn
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->minimumBufferIn
+ pC->pAddedClipCtxt->
AudioDecBufferOut.
m_bufferSize,
@@ -1785,7 +1785,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
/**
* Allocate buffer for the output of the SSRC */
/* The "3" value below should be optimized ... one day ... */
- pC->pSsrcBufferOut = (M4OSA_MemAddr8)M4OSA_malloc(
+ pC->pSsrcBufferOut = (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(
pC->pInputClipCtxt->AudioDecBufferOut.m_bufferSize,
M4VSS3GPP, (M4OSA_Char *)"pSsrcBufferOut");
@@ -1830,7 +1830,7 @@ M4VSS3GPP_intAudioMixingOpen( M4VSS3GPP_InternalAudioMixingContext *pC,
/**
* Allocate buffer for the input of the SSRC */
pC->pSsrcBufferIn =
- (M4OSA_MemAddr8)M4OSA_malloc(2 * minbuffer, M4VSS3GPP,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(2 * minbuffer, M4VSS3GPP,
(M4OSA_Char *)"pSsrcBufferIn");
if( M4OSA_NULL == pC->pSsrcBufferIn )
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Clip.c b/libvideoeditor/vss/src/M4VSS3GPP_Clip.c
index 46c0eb1..6311cd6 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_Clip.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_Clip.c
@@ -93,7 +93,7 @@ M4OSA_ERR M4VSS3GPP_intClipInit( M4VSS3GPP_ClipContext ** hClipCtxt,
/**
* Allocate the clip context */
*hClipCtxt =
- (M4VSS3GPP_ClipContext *)M4OSA_malloc(sizeof(M4VSS3GPP_ClipContext),
+ (M4VSS3GPP_ClipContext *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_ClipContext),
M4VSS3GPP, (M4OSA_Char *)"M4VSS3GPP_ClipContext");
if( M4OSA_NULL == *hClipCtxt )
@@ -719,7 +719,7 @@ M4OSA_Void M4VSS3GPP_intClipDeleteAudioTrack( M4VSS3GPP_ClipContext *pClipCtxt )
frame eventually)*/
if( M4OSA_NULL != pClipCtxt->AudioDecBufferOut.m_dataAddress )
{
- M4OSA_free((M4OSA_MemAddr32)pClipCtxt->AudioDecBufferOut.m_dataAddress);
+ free(pClipCtxt->AudioDecBufferOut.m_dataAddress);
pClipCtxt->AudioDecBufferOut.m_dataAddress = M4OSA_NULL;
}
@@ -1334,7 +1334,7 @@ static M4OSA_ERR M4VSS3GPP_intClipPrepareAudioDecoder(
* pClipCtxt->pAudioStream->m_byteSampleSize
* pClipCtxt->pAudioStream->m_nbChannels;
pClipCtxt->AudioDecBufferOut.m_dataAddress =
- (M4OSA_MemAddr8)M4OSA_malloc(pClipCtxt->AudioDecBufferOut.m_bufferSize
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pClipCtxt->AudioDecBufferOut.m_bufferSize
* sizeof(M4OSA_Int16),
M4VSS3GPP, (M4OSA_Char *)"AudioDecBufferOut.m_bufferSize");
@@ -1375,7 +1375,7 @@ M4OSA_ERR M4VSS3GPP_intClipDecodeCurrentAudioFrame(
pClipCtxt->AudioDecBufferOut.m_bufferSize =
pClipCtxt->uiSilencePcmSize;
pClipCtxt->AudioDecBufferOut.m_dataAddress =
- (M4OSA_MemAddr8)M4OSA_malloc(
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(
pClipCtxt->AudioDecBufferOut.m_bufferSize
* sizeof(M4OSA_Int16),
M4VSS3GPP,(M4OSA_Char *) "AudioDecBufferOut.m_bufferSize");
@@ -1655,7 +1655,7 @@ M4OSA_ERR M4VSS3GPP_intClipClose( M4VSS3GPP_ClipContext *pClipCtxt )
* Free the decoded audio buffer */
if( M4OSA_NULL != pClipCtxt->AudioDecBufferOut.m_dataAddress )
{
- M4OSA_free((M4OSA_MemAddr32)pClipCtxt->AudioDecBufferOut.m_dataAddress);
+ free(pClipCtxt->AudioDecBufferOut.m_dataAddress);
pClipCtxt->AudioDecBufferOut.m_dataAddress = M4OSA_NULL;
}
@@ -1750,7 +1750,7 @@ M4OSA_ERR M4VSS3GPP_intClipCleanUp( M4VSS3GPP_ClipContext *pClipCtxt )
* Free the decoded audio buffer */
if( M4OSA_NULL != pClipCtxt->AudioDecBufferOut.m_dataAddress )
{
- M4OSA_free((M4OSA_MemAddr32)pClipCtxt->AudioDecBufferOut.m_dataAddress);
+ free(pClipCtxt->AudioDecBufferOut.m_dataAddress);
pClipCtxt->AudioDecBufferOut.m_dataAddress = M4OSA_NULL;
}
@@ -1812,7 +1812,7 @@ M4OSA_ERR M4VSS3GPP_intClipCleanUp( M4VSS3GPP_ClipContext *pClipCtxt )
M4OSA_TRACE3_1("M4VSS3GPP_intClipCleanUp: pClipCtxt=0x%x", pClipCtxt);
/**
* Free the clip context */
- M4OSA_free((M4OSA_MemAddr32)pClipCtxt);
+ free(pClipCtxt);
return err;
}
@@ -1850,7 +1850,7 @@ M4VSS3GPP_intClipRegisterExternalVideoDecoder( M4VSS3GPP_ClipContext *pClipCtxt,
}
shellUserData =
- (M4DECODER_EXTERNAL_UserDataType)M4OSA_malloc(sizeof(*shellUserData),
+ (M4DECODER_EXTERNAL_UserDataType)M4OSA_32bitAlignedMalloc(sizeof(*shellUserData),
M4VSS3GPP, (M4OSA_Char *)"userData structure for the external shell decoder");
if( M4OSA_NULL == shellUserData )
@@ -1872,7 +1872,7 @@ M4VSS3GPP_intClipRegisterExternalVideoDecoder( M4VSS3GPP_ClipContext *pClipCtxt,
"M4VSS3GPP_intClipRegisterExternalVideoDecoder:\
M4DECODER_EXTERNAL_getInterface failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)shellUserData);
+ free(shellUserData);
return err;
}
@@ -1885,8 +1885,8 @@ M4VSS3GPP_intClipRegisterExternalVideoDecoder( M4VSS3GPP_ClipContext *pClipCtxt,
"M4VSS3GPP_intClipRegisterExternalVideoDecoder:\
M4VSS3GPP_registerVideoDecoder failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)shellInterface);
- M4OSA_free((M4OSA_MemAddr32)shellUserData);
+ free(shellInterface);
+ free(shellUserData);
return err;
}
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Codecs.c b/libvideoeditor/vss/src/M4VSS3GPP_Codecs.c
index 6a523c7..3fe3a1d 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_Codecs.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_Codecs.c
@@ -218,7 +218,7 @@ M4OSA_ERR M4VSS3GPP_registerVideoEncoder( M4VSS3GPP_MediaAndCodecCtxt *pC,
#endif
- M4OSA_free((M4OSA_MemAddr32)pC->pVideoEncoderInterface[MediaType]);
+ free(pC->pVideoEncoderInterface[MediaType]);
#ifdef M4VSS_SUPPORT_OMX_CODECS
}
@@ -277,7 +277,7 @@ M4OSA_ERR M4VSS3GPP_registerAudioEncoder( M4VSS3GPP_MediaAndCodecCtxt *pC,
if( pC->pAudioEncoderInterface[MediaType] != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pAudioEncoderInterface[MediaType]);
+ free(pC->pAudioEncoderInterface[MediaType]);
pC->pAudioEncoderInterface[MediaType] = M4OSA_NULL;
}
/*
@@ -385,8 +385,7 @@ M4OSA_ERR M4VSS3GPP_registerVideoDecoder( M4VSS3GPP_MediaAndCodecCtxt *pC,
#endif
- M4OSA_free(
- (M4OSA_MemAddr32)pC->m_pVideoDecoderItTable[decoderType]);
+ free(pC->m_pVideoDecoderItTable[decoderType]);
#ifdef M4VSS_SUPPORT_OMX_CODECS
}
@@ -397,8 +396,7 @@ M4OSA_ERR M4VSS3GPP_registerVideoDecoder( M4VSS3GPP_MediaAndCodecCtxt *pC,
/* oh, and don't forget the user data, too. */
if( pC->m_pVideoDecoderUserDataTable[decoderType] != M4OSA_NULL )
{
- M4OSA_free(
- (M4OSA_MemAddr32)pC->m_pVideoDecoderUserDataTable[decoderType]);
+ free(pC->m_pVideoDecoderUserDataTable[decoderType]);
pC->m_pVideoDecoderUserDataTable[decoderType] = M4OSA_NULL;
}
#endif /* are external decoders possible? */
@@ -447,12 +445,12 @@ M4OSA_ERR M4VSS3GPP_registerAudioDecoder( M4VSS3GPP_MediaAndCodecCtxt *pC,
}
if(M4OSA_NULL != pC->m_pAudioDecoderItTable[decoderType])
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioDecoderItTable[decoderType]);
+ free(pC->m_pAudioDecoderItTable[decoderType]);
pC->m_pAudioDecoderItTable[decoderType] = M4OSA_NULL;
if(M4OSA_NULL != pC->m_pAudioDecoderItTable[decoderType])
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioDecoderItTable[decoderType]);
+ free(pC->m_pAudioDecoderItTable[decoderType]);
pC->m_pAudioDecoderItTable[decoderType] = M4OSA_NULL;
}
}
@@ -487,13 +485,13 @@ M4OSA_ERR M4VSS3GPP_unRegisterAllWriters( M4VSS3GPP_MediaAndCodecCtxt *pC )
{
if( pC->WriterInterface[i].pGlobalFcts != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->WriterInterface[i].pGlobalFcts);
+ free(pC->WriterInterface[i].pGlobalFcts);
pC->WriterInterface[i].pGlobalFcts = M4OSA_NULL;
}
if( pC->WriterInterface[i].pDataFcts != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->WriterInterface[i].pDataFcts);
+ free(pC->WriterInterface[i].pDataFcts);
pC->WriterInterface[i].pDataFcts = M4OSA_NULL;
}
}
@@ -532,7 +530,7 @@ M4OSA_ERR M4VSS3GPP_unRegisterAllEncoders( M4VSS3GPP_MediaAndCodecCtxt *pC )
#endif
- M4OSA_free((M4OSA_MemAddr32)pC->pVideoEncoderInterface[i]);
+ free(pC->pVideoEncoderInterface[i]);
#ifdef M4VSS_SUPPORT_OMX_CODECS
}
@@ -557,7 +555,7 @@ M4OSA_ERR M4VSS3GPP_unRegisterAllEncoders( M4VSS3GPP_MediaAndCodecCtxt *pC )
if( M4OSA_FALSE == pC->pAudioEncoderFlag[i] )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pAudioEncoderInterface[i]);
+ free(pC->pAudioEncoderInterface[i]);
}
#ifdef M4VSS_SUPPORT_OMX_CODECS
@@ -595,13 +593,13 @@ M4OSA_ERR M4VSS3GPP_unRegisterAllReaders( M4VSS3GPP_MediaAndCodecCtxt *pC )
{
if( pC->m_pReaderGlobalItTable[i] != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pReaderGlobalItTable[i]);
+ free(pC->m_pReaderGlobalItTable[i]);
pC->m_pReaderGlobalItTable[i] = M4OSA_NULL;
}
if( pC->m_pReaderDataItTable[i] != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pReaderDataItTable[i]);
+ free(pC->m_pReaderDataItTable[i]);
pC->m_pReaderDataItTable[i] = M4OSA_NULL;
}
}
@@ -641,7 +639,7 @@ M4OSA_ERR M4VSS3GPP_unRegisterAllDecoders( M4VSS3GPP_MediaAndCodecCtxt *pC )
#endif
- M4OSA_free((M4OSA_MemAddr32)pC->m_pVideoDecoderItTable[i]);
+ free(pC->m_pVideoDecoderItTable[i]);
#ifdef M4VSS_SUPPORT_OMX_CODECS
}
@@ -654,8 +652,7 @@ M4OSA_ERR M4VSS3GPP_unRegisterAllDecoders( M4VSS3GPP_MediaAndCodecCtxt *pC )
if( pC->m_pVideoDecoderUserDataTable[i] != M4OSA_NULL )
{
- M4OSA_free(
- (M4OSA_MemAddr32)pC->m_pVideoDecoderUserDataTable[i]);
+ free(pC->m_pVideoDecoderUserDataTable[i]);
/* there ought to be a better pattern... right? */
pC->m_pVideoDecoderUserDataTable[i] = M4OSA_NULL;
}
@@ -681,7 +678,7 @@ M4OSA_ERR M4VSS3GPP_unRegisterAllDecoders( M4VSS3GPP_MediaAndCodecCtxt *pC )
if( M4OSA_FALSE == pC->m_pAudioDecoderFlagTable[i] )
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pAudioDecoderItTable[i]);
+ free(pC->m_pAudioDecoderItTable[i]);
}
#ifdef M4VSS_SUPPORT_OMX_CODECS
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
index 7f44a6b..aa5e532 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_Edit.c
@@ -133,7 +133,7 @@ M4OSA_ERR M4VSS3GPP_editInit( M4VSS3GPP_EditContext *pContext,
/**
* Allocate the VSS context and return it to the user */
pC = (M4VSS3GPP_InternalEditContext
- *)M4OSA_malloc(sizeof(M4VSS3GPP_InternalEditContext),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_InternalEditContext),
M4VSS3GPP, (M4OSA_Char *)"M4VSS3GPP_InternalContext");
*pContext = pC;
/* Inialization of context Variables */
@@ -278,11 +278,11 @@ M4VSS3GPP_editCreateClipSettings( M4VSS3GPP_ClipSettings *pClipSettings,
if( M4OSA_NULL != pFile )
{
- //pClipSettings->pFile = (M4OSA_Char*) M4OSA_malloc(strlen(pFile)+1, M4VSS3GPP,
+ //pClipSettings->pFile = (M4OSA_Char*) M4OSA_32bitAlignedMalloc(strlen(pFile)+1, M4VSS3GPP,
// "pClipSettings->pFile");
/*FB: add clip path size because of utf 16 conversion*/
pClipSettings->pFile =
- (M4OSA_Void *)M4OSA_malloc(filePathSize + 1, M4VSS3GPP,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(filePathSize + 1, M4VSS3GPP,
(M4OSA_Char *)"pClipSettings->pFile");
if( M4OSA_NULL == pClipSettings->pFile )
@@ -382,12 +382,12 @@ M4VSS3GPP_editDuplicateClipSettings( M4VSS3GPP_ClipSettings *pClipSettingsDest,
if( M4OSA_NULL != pClipSettingsOrig->pFile )
{
//pClipSettingsDest->pFile =
- // (M4OSA_Char*) M4OSA_malloc(strlen(pClipSettingsOrig->pFile)+1, M4VSS3GPP,
+ // (M4OSA_Char*) M4OSA_32bitAlignedMalloc(strlen(pClipSettingsOrig->pFile)+1, M4VSS3GPP,
// "pClipSettingsDest->pFile");
/*FB: clip path size is needed for utf 16 conversion*/
/*FB 2008/10/16: bad allocation size which raises a crash*/
pClipSettingsDest->pFile =
- (M4OSA_Char *)M4OSA_malloc(pClipSettingsOrig->filePathSize + 1,
+ (M4OSA_Char *)M4OSA_32bitAlignedMalloc(pClipSettingsOrig->filePathSize + 1,
M4VSS3GPP, (M4OSA_Char *)"pClipSettingsDest->pFile");
if( M4OSA_NULL == pClipSettingsDest->pFile )
@@ -414,7 +414,7 @@ M4VSS3GPP_editDuplicateClipSettings( M4VSS3GPP_ClipSettings *pClipSettingsDest,
if( pClipSettingsOrig->nbEffects > 0 )
{
pClipSettingsDest->Effects = (M4VSS3GPP_EffectSettings
- *)M4OSA_malloc(sizeof(M4VSS3GPP_EffectSettings)
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_EffectSettings)
* pClipSettingsOrig->nbEffects,
M4VSS3GPP, "pClipSettingsDest->Effects");
@@ -473,14 +473,14 @@ M4OSA_ERR M4VSS3GPP_editFreeClipSettings(
/* free filename */
if( M4OSA_NULL != pClipSettings->pFile )
{
- M4OSA_free((M4OSA_MemAddr32)pClipSettings->pFile);
+ free(pClipSettings->pFile);
pClipSettings->pFile = M4OSA_NULL;
}
/* free effects settings */
/* if(M4OSA_NULL != pClipSettings->Effects)
{
- M4OSA_free((M4OSA_MemAddr32)pClipSettings->Effects);
+ free(pClipSettings->Effects);
pClipSettings->Effects = M4OSA_NULL;
pClipSettings->nbEffects = 0;
} RC */
@@ -551,7 +551,7 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext,
/**
* Copy the clip list */
pC->pClipList =
- (M4VSS3GPP_ClipSettings *)M4OSA_malloc(sizeof(M4VSS3GPP_ClipSettings)
+ (M4VSS3GPP_ClipSettings *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_ClipSettings)
* pC->uiClipNumber, M4VSS3GPP, (M4OSA_Char *)"pC->pClipList");
if( M4OSA_NULL == pC->pClipList )
@@ -576,7 +576,7 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext,
{
pC->nbEffects = pSettings->nbEffects;
pC->pEffectsList = (M4VSS3GPP_EffectSettings
- *)M4OSA_malloc(sizeof(M4VSS3GPP_EffectSettings) * pC->nbEffects,
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_EffectSettings) * pC->nbEffects,
M4VSS3GPP, (M4OSA_Char *)"pC->pEffectsList");
if( M4OSA_NULL == pC->pEffectsList )
@@ -596,7 +596,7 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext,
/**
* Allocate active effects list RC */
pC->pActiveEffectsList =
- (M4OSA_UInt8 *)M4OSA_malloc(sizeof(M4OSA_UInt8) * pC->nbEffects,
+ (M4OSA_UInt8 *)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_UInt8) * pC->nbEffects,
M4VSS3GPP, (M4OSA_Char *)"pC->pActiveEffectsList");
if( M4OSA_NULL == pC->pActiveEffectsList )
@@ -609,7 +609,7 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext,
/**
* Allocate active effects list */
pC->pActiveEffectsList1 =
- (M4OSA_UInt8 *)M4OSA_malloc(sizeof(M4OSA_UInt8) * pC->nbEffects,
+ (M4OSA_UInt8 *)M4OSA_32bitAlignedMalloc(sizeof(M4OSA_UInt8) * pC->nbEffects,
M4VSS3GPP, (M4OSA_Char *)"pC->pActiveEffectsList");
if (M4OSA_NULL == pC->pActiveEffectsList1)
{
@@ -717,7 +717,7 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext,
* We add a transition of duration 0 at the end of the last clip.
* It will suppress a whole bunch a test latter in the processing... */
pC->pTransitionList = (M4VSS3GPP_TransitionSettings
- *)M4OSA_malloc(sizeof(M4VSS3GPP_TransitionSettings)
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_TransitionSettings)
* (pC->uiClipNumber), M4VSS3GPP, (M4OSA_Char *)"pC->pTransitionList");
if( M4OSA_NULL == pC->pTransitionList )
@@ -1144,7 +1144,7 @@ M4OSA_ERR M4VSS3GPP_editOpen( M4VSS3GPP_EditContext pContext,
/**
* Free before the error checking anyway */
- M4OSA_free((M4OSA_MemAddr32)mp3tagBuffer.m_pData);
+ free(mp3tagBuffer.m_pData);
/**
* Error checking */
@@ -1430,7 +1430,7 @@ M4OSA_ERR M4VSS3GPP_editClose( M4VSS3GPP_EditContext pContext )
* Free the output video DSI, if it has been created */
if( M4OSA_NULL != pC->ewc.pVideoOutputDsi )
{
- M4OSA_free((M4OSA_MemAddr32)pC->ewc.pVideoOutputDsi);
+ free(pC->ewc.pVideoOutputDsi);
pC->ewc.pVideoOutputDsi = M4OSA_NULL;
}
@@ -1438,7 +1438,7 @@ M4OSA_ERR M4VSS3GPP_editClose( M4VSS3GPP_EditContext pContext )
* Free the output audio DSI, if it has been created */
if( M4OSA_NULL != pC->ewc.pAudioOutputDsi )
{
- M4OSA_free((M4OSA_MemAddr32)pC->ewc.pAudioOutputDsi);
+ free(pC->ewc.pAudioOutputDsi);
pC->ewc.pAudioOutputDsi = M4OSA_NULL;
}
@@ -1488,75 +1488,75 @@ M4OSA_ERR M4VSS3GPP_editClose( M4VSS3GPP_EditContext pContext )
* Free the temporary YUV planes */
if( M4OSA_NULL != pC->yuv1[0].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv1[0].pac_data);
+ free(pC->yuv1[0].pac_data);
pC->yuv1[0].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv1[1].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv1[1].pac_data);
+ free(pC->yuv1[1].pac_data);
pC->yuv1[1].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv1[2].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv1[2].pac_data);
+ free(pC->yuv1[2].pac_data);
pC->yuv1[2].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv2[0].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv2[0].pac_data);
+ free(pC->yuv2[0].pac_data);
pC->yuv2[0].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv2[1].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv2[1].pac_data);
+ free(pC->yuv2[1].pac_data);
pC->yuv2[1].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv2[2].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv2[2].pac_data);
+ free(pC->yuv2[2].pac_data);
pC->yuv2[2].pac_data = M4OSA_NULL;
}
/* RC */
if( M4OSA_NULL != pC->yuv3[0].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv3[0].pac_data);
+ free(pC->yuv3[0].pac_data);
pC->yuv3[0].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv3[1].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv3[1].pac_data);
+ free(pC->yuv3[1].pac_data);
pC->yuv3[1].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv3[2].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv3[2].pac_data);
+ free(pC->yuv3[2].pac_data);
pC->yuv3[2].pac_data = M4OSA_NULL;
}
/* RC */
if( M4OSA_NULL != pC->yuv4[0].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv4[0].pac_data);
+ free(pC->yuv4[0].pac_data);
pC->yuv4[0].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv4[1].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv4[1].pac_data);
+ free(pC->yuv4[1].pac_data);
pC->yuv4[1].pac_data = M4OSA_NULL;
}
if( M4OSA_NULL != pC->yuv4[2].pac_data )
{
- M4OSA_free((M4OSA_MemAddr32)pC->yuv4[2].pac_data);
+ free(pC->yuv4[2].pac_data);
pC->yuv4[2].pac_data = M4OSA_NULL;
}
@@ -1564,7 +1564,7 @@ M4OSA_ERR M4VSS3GPP_editClose( M4VSS3GPP_EditContext pContext )
* RC Free effects list */
if( pC->pEffectsList != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pEffectsList);
+ free(pC->pEffectsList);
pC->pEffectsList = M4OSA_NULL;
}
@@ -1572,14 +1572,14 @@ M4OSA_ERR M4VSS3GPP_editClose( M4VSS3GPP_EditContext pContext )
* RC Free active effects list */
if( pC->pActiveEffectsList != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pActiveEffectsList);
+ free(pC->pActiveEffectsList);
pC->pActiveEffectsList = M4OSA_NULL;
}
/**
* Free active effects list */
if(pC->pActiveEffectsList1 != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pC->pActiveEffectsList1);
+ free(pC->pActiveEffectsList1);
pC->pActiveEffectsList1 = M4OSA_NULL;
}
/**
@@ -1641,7 +1641,7 @@ M4OSA_ERR M4VSS3GPP_editCleanUp( M4VSS3GPP_EditContext pContext )
* Free the video encoder dummy AU */
if( M4OSA_NULL != pC->ewc.pDummyAuBuffer )
{
- M4OSA_free((M4OSA_MemAddr32)pC->ewc.pDummyAuBuffer);
+ free(pC->ewc.pDummyAuBuffer);
pC->ewc.pDummyAuBuffer = M4OSA_NULL;
}
@@ -1687,7 +1687,7 @@ M4OSA_ERR M4VSS3GPP_editCleanUp( M4VSS3GPP_EditContext pContext )
/**
* Finally, Free context */
- M4OSA_free((M4OSA_MemAddr32)pC);
+ free(pC);
pC = M4OSA_NULL;
/**
@@ -1792,7 +1792,7 @@ M4VSS3GPP_editRegisterExternalVideoEncoder( M4VSS3GPP_EditContext pContext,
"M4VSS3GPP_editRegisterExternalVideoEncoder:\
M4VSS3GPP_registerVideoEncoder failed with error 0x%08X",
err);
- M4OSA_free((M4OSA_MemAddr32)shellInterface);
+ free(shellInterface);
return err;
}
@@ -2263,7 +2263,7 @@ static M4OSA_Void M4VSS3GPP_intFreeSettingsList(
M4VSS3GPP_editFreeClipSettings(&(pC->pClipList[i]));
}
- M4OSA_free((M4OSA_MemAddr32)pC->pClipList);
+ free(pC->pClipList);
pC->pClipList = M4OSA_NULL;
}
@@ -2271,7 +2271,7 @@ static M4OSA_Void M4VSS3GPP_intFreeSettingsList(
* Free the transition list */
if( M4OSA_NULL != pC->pTransitionList )
{
- M4OSA_free((M4OSA_MemAddr32)pC->pTransitionList);
+ free(pC->pTransitionList);
pC->pTransitionList = M4OSA_NULL;
}
}
@@ -2735,7 +2735,7 @@ M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
* H263 output DSI is always 7 bytes */
pC->ewc.uiVideoOutputDsiSize = 7;
pC->ewc.pVideoOutputDsi =
- (M4OSA_MemAddr8)M4OSA_malloc(pC->ewc.uiVideoOutputDsiSize,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(pC->ewc.uiVideoOutputDsiSize,
M4VSS3GPP, (M4OSA_Char *)"pC->ewc.pVideoOutputDsi (H263)");
if( M4OSA_NULL == pC->ewc.pVideoOutputDsi )
@@ -2935,7 +2935,7 @@ M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
/**
* Allocate and copy the new DSI */
- pC->ewc.pVideoOutputDsi = (M4OSA_MemAddr8)M4OSA_malloc(
+ pC->ewc.pVideoOutputDsi = (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(
pStreamForDsi->m_decoderSpecificInfoSize,
M4VSS3GPP, (M4OSA_Char *)"pC->ewc.pVideoOutputDsi (MPEG4)");
@@ -3023,7 +3023,7 @@ M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
/**
* Allocate and copy the new DSI */
pC->ewc.pVideoOutputDsi =
- (M4OSA_MemAddr8)M4OSA_malloc(encHeader->Size, M4VSS3GPP,
+ (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(encHeader->Size, M4VSS3GPP,
(M4OSA_Char *)"pC->ewc.pVideoOutputDsi (H264)");
if( M4OSA_NULL == pC->ewc.pVideoOutputDsi )
@@ -3105,7 +3105,7 @@ M4VSS3GPP_intComputeOutputVideoAndAudioDsi( M4VSS3GPP_InternalEditContext *pC,
/**
* Allocate and copy the new DSI */
- pC->ewc.pAudioOutputDsi = (M4OSA_MemAddr8)M4OSA_malloc(
+ pC->ewc.pAudioOutputDsi = (M4OSA_MemAddr8)M4OSA_32bitAlignedMalloc(
pStreamForDsi->m_decoderSpecificInfoSize,
M4VSS3GPP, (M4OSA_Char *)"pC->ewc.pAudioOutputDsi");
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_EditAudio.c b/libvideoeditor/vss/src/M4VSS3GPP_EditAudio.c
index 1e2eb99..517746f 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_EditAudio.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_EditAudio.c
@@ -170,7 +170,7 @@ M4OSA_ERR M4VSS3GPP_intEditStepMP3( M4VSS3GPP_InternalEditContext *pC )
(M4OSA_MemAddr8)mp3tagBuffer.m_pData, mp3tagBuffer.m_uiBufferSize);
/**
* Free before the error checking anyway */
- M4OSA_free((M4OSA_MemAddr32)mp3tagBuffer.m_pData);
+ free(mp3tagBuffer.m_pData);
/**
* Error checking */
diff --git a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
index 9161a9a..c2226a7 100755
--- a/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
+++ b/libvideoeditor/vss/src/M4VSS3GPP_EditVideo.c
@@ -1248,14 +1248,14 @@ M4OSA_ERR M4VSS3GPP_intVPP( M4VPP_Context pContext, M4VIFI_ImagePlane *pPlaneIn,
{
if (pTemp2[i].pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pTemp2[i].pac_data);
+ free(pTemp2[i].pac_data);
pTemp2[i].pac_data = M4OSA_NULL;
}
if (pTemp1[i].pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pTemp1[i].pac_data);
+ free(pTemp1[i].pac_data);
pTemp1[i].pac_data = M4OSA_NULL;
}
}
@@ -2540,7 +2540,7 @@ static M4OSA_ERR M4VSS3GPP_intAllocateYUV420( M4VIFI_ImagePlane *pPlanes,
pPlanes[0].u_height = uiHeight;
pPlanes[0].u_stride = uiWidth;
pPlanes[0].u_topleft = 0;
- pPlanes[0].pac_data = (M4VIFI_UInt8 *)M4OSA_malloc(pPlanes[0].u_stride
+ pPlanes[0].pac_data = (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(pPlanes[0].u_stride
* pPlanes[0].u_height, M4VSS3GPP, (M4OSA_Char *)"pPlanes[0].pac_data");
if( M4OSA_NULL == pPlanes[0].pac_data )
@@ -2555,7 +2555,7 @@ static M4OSA_ERR M4VSS3GPP_intAllocateYUV420( M4VIFI_ImagePlane *pPlanes,
pPlanes[1].u_height = pPlanes[0].u_height >> 1;
pPlanes[1].u_stride = pPlanes[1].u_width;
pPlanes[1].u_topleft = 0;
- pPlanes[1].pac_data = (M4VIFI_UInt8 *)M4OSA_malloc(pPlanes[1].u_stride
+ pPlanes[1].pac_data = (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(pPlanes[1].u_stride
* pPlanes[1].u_height, M4VSS3GPP,(M4OSA_Char *) "pPlanes[1].pac_data");
if( M4OSA_NULL == pPlanes[1].pac_data )
@@ -2570,7 +2570,7 @@ static M4OSA_ERR M4VSS3GPP_intAllocateYUV420( M4VIFI_ImagePlane *pPlanes,
pPlanes[2].u_height = pPlanes[1].u_height;
pPlanes[2].u_stride = pPlanes[2].u_width;
pPlanes[2].u_topleft = 0;
- pPlanes[2].pac_data = (M4VIFI_UInt8 *)M4OSA_malloc(pPlanes[2].u_stride
+ pPlanes[2].pac_data = (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(pPlanes[2].u_stride
* pPlanes[2].u_height, M4VSS3GPP, (M4OSA_Char *)"pPlanes[2].pac_data");
if( M4OSA_NULL == pPlanes[2].pac_data )
diff --git a/libvideoeditor/vss/src/M4xVSS_API.c b/libvideoeditor/vss/src/M4xVSS_API.c
index d211a34..bce327d 100755
--- a/libvideoeditor/vss/src/M4xVSS_API.c
+++ b/libvideoeditor/vss/src/M4xVSS_API.c
@@ -84,7 +84,7 @@ M4OSA_ERR M4xVSS_Init( M4OSA_Context *pContext, M4xVSS_InitParams *pParams )
return M4ERR_PARAMETER;
}
- xVSS_context = (M4xVSS_Context *)M4OSA_malloc(sizeof(M4xVSS_Context), M4VS,
+ xVSS_context = (M4xVSS_Context *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_Context), M4VS,
(M4OSA_Char *)"Context of the xVSS layer");
if( xVSS_context == M4OSA_NULL )
@@ -110,7 +110,7 @@ M4OSA_ERR M4xVSS_Init( M4OSA_Context *pContext, M4xVSS_InitParams *pParams )
xVSS_context->UTFConversionContext.m_TempOutConversionSize =
UTF_CONVERSION_BUFFER_SIZE;
xVSS_context->UTFConversionContext.pTempOutConversionBuffer =
- (M4OSA_Void *)M4OSA_malloc(UTF_CONVERSION_BUFFER_SIZE
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(UTF_CONVERSION_BUFFER_SIZE
* sizeof(M4OSA_UInt8),
M4VA, (M4OSA_Char *)"M4xVSS_Init: UTF conversion buffer");
@@ -118,9 +118,9 @@ M4OSA_ERR M4xVSS_Init( M4OSA_Context *pContext, M4xVSS_InitParams *pParams )
== xVSS_context->UTFConversionContext.pTempOutConversionBuffer )
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_Init");
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pTempPath);
+ free(xVSS_context->pTempPath);
xVSS_context->pTempPath = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)xVSS_context);
+ free(xVSS_context);
xVSS_context = M4OSA_NULL;
return M4ERR_ALLOC;
}
@@ -129,9 +129,9 @@ M4OSA_ERR M4xVSS_Init( M4OSA_Context *pContext, M4xVSS_InitParams *pParams )
{
M4OSA_TRACE1_0("M4xVSS_Init: one UTF conversion pointer is null and the other\
is not null");
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pTempPath);
+ free(xVSS_context->pTempPath);
xVSS_context->pTempPath = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)xVSS_context);
+ free(xVSS_context);
xVSS_context = M4OSA_NULL;
return M4ERR_PARAMETER;
}
@@ -151,7 +151,7 @@ M4OSA_ERR M4xVSS_Init( M4OSA_Context *pContext, M4xVSS_InitParams *pParams )
(the conversion customer format into UTF8
is done in VA/VAL)*/
xVSS_context->pTempPath =
- (M4OSA_Void *)M4OSA_malloc(strlen(pParams->pTempPath) + 1,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(strlen(pParams->pTempPath) + 1,
M4VS, (M4OSA_Char *)"xVSS Path for temporary files");
if( xVSS_context->pTempPath == M4OSA_NULL )
@@ -166,21 +166,21 @@ M4OSA_ERR M4xVSS_Init( M4OSA_Context *pContext, M4xVSS_InitParams *pParams )
else
{
M4OSA_TRACE1_0("Path for temporary files is NULL");
- M4OSA_free((M4OSA_MemAddr32)xVSS_context);
+ free(xVSS_context);
xVSS_context = M4OSA_NULL;
return M4ERR_PARAMETER;
}
xVSS_context->pSettings =
- (M4VSS3GPP_EditSettings *)M4OSA_malloc(sizeof(M4VSS3GPP_EditSettings),
+ (M4VSS3GPP_EditSettings *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_EditSettings),
M4VS, (M4OSA_Char *)"Copy of VSS structure");
if( xVSS_context->pSettings == M4OSA_NULL )
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_Init");
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pTempPath);
+ free(xVSS_context->pTempPath);
xVSS_context->pTempPath = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)xVSS_context);
+ free(xVSS_context);
xVSS_context = M4OSA_NULL;
return M4ERR_ALLOC;
}
@@ -662,8 +662,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/* We need to unallocate PCM preview file path in internal context */
if( xVSS_context->pcmPreviewFile != M4OSA_NULL )
{
- M4OSA_free(
- (M4OSA_MemAddr32)xVSS_context->pcmPreviewFile);
+ free(xVSS_context->pcmPreviewFile);
xVSS_context->pcmPreviewFile = M4OSA_NULL;
}
}
@@ -673,7 +672,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/* We need to unallocate PCM preview file path in internal context */
if( xVSS_context->pcmPreviewFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pcmPreviewFile);
+ free(xVSS_context->pcmPreviewFile);
xVSS_context->pcmPreviewFile = M4OSA_NULL;
}
}
@@ -703,7 +702,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
if( pParams->pFileIn != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileIn);
+ free(pParams->pFileIn);
pParams->pFileIn = M4OSA_NULL;
}
@@ -711,7 +710,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
/* Delete temporary file */
remove((const char *)pParams->pFileOut);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileOut);
+ free(pParams->pFileOut);
pParams->pFileOut = M4OSA_NULL;
}
@@ -721,7 +720,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
#ifdef M4xVSS_RESERVED_MOOV_DISK_SPACE
remove((const char *)pParams->pFileTemp);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileTemp);
+ free(pParams->pFileTemp);
#endif /*M4xVSS_RESERVED_MOOV_DISK_SPACE*/
@@ -729,7 +728,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
}
pParams_sauv = pParams;
pParams = pParams->pNext;
- M4OSA_free((M4OSA_MemAddr32)pParams_sauv);
+ free(pParams_sauv);
pParams_sauv = M4OSA_NULL;
}
xVSS_context->pPTo3GPPparamsList = M4OSA_NULL;
@@ -748,7 +747,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
if( pParams->pFileIn != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileIn);
+ free(pParams->pFileIn);
pParams->pFileIn = M4OSA_NULL;
}
@@ -756,7 +755,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
/* Delete temporary file */
remove((const char *)pParams->pFileOut);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileOut);
+ free(pParams->pFileOut);
pParams->pFileOut = M4OSA_NULL;
}
@@ -766,7 +765,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
#ifdef M4xVSS_RESERVED_MOOV_DISK_SPACE
remove((const char *)pParams->pFileTemp);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileTemp);
+ free(pParams->pFileTemp);
#endif /*M4xVSS_RESERVED_MOOV_DISK_SPACE*/
@@ -774,7 +773,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
}
pParams_sauv = pParams;
pParams = pParams->pNext;
- M4OSA_free((M4OSA_MemAddr32)pParams_sauv);
+ free(pParams_sauv);
pParams_sauv = M4OSA_NULL;
}
else
@@ -802,7 +801,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/*Unallocate output file path*/
if( xVSS_context->pSettings->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pSettings->pOutputFile);
+ free(xVSS_context->pSettings->pOutputFile);
xVSS_context->pSettings->pOutputFile = M4OSA_NULL;
}
xVSS_context->pSettings->uiOutputPathSize = 0;
@@ -860,7 +859,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
pSettings->uiOutputPathSize = length;
}
- xVSS_context->pSettings->pOutputFile = (M4OSA_Void *)M4OSA_malloc \
+ xVSS_context->pSettings->pOutputFile = (M4OSA_Void *)M4OSA_32bitAlignedMalloc \
(pSettings->uiOutputPathSize + 1, M4VS,
(M4OSA_Char *)"output file path");
@@ -1056,19 +1055,18 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
if( xVSS_context->pSettings->pClipList != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pSettings->pClipList));
+ free((xVSS_context->pSettings->pClipList));
xVSS_context->pSettings->pClipList = M4OSA_NULL;
}
if( xVSS_context->pSettings->pTransitionList != M4OSA_NULL )
{
- M4OSA_free(
- (M4OSA_MemAddr32)(xVSS_context->pSettings->pTransitionList));
+ free(xVSS_context->pSettings->pTransitionList);
xVSS_context->pSettings->pTransitionList = M4OSA_NULL;
}
xVSS_context->pSettings->pClipList =
- (M4VSS3GPP_ClipSettings ** )M4OSA_malloc \
+ (M4VSS3GPP_ClipSettings ** )M4OSA_32bitAlignedMalloc \
(sizeof(M4VSS3GPP_ClipSettings *)*xVSS_context->pSettings->uiClipNumber,
M4VS, (M4OSA_Char *)"xVSS, copy of pClipList");
@@ -1090,7 +1088,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
xVSS_context->pSettings->pTransitionList =
(M4VSS3GPP_TransitionSettings ** ) \
- M4OSA_malloc(sizeof(M4VSS3GPP_TransitionSettings *) \
+ M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_TransitionSettings *) \
*(xVSS_context->pSettings->uiClipNumber - 1), M4VS, (M4OSA_Char *) \
"xVSS, copy of pTransitionList");
@@ -1131,7 +1129,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
if( 0 < xVSS_context->pSettings->nbEffects )
{
xVSS_context->pSettings->Effects =
- (M4VSS3GPP_EffectSettings *)M4OSA_malloc \
+ (M4VSS3GPP_EffectSettings *)M4OSA_32bitAlignedMalloc \
(xVSS_context->pSettings->nbEffects * sizeof(M4VSS3GPP_EffectSettings),
M4VS, (M4OSA_Char *)"effects settings");
@@ -1184,7 +1182,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
/* Allocate current clip */
xVSS_context->pSettings->pClipList[i] =
- (M4VSS3GPP_ClipSettings *)M4OSA_malloc \
+ (M4VSS3GPP_ClipSettings *)M4OSA_32bitAlignedMalloc \
(sizeof(M4VSS3GPP_ClipSettings), M4VS, (M4OSA_Char *)"clip settings");
if( xVSS_context->pSettings->pClipList[i] == M4OSA_NULL )
@@ -1219,7 +1217,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
xVSS_context->pSettings->pTransitionList[i] =
(M4VSS3GPP_TransitionSettings
- *)M4OSA_malloc(sizeof(M4VSS3GPP_TransitionSettings),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_TransitionSettings),
M4VS, (M4OSA_Char *)"transition settings");
if( xVSS_context->pSettings->pTransitionList[i] == M4OSA_NULL )
@@ -1250,7 +1248,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
provided one */
xVSS_context->pSettings->pTransitionList[i]-> \
xVSS.transitionSpecific.pAlphaMagicSettings =
- (M4xVSS_AlphaMagicSettings *)M4OSA_malloc \
+ (M4xVSS_AlphaMagicSettings *)M4OSA_32bitAlignedMalloc \
(sizeof(M4xVSS_AlphaMagicSettings), M4VS,
(M4OSA_Char *)"Input Alpha magic settings structure");
@@ -1277,7 +1275,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/* Allocate our alpha magic input filename */
xVSS_context->pSettings->pTransitionList[i]-> \
xVSS.transitionSpecific.pAlphaMagicSettings->
- pAlphaFilePath = M4OSA_malloc(
+ pAlphaFilePath = M4OSA_32bitAlignedMalloc(
(strlen(pSettings->pTransitionList[i]-> \
xVSS.transitionSpecific.pAlphaMagicSettings->pAlphaFilePath)
+ 1), M4VS, (M4OSA_Char *)"Alpha magic file path");
@@ -1329,7 +1327,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
alphaSettings =
(M4xVSS_internal_AlphaMagicSettings
- *)M4OSA_malloc(
+ *)M4OSA_32bitAlignedMalloc(
sizeof(
M4xVSS_internal_AlphaMagicSettings),
M4VS,
@@ -1427,7 +1425,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
" TransitionListM4xVSS_SendCommand height! State is %d",
height_ARGB888);
/* Allocate output plane */
- outputPlane = (M4VIFI_ImagePlane *)M4OSA_malloc(3
+ outputPlane = (M4VIFI_ImagePlane *)M4OSA_32bitAlignedMalloc(3
* sizeof(M4VIFI_ImagePlane), M4VS, (M4OSA_Char
*)
"Output plane for Alpha magic transition");
@@ -1448,7 +1446,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
outputPlane[0].u_topleft = 0;
outputPlane[0].u_stride = width;
outputPlane[0].pac_data = (M4VIFI_UInt8
- *)M4OSA_malloc(( width * height * 3)
+ *)M4OSA_32bitAlignedMalloc(( width * height * 3)
>> 1,
M4VS,
(M4OSA_Char
@@ -1458,7 +1456,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
if( outputPlane[0].pac_data == M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)outputPlane);
+ free(outputPlane);
outputPlane = M4OSA_NULL;
M4OSA_TRACE1_0(
"Allocation error in M4xVSS_SendCommand");
@@ -1525,10 +1523,9 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
if( err != M4NO_ERROR )
{
- M4OSA_free(
- (M4OSA_MemAddr32)outputPlane[0].pac_data);
+ free(outputPlane[0].pac_data);
outputPlane[0].pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)outputPlane);
+ free(outputPlane);
outputPlane = M4OSA_NULL;
M4xVSS_freeCommand(xVSS_context);
M4OSA_TRACE1_1(
@@ -1539,7 +1536,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/* Allocate alpha settings structure */
alphaSettings =
- (M4xVSS_internal_AlphaMagicSettings *)M4OSA_malloc(
+ (M4xVSS_internal_AlphaMagicSettings *)M4OSA_32bitAlignedMalloc(
sizeof(M4xVSS_internal_AlphaMagicSettings),
M4VS, (M4OSA_Char
*)"Alpha magic settings structure 2");
@@ -1599,7 +1596,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
{
M4xVSS_internal_SlideTransitionSettings *slideSettings;
slideSettings =
- (M4xVSS_internal_SlideTransitionSettings *)M4OSA_malloc(
+ (M4xVSS_internal_SlideTransitionSettings *)M4OSA_32bitAlignedMalloc(
sizeof(M4xVSS_internal_SlideTransitionSettings),
M4VS, (M4OSA_Char
*)"Internal slide transition settings");
@@ -1745,7 +1742,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/* Allocate last element Pto3GPP params structure */
pParams = (M4xVSS_Pto3GPP_params
- *)M4OSA_malloc(sizeof(M4xVSS_Pto3GPP_params),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_Pto3GPP_params),
M4VS, (M4OSA_Char *)"Element of Pto3GPP Params");
if( pParams == M4OSA_NULL )
@@ -1829,7 +1826,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/**
* End of the UTF conversion, use the converted file path*/
- pParams->pFileIn = (M4OSA_Void *)M4OSA_malloc(length + 1, M4VS,
+ pParams->pFileIn = (M4OSA_Void *)M4OSA_32bitAlignedMalloc(length + 1, M4VS,
(M4OSA_Char *)"Pto3GPP Params: file in");
if( pParams->pFileIn == M4OSA_NULL )
@@ -1898,7 +1895,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/**
* End of the UTF conversion, use the converted file path*/
- pParams->pFileOut = (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ pParams->pFileOut = (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"Pto3GPP Params: file out");
if( pParams->pFileOut == M4OSA_NULL )
@@ -1944,7 +1941,7 @@ M4OSA_ERR M4xVSS_SendCommand( M4OSA_Context pContext,
/**
* End of the UTF conversion, use the converted file path*/
- pParams->pFileTemp = (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ pParams->pFileTemp = (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"Pto3GPP Params: file temp");
if( pParams->pFileTemp == M4OSA_NULL )
@@ -2086,7 +2083,7 @@ replaceJPG_3GP:
if( xVSS_context->pSettings->pClipList[i]->pFile != M4OSA_NULL )
{
- M4OSA_free(xVSS_context->pSettings->pClipList[i]->pFile);
+ free(xVSS_context->pSettings->pClipList[i]->pFile);
xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_NULL;
}
@@ -2122,7 +2119,7 @@ replaceJPG_3GP:
}
/**
* End of the UTF conversion, use the converted file path*/
- xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_malloc((length
+ xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_32bitAlignedMalloc((length
+ 1), M4VS, (M4OSA_Char *)"xVSS file path of jpg to 3gp");
if( xVSS_context->pSettings->pClipList[i]->pFile == M4OSA_NULL )
@@ -2221,7 +2218,7 @@ replaceJPG_3GP:
/* Allocate last element Pto3GPP params structure */
pParams = (M4xVSS_Pto3GPP_params
- *)M4OSA_malloc(sizeof(M4xVSS_Pto3GPP_params),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_Pto3GPP_params),
M4VS, (M4OSA_Char *)"Element of Pto3GPP Params");
if( pParams == M4OSA_NULL )
@@ -2313,7 +2310,7 @@ replaceJPG_3GP:
/**
* End of the UTF conversion, use the converted file path*/
- pParams->pFileIn = (M4OSA_Void *)M4OSA_malloc(length + 1, M4VS,
+ pParams->pFileIn = (M4OSA_Void *)M4OSA_32bitAlignedMalloc(length + 1, M4VS,
(M4OSA_Char *)"Pto3GPP Params: file in");
if( pParams->pFileIn == M4OSA_NULL )
@@ -2382,7 +2379,7 @@ replaceJPG_3GP:
/**
* End of the UTF conversion, use the converted file path*/
- pParams->pFileOut = (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ pParams->pFileOut = (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"Pto3GPP Params: file out");
if( pParams->pFileOut == M4OSA_NULL )
@@ -2428,7 +2425,7 @@ replaceJPG_3GP:
/**
* End of the UTF conversion, use the converted file path*/
- pParams->pFileTemp = (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ pParams->pFileTemp = (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"Pto3GPP Params: file temp");
if( pParams->pFileTemp == M4OSA_NULL )
@@ -2562,7 +2559,7 @@ replaceARGB_3GP:
if( xVSS_context->pSettings->pClipList[i]->pFile != M4OSA_NULL )
{
- M4OSA_free(xVSS_context->pSettings->pClipList[i]->pFile);
+ free(xVSS_context->pSettings->pClipList[i]->pFile);
xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_NULL;
}
@@ -2598,7 +2595,7 @@ replaceARGB_3GP:
}
/**
* End of the UTF conversion, use the converted file path*/
- xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_malloc((length
+ xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_32bitAlignedMalloc((length
+ 1), M4VS, (M4OSA_Char *)"xVSS file path of ARGB to 3gp");
if( xVSS_context->pSettings->pClipList[i]->pFile == M4OSA_NULL )
@@ -2984,7 +2981,7 @@ replaceARGB_3GP:
xVSS_context->tempFileIndex++;
pParams =
- (M4xVSS_MCS_params *)M4OSA_malloc(sizeof(M4xVSS_MCS_params),
+ (M4xVSS_MCS_params *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_MCS_params),
M4VS, (M4OSA_Char *)"Element of MCS Params (for 3GP)");
if( pParams == M4OSA_NULL )
@@ -3283,7 +3280,7 @@ replaceARGB_3GP:
/**
* End of the UTF conversion, use the converted file path*/
pParams->pFileIn =
- (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"MCS 3GP Params: file in");
if( pParams->pFileIn == M4OSA_NULL )
@@ -3329,7 +3326,7 @@ replaceARGB_3GP:
/**
* End of the UTF conversion, use the converted file path*/
pParams->pFileOut =
- (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"MCS 3GP Params: file out");
if( pParams->pFileOut == M4OSA_NULL )
@@ -3378,7 +3375,7 @@ replaceARGB_3GP:
/**
* End of the UTF conversion, use the converted file path*/
pParams->pFileTemp =
- (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"MCS 3GP Params: file temp");
if( pParams->pFileTemp == M4OSA_NULL )
@@ -3442,7 +3439,7 @@ replace3GP_3GP:
if( xVSS_context->pSettings->pClipList[i]->pFile != M4OSA_NULL )
{
- M4OSA_free(xVSS_context->pSettings->pClipList[i]->pFile);
+ free(xVSS_context->pSettings->pClipList[i]->pFile);
xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_NULL;
}
@@ -3479,7 +3476,7 @@ replace3GP_3GP:
}
/**
* End of the UTF conversion, use the converted file path*/
- xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_malloc(
+ xVSS_context->pSettings->pClipList[i]->pFile = M4OSA_32bitAlignedMalloc(
(length + 1),
M4VS, (M4OSA_Char *)"xVSS file path of 3gp to 3gp");
@@ -3604,7 +3601,7 @@ replace3GP_3GP:
if( pSettings->Effects[j].xVSS.pFramingFilePath != M4OSA_NULL )
{
xVSS_context->pSettings->
- Effects[j].xVSS.pFramingFilePath = M4OSA_malloc(
+ Effects[j].xVSS.pFramingFilePath = M4OSA_32bitAlignedMalloc(
strlen(pSettings->Effects[j].xVSS.pFramingFilePath)
+ 1, M4VS, (M4OSA_Char *)"Local Framing file path");
@@ -3631,7 +3628,7 @@ replace3GP_3GP:
#ifdef DECODE_GIF_ON_SAVING
framingCtx = (M4xVSS_FramingContext
- *)M4OSA_malloc(sizeof(M4xVSS_FramingContext),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FramingContext),
M4VS, (M4OSA_Char *)"Context of the framing effect");
if( framingCtx == M4OSA_NULL )
@@ -3710,7 +3707,7 @@ replace3GP_3GP:
{
/*Allocate the alpha blending structure*/
framingCtx->alphaBlendingStruct =
- (M4xVSS_internalEffectsAlphaBlending *)M4OSA_malloc(
+ (M4xVSS_internalEffectsAlphaBlending *)M4OSA_32bitAlignedMalloc(
sizeof(M4xVSS_internalEffectsAlphaBlending),
M4VS, (M4OSA_Char *)"alpha blending structure");
@@ -3774,7 +3771,7 @@ replace3GP_3GP:
/**
* End of the UTF conversion, use the converted file path*/
- framingCtx->pEffectFilePath = M4OSA_malloc(length + 1, M4VS,
+ framingCtx->pEffectFilePath = M4OSA_32bitAlignedMalloc(length + 1, M4VS,
(M4OSA_Char *)"Local Framing file path");
if( framingCtx->pEffectFilePath == M4OSA_NULL )
@@ -3796,7 +3793,7 @@ replace3GP_3GP:
#else
framingCtx = (M4xVSS_FramingStruct
- *)M4OSA_malloc(sizeof(M4xVSS_FramingStruct),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FramingStruct),
M4VS, (M4OSA_Char *)"Context of the framing effect");
if( framingCtx == M4OSA_NULL )
@@ -3838,7 +3835,7 @@ replace3GP_3GP:
framingCtx->aFramingCtx =
(M4xVSS_FramingStruct
- *)M4OSA_malloc(sizeof(M4xVSS_FramingStruct),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FramingStruct),
M4VS,
(M4OSA_Char
*)
@@ -3910,7 +3907,7 @@ replace3GP_3GP:
#ifdef DECODE_GIF_ON_SAVING
framingCtx->aFramingCtx = (M4xVSS_FramingStruct
- *)M4OSA_malloc(sizeof(M4xVSS_FramingStruct),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FramingStruct),
M4VS, (M4OSA_Char *)"Context of the framing effect");
if( framingCtx->aFramingCtx == M4OSA_NULL )
@@ -4008,7 +4005,7 @@ replace3GP_3GP:
#ifdef DECODE_GIF_ON_SAVING
framingCtx = (M4xVSS_FramingContext
- *)M4OSA_malloc(sizeof(M4xVSS_FramingContext),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FramingContext),
M4VS, (M4OSA_Char *)"Context of the framing effect");
if( framingCtx == M4OSA_NULL )
@@ -4046,7 +4043,7 @@ replace3GP_3GP:
framingCtx;
framingCtx->aFramingCtx = (M4xVSS_FramingStruct
- *)M4OSA_malloc(sizeof(M4xVSS_FramingStruct),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FramingStruct),
M4VS, (M4OSA_Char *)"Context of the framing effect");
if( framingCtx->aFramingCtx == M4OSA_NULL )
@@ -4105,7 +4102,7 @@ replace3GP_3GP:
{
/*Allocate the alpha blending structure*/
framingCtx->alphaBlendingStruct =
- (M4xVSS_internalEffectsAlphaBlending *)M4OSA_malloc(
+ (M4xVSS_internalEffectsAlphaBlending *)M4OSA_32bitAlignedMalloc(
sizeof(M4xVSS_internalEffectsAlphaBlending),
M4VS, (M4OSA_Char *)"alpha blending structure");
@@ -4139,7 +4136,7 @@ replace3GP_3GP:
#else
framingCtx = (M4xVSS_FramingStruct
- *)M4OSA_malloc(sizeof(M4xVSS_FramingStruct),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FramingStruct),
M4VS, (M4OSA_Char
*)"Context of the framing effect (for text)");
@@ -4215,12 +4212,12 @@ replace3GP_3GP:
* End of the UTF conversion, use the converted file path*/
xVSS_context->pSettings->
- Effects[j].xVSS.pTextBuffer = M4OSA_malloc(
+ Effects[j].xVSS.pTextBuffer = M4OSA_32bitAlignedMalloc(
xVSS_context->pSettings->Effects[j].xVSS.textBufferSize + 1,
M4VS, (M4OSA_Char *)"Local text buffer effect");
//xVSS_context->pSettings->Effects[j].xVSS.pTextBuffer =
- // M4OSA_malloc(strlen(pSettings->Effects[j].xVSS.pTextBuffer)+1,
+ // M4OSA_32bitAlignedMalloc(strlen(pSettings->Effects[j].xVSS.pTextBuffer)+1,
// M4VS, "Local text buffer effect");
if( xVSS_context->pSettings->Effects[j].xVSS.pTextBuffer
== M4OSA_NULL )
@@ -4246,7 +4243,7 @@ replace3GP_3GP:
/*Allocate the text RGB buffer*/
framingCtx->aFramingCtx->FramingRgb =
- (M4VIFI_ImagePlane *)M4OSA_malloc(sizeof(M4VIFI_ImagePlane),
+ (M4VIFI_ImagePlane *)M4OSA_32bitAlignedMalloc(sizeof(M4VIFI_ImagePlane),
M4VS,
(M4OSA_Char *)"RGB structure for the text effect");
@@ -4284,7 +4281,7 @@ replace3GP_3GP:
2 * framingCtx->aFramingCtx->FramingRgb->u_width;
framingCtx->aFramingCtx->FramingRgb->u_topleft = 0;
framingCtx->aFramingCtx->FramingRgb->pac_data =
- (M4VIFI_UInt8 *)M4OSA_malloc(
+ (M4VIFI_UInt8 *)M4OSA_32bitAlignedMalloc(
framingCtx->aFramingCtx->FramingRgb->u_height
* framingCtx->aFramingCtx->FramingRgb->u_stride,
M4VS, (M4OSA_Char *)"Text RGB plane->pac_data");
@@ -4414,7 +4411,7 @@ replace3GP_3GP:
}
fiftiesCtx = (M4xVSS_FiftiesStruct
- *)M4OSA_malloc(sizeof(M4xVSS_FiftiesStruct),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_FiftiesStruct),
M4VS, (M4OSA_Char *)"Context of the fifties effect");
if( fiftiesCtx == M4OSA_NULL )
@@ -4455,7 +4452,7 @@ replace3GP_3GP:
M4xVSS_ColorStruct *ColorCtx;
ColorCtx =
- (M4xVSS_ColorStruct *)M4OSA_malloc(sizeof(M4xVSS_ColorStruct),
+ (M4xVSS_ColorStruct *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_ColorStruct),
M4VS, (M4OSA_Char *)"Context of the color effect");
if( ColorCtx == M4OSA_NULL )
@@ -4514,19 +4511,17 @@ replace3GP_3GP:
{
if( xVSS_context->pSettings->xVSS.pBGMtrack->pFile != M4OSA_NULL )
{
- M4OSA_free(
- (M4OSA_MemAddr32)xVSS_context->pSettings->xVSS.pBGMtrack->
+ free(xVSS_context->pSettings->xVSS.pBGMtrack->
pFile);
xVSS_context->pSettings->xVSS.pBGMtrack->pFile = M4OSA_NULL;
}
- M4OSA_free(
- (M4OSA_MemAddr32)xVSS_context->pSettings->xVSS.pBGMtrack);
+ free(xVSS_context->pSettings->xVSS.pBGMtrack);
xVSS_context->pSettings->xVSS.pBGMtrack = M4OSA_NULL;
}
/* Allocate BGM */
xVSS_context->pSettings->xVSS.pBGMtrack =
- (M4xVSS_BGMSettings *)M4OSA_malloc(sizeof(M4xVSS_BGMSettings), M4VS,
+ (M4xVSS_BGMSettings *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_BGMSettings), M4VS,
(M4OSA_Char *)"xVSS_context->pSettings->xVSS.pBGMtrack");
if( xVSS_context->pSettings->xVSS.pBGMtrack == M4OSA_NULL )
@@ -4542,7 +4537,7 @@ replace3GP_3GP:
sizeof(M4xVSS_BGMSettings));
/* Allocate file name, and copy file name buffer to our structure */
xVSS_context->pSettings->xVSS.pBGMtrack->pFile =
- M4OSA_malloc((strlen(pSettings->xVSS.pBGMtrack->pFile)
+ M4OSA_32bitAlignedMalloc((strlen(pSettings->xVSS.pBGMtrack->pFile)
+ 1), M4VS, (M4OSA_Char *)"xVSS BGM file path");
if( xVSS_context->pSettings->xVSS.pBGMtrack->pFile == M4OSA_NULL )
@@ -4559,7 +4554,7 @@ replace3GP_3GP:
/* Decode BGM track to pcm output file */
pParams =
- (M4xVSS_MCS_params *)M4OSA_malloc(sizeof(M4xVSS_MCS_params), M4VS,
+ (M4xVSS_MCS_params *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_MCS_params), M4VS,
(M4OSA_Char *)"Element of MCS Params (for BGM)");
if( pParams == M4OSA_NULL )
@@ -4605,7 +4600,7 @@ replace3GP_3GP:
/* Remove this element */
if( pParams_temp->pFileIn != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pParams_temp->pFileIn);
+ free(pParams_temp->pFileIn);
pParams_temp->pFileIn = M4OSA_NULL;
}
@@ -4613,7 +4608,7 @@ replace3GP_3GP:
{
/* Remove PCM temporary file */
remove((const char *)pParams_temp->pFileOut);
- M4OSA_free((M4OSA_MemAddr32)pParams_temp->pFileOut);
+ free(pParams_temp->pFileOut);
pParams_temp->pFileOut = M4OSA_NULL;
}
/* Chain previous element with next element = remove BGM chained
@@ -4644,13 +4639,13 @@ replace3GP_3GP:
if( pParams_temp->pNext != M4OSA_NULL )
{
pParams_prev = pParams_temp->pNext;
- M4OSA_free((M4OSA_MemAddr32)pParams_temp);
+ free(pParams_temp);
pParams_temp = M4OSA_NULL;
pParams_temp = pParams_prev;
}
else
{
- M4OSA_free((M4OSA_MemAddr32)pParams_temp);
+ free(pParams_temp);
pParams_temp = M4OSA_NULL;
}
}
@@ -4742,7 +4737,7 @@ replace3GP_3GP:
/* Prepare output filename */
/* 21 is the size of "preview_16000_2.pcm" + \0 */
out_pcm =
- (M4OSA_Char *)M4OSA_malloc(strlen(xVSS_context->pTempPath)
+ (M4OSA_Char *)M4OSA_32bitAlignedMalloc(strlen(xVSS_context->pTempPath)
+ 21, M4VS, (M4OSA_Char *)"Temp char* for pcmPreviewFile");
if( out_pcm == M4OSA_NULL )
@@ -4783,7 +4778,7 @@ replace3GP_3GP:
{
if( out_pcm != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)out_pcm);
+ free(out_pcm);
out_pcm = M4OSA_NULL;
}
M4xVSS_freeCommand(xVSS_context);
@@ -4822,13 +4817,13 @@ replace3GP_3GP:
/**
* End of the UTF conversion, use the converted file path*/
xVSS_context->pcmPreviewFile =
- (M4OSA_Void *)M4OSA_malloc(length + 1, M4VS,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(length + 1, M4VS,
(M4OSA_Char *)"pcmPreviewFile");
if( xVSS_context->pcmPreviewFile == M4OSA_NULL )
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_SendCommand");
- M4OSA_free((M4OSA_MemAddr32)out_pcm);
+ free(out_pcm);
out_pcm = M4OSA_NULL;
/*FB: to avoid leaks when there is an error in the send command*/
/* Free Send command */
@@ -4841,11 +4836,11 @@ replace3GP_3GP:
/* Free temporary output filename */
if( out_pcm != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)out_pcm);
+ free(out_pcm);
out_pcm = M4OSA_NULL;
}
- pParams->pFileOut = M4OSA_malloc((length + 1), M4VS,
+ pParams->pFileOut = M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"MCS BGM Params: file out");
if( pParams->pFileOut == M4OSA_NULL )
@@ -4862,13 +4857,13 @@ replace3GP_3GP:
#if 0
xVSS_context->pcmPreviewFile =
- (M4OSA_Char *)M4OSA_malloc(strlen(out_pcm) + 1, M4VS,
+ (M4OSA_Char *)M4OSA_32bitAlignedMalloc(strlen(out_pcm) + 1, M4VS,
"pcmPreviewFile");
if( xVSS_context->pcmPreviewFile == M4OSA_NULL )
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_Init");
- M4OSA_free((M4OSA_MemAddr32)out_pcm);
+ free(out_pcm);
out_pcm = M4OSA_NULL;
/*FB: to avoid leaks when there is an error in the send command*/
/* Free Send command */
@@ -4882,7 +4877,7 @@ replace3GP_3GP:
/* Free temporary output filename */
if( out_pcm != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)out_pcm);
+ free(out_pcm);
out_pcm = M4OSA_NULL;
}
@@ -4918,7 +4913,7 @@ replace3GP_3GP:
/**
* End of the UTF conversion, use the converted file path*/
- pParams->pFileIn = (M4OSA_Void *)M4OSA_malloc((length + 1), M4VS,
+ pParams->pFileIn = (M4OSA_Void *)M4OSA_32bitAlignedMalloc((length + 1), M4VS,
(M4OSA_Char *)"MCS BGM Params: file in");
if( pParams->pFileIn == M4OSA_NULL )
@@ -5003,13 +4998,13 @@ replace3GP_3GP:
/* Remove this element */
if( pParams_temp->pFileIn != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pParams_temp->pFileIn);
+ free(pParams_temp->pFileIn);
pParams_temp->pFileIn = M4OSA_NULL;
}
if( pParams_temp->pFileOut != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pParams_temp->pFileOut);
+ free(pParams_temp->pFileOut);
pParams_temp->pFileOut = M4OSA_NULL;
}
/* Chain previous element with next element */
@@ -5024,7 +5019,7 @@ replace3GP_3GP:
if( pParams_temp == xVSS_context->pMCSparamsList
&& pParams_temp->pNext == M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)pParams_temp);
+ free(pParams_temp);
xVSS_context->pMCSparamsList = M4OSA_NULL;
}
/* In that case, BGM pointer is the first one, but there are others
@@ -5033,14 +5028,14 @@ replace3GP_3GP:
else if( pParams_temp->pNext != M4OSA_NULL )
{
xVSS_context->pMCSparamsList = pParams_temp->pNext;
- M4OSA_free((M4OSA_MemAddr32)pParams_temp);
+ free(pParams_temp);
pParams_temp = M4OSA_NULL;
}
/* In all other cases, nothing else to do except freeing the chained
list element */
else
{
- M4OSA_free((M4OSA_MemAddr32)pParams_temp);
+ free(pParams_temp);
pParams_temp = M4OSA_NULL;
}
break;
@@ -5058,11 +5053,10 @@ replace3GP_3GP:
if( xVSS_context->pSettings->xVSS.pBGMtrack->pFile
!= M4OSA_NULL )
{
- M4OSA_free(xVSS_context->pSettings->xVSS.pBGMtrack->pFile);
+ free(xVSS_context->pSettings->xVSS.pBGMtrack->pFile);
xVSS_context->pSettings->xVSS.pBGMtrack->pFile = M4OSA_NULL;
}
- M4OSA_free(
- (M4OSA_MemAddr32)xVSS_context->pSettings->xVSS.pBGMtrack);
+ free(xVSS_context->pSettings->xVSS.pBGMtrack);
xVSS_context->pSettings->xVSS.pBGMtrack = M4OSA_NULL;
}
}
@@ -5365,7 +5359,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pSettings->pOutputFile != M4OSA_NULL )
{
/*it means that pOutputFile has been allocated in M4xVSS_sendCommand()*/
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pSettings->pOutputFile);
+ free(xVSS_context->pSettings->pOutputFile);
xVSS_context->pSettings->pOutputFile = M4OSA_NULL;
xVSS_context->pSettings->uiOutputPathSize = 0;
}
@@ -5394,7 +5388,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
}
xVSS_context->pOutputFile =
- (M4OSA_Void *)M4OSA_malloc(filePathSize + 1, M4VS,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(filePathSize + 1, M4VS,
(M4OSA_Char *)"M4xVSS_SaveStart: output file");
if( xVSS_context->pOutputFile == M4OSA_NULL )
@@ -5414,7 +5408,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
/*FB: Add for UTF conversion: copy the pSettings structure into a new pCurrentEditSettings*/
/*It is the same principle as in the PreviewStart()*/
pEditSavingSettings =
- (M4VSS3GPP_EditSettings *)M4OSA_malloc(sizeof(M4VSS3GPP_EditSettings),
+ (M4VSS3GPP_EditSettings *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_EditSettings),
M4VS, (M4OSA_Char *)"Saving, copy of VSS structure");
if( pEditSavingSettings == M4OSA_NULL )
@@ -5423,7 +5417,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5445,7 +5439,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
/* Allocate savingSettings.pClipList/pTransitions structure */
pEditSavingSettings->pClipList = (M4VSS3GPP_ClipSettings *
- * )M4OSA_malloc(sizeof(M4VSS3GPP_ClipSettings *)
+ * )M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_ClipSettings *)
*pEditSavingSettings->uiClipNumber,
M4VS, (M4OSA_Char *)"xVSS, saving , copy of pClipList");
@@ -5455,7 +5449,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5464,7 +5458,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( pEditSavingSettings->uiClipNumber > 1 )
{
pEditSavingSettings->pTransitionList = (M4VSS3GPP_TransitionSettings *
- * )M4OSA_malloc(sizeof(M4VSS3GPP_TransitionSettings *)
+ * )M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_TransitionSettings *)
*(pEditSavingSettings->uiClipNumber - 1),
M4VS, (M4OSA_Char *)"xVSS, saving, copy of pTransitionList");
@@ -5474,7 +5468,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5488,7 +5482,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
for ( i = 0; i < pEditSavingSettings->uiClipNumber; i++ )
{
pEditSavingSettings->pClipList[i] = (M4VSS3GPP_ClipSettings
- *)M4OSA_malloc(sizeof(M4VSS3GPP_ClipSettings),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_ClipSettings),
M4VS, (M4OSA_Char *)"saving clip settings");
if( pEditSavingSettings->pClipList[i] == M4OSA_NULL )
@@ -5497,7 +5491,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5508,7 +5502,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
{
pEditSavingSettings->pTransitionList[i] =
(M4VSS3GPP_TransitionSettings
- *)M4OSA_malloc(sizeof(M4VSS3GPP_TransitionSettings),
+ *)M4OSA_32bitAlignedMalloc(sizeof(M4VSS3GPP_TransitionSettings),
M4VS, (M4OSA_Char *)"saving transition settings");
if( pEditSavingSettings->pTransitionList[i] == M4OSA_NULL )
@@ -5517,7 +5511,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5567,8 +5561,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free(
- (M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return err;
@@ -5578,10 +5571,10 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
/**
* End of the UTF conversion, use the converted file path*/
- M4OSA_free((M4OSA_MemAddr32)
+ free(
pEditSavingSettings->pClipList[i]->pFile);
pEditSavingSettings->pClipList[i]->pFile = (M4OSA_Void
- *)M4OSA_malloc((length + 1),
+ *)M4OSA_32bitAlignedMalloc((length + 1),
M4VS, (M4OSA_Char *)"saving transition settings");
if( pEditSavingSettings->pClipList[i]->pFile == M4OSA_NULL )
@@ -5590,8 +5583,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free(
- (M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5621,7 +5613,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_PARAMETER;
@@ -5643,7 +5635,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( nbEffects != 0 )
{
pEditSavingSettings->Effects =
- (M4VSS3GPP_EffectSettings *)M4OSA_malloc(nbEffects
+ (M4VSS3GPP_EffectSettings *)M4OSA_32bitAlignedMalloc(nbEffects
* sizeof(M4VSS3GPP_EffectSettings), M4VS, (M4OSA_Char
*)"Saving settings, effects table of structure settings");
@@ -5653,7 +5645,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5690,7 +5682,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
/**/
pEditSavingSettings->xVSS.pBGMtrack =
- (M4xVSS_BGMSettings *)M4OSA_malloc(sizeof(M4xVSS_BGMSettings), M4VS,
+ (M4xVSS_BGMSettings *)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_BGMSettings), M4VS,
(M4OSA_Char
*)"Saving settings, effects table of structure settings");
@@ -5700,7 +5692,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5713,7 +5705,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
sizeof(M4xVSS_BGMSettings));
/* Allocate file name, and copy file name buffer to our structure */
- pEditSavingSettings->xVSS.pBGMtrack->pFile = M4OSA_malloc(
+ pEditSavingSettings->xVSS.pBGMtrack->pFile = M4OSA_32bitAlignedMalloc(
(strlen(xVSS_context->pSettings->xVSS.pBGMtrack->pFile)
+ 1),
M4VS, (M4OSA_Char *)"Saving struct xVSS BGM file path");
@@ -5725,7 +5717,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5756,7 +5748,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return err;
@@ -5764,10 +5756,9 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
pDecodedPath =
xVSS_context->UTFConversionContext.pTempOutConversionBuffer;
- M4OSA_free(
- (M4OSA_MemAddr32)pEditSavingSettings->xVSS.pBGMtrack->pFile);
+ free(pEditSavingSettings->xVSS.pBGMtrack->pFile);
pEditSavingSettings->xVSS.pBGMtrack->pFile =
- (M4OSA_Void *)M4OSA_malloc(length + 1, M4VS, (M4OSA_Char
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(length + 1, M4VS, (M4OSA_Char
*)"M4xVSS_SaveStart: Temp filename in case of BGM");
if( pEditSavingSettings->xVSS.pBGMtrack->pFile == M4OSA_NULL )
@@ -5776,7 +5767,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5815,7 +5806,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return err;
@@ -5827,7 +5818,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
/**
* End of the UTF conversion, use the converted file path*/
xVSS_context->pCurrentEditSettings->pOutputFile =
- (M4OSA_Void *)M4OSA_malloc(length + 1, M4VS,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(length + 1, M4VS,
(M4OSA_Char *)"M4xVSS_SaveStart: Temp filename in case of BGM");
if( xVSS_context->pCurrentEditSettings->pOutputFile == M4OSA_NULL )
@@ -5836,7 +5827,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5866,7 +5857,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return err;
@@ -5878,7 +5869,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
/**
* End of the UTF conversion, use the converted file path*/
xVSS_context->pCurrentEditSettings->pTemporaryFile =
- (M4OSA_Void *)M4OSA_malloc(length + 1, M4VS,
+ (M4OSA_Void *)M4OSA_32bitAlignedMalloc(length + 1, M4VS,
(M4OSA_Char *)"M4xVSS_SaveStart: Temporary file");
if( xVSS_context->pCurrentEditSettings->pTemporaryFile == M4OSA_NULL )
@@ -5887,7 +5878,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
return M4ERR_ALLOC;
@@ -5923,7 +5914,7 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pCurrentEditSettings->pOutputFile != M4OSA_NULL
&& xVSS_context->pSettings->xVSS.pBGMtrack == M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pCurrentEditSettings->
+ free(xVSS_context->pCurrentEditSettings->
pOutputFile);
xVSS_context->pCurrentEditSettings->pOutputFile = M4OSA_NULL;
xVSS_context->pOutputFile = M4OSA_NULL;
@@ -5932,14 +5923,14 @@ M4OSA_ERR M4xVSS_SaveStart( M4OSA_Context pContext, M4OSA_Void *pFilePath,
if( xVSS_context->pCurrentEditSettings->pTemporaryFile != M4OSA_NULL
&& xVSS_context->pSettings->xVSS.pBGMtrack != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pCurrentEditSettings->
+ free(xVSS_context->pCurrentEditSettings->
pTemporaryFile);
xVSS_context->pCurrentEditSettings->pTemporaryFile = M4OSA_NULL;
}
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
/* TODO: Translate error code of VSS to an xVSS error code */
@@ -5988,7 +5979,7 @@ M4OSA_ERR M4xVSS_SaveStop( M4OSA_Context pContext )
if( xVSS_context->pOutputFile != M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
@@ -6574,12 +6565,12 @@ M4OSA_ERR M4xVSS_CloseCommand( M4OSA_Context pContext )
if( xVSS_context->pSettings->xVSS.pBGMtrack != M4OSA_NULL ) {
/*if(M4OSA_NULL != xVSS_context->pSettings->pOutputFile)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pSettings->pOutputFile);
+ free(xVSS_context->pSettings->pOutputFile);
xVSS_context->pSettings->pOutputFile = M4OSA_NULL;
}*/
/*if(M4OSA_NULL != xVSS_context->pSettings->pTemporaryFile)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pSettings->pTemporaryFile);
+ free(xVSS_context->pSettings->pTemporaryFile);
xVSS_context->pSettings->pTemporaryFile = M4OSA_NULL;
}*/
}
@@ -6679,19 +6670,19 @@ M4OSA_ERR M4xVSS_CleanUp( M4OSA_Context pContext )
if( xVSS_context->UTFConversionContext.pTempOutConversionBuffer
!= M4OSA_NULL )
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->
+ free(xVSS_context->
UTFConversionContext.pTempOutConversionBuffer);
xVSS_context->UTFConversionContext.pTempOutConversionBuffer =
M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pTempPath);
+ free(xVSS_context->pTempPath);
xVSS_context->pTempPath = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pSettings);
+ free(xVSS_context->pSettings);
xVSS_context->pSettings = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)xVSS_context);
+ free(xVSS_context);
xVSS_context = M4OSA_NULL;
M4OSA_TRACE3_0("M4xVSS_CleanUp:leaving ");
diff --git a/libvideoeditor/vss/src/M4xVSS_internal.c b/libvideoeditor/vss/src/M4xVSS_internal.c
index 53ee75a..174ddbd 100755
--- a/libvideoeditor/vss/src/M4xVSS_internal.c
+++ b/libvideoeditor/vss/src/M4xVSS_internal.c
@@ -306,7 +306,7 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
M4OSA_ERR err=M4NO_ERROR;
- M4OSA_UInt8 *pTmpData = (M4OSA_UInt8*) M4OSA_malloc(frameSize_argb,
+ M4OSA_UInt8 *pTmpData = (M4OSA_UInt8*) M4OSA_32bitAlignedMalloc(frameSize_argb,
M4VS, (M4OSA_Char*)"Image argb data");
M4OSA_TRACE1_0("M4xVSS_internalConvertAndResizeARGB8888toYUV420 Entering :");
if(pTmpData == M4OSA_NULL) {
@@ -323,7 +323,7 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
{
M4OSA_TRACE1_2("M4xVSS_internalConvertAndResizeARGB8888toYUV420 :\
Can't open input ARGB8888 file %s, error: 0x%x\n",pFileIn, err);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
goto cleanup;
}
@@ -334,7 +334,7 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
M4OSA_TRACE1_2("M4xVSS_internalConvertAndResizeARGB8888toYUV420 Can't close ARGB8888\
file %s, error: 0x%x\n",pFileIn, err);
pFileReadPtr->closeRead(pARGBIn);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
goto cleanup;
}
@@ -344,18 +344,18 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
{
M4OSA_TRACE1_2("M4xVSS_internalConvertAndResizeARGB8888toYUV420 Can't close ARGB8888 \
file %s, error: 0x%x\n",pFileIn, err);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
goto cleanup;
}
- rgbPlane1.pac_data = (M4VIFI_UInt8*)M4OSA_malloc(frameSize, M4VS,
+ rgbPlane1.pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(frameSize, M4VS,
(M4OSA_Char*)"Image clip RGB888 data");
if(rgbPlane1.pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("M4xVSS_internalConvertAndResizeARGB8888toYUV420 \
Failed to allocate memory for Image clip");
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
return M4ERR_ALLOC;
}
@@ -371,19 +371,19 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
rgbPlane1.pac_data[j] = pTmpData[i];
j++;
}
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
/* To Check if resizing is required with color conversion */
if(width != pImagePlanes->u_width || height != pImagePlanes->u_height)
{
M4OSA_TRACE1_0("M4xVSS_internalConvertAndResizeARGB8888toYUV420 Resizing :");
frameSize = ( pImagePlanes->u_width * pImagePlanes->u_height * 3);
- rgbPlane2.pac_data = (M4VIFI_UInt8*)M4OSA_malloc(frameSize, M4VS,
+ rgbPlane2.pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(frameSize, M4VS,
(M4OSA_Char*)"Image clip RGB888 data");
if(rgbPlane2.pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Failed to allocate memory for Image clip");
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
return M4ERR_ALLOC;
}
rgbPlane2.u_height = pImagePlanes->u_height;
@@ -396,8 +396,8 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
if(err != M4NO_ERROR)
{
M4OSA_TRACE1_1("error when converting from Resize RGB888 to RGB888: 0x%x\n", err);
- M4OSA_free((M4OSA_MemAddr32)rgbPlane2.pac_data);
- M4OSA_free((M4OSA_MemAddr32)rgbPlane1.pac_data);
+ free(rgbPlane2.pac_data);
+ free(rgbPlane1.pac_data);
return err;
}
/*Converting Resized RGB888 to YUV420 */
@@ -405,12 +405,12 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
if(err != M4NO_ERROR)
{
M4OSA_TRACE1_1("error when converting from RGB888 to YUV: 0x%x\n", err);
- M4OSA_free((M4OSA_MemAddr32)rgbPlane2.pac_data);
- M4OSA_free((M4OSA_MemAddr32)rgbPlane1.pac_data);
+ free(rgbPlane2.pac_data);
+ free(rgbPlane1.pac_data);
return err;
}
- M4OSA_free((M4OSA_MemAddr32)rgbPlane2.pac_data);
- M4OSA_free((M4OSA_MemAddr32)rgbPlane1.pac_data);
+ free(rgbPlane2.pac_data);
+ free(rgbPlane1.pac_data);
M4OSA_TRACE1_0("RGB to YUV done");
@@ -424,7 +424,7 @@ M4OSA_ERR M4xVSS_internalConvertAndResizeARGB8888toYUV420(M4OSA_Void* pFileIn,
{
M4OSA_TRACE1_1("error when converting from RGB to YUV: 0x%x\n", err);
}
- M4OSA_free((M4OSA_MemAddr32)rgbPlane1.pac_data);
+ free(rgbPlane1.pac_data);
M4OSA_TRACE1_0("RGB to YUV done");
}
@@ -463,7 +463,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB8888toYUV420(M4OSA_Void* pFileIn,
M4OSA_ERR err = M4NO_ERROR;
M4VIFI_ImagePlane *yuvPlane = M4OSA_NULL;
- yuvPlane = (M4VIFI_ImagePlane*)M4OSA_malloc(3*sizeof(M4VIFI_ImagePlane),
+ yuvPlane = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(3*sizeof(M4VIFI_ImagePlane),
M4VS, (M4OSA_Char*)"M4xVSS_internalConvertRGBtoYUV: Output plane YUV");
if(yuvPlane == M4OSA_NULL) {
M4OSA_TRACE1_0("M4xVSS_internalConvertAndResizeARGB8888toYUV420 :\
@@ -474,7 +474,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB8888toYUV420(M4OSA_Void* pFileIn,
yuvPlane[0].u_width = width;
yuvPlane[0].u_stride = width;
yuvPlane[0].u_topleft = 0;
- yuvPlane[0].pac_data = (M4VIFI_UInt8*)M4OSA_malloc(yuvPlane[0].u_height \
+ yuvPlane[0].pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(yuvPlane[0].u_height \
* yuvPlane[0].u_width * 1.5, M4VS, (M4OSA_Char*)"imageClip YUV data");
yuvPlane[1].u_height = yuvPlane[0].u_height >>1;
@@ -495,7 +495,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB8888toYUV420(M4OSA_Void* pFileIn,
if(err != M4NO_ERROR)
{
M4OSA_TRACE1_1("M4xVSS_internalConvertAndResizeARGB8888toYUV420 return error: 0x%x\n", err);
- M4OSA_free((M4OSA_MemAddr32)yuvPlane);
+ free(yuvPlane);
return err;
}
@@ -600,9 +600,9 @@ M4OSA_ERR M4xVSS_PictureCallbackFct(M4OSA_Void* pPictureCtxt, M4VIFI_ImagePlane*
(contigous planes in memory) */
if(pC->m_pDecodedPlane->pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane->pac_data);
+ free(pC->m_pDecodedPlane->pac_data);
}
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane);
+ free(pC->m_pDecodedPlane);
pC->m_pDecodedPlane = M4OSA_NULL;
}
return err;
@@ -1471,8 +1471,8 @@ M4OSA_ERR M4xVSS_PictureCallbackFct(M4OSA_Void* pPictureCtxt, M4VIFI_ImagePlane*
err = M4AIR_create(&pC->m_air_context, M4AIR_kYUV420P);
if(err != M4NO_ERROR)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane[0].pac_data);
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane);
+ free(pC->m_pDecodedPlane[0].pac_data);
+ free(pC->m_pDecodedPlane);
pC->m_pDecodedPlane = M4OSA_NULL;
M4OSA_TRACE1_1("M4xVSS_PictureCallbackFct:\
Error when initializing AIR: 0x%x", err);
@@ -1486,8 +1486,8 @@ M4OSA_ERR M4xVSS_PictureCallbackFct(M4OSA_Void* pPictureCtxt, M4VIFI_ImagePlane*
M4OSA_TRACE1_1("M4xVSS_PictureCallbackFct:\
Error when configuring AIR: 0x%x", err);
M4AIR_cleanUp(pC->m_air_context);
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane[0].pac_data);
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane);
+ free(pC->m_pDecodedPlane[0].pac_data);
+ free(pC->m_pDecodedPlane);
pC->m_pDecodedPlane = M4OSA_NULL;
return err;
}
@@ -1497,8 +1497,8 @@ M4OSA_ERR M4xVSS_PictureCallbackFct(M4OSA_Void* pPictureCtxt, M4VIFI_ImagePlane*
{
M4OSA_TRACE1_1("M4xVSS_PictureCallbackFct: Error when getting AIR plane: 0x%x", err);
M4AIR_cleanUp(pC->m_air_context);
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane[0].pac_data);
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane);
+ free(pC->m_pDecodedPlane[0].pac_data);
+ free(pC->m_pDecodedPlane);
pC->m_pDecodedPlane = M4OSA_NULL;
return err;
}
@@ -1533,8 +1533,8 @@ M4OSA_ERR M4xVSS_PictureCallbackFct(M4OSA_Void* pPictureCtxt, M4VIFI_ImagePlane*
}
if(M4OSA_NULL != pC->m_pDecodedPlane)
{
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane[0].pac_data);
- M4OSA_free((M4OSA_MemAddr32)pC->m_pDecodedPlane);
+ free(pC->m_pDecodedPlane[0].pac_data);
+ free(pC->m_pDecodedPlane);
pC->m_pDecodedPlane = M4OSA_NULL;
}
return M4PTO3GPP_WAR_LAST_PICTURE;
@@ -1614,7 +1614,7 @@ M4OSA_ERR M4xVSS_internalStartConvertPictureTo3gp(M4OSA_Context pContext)
}
}
- pCallBackCtxt = (M4xVSS_PictureCallbackCtxt*)M4OSA_malloc(sizeof(M4xVSS_PictureCallbackCtxt),
+ pCallBackCtxt = (M4xVSS_PictureCallbackCtxt*)M4OSA_32bitAlignedMalloc(sizeof(M4xVSS_PictureCallbackCtxt),
M4VS,(M4OSA_Char *) "Pto3gpp callback struct");
if(pCallBackCtxt == M4OSA_NULL)
{
@@ -1739,7 +1739,7 @@ M4OSA_ERR M4xVSS_internalStartConvertPictureTo3gp(M4OSA_Context pContext)
M4OSA_TRACE1_1("M4PTO3GPP_Open returned: 0x%x\n",err);
if(pCallBackCtxt != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pCallBackCtxt);
+ free(pCallBackCtxt);
pCallBackCtxt = M4OSA_NULL;
}
M4PTO3GPP_CleanUp(pM4PTO3GPP_Ctxt);
@@ -1777,7 +1777,7 @@ M4OSA_ERR M4xVSS_internalStopConvertPictureTo3gp(M4OSA_Context pContext)
* Free the PTO3GPP callback context */
if(M4OSA_NULL != xVSS_context->pCallBackCtxt)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pCallBackCtxt);
+ free(xVSS_context->pCallBackCtxt);
xVSS_context->pCallBackCtxt = M4OSA_NULL;
}
@@ -1856,7 +1856,7 @@ M4OSA_ERR M4xVSS_internalConvertRGBtoYUV(M4xVSS_FramingStruct* framingCtx)
/**
* Allocate output YUV planes */
- framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_malloc(3*sizeof(M4VIFI_ImagePlane),
+ framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(3*sizeof(M4VIFI_ImagePlane),
M4VS, (M4OSA_Char *)"M4xVSS_internalConvertRGBtoYUV: Output plane YUV");
if(framingCtx->FramingYuv == M4OSA_NULL)
{
@@ -1868,7 +1868,7 @@ M4OSA_ERR M4xVSS_internalConvertRGBtoYUV(M4xVSS_FramingStruct* framingCtx)
framingCtx->FramingYuv[0].u_topleft = 0;
framingCtx->FramingYuv[0].u_stride = framingCtx->FramingRgb->u_width;
framingCtx->FramingYuv[0].pac_data =
- (M4VIFI_UInt8*)M4OSA_malloc((framingCtx->FramingYuv[0].u_width\
+ (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc((framingCtx->FramingYuv[0].u_width\
*framingCtx->FramingYuv[0].u_height*3)>>1, M4VS, (M4OSA_Char *)\
"Alloc for the Convertion output YUV");;
if(framingCtx->FramingYuv[0].pac_data == M4OSA_NULL)
@@ -1982,7 +1982,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
M4OSA_TRACE1_2("M4xVSS_internalConvertARGB888toYUV420_FrammingEffect width and height %d %d ",
framingCtx->width,framingCtx->height);
- M4OSA_UInt8 *pTmpData = (M4OSA_UInt8*) M4OSA_malloc(frameSize_argb, M4VS, (M4OSA_Char*)\
+ M4OSA_UInt8 *pTmpData = (M4OSA_UInt8*) M4OSA_32bitAlignedMalloc(frameSize_argb, M4VS, (M4OSA_Char*)\
"Image argb data");
if(pTmpData == M4OSA_NULL) {
M4OSA_TRACE1_0("Failed to allocate memory for Image clip");
@@ -2002,7 +2002,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
{
M4OSA_TRACE1_1("M4xVSS_internalDecodePNG:\
M4xVSS_internalConvertFromUTF8 returns err: 0x%x",err);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
return err;
}
@@ -2018,7 +2018,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
if(err != M4NO_ERROR)
{
M4OSA_TRACE1_2("Can't open input ARGB8888 file %s, error: 0x%x\n",pFile, err);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
return err;
}
@@ -2027,7 +2027,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
if(err != M4NO_ERROR)
{
xVSS_context->pFileReadPtr->closeRead(pARGBIn);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
return err;
}
@@ -2037,7 +2037,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
if(err != M4NO_ERROR)
{
M4OSA_TRACE1_2("Can't close input png file %s, error: 0x%x\n",pFile, err);
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
return err;
}
@@ -2049,12 +2049,12 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
rgbPlane.u_topleft = 0;
frameSize = (rgbPlane.u_width * rgbPlane.u_height * 3); //Size of RGB888 data
- rgbPlane.pac_data = (M4VIFI_UInt8*)M4OSA_malloc(((frameSize)+ (2 * framingCtx->width)),
+ rgbPlane.pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(((frameSize)+ (2 * framingCtx->width)),
M4VS, (M4OSA_Char*)"Image clip RGB888 data");
if(rgbPlane.pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Failed to allocate memory for Image clip");
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
return M4ERR_ALLOC;
}
@@ -2087,18 +2087,18 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
j++;
}
- M4OSA_free((M4OSA_MemAddr32)pTmpData);
+ free(pTmpData);
pTmpData = M4OSA_NULL;
/* convert RGB888 to RGB565 */
/* allocate temp RGB 565 buffer */
- TempPacData = (M4VIFI_UInt8*)M4OSA_malloc(frameSize +
+ TempPacData = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(frameSize +
(4 * (framingCtx->width + framingCtx->height + 1)),
M4VS, (M4OSA_Char*)"Image clip RGB565 data");
if (TempPacData == M4OSA_NULL) {
M4OSA_TRACE1_0("Failed to allocate memory for Image clip RGB565 data");
- M4OSA_free((M4OSA_MemAddr32)rgbPlane.pac_data);
+ free(rgbPlane.pac_data);
return M4ERR_ALLOC;
}
@@ -2113,7 +2113,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
}
/* free the RBG888 and assign RGB565 */
- M4OSA_free((M4OSA_MemAddr32)rgbPlane.pac_data);
+ free(rgbPlane.pac_data);
rgbPlane.pac_data = TempPacData;
/**
@@ -2150,14 +2150,14 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
/**
* We need to allocate a new RGB output buffer in which all decoded data
+ white line will be copied */
- newRGBpac_data = (M4VIFI_UInt8*)M4OSA_malloc(rgbPlane.u_height*rgbPlane.u_width*2\
+ newRGBpac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(rgbPlane.u_height*rgbPlane.u_width*2\
*sizeof(M4VIFI_UInt8), M4VS, (M4OSA_Char *)"New Framing GIF Output pac_data RGB");
if(newRGBpac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Allocation error in \
M4xVSS_internalConvertARGB888toYUV420_FrammingEffect");
- M4OSA_free((M4OSA_MemAddr32)rgbPlane.pac_data);
+ free(rgbPlane.pac_data);
return M4ERR_ALLOC;
}
@@ -2176,7 +2176,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
input_pac_data += ((rgbPlane.u_width-1)*2);
}
- M4OSA_free((M4OSA_MemAddr32)rgbPlane.pac_data);
+ free(rgbPlane.pac_data);
rgbPlane.pac_data = newRGBpac_data;
}
@@ -2265,7 +2265,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
/**
* Allocate output planes structures */
- framingCtx->FramingRgb = (M4VIFI_ImagePlane*)M4OSA_malloc(sizeof(M4VIFI_ImagePlane), M4VS,
+ framingCtx->FramingRgb = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(sizeof(M4VIFI_ImagePlane), M4VS,
(M4OSA_Char *)"Framing Output plane RGB");
if(framingCtx->FramingRgb == M4OSA_NULL)
{
@@ -2289,7 +2289,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
framingCtx->FramingRgb->u_topleft = 0;
framingCtx->FramingRgb->pac_data =
- (M4VIFI_UInt8*)M4OSA_malloc(framingCtx->FramingRgb->u_height*framingCtx->\
+ (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(framingCtx->FramingRgb->u_height*framingCtx->\
FramingRgb->u_width*2*sizeof(M4VIFI_UInt8), M4VS,
(M4OSA_Char *)"Framing Output pac_data RGB");
@@ -2297,8 +2297,8 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
{
M4OSA_TRACE1_0("Allocation error in \
M4xVSS_internalConvertARGB888toYUV420_FrammingEffect");
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingRgb);
- M4OSA_free((M4OSA_MemAddr32)rgbPlane.pac_data);
+ free(framingCtx->FramingRgb);
+ free(rgbPlane.pac_data);
return M4ERR_ALLOC;
}
@@ -2318,7 +2318,7 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
if(rgbPlane.pac_data != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)rgbPlane.pac_data);
+ free(rgbPlane.pac_data);
rgbPlane.pac_data = M4OSA_NULL;
}
}
@@ -2350,12 +2350,12 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
/**
* Convert RGB output to YUV 420 to be able to merge it with output video in framing
effect */
- framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_malloc(3*sizeof(M4VIFI_ImagePlane), M4VS,
+ framingCtx->FramingYuv = (M4VIFI_ImagePlane*)M4OSA_32bitAlignedMalloc(3*sizeof(M4VIFI_ImagePlane), M4VS,
(M4OSA_Char *)"Framing Output plane YUV");
if(framingCtx->FramingYuv == M4OSA_NULL)
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_internalConvertARGB888toYUV420_FrammingEffect");
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingRgb->pac_data);
+ free(framingCtx->FramingRgb->pac_data);
return M4ERR_ALLOC;
}
@@ -2364,14 +2364,14 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
framingCtx->FramingYuv[0].u_height = ((height+1)>>1)<<1;
framingCtx->FramingYuv[0].u_topleft = 0;
framingCtx->FramingYuv[0].u_stride = ((width+1)>>1)<<1;
- framingCtx->FramingYuv[0].pac_data = (M4VIFI_UInt8*)M4OSA_malloc
+ framingCtx->FramingYuv[0].pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc
((framingCtx->FramingYuv[0].u_width*framingCtx->FramingYuv[0].u_height), M4VS,
(M4OSA_Char *)"Alloc for the output Y");
if(framingCtx->FramingYuv[0].pac_data == M4OSA_NULL)
{
M4OSA_TRACE1_0("Allocation error in M4xVSS_internalConvertARGB888toYUV420_FrammingEffect");
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv);
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingRgb->pac_data);
+ free(framingCtx->FramingYuv);
+ free(framingCtx->FramingRgb->pac_data);
return M4ERR_ALLOC;
}
framingCtx->FramingYuv[1].u_width = (((width+1)>>1)<<1)>>1;
@@ -2380,13 +2380,13 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
framingCtx->FramingYuv[1].u_stride = (((width+1)>>1)<<1)>>1;
- framingCtx->FramingYuv[1].pac_data = (M4VIFI_UInt8*)M4OSA_malloc(
+ framingCtx->FramingYuv[1].pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(
framingCtx->FramingYuv[1].u_width * framingCtx->FramingYuv[1].u_height, M4VS,
(M4OSA_Char *)"Alloc for the output U");
if (framingCtx->FramingYuv[1].pac_data == M4OSA_NULL) {
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv[0].pac_data);
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv);
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingRgb->pac_data);
+ free(framingCtx->FramingYuv[0].pac_data);
+ free(framingCtx->FramingYuv);
+ free(framingCtx->FramingRgb->pac_data);
return M4ERR_ALLOC;
}
@@ -2396,14 +2396,14 @@ M4OSA_ERR M4xVSS_internalConvertARGB888toYUV420_FrammingEffect(M4OSA_Context pCo
framingCtx->FramingYuv[2].u_stride = (((width+1)>>1)<<1)>>1;
- framingCtx->FramingYuv[2].pac_data = (M4VIFI_UInt8*)M4OSA_malloc(
+ framingCtx->FramingYuv[2].pac_data = (M4VIFI_UInt8*)M4OSA_32bitAlignedMalloc(
framingCtx->FramingYuv[2].u_width * framingCtx->FramingYuv[0].u_height, M4VS,
(M4OSA_Char *)"Alloc for the output V");
if (framingCtx->FramingYuv[2].pac_data == M4OSA_NULL) {
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv[1].pac_data);
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv[0].pac_data);
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv);
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingRgb->pac_data);
+ free(framingCtx->FramingYuv[1].pac_data);
+ free(framingCtx->FramingYuv[0].pac_data);
+ free(framingCtx->FramingYuv);
+ free(framingCtx->FramingRgb->pac_data);
return M4ERR_ALLOC;
}
@@ -2731,7 +2731,7 @@ M4OSA_ERR M4xVSS_internalGenerateAudioMixFile(M4OSA_Context pContext)
/**
* Allocate audio mixing settings structure and fill it with BGM parameters */
- pAudioMixSettings = (M4VSS3GPP_AudioMixingSettings*)M4OSA_malloc
+ pAudioMixSettings = (M4VSS3GPP_AudioMixingSettings*)M4OSA_32bitAlignedMalloc
(sizeof(M4VSS3GPP_AudioMixingSettings), M4VS, (M4OSA_Char *)"pAudioMixSettings");
if(pAudioMixSettings == M4OSA_NULL)
{
@@ -2870,7 +2870,7 @@ M4OSA_ERR M4xVSS_internalCloseAudioMixedFile(M4OSA_Context pContext)
* Free VSS audio mixing settings */
if(xVSS_context->pAudioMixSettings != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pAudioMixSettings);
+ free(xVSS_context->pAudioMixSettings);
xVSS_context->pAudioMixSettings = M4OSA_NULL;
}
@@ -2901,14 +2901,14 @@ M4OSA_ERR M4xVSS_internalFreePreview(M4OSA_Context pContext)
{
M4xVSS_FreeClipSettings(xVSS_context->pCurrentEditSettings->pClipList[i]);
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->pClipList[i]));
+ free((xVSS_context->pCurrentEditSettings->pClipList[i]));
xVSS_context->pCurrentEditSettings->pClipList[i] = M4OSA_NULL;
/**
* Because there is 1 less transition than clip number */
if(i != xVSS_context->pCurrentEditSettings->uiClipNumber-1)
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->pTransitionList[i]));
+ free((xVSS_context->pCurrentEditSettings->pTransitionList[i]));
xVSS_context->pCurrentEditSettings->pTransitionList[i] = M4OSA_NULL;
}
}
@@ -2917,12 +2917,12 @@ M4OSA_ERR M4xVSS_internalFreePreview(M4OSA_Context pContext)
* Free clip/transition list */
if(xVSS_context->pCurrentEditSettings->pClipList != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->pClipList));
+ free((xVSS_context->pCurrentEditSettings->pClipList));
xVSS_context->pCurrentEditSettings->pClipList = M4OSA_NULL;
}
if(xVSS_context->pCurrentEditSettings->pTransitionList != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->pTransitionList));
+ free((xVSS_context->pCurrentEditSettings->pTransitionList));
xVSS_context->pCurrentEditSettings->pTransitionList = M4OSA_NULL;
}
@@ -2930,7 +2930,7 @@ M4OSA_ERR M4xVSS_internalFreePreview(M4OSA_Context pContext)
* Free output preview file path */
if(xVSS_context->pCurrentEditSettings->pOutputFile != M4OSA_NULL)
{
- M4OSA_free(xVSS_context->pCurrentEditSettings->pOutputFile);
+ free(xVSS_context->pCurrentEditSettings->pOutputFile);
xVSS_context->pCurrentEditSettings->pOutputFile = M4OSA_NULL;
}
@@ -2939,7 +2939,7 @@ M4OSA_ERR M4xVSS_internalFreePreview(M4OSA_Context pContext)
if(xVSS_context->pCurrentEditSettings->pTemporaryFile != M4OSA_NULL)
{
remove((const char *)xVSS_context->pCurrentEditSettings->pTemporaryFile);
- M4OSA_free(xVSS_context->pCurrentEditSettings->pTemporaryFile);
+ free(xVSS_context->pCurrentEditSettings->pTemporaryFile);
xVSS_context->pCurrentEditSettings->pTemporaryFile = M4OSA_NULL;
}
@@ -2949,10 +2949,10 @@ M4OSA_ERR M4xVSS_internalFreePreview(M4OSA_Context pContext)
{
if(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile != M4OSA_NULL)
{
- M4OSA_free(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile);
+ free(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile);
xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack);
+ free(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack);
xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack = M4OSA_NULL;
}
@@ -2960,7 +2960,7 @@ M4OSA_ERR M4xVSS_internalFreePreview(M4OSA_Context pContext)
* Free current edit settings structure */
if(xVSS_context->pCurrentEditSettings != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pCurrentEditSettings);
+ free(xVSS_context->pCurrentEditSettings);
xVSS_context->pCurrentEditSettings = M4OSA_NULL;
}
@@ -2968,7 +2968,7 @@ M4OSA_ERR M4xVSS_internalFreePreview(M4OSA_Context pContext)
* Free preview effects given to application */
if(M4OSA_NULL != xVSS_context->pPreviewSettings->Effects)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pPreviewSettings->Effects);
+ free(xVSS_context->pPreviewSettings->Effects);
xVSS_context->pPreviewSettings->Effects = M4OSA_NULL;
xVSS_context->pPreviewSettings->nbEffects = 0;
}
@@ -3003,14 +3003,14 @@ M4OSA_ERR M4xVSS_internalFreeSaving(M4OSA_Context pContext)
{
M4xVSS_FreeClipSettings(xVSS_context->pCurrentEditSettings->pClipList[i]);
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->pClipList[i]));
+ free((xVSS_context->pCurrentEditSettings->pClipList[i]));
xVSS_context->pCurrentEditSettings->pClipList[i] = M4OSA_NULL;
/**
* Because there is 1 less transition than clip number */
if(i != xVSS_context->pCurrentEditSettings->uiClipNumber-1)
{
- M4OSA_free((M4OSA_MemAddr32)\
+ free(\
(xVSS_context->pCurrentEditSettings->pTransitionList[i]));
xVSS_context->pCurrentEditSettings->pTransitionList[i] = M4OSA_NULL;
}
@@ -3020,18 +3020,18 @@ M4OSA_ERR M4xVSS_internalFreeSaving(M4OSA_Context pContext)
* Free clip/transition list */
if(xVSS_context->pCurrentEditSettings->pClipList != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->pClipList));
+ free((xVSS_context->pCurrentEditSettings->pClipList));
xVSS_context->pCurrentEditSettings->pClipList = M4OSA_NULL;
}
if(xVSS_context->pCurrentEditSettings->pTransitionList != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->pTransitionList));
+ free((xVSS_context->pCurrentEditSettings->pTransitionList));
xVSS_context->pCurrentEditSettings->pTransitionList = M4OSA_NULL;
}
if(xVSS_context->pCurrentEditSettings->Effects != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pCurrentEditSettings->Effects));
+ free((xVSS_context->pCurrentEditSettings->Effects));
xVSS_context->pCurrentEditSettings->Effects = M4OSA_NULL;
xVSS_context->pCurrentEditSettings->nbEffects = 0;
}
@@ -3043,11 +3043,11 @@ M4OSA_ERR M4xVSS_internalFreeSaving(M4OSA_Context pContext)
if(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack != M4OSA_NULL)
{
remove((const char *)xVSS_context->pCurrentEditSettings->pOutputFile);
- M4OSA_free(xVSS_context->pCurrentEditSettings->pOutputFile);
+ free(xVSS_context->pCurrentEditSettings->pOutputFile);
}
if(xVSS_context->pOutputFile != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pOutputFile);
+ free(xVSS_context->pOutputFile);
xVSS_context->pOutputFile = M4OSA_NULL;
}
xVSS_context->pSettings->pOutputFile = M4OSA_NULL;
@@ -3059,7 +3059,7 @@ M4OSA_ERR M4xVSS_internalFreeSaving(M4OSA_Context pContext)
if(xVSS_context->pCurrentEditSettings->pTemporaryFile != M4OSA_NULL)
{
remove((const char *)xVSS_context->pCurrentEditSettings->pTemporaryFile);
- M4OSA_free(xVSS_context->pCurrentEditSettings->pTemporaryFile);
+ free(xVSS_context->pCurrentEditSettings->pTemporaryFile);
xVSS_context->pCurrentEditSettings->pTemporaryFile = M4OSA_NULL;
}
@@ -3069,16 +3069,16 @@ M4OSA_ERR M4xVSS_internalFreeSaving(M4OSA_Context pContext)
{
if(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile != M4OSA_NULL)
{
- M4OSA_free(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile);
+ free(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile);
xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack->pFile = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack);
+ free(xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack);
xVSS_context->pCurrentEditSettings->xVSS.pBGMtrack = M4OSA_NULL;
}
/**
* Free current edit settings structure */
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pCurrentEditSettings);
+ free(xVSS_context->pCurrentEditSettings);
xVSS_context->pCurrentEditSettings = M4OSA_NULL;
}
@@ -3112,7 +3112,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
{
M4xVSS_FreeClipSettings(pSettings->pClipList[i]);
- M4OSA_free((M4OSA_MemAddr32)(pSettings->pClipList[i]));
+ free((pSettings->pClipList[i]));
pSettings->pClipList[i] = M4OSA_NULL;
}
@@ -3132,19 +3132,19 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
if(pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt\
!= M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(((M4xVSS_internal_AlphaMagicSettings*)\
+ free((((M4xVSS_internal_AlphaMagicSettings*)\
pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt)->\
pPlane->pac_data));
((M4xVSS_internal_AlphaMagicSettings*)pSettings->pTransitionList[i\
]->pExtVideoTransitionFctCtxt)->pPlane->pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)(((M4xVSS_internal_AlphaMagicSettings*)\
+ free((((M4xVSS_internal_AlphaMagicSettings*)\
pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt)->pPlane));
((M4xVSS_internal_AlphaMagicSettings*)pSettings->pTransitionList[i]\
->pExtVideoTransitionFctCtxt)->pPlane = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)(pSettings->pTransitionList[i]->\
+ free((pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt));
pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt = M4OSA_NULL;
@@ -3166,7 +3166,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
{
/* Free extra internal alpha magic structure and put
it to NULL to avoid refreeing it */
- M4OSA_free((M4OSA_MemAddr32)(pSettings->\
+ free((pSettings->\
pTransitionList[j]->pExtVideoTransitionFctCtxt));
pSettings->pTransitionList[j]->\
pExtVideoTransitionFctCtxt = M4OSA_NULL;
@@ -3183,7 +3183,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
xVSS.transitionSpecific.pAlphaMagicSettings->\
pAlphaFilePath != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pSettings->\
+ free(pSettings->\
pTransitionList[i]->\
xVSS.transitionSpecific.pAlphaMagicSettings->\
pAlphaFilePath);
@@ -3191,7 +3191,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
xVSS.transitionSpecific.pAlphaMagicSettings->\
pAlphaFilePath = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)pSettings->pTransitionList[i]->\
+ free(pSettings->pTransitionList[i]->\
xVSS.transitionSpecific.pAlphaMagicSettings);
pSettings->pTransitionList[i]->\
xVSS.transitionSpecific.pAlphaMagicSettings = M4OSA_NULL;
@@ -3205,14 +3205,14 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
if (M4OSA_NULL != pSettings->pTransitionList[i]->\
xVSS.transitionSpecific.pSlideTransitionSettings)
{
- M4OSA_free((M4OSA_MemAddr32)pSettings->pTransitionList[i]->\
+ free(pSettings->pTransitionList[i]->\
xVSS.transitionSpecific.pSlideTransitionSettings);
pSettings->pTransitionList[i]->\
xVSS.transitionSpecific.pSlideTransitionSettings = M4OSA_NULL;
}
if(pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(pSettings->pTransitionList[i]->\
+ free((pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt));
pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt = M4OSA_NULL;
}
@@ -3223,7 +3223,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
}
/**
* Free transition settings structure */
- M4OSA_free((M4OSA_MemAddr32)(pSettings->pTransitionList[i]));
+ free((pSettings->pTransitionList[i]));
pSettings->pTransitionList[i] = M4OSA_NULL;
}
}
@@ -3233,7 +3233,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
* Free clip list */
if(pSettings->pClipList != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(pSettings->pClipList));
+ free((pSettings->pClipList));
pSettings->pClipList = M4OSA_NULL;
}
@@ -3241,7 +3241,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
* Free transition list */
if(pSettings->pTransitionList != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(pSettings->pTransitionList));
+ free((pSettings->pTransitionList));
pSettings->pTransitionList = M4OSA_NULL;
}
@@ -3273,55 +3273,55 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
{
if(framingCtx->aFramingCtx->FramingRgb != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx->\
+ free(framingCtx->aFramingCtx->\
FramingRgb->pac_data);
framingCtx->aFramingCtx->FramingRgb->pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx->FramingRgb);
+ free(framingCtx->aFramingCtx->FramingRgb);
framingCtx->aFramingCtx->FramingRgb = M4OSA_NULL;
}
}
if(framingCtx->aFramingCtx->FramingYuv != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx->\
+ free(framingCtx->aFramingCtx->\
FramingYuv[0].pac_data);
framingCtx->aFramingCtx->FramingYuv[0].pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx->\
+ free(framingCtx->aFramingCtx->\
FramingYuv[1].pac_data);
framingCtx->aFramingCtx->FramingYuv[1].pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx->\
+ free(framingCtx->aFramingCtx->\
FramingYuv[2].pac_data);
framingCtx->aFramingCtx->FramingYuv[2].pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx->FramingYuv);
+ free(framingCtx->aFramingCtx->FramingYuv);
framingCtx->aFramingCtx->FramingYuv = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx);
+ free(framingCtx->aFramingCtx);
framingCtx->aFramingCtx = M4OSA_NULL;
}
if(framingCtx->aFramingCtx_last != M4OSA_NULL)
{
if(framingCtx->aFramingCtx_last->FramingRgb != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx_last->\
+ free(framingCtx->aFramingCtx_last->\
FramingRgb->pac_data);
framingCtx->aFramingCtx_last->FramingRgb->pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx_last->\
+ free(framingCtx->aFramingCtx_last->\
FramingRgb);
framingCtx->aFramingCtx_last->FramingRgb = M4OSA_NULL;
}
if(framingCtx->aFramingCtx_last->FramingYuv != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx_last->\
+ free(framingCtx->aFramingCtx_last->\
FramingYuv[0].pac_data);
framingCtx->aFramingCtx_last->FramingYuv[0].pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx_last->FramingYuv);
+ free(framingCtx->aFramingCtx_last->FramingYuv);
framingCtx->aFramingCtx_last->FramingYuv = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)framingCtx->aFramingCtx_last);
+ free(framingCtx->aFramingCtx_last);
framingCtx->aFramingCtx_last = M4OSA_NULL;
}
if(framingCtx->pEffectFilePath != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->pEffectFilePath);
+ free(framingCtx->pEffectFilePath);
framingCtx->pEffectFilePath = M4OSA_NULL;
}
/*In case there are still allocated*/
@@ -3332,7 +3332,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
#if 0
if(framingCtx->inputStream.data_buffer != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->inputStream.data_buffer);
+ free(framingCtx->inputStream.data_buffer);
framingCtx->inputStream.data_buffer = M4OSA_NULL;
}
#endif
@@ -3340,11 +3340,11 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
/*Alpha blending structure*/
if(framingCtx->alphaBlendingStruct != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->alphaBlendingStruct);
+ free(framingCtx->alphaBlendingStruct);
framingCtx->alphaBlendingStruct = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)framingCtx);
+ free(framingCtx);
framingCtx = M4OSA_NULL;
}
#else
@@ -3355,20 +3355,20 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
{
if(framingCtx->FramingRgb != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingRgb->pac_data);
+ free(framingCtx->FramingRgb->pac_data);
framingCtx->FramingRgb->pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingRgb);
+ free(framingCtx->FramingRgb);
framingCtx->FramingRgb = M4OSA_NULL;
}
if(framingCtx->FramingYuv != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv[0].pac_data);
+ free(framingCtx->FramingYuv[0].pac_data);
framingCtx->FramingYuv[0].pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)framingCtx->FramingYuv);
+ free(framingCtx->FramingYuv);
framingCtx->FramingYuv = M4OSA_NULL;
}
framingCtx_save = framingCtx->pNext;
- M4OSA_free((M4OSA_MemAddr32)framingCtx);
+ free(framingCtx);
framingCtx = M4OSA_NULL;
framingCtx = framingCtx_save;
}
@@ -3387,7 +3387,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
if(FiftiesCtx != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)FiftiesCtx);
+ free(FiftiesCtx);
FiftiesCtx = M4OSA_NULL;
}
@@ -3405,7 +3405,7 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
if(ColorCtx != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)ColorCtx);
+ free(ColorCtx);
ColorCtx = M4OSA_NULL;
}
}
@@ -3413,21 +3413,21 @@ M4OSA_ERR M4xVSS_freeSettings(M4VSS3GPP_EditSettings* pSettings)
/* Free simple fields */
if(pSettings->Effects[i].xVSS.pFramingFilePath != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pSettings->Effects[i].xVSS.pFramingFilePath);
+ free(pSettings->Effects[i].xVSS.pFramingFilePath);
pSettings->Effects[i].xVSS.pFramingFilePath = M4OSA_NULL;
}
if(pSettings->Effects[i].xVSS.pFramingBuffer != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pSettings->Effects[i].xVSS.pFramingBuffer);
+ free(pSettings->Effects[i].xVSS.pFramingBuffer);
pSettings->Effects[i].xVSS.pFramingBuffer = M4OSA_NULL;
}
if(pSettings->Effects[i].xVSS.pTextBuffer != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pSettings->Effects[i].xVSS.pTextBuffer);
+ free(pSettings->Effects[i].xVSS.pTextBuffer);
pSettings->Effects[i].xVSS.pTextBuffer = M4OSA_NULL;
}
}
- M4OSA_free((M4OSA_MemAddr32)pSettings->Effects);
+ free(pSettings->Effects);
pSettings->Effects = M4OSA_NULL;
}
@@ -3444,10 +3444,10 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
{
if(xVSS_context->pSettings->xVSS.pBGMtrack->pFile != M4OSA_NULL)
{
- M4OSA_free(xVSS_context->pSettings->xVSS.pBGMtrack->pFile);
+ free(xVSS_context->pSettings->xVSS.pBGMtrack->pFile);
xVSS_context->pSettings->xVSS.pBGMtrack->pFile = M4OSA_NULL;
}
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pSettings->xVSS.pBGMtrack);
+ free(xVSS_context->pSettings->xVSS.pBGMtrack);
xVSS_context->pSettings->xVSS.pBGMtrack = M4OSA_NULL;
}
#if 0
@@ -3469,21 +3469,21 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
if(xVSS_context->pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(((M4xVSS_internal_AlphaMagicSettings*)\
+ free((((M4xVSS_internal_AlphaMagicSettings*)\
xVSS_context->pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt)->pPlane->pac_data));
((M4xVSS_internal_AlphaMagicSettings*)xVSS_context->\
pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt)->\
pPlane->pac_data = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)(((M4xVSS_internal_AlphaMagicSettings*)\
+ free((((M4xVSS_internal_AlphaMagicSettings*)\
xVSS_context->pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt)->pPlane));
((M4xVSS_internal_AlphaMagicSettings*)xVSS_context->\
pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt)->\
pPlane = M4OSA_NULL;
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pSettings->\
+ free((xVSS_context->pSettings->\
pTransitionList[i]->pExtVideoTransitionFctCtxt));
xVSS_context->pSettings->pTransitionList[i]->pExtVideoTransitionFctCtxt
= M4OSA_NULL;
@@ -3506,7 +3506,7 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
{
/* Free extra internal alpha magic structure and put it
to NULL to avoid refreeing it */
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pSettings->\
+ free((xVSS_context->pSettings->\
pTransitionList[j]->pExtVideoTransitionFctCtxt));
xVSS_context->pSettings->pTransitionList[j]->\
pExtVideoTransitionFctCtxt = M4OSA_NULL;
@@ -3521,7 +3521,7 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
if(xVSS_context->pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)(xVSS_context->pSettings->\
+ free((xVSS_context->pSettings->\
pTransitionList[i]->pExtVideoTransitionFctCtxt));
xVSS_context->pSettings->pTransitionList[i]->\
pExtVideoTransitionFctCtxt = M4OSA_NULL;
@@ -3543,14 +3543,14 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
{
if(pParams->pFileIn != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileIn);
+ free(pParams->pFileIn);
pParams->pFileIn = M4OSA_NULL;
}
if(pParams->pFileOut != M4OSA_NULL)
{
/* Delete temporary file */
remove((const char *)pParams->pFileOut);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileOut);
+ free(pParams->pFileOut);
pParams->pFileOut = M4OSA_NULL;
}
if(pParams->pFileTemp != M4OSA_NULL)
@@ -3558,13 +3558,13 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
/* Delete temporary file */
#ifdef M4xVSS_RESERVED_MOOV_DISK_SPACE
remove((const char *)pParams->pFileTemp);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileTemp);
+ free(pParams->pFileTemp);
#endif/*M4xVSS_RESERVED_MOOV_DISK_SPACE*/
pParams->pFileTemp = M4OSA_NULL;
}
pParams_sauv = pParams;
pParams = pParams->pNext;
- M4OSA_free((M4OSA_MemAddr32)pParams_sauv);
+ free(pParams_sauv);
pParams_sauv = M4OSA_NULL;
}
}
@@ -3578,14 +3578,14 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
{
if(pParams->pFileIn != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileIn);
+ free(pParams->pFileIn);
pParams->pFileIn = M4OSA_NULL;
}
if(pParams->pFileOut != M4OSA_NULL)
{
/* Delete temporary file */
remove((const char *)pParams->pFileOut);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileOut);
+ free(pParams->pFileOut);
pParams->pFileOut = M4OSA_NULL;
}
if(pParams->pFileTemp != M4OSA_NULL)
@@ -3593,26 +3593,26 @@ M4OSA_ERR M4xVSS_freeCommand(M4OSA_Context pContext)
/* Delete temporary file */
#ifdef M4xVSS_RESERVED_MOOV_DISK_SPACE
remove((const char *)pParams->pFileTemp);
- M4OSA_free((M4OSA_MemAddr32)pParams->pFileTemp);
+ free(pParams->pFileTemp);
#endif/*M4xVSS_RESERVED_MOOV_DISK_SPACE*/
pParams->pFileTemp = M4OSA_NULL;
}
pParams_sauv = pParams;
pParams = pParams->pNext;
- M4OSA_free((M4OSA_MemAddr32)pParams_sauv);
+ free(pParams_sauv);
pParams_sauv = M4OSA_NULL;
}
}
if(xVSS_context->pcmPreviewFile != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pcmPreviewFile);
+ free(xVSS_context->pcmPreviewFile);
xVSS_context->pcmPreviewFile = M4OSA_NULL;
}
if(xVSS_context->pSettings->pOutputFile != M4OSA_NULL
&& xVSS_context->pOutputFile != M4OSA_NULL)
{
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->pSettings->pOutputFile);
+ free(xVSS_context->pSettings->pOutputFile);
xVSS_context->pSettings->pOutputFile = M4OSA_NULL;
xVSS_context->pOutputFile = M4OSA_NULL;
}
@@ -5006,12 +5006,12 @@ M4OSA_ERR M4xVSS_internalConvertToUTF8(M4OSA_Context pContext, M4OSA_Void* pBuff
M4OSA_TRACE2_1("M4xVSS_internalConvertToUTF8: pConvToUTF8Fct return 0x%x",err);
/*free too small buffer*/
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->\
+ free(xVSS_context->\
UTFConversionContext.pTempOutConversionBuffer);
/*re-allocate the buffer*/
xVSS_context->UTFConversionContext.pTempOutConversionBuffer =
- (M4OSA_Void*)M4OSA_malloc(ConvertedSize*sizeof(M4OSA_UInt8), M4VA,
+ (M4OSA_Void*)M4OSA_32bitAlignedMalloc(ConvertedSize*sizeof(M4OSA_UInt8), M4VA,
(M4OSA_Char *)"M4xVSS_internalConvertToUTF8: UTF conversion buffer");
if(M4OSA_NULL == xVSS_context->UTFConversionContext.pTempOutConversionBuffer)
{
@@ -5085,12 +5085,12 @@ M4OSA_ERR M4xVSS_internalConvertFromUTF8(M4OSA_Context pContext, M4OSA_Void* pBu
M4OSA_TRACE2_1("M4xVSS_internalConvertFromUTF8: pConvFromUTF8Fct return 0x%x",err);
/*free too small buffer*/
- M4OSA_free((M4OSA_MemAddr32)xVSS_context->\
+ free(xVSS_context->\
UTFConversionContext.pTempOutConversionBuffer);
/*re-allocate the buffer*/
xVSS_context->UTFConversionContext.pTempOutConversionBuffer =
- (M4OSA_Void*)M4OSA_malloc(ConvertedSize*sizeof(M4OSA_UInt8), M4VA,
+ (M4OSA_Void*)M4OSA_32bitAlignedMalloc(ConvertedSize*sizeof(M4OSA_UInt8), M4VA,
(M4OSA_Char *)"M4xVSS_internalConvertFromUTF8: UTF conversion buffer");
if(M4OSA_NULL == xVSS_context->UTFConversionContext.pTempOutConversionBuffer)
{
diff --git a/libvideoeditor/vss/stagefrightshells/inc/VideoEditorUtils.h b/libvideoeditor/vss/stagefrightshells/inc/VideoEditorUtils.h
index 29993bc..86d676e 100755
--- a/libvideoeditor/vss/stagefrightshells/inc/VideoEditorUtils.h
+++ b/libvideoeditor/vss/stagefrightshells/inc/VideoEditorUtils.h
@@ -61,7 +61,7 @@
#define SAFE_FREE(p) \
{ \
if(M4OSA_NULL != (p)) { \
- M4OSA_free((M4OSA_MemAddr32)(p)) ; \
+ free((p)) ; \
(p) = M4OSA_NULL ; \
} \
}
@@ -75,7 +75,7 @@
*/
#define SAFE_MALLOC(p, type, count, comment) \
{ \
- (p) = (type*)M4OSA_malloc(sizeof(type)*(count), 0xFF,(M4OSA_Char*)comment);\
+ (p) = (type*)M4OSA_32bitAlignedMalloc(sizeof(type)*(count), 0xFF,(M4OSA_Char*)comment);\
VIDEOEDITOR_CHECK(M4OSA_NULL != (p), M4ERR_ALLOC); \
memset((void *)(p), 0,sizeof(type)*(count)); \
}
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
index 7f74685..6ea9753 100755
--- a/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
+++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditor3gpReader.cpp
@@ -134,7 +134,7 @@ static void VideoEditor3gpReader_BitStreamParserInit(void** pContext,
VideoEditor3gpReader_BitStreamParserContext* pStreamContext;
*pContext=M4OSA_NULL;
- pStreamContext = (VideoEditor3gpReader_BitStreamParserContext*)M4OSA_malloc(
+ pStreamContext = (VideoEditor3gpReader_BitStreamParserContext*)M4OSA_32bitAlignedMalloc(
sizeof(VideoEditor3gpReader_BitStreamParserContext), M4READER_3GP,
(M4OSA_Char*)"3GP BitStreamParser Context");
if (M4OSA_NULL == pStreamContext) {
@@ -156,7 +156,7 @@ static void VideoEditor3gpReader_BitStreamParserInit(void** pContext,
**********************************************************************
*/
static void VideoEditor3gpReader_BitStreamParserCleanUp(void* pContext) {
- M4OSA_free((M4OSA_Int32*)pContext);
+ free((M4OSA_Int32*)pContext);
}
/**
*****************************************************************************
@@ -538,7 +538,7 @@ M4OSA_ERR VideoEditor3gpReader_close(M4OSA_Context context) {
LOGV("VideoEditor3gpReader_close Audio");
if (M4OSA_NULL != pC->mAudioStreamHandler->m_pDecoderSpecificInfo) {
- M4OSA_free((M4OSA_MemAddr32)pC->mAudioStreamHandler->\
+ free(pC->mAudioStreamHandler->\
m_pDecoderSpecificInfo);
pC->mAudioStreamHandler->m_decoderSpecificInfoSize = 0;
pC->mAudioStreamHandler->m_pDecoderSpecificInfo = M4OSA_NULL;
@@ -551,24 +551,24 @@ M4OSA_ERR VideoEditor3gpReader_close(M4OSA_Context context) {
pAU = (M4_AccessUnit*)pAudioSbrUserData->m_pFirstAU;
if (M4OSA_NULL != pAU) {
- M4OSA_free((M4OSA_MemAddr32)pAU);
+ free(pAU);
}
if (M4OSA_NULL != pAudioSbrUserData->m_pAacDecoderUserConfig) {
- M4OSA_free((M4OSA_MemAddr32)pAudioSbrUserData->\
+ free(pAudioSbrUserData->\
m_pAacDecoderUserConfig);
}
- M4OSA_free((M4OSA_MemAddr32)pAudioSbrUserData);
+ free(pAudioSbrUserData);
pC->mAudioStreamHandler->m_pUserData = M4OSA_NULL;
}
if (pC->mAudioStreamHandler->m_pESDSInfo != M4OSA_NULL) {
- M4OSA_free((M4OSA_MemAddr32)pC->mAudioStreamHandler->m_pESDSInfo);
+ free(pC->mAudioStreamHandler->m_pESDSInfo);
pC->mAudioStreamHandler->m_pESDSInfo = M4OSA_NULL;
pC->mAudioStreamHandler->m_ESDSInfoSize = 0;
}
/* Finally destroy the stream handler */
- M4OSA_free((M4OSA_MemAddr32)pC->mAudioStreamHandler);
+ free(pC->mAudioStreamHandler);
pC->mAudioStreamHandler = M4OSA_NULL;
pC->mAudioSource->stop();
@@ -578,27 +578,27 @@ M4OSA_ERR VideoEditor3gpReader_close(M4OSA_Context context) {
LOGV("VideoEditor3gpReader_close Video ");
if(M4OSA_NULL != pC->mVideoStreamHandler->m_pDecoderSpecificInfo) {
- M4OSA_free((M4OSA_MemAddr32)pC->mVideoStreamHandler->\
+ free(pC->mVideoStreamHandler->\
m_pDecoderSpecificInfo);
pC->mVideoStreamHandler->m_decoderSpecificInfoSize = 0;
pC->mVideoStreamHandler->m_pDecoderSpecificInfo = M4OSA_NULL;
}
if(M4OSA_NULL != pC->mVideoStreamHandler->m_pH264DecoderSpecificInfo) {
- M4OSA_free((M4OSA_MemAddr32)pC->mVideoStreamHandler->\
+ free(pC->mVideoStreamHandler->\
m_pH264DecoderSpecificInfo);
pC->mVideoStreamHandler->m_H264decoderSpecificInfoSize = 0;
pC->mVideoStreamHandler->m_pH264DecoderSpecificInfo = M4OSA_NULL;
}
if(pC->mVideoStreamHandler->m_pESDSInfo != M4OSA_NULL) {
- M4OSA_free((M4OSA_MemAddr32)pC->mVideoStreamHandler->m_pESDSInfo);
+ free(pC->mVideoStreamHandler->m_pESDSInfo);
pC->mVideoStreamHandler->m_pESDSInfo = M4OSA_NULL;
pC->mVideoStreamHandler->m_ESDSInfoSize = 0;
}
/* Finally destroy the stream handler */
- M4OSA_free((M4OSA_MemAddr32)pC->mVideoStreamHandler);
+ free(pC->mVideoStreamHandler);
pC->mVideoStreamHandler = M4OSA_NULL;
pC->mVideoSource->stop();
@@ -1081,13 +1081,13 @@ M4OSA_ERR VideoEditor3gpReader_getNextAu(M4OSA_Context context,
if( (pAu->dataAddress == NULL) || (pAu->size < \
mMediaBuffer->range_length())) {
if(pAu->dataAddress != NULL) {
- M4OSA_free((M4OSA_Int32*)pAu->dataAddress);
+ free((M4OSA_Int32*)pAu->dataAddress);
pAu->dataAddress = NULL;
}
LOGV("Buffer lenght = %d ,%d",(mMediaBuffer->range_length() +\
3) & ~0x3,(mMediaBuffer->range_length()));
- pAu->dataAddress = (M4OSA_Int32*)M4OSA_malloc(
+ pAu->dataAddress = (M4OSA_Int32*)M4OSA_32bitAlignedMalloc(
(mMediaBuffer->range_length() + 3) & ~0x3,M4READER_3GP,
(M4OSA_Char*)"pAccessUnit->m_dataAddress" );
if(pAu->dataAddress == NULL) {
@@ -1270,7 +1270,7 @@ static M4OSA_ERR VideoEditor3gpReader_AnalyseAvcDsi(
uiTotalSizeOfPPS;
/**
* Allocate the buffer */
- pAvcSpecInfo =(struct _avcSpecificInfo*)M4OSA_malloc(uiSpecInfoSize,
+ pAvcSpecInfo =(struct _avcSpecificInfo*)M4OSA_32bitAlignedMalloc(uiSpecInfoSize,
M4READER_3GP, (M4OSA_Char*)"MPEG-4 AVC DecoderSpecific");
if (M4OSA_NULL == pAvcSpecInfo) {
VideoEditor3gpReader_BitStreamParserCleanUp(pBitParserContext);
@@ -1312,7 +1312,7 @@ static M4OSA_ERR VideoEditor3gpReader_AnalyseAvcDsi(
pDecoderConfigLocal, decoderConfigSizeLocal);
if (M4OSA_NULL == pBitParserContext) {
- M4OSA_free((M4OSA_MemAddr32)pAvcSpecInfo);
+ free(pAvcSpecInfo);
return M4ERR_ALLOC;
}
@@ -1374,7 +1374,7 @@ static M4OSA_ERR VideoEditor3gpReader_AnalyseAvcDsi(
pStreamHandler->m_pDecoderSpecificInfo = (M4OSA_UInt8*)pAvcSpecInfo;
}
pStreamHandler->m_H264decoderSpecificInfoSize = decoderConfigSizeLocal;
- pStreamHandler->m_pH264DecoderSpecificInfo = (M4OSA_UInt8*)M4OSA_malloc(
+ pStreamHandler->m_pH264DecoderSpecificInfo = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(
decoderConfigSizeLocal, M4READER_3GP,
(M4OSA_Char*)"MPEG-4 AVC DecoderSpecific");
if (M4OSA_NULL == pStreamHandler->m_pH264DecoderSpecificInfo) {
@@ -1476,7 +1476,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
pC->mStreamType = streamType;
pC->mStreamId = pC->mCurrTrack;
- pVideoStreamHandler = (M4_VideoStreamHandler*)M4OSA_malloc
+ pVideoStreamHandler = (M4_VideoStreamHandler*)M4OSA_32bitAlignedMalloc
(sizeof(M4_VideoStreamHandler), M4READER_3GP,
(M4OSA_Char*)"M4_VideoStreamHandler");
if (M4OSA_NULL == pVideoStreamHandler) {
@@ -1531,7 +1531,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
if (meta->findData(kKeyD263, &type, &data, &size)) {
(*pStreamHandler)->m_decoderSpecificInfoSize = size;
if ((*pStreamHandler)->m_decoderSpecificInfoSize != 0) {
- DecoderSpecific = (M4OSA_UInt8*)M4OSA_malloc(
+ DecoderSpecific = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(
(*pStreamHandler)->m_decoderSpecificInfoSize,
M4READER_3GP,(M4OSA_Char*)"H263 DSI");
if (M4OSA_NULL == DecoderSpecific) {
@@ -1566,7 +1566,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
if(meta->findData(kKeyAVCC, &type, &data, &size)) {
decoderSpecificInfoSize = size;
if (decoderSpecificInfoSize != 0) {
- DecoderSpecificInfo = (M4OSA_Int8*)M4OSA_malloc(
+ DecoderSpecificInfo = (M4OSA_Int8*)M4OSA_32bitAlignedMalloc(
decoderSpecificInfoSize, M4READER_3GP,
(M4OSA_Char*)"H264 DecoderSpecific" );
if (M4OSA_NULL == DecoderSpecificInfo) {
@@ -1594,7 +1594,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
m_H264decoderSpecificInfoSize);
if(M4OSA_NULL != DecoderSpecificInfo) {
- M4OSA_free((M4OSA_MemAddr32)DecoderSpecificInfo);
+ free(DecoderSpecificInfo);
DecoderSpecificInfo = M4OSA_NULL;
}
} else if( (M4DA_StreamTypeVideoMpeg4 == streamType) ) {
@@ -1604,7 +1604,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
(*pStreamHandler)->m_ESDSInfoSize = size;
(*pStreamHandler)->m_pESDSInfo = (M4OSA_UInt8*)\
- M4OSA_malloc((*pStreamHandler)->m_ESDSInfoSize,
+ M4OSA_32bitAlignedMalloc((*pStreamHandler)->m_ESDSInfoSize,
M4READER_3GP, (M4OSA_Char*)"H263 DecoderSpecific" );
if (M4OSA_NULL == (*pStreamHandler)->m_pESDSInfo) {
return M4ERR_ALLOC;
@@ -1620,7 +1620,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
(*pStreamHandler)->m_decoderSpecificInfoSize =
codec_specific_data_size;
if ((*pStreamHandler)->m_decoderSpecificInfoSize != 0) {
- DecoderSpecific = (M4OSA_UInt8*)M4OSA_malloc(
+ DecoderSpecific = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(
(*pStreamHandler)->m_decoderSpecificInfoSize,
M4READER_3GP, (M4OSA_Char*)" DecoderSpecific" );
if (M4OSA_NULL == DecoderSpecific) {
@@ -1672,7 +1672,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
LOGV("VE streamtype %d ,id %d", streamType, pC->mCurrTrack);
- pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_malloc
+ pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_32bitAlignedMalloc
(sizeof(M4_AudioStreamHandler), M4READER_3GP,
(M4OSA_Char*)"M4_AudioStreamHandler");
if (M4OSA_NULL == pAudioStreamHandler) {
@@ -1721,7 +1721,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
codec_specific_data_size;
if ((*pStreamHandler)->m_decoderSpecificInfoSize != 0) {
- DecoderSpecific = (M4OSA_UInt8*)M4OSA_malloc(
+ DecoderSpecific = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(
(*pStreamHandler)->m_decoderSpecificInfoSize,
M4READER_3GP, (M4OSA_Char*)"H263 DecoderSpecific" );
if (M4OSA_NULL == DecoderSpecific) {
@@ -1739,7 +1739,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
M4OSA_UChar AmrDsi[] =
{'P','H','L','P',0x00, 0x00, 0x80, 0x00, 0x01,};
(*pStreamHandler)->m_decoderSpecificInfoSize = 9;
- DecoderSpecific = (M4OSA_UInt8*)M4OSA_malloc(
+ DecoderSpecific = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(
(*pStreamHandler)->m_decoderSpecificInfoSize,
M4READER_3GP, (M4OSA_Char*)"H263 DecoderSpecific" );
if (M4OSA_NULL == DecoderSpecific) {
@@ -1763,7 +1763,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
CHECK_EQ(esds.InitCheck(), OK);
(*pStreamHandler)->m_ESDSInfoSize = size;
- (*pStreamHandler)->m_pESDSInfo = (M4OSA_UInt8*)M4OSA_malloc(
+ (*pStreamHandler)->m_pESDSInfo = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(
(*pStreamHandler)->m_ESDSInfoSize, M4READER_3GP,
(M4OSA_Char*)"H263 DecoderSpecific" );
if (M4OSA_NULL == (*pStreamHandler)->m_pESDSInfo) {
@@ -1780,7 +1780,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
(*pStreamHandler)->m_decoderSpecificInfoSize =
codec_specific_data_size;
if ((*pStreamHandler)->m_decoderSpecificInfoSize != 0) {
- DecoderSpecific = (M4OSA_UInt8*)M4OSA_malloc(
+ DecoderSpecific = (M4OSA_UInt8*)M4OSA_32bitAlignedMalloc(
(*pStreamHandler)->m_decoderSpecificInfoSize,
M4READER_3GP, (M4OSA_Char*)"H263 DecoderSpecific" );
if (M4OSA_NULL == DecoderSpecific) {
@@ -1824,7 +1824,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
if(M4DA_StreamTypeAudioAac == (*pStreamHandler)->m_streamType) {
M4READER_AudioSbrUserdata* pAudioSbrUserdata;
- pAudioSbrUserdata = (M4READER_AudioSbrUserdata*)M4OSA_malloc(
+ pAudioSbrUserdata = (M4READER_AudioSbrUserdata*)M4OSA_32bitAlignedMalloc(
sizeof(M4READER_AudioSbrUserdata),M4READER_3GP,
(M4OSA_Char*)"M4READER_AudioSbrUserdata");
if (M4OSA_NULL == pAudioSbrUserdata) {
@@ -1834,7 +1834,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
(*pStreamHandler)->m_pUserData = pAudioSbrUserdata;
pAudioSbrUserdata->m_bIsSbrEnabled = M4OSA_FALSE;
- pAudioSbrUserdata->m_pFirstAU = (M4_AccessUnit*)M4OSA_malloc(
+ pAudioSbrUserdata->m_pFirstAU = (M4_AccessUnit*)M4OSA_32bitAlignedMalloc(
sizeof(M4_AccessUnit),M4READER_3GP, (M4OSA_Char*)"1st AAC AU");
if (M4OSA_NULL == pAudioSbrUserdata->m_pFirstAU) {
pAudioSbrUserdata->m_pAacDecoderUserConfig = M4OSA_NULL;
@@ -1842,7 +1842,7 @@ M4OSA_ERR VideoEditor3gpReader_getNextStreamHandler(M4OSA_Context context,
goto Error;
}
pAudioSbrUserdata->m_pAacDecoderUserConfig = (M4_AacDecoderConfig*)\
- M4OSA_malloc(sizeof(M4_AacDecoderConfig),M4READER_3GP,
+ M4OSA_32bitAlignedMalloc(sizeof(M4_AacDecoderConfig),M4READER_3GP,
(M4OSA_Char*)"m_pAacDecoderUserConfig");
if (M4OSA_NULL == pAudioSbrUserdata->m_pAacDecoderUserConfig) {
err = M4ERR_ALLOC;
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c b/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c
index 2f534db..37f960a 100755
--- a/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c
+++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditorBuffer.c
@@ -32,7 +32,7 @@
{ \
if(M4OSA_NULL != p) \
{ \
- M4OSA_free((M4OSA_MemAddr32)p); \
+ free(p); \
p = M4OSA_NULL; \
} \
}
@@ -59,7 +59,7 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_allocatePool(VIDEOEDITOR_BUFFER_Pool** ppool,
ppool, nbBuffers);
pool = M4OSA_NULL;
- pool = (VIDEOEDITOR_BUFFER_Pool*)M4OSA_malloc(
+ pool = (VIDEOEDITOR_BUFFER_Pool*)M4OSA_32bitAlignedMalloc(
sizeof(VIDEOEDITOR_BUFFER_Pool), VIDEOEDITOR_BUFFER_EXTERNAL,
(M4OSA_Char*)("VIDEOEDITOR_BUFFER_allocatePool: pool"));
if (M4OSA_NULL == pool)
@@ -70,7 +70,7 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_allocatePool(VIDEOEDITOR_BUFFER_Pool** ppool,
LOGV("VIDEOEDITOR_BUFFER_allocatePool : Allocating Pool buffers");
pool->pNXPBuffer = M4OSA_NULL;
- pool->pNXPBuffer = (VIDEOEDITOR_BUFFER_Buffer*)M4OSA_malloc(
+ pool->pNXPBuffer = (VIDEOEDITOR_BUFFER_Buffer*)M4OSA_32bitAlignedMalloc(
sizeof(VIDEOEDITOR_BUFFER_Buffer)*nbBuffers,
VIDEOEDITOR_BUFFER_EXTERNAL,
(M4OSA_Char*)("BUFFER_allocatePool: pNXPBuffer"));
@@ -82,7 +82,7 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_allocatePool(VIDEOEDITOR_BUFFER_Pool** ppool,
LOGV("VIDEOEDITOR_BUFFER_allocatePool : Allocating Pool name buffer");
pool->poolName = M4OSA_NULL;
- pool->poolName = (M4OSA_Char*)M4OSA_malloc(
+ pool->poolName = (M4OSA_Char*)M4OSA_32bitAlignedMalloc(
VIDEOEDITOR_BUFFEPOOL_MAX_NAME_SIZE,VIDEOEDITOR_BUFFER_EXTERNAL,
(M4OSA_Char*)("VIDEOEDITOR_BUFFER_allocatePool: poolname"));
if(pool->poolName == M4OSA_NULL)
@@ -134,7 +134,7 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_freePool(VIDEOEDITOR_BUFFER_Pool* ppool)
{
if(M4OSA_NULL != ppool->pNXPBuffer[j].pData)
{
- M4OSA_free((M4OSA_MemAddr32)ppool->pNXPBuffer[j].pData);
+ free(ppool->pNXPBuffer[j].pData);
ppool->pNXPBuffer[j].pData = M4OSA_NULL;
}
}
@@ -211,7 +211,7 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_initPoolBuffers(VIDEOEDITOR_BUFFER_Pool* pool,
for(index = 0; index < pool->NB; index++)
{
pool->pNXPBuffer[index].pData = M4OSA_NULL;
- pool->pNXPBuffer[index].pData = (M4OSA_Void*)M4OSA_malloc(
+ pool->pNXPBuffer[index].pData = (M4OSA_Void*)M4OSA_32bitAlignedMalloc(
lSize, VIDEOEDITOR_BUFFER_EXTERNAL,
(M4OSA_Char*)("BUFFER_initPoolBuffers: Buffer data"));
if(M4OSA_NULL == pool->pNXPBuffer[index].pData)
@@ -220,7 +220,7 @@ M4OSA_ERR VIDEOEDITOR_BUFFER_initPoolBuffers(VIDEOEDITOR_BUFFER_Pool* pool,
{
if(M4OSA_NULL != pool->pNXPBuffer[j].pData)
{
- M4OSA_free((M4OSA_MemAddr32)pool->pNXPBuffer[j].pData);
+ free(pool->pNXPBuffer[j].pData);
pool->pNXPBuffer[j].pData = M4OSA_NULL;
}
}
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp
index c55b89b..d126fae 100755
--- a/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp
+++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditorMp3Reader.cpp
@@ -218,7 +218,7 @@ M4OSA_ERR VideoEditorMp3Reader_close(M4OSA_Context context) {
if (pReaderContext->mAudioStreamHandler != NULL) {
if (M4OSA_NULL != pReaderContext->mAudioStreamHandler->\
m_basicProperties.m_pDecoderSpecificInfo) {
- M4OSA_free((M4OSA_MemAddr32)pReaderContext->mAudioStreamHandler->\
+ free(pReaderContext->mAudioStreamHandler->\
m_basicProperties.m_pDecoderSpecificInfo);
pReaderContext->mAudioStreamHandler->m_basicProperties.\
m_decoderSpecificInfoSize = 0;
@@ -227,11 +227,11 @@ M4OSA_ERR VideoEditorMp3Reader_close(M4OSA_Context context) {
}
/* Finally destroy the stream handler */
- M4OSA_free((M4OSA_MemAddr32)pReaderContext->mAudioStreamHandler);
+ free(pReaderContext->mAudioStreamHandler);
pReaderContext->mAudioStreamHandler = M4OSA_NULL;
if (pReaderContext->mAudioAu.dataAddress != NULL) {
- M4OSA_free((M4OSA_MemAddr32)pReaderContext->mAudioAu.dataAddress);
+ free(pReaderContext->mAudioAu.dataAddress);
pReaderContext->mAudioAu.dataAddress = NULL;
}
}
@@ -503,7 +503,7 @@ M4OSA_ERR VideoEditorMp3Reader_getNextStream(M4OSA_Context context,
streamDesc.maxBitrate = streamDesc.averageBitrate;
/* Allocate the audio stream handler and set its parameters */
- pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_malloc(
+ pAudioStreamHandler = (M4_AudioStreamHandler*)M4OSA_32bitAlignedMalloc(
sizeof(M4_AudioStreamHandler), M4READER_MP3,
(M4OSA_Char*)"M4_AudioStreamHandler");
@@ -700,10 +700,10 @@ M4OSA_ERR VideoEditorMp3Reader_getNextAu(M4OSA_Context context,
if ((pAu->dataAddress == NULL) ||
(pAu->size < mAudioBuffer->range_length())) {
if (pAu->dataAddress != NULL) {
- M4OSA_free((M4OSA_Int32*)pAu->dataAddress);
+ free((M4OSA_Int32*)pAu->dataAddress);
pAu->dataAddress = NULL;
}
- pAu->dataAddress = (M4OSA_Int32*)M4OSA_malloc(
+ pAu->dataAddress = (M4OSA_Int32*)M4OSA_32bitAlignedMalloc(
(mAudioBuffer->range_length() + 3) & ~0x3,
M4READER_MP3, (M4OSA_Char*)"pAccessUnit->m_dataAddress" );
diff --git a/libvideoeditor/vss/stagefrightshells/src/VideoEditorVideoDecoder.cpp b/libvideoeditor/vss/stagefrightshells/src/VideoEditorVideoDecoder.cpp
index fb0d89e..809579b 100755
--- a/libvideoeditor/vss/stagefrightshells/src/VideoEditorVideoDecoder.cpp
+++ b/libvideoeditor/vss/stagefrightshells/src/VideoEditorVideoDecoder.cpp
@@ -1585,7 +1585,7 @@ M4OSA_ERR VideoEditorVideoDecoder_getInterface(M4DECODER_VideoType decoderType,
M4DECODER_VideoType *pDecoderType, M4OSA_Context *pDecInterface) {
M4DECODER_VideoInterface* pDecoderInterface = M4OSA_NULL;
- pDecoderInterface = (M4DECODER_VideoInterface*)M4OSA_malloc(
+ pDecoderInterface = (M4DECODER_VideoInterface*)M4OSA_32bitAlignedMalloc(
sizeof(M4DECODER_VideoInterface), M4DECODER_EXTERNAL,
(M4OSA_Char*)"VideoEditorVideoDecoder_getInterface" );
if (M4OSA_NULL == pDecoderInterface) {
@@ -1609,7 +1609,7 @@ M4OSA_ERR VideoEditorVideoDecoder_getSoftwareInterface(M4DECODER_VideoType decod
M4DECODER_VideoType *pDecoderType, M4OSA_Context *pDecInterface) {
M4DECODER_VideoInterface* pDecoderInterface = M4OSA_NULL;
- pDecoderInterface = (M4DECODER_VideoInterface*)M4OSA_malloc(
+ pDecoderInterface = (M4DECODER_VideoInterface*)M4OSA_32bitAlignedMalloc(
sizeof(M4DECODER_VideoInterface), M4DECODER_EXTERNAL,
(M4OSA_Char*)"VideoEditorVideoDecoder_getInterface" );
if (M4OSA_NULL == pDecoderInterface) {
diff --git a/libvideoeditor/vss/video_filters/src/M4VIFI_RGB565toYUV420.c b/libvideoeditor/vss/video_filters/src/M4VIFI_RGB565toYUV420.c
index 6192e4e..6192e4e 100644..100755
--- a/libvideoeditor/vss/video_filters/src/M4VIFI_RGB565toYUV420.c
+++ b/libvideoeditor/vss/video_filters/src/M4VIFI_RGB565toYUV420.c
diff --git a/libvideoeditor/vss/video_filters/src/M4VIFI_ResizeRGB565toRGB565.c b/libvideoeditor/vss/video_filters/src/M4VIFI_ResizeRGB565toRGB565.c
index 256687c..256687c 100644..100755
--- a/libvideoeditor/vss/video_filters/src/M4VIFI_ResizeRGB565toRGB565.c
+++ b/libvideoeditor/vss/video_filters/src/M4VIFI_ResizeRGB565toRGB565.c