mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 09:06:50 +08:00
[osal]: add clear operation to mpp_free
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@210 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
@@ -93,7 +93,6 @@ MPP_RET mpp_buf_slot_deinit(MppBufSlots slots)
|
|||||||
|
|
||||||
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
|
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
|
||||||
delete impl->lock;
|
delete impl->lock;
|
||||||
if (impl->slots)
|
|
||||||
mpp_free(impl->slots);
|
mpp_free(impl->slots);
|
||||||
mpp_free(slots);
|
mpp_free(slots);
|
||||||
return MPP_OK;
|
return MPP_OK;
|
||||||
|
@@ -252,7 +252,7 @@ MPP_RET mpp_dec_init(MppDec **dec, MppCodingType coding)
|
|||||||
// then init hal with task count from parser
|
// then init hal with task count from parser
|
||||||
MppHalCfg hal_cfg = {
|
MppHalCfg hal_cfg = {
|
||||||
MPP_CTX_DEC,
|
MPP_CTX_DEC,
|
||||||
MPP_VIDEO_CodingAVC,
|
coding,
|
||||||
NULL,
|
NULL,
|
||||||
parser_cfg.task_count,
|
parser_cfg.task_count,
|
||||||
};
|
};
|
||||||
@@ -279,7 +279,6 @@ MPP_RET mpp_dec_deinit(MppDec *dec)
|
|||||||
return MPP_ERR_NULL_PTR;
|
return MPP_ERR_NULL_PTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dec->parser_ctx)
|
|
||||||
mpp_free(dec->parser_ctx);
|
mpp_free(dec->parser_ctx);
|
||||||
|
|
||||||
if (dec->hal_ctx)
|
if (dec->hal_ctx)
|
||||||
|
@@ -83,7 +83,6 @@ MPP_RET mpp_hal_init(MppHal *ctx, MppHalCfg *cfg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mpp_err_f("could not found coding type %d\n", cfg->coding);
|
mpp_err_f("could not found coding type %d\n", cfg->coding);
|
||||||
if (p->ctx)
|
|
||||||
mpp_free(p->ctx);
|
mpp_free(p->ctx);
|
||||||
mpp_free(p);
|
mpp_free(p);
|
||||||
|
|
||||||
@@ -98,7 +97,6 @@ MPP_RET mpp_hal_deinit(MppHal ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MppHalImpl *p = (MppHalImpl*)ctx;
|
MppHalImpl *p = (MppHalImpl*)ctx;
|
||||||
if (p->ctx)
|
|
||||||
mpp_free(p->ctx);
|
mpp_free(p->ctx);
|
||||||
if (p->tasks)
|
if (p->tasks)
|
||||||
hal_task_group_deinit(p->tasks);
|
hal_task_group_deinit(p->tasks);
|
||||||
|
@@ -224,14 +224,8 @@ RK_S32 vpu_close_context(VpuCodecContext **ctx)
|
|||||||
delete api;
|
delete api;
|
||||||
s->vpuApiObj = NULL;
|
s->vpuApiObj = NULL;
|
||||||
}
|
}
|
||||||
if (s->extradata) {
|
|
||||||
mpp_free(s->extradata);
|
mpp_free(s->extradata);
|
||||||
s->extradata = NULL;
|
|
||||||
}
|
|
||||||
if (s->private_data) {
|
|
||||||
mpp_free(s->private_data);
|
mpp_free(s->private_data);
|
||||||
s->private_data = NULL;
|
|
||||||
}
|
|
||||||
mpp_free(s);
|
mpp_free(s);
|
||||||
*ctx = s = NULL;
|
*ctx = s = NULL;
|
||||||
|
|
||||||
|
@@ -224,7 +224,6 @@ MPP_RET mpp_deinit(MppCtx ctx)
|
|||||||
if (p->ctx)
|
if (p->ctx)
|
||||||
delete p->ctx;
|
delete p->ctx;
|
||||||
|
|
||||||
if (p)
|
|
||||||
mpp_free(p);
|
mpp_free(p);
|
||||||
|
|
||||||
MPI_FUNCTION_LEAVE();
|
MPI_FUNCTION_LEAVE();
|
||||||
|
@@ -154,7 +154,6 @@ void Mpp::clear()
|
|||||||
mpp_buffer_group_put(mFrameGroup);
|
mpp_buffer_group_put(mFrameGroup);
|
||||||
mFrameGroup = NULL;
|
mFrameGroup = NULL;
|
||||||
}
|
}
|
||||||
if (mTask)
|
|
||||||
mpp_free(mTask);
|
mpp_free(mTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,7 +58,6 @@ MPP_RET mpp_packet_deinit(MppPacket *packet)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mpp_free(*packet);
|
mpp_free(*packet);
|
||||||
*packet = NULL;
|
|
||||||
return MPP_OK;
|
return MPP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,13 @@
|
|||||||
#define mpp_realloc(ptr, type, count) \
|
#define mpp_realloc(ptr, type, count) \
|
||||||
(type*)mpp_osal_realloc(MODULE_TAG, ptr, sizeof(type) * (count))
|
(type*)mpp_osal_realloc(MODULE_TAG, ptr, sizeof(type) * (count))
|
||||||
|
|
||||||
#define mpp_free(ptr) mpp_osal_free(ptr)
|
#define mpp_free(ptr) \
|
||||||
|
do { \
|
||||||
|
if (ptr) { \
|
||||||
|
mpp_osal_free(ptr); \
|
||||||
|
ptr = NULL; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@@ -121,7 +121,6 @@ MPP_RET mpp_alloctor_put(MppAllocator *allocator)
|
|||||||
if (p->os_api.close)
|
if (p->os_api.close)
|
||||||
p->os_api.close(p->ctx);
|
p->os_api.close(p->ctx);
|
||||||
pthread_mutex_destroy(&p->lock);
|
pthread_mutex_destroy(&p->lock);
|
||||||
if (p)
|
|
||||||
mpp_free(p);
|
mpp_free(p);
|
||||||
|
|
||||||
return MPP_OK;
|
return MPP_OK;
|
||||||
|
Reference in New Issue
Block a user