mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-04-05 06:04:50 +00:00
Added video frame dispose macro
This commit is contained in:
@@ -301,9 +301,7 @@ static void *sender_thread(void *arg) {
|
||||
data->send_frame(data->tx_module_state, tx_frame);
|
||||
}
|
||||
|
||||
if (tx_frame->dispose) {
|
||||
tx_frame->dispose(tx_frame);
|
||||
}
|
||||
VIDEO_FRAME_DISPOSE(tx_frame);
|
||||
|
||||
if (data->rxtx_protocol == ULTRAGRID_RTP || data->rxtx_protocol == H264_STD) {
|
||||
struct ultragrid_rtp_state *rtp_state = data->tx_module_state;
|
||||
|
||||
@@ -151,9 +151,7 @@ struct dispose_original_frame_udata {
|
||||
pthread_mutex_lock(&inst->m_lock);
|
||||
inst->m_disposed++;
|
||||
if (inst->m_disposed == inst->m_original_frame->tile_count) {
|
||||
if (inst->m_original_frame->dispose) {
|
||||
inst->m_original_frame->dispose(inst->m_original_frame);
|
||||
}
|
||||
VIDEO_FRAME_DISPOSE(inst->m_original_frame);
|
||||
pthread_mutex_unlock(&inst->m_lock);
|
||||
delete inst;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,7 @@ struct auto_video_frame_disposer {
|
||||
}
|
||||
|
||||
~auto_video_frame_disposer() {
|
||||
if (m_frame->dispose)
|
||||
m_frame->dispose(m_frame);
|
||||
VIDEO_FRAME_DISPOSE(m_frame);
|
||||
}
|
||||
|
||||
struct video_frame *m_frame;
|
||||
|
||||
@@ -591,8 +591,7 @@ static struct video_frame *compress_frame_tiles(struct compress_state_real *s,
|
||||
|
||||
if (failed) {
|
||||
for(unsigned int i = 0; i < frame->tile_count; ++i) {
|
||||
if (compressed_tiles[i] && compressed_tiles[i]->dispose)
|
||||
compressed_tiles[i]->dispose(compressed_tiles[i]);
|
||||
VIDEO_FRAME_DISPOSE(compressed_tiles[i]);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -204,8 +204,6 @@ struct video_frame *cuda_dxt_compress_tile(struct module *mod, struct video_fram
|
||||
s->saved_desc = video_desc_from_frame(tx);
|
||||
} else {
|
||||
fprintf(stderr, "[CUDA DXT] Reconfiguration failed!\n");
|
||||
if (tx->dispose)
|
||||
tx->dispose(tx);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,14 +692,12 @@ struct video_frame *libavcodec_compress_tile(struct module *mod, struct video_fr
|
||||
|
||||
platform_spin_unlock(&s->spin);
|
||||
|
||||
if (tx->dispose)
|
||||
tx->dispose(tx);
|
||||
VIDEO_FRAME_DISPOSE(tx);
|
||||
|
||||
return out;
|
||||
|
||||
error:
|
||||
if (tx->dispose)
|
||||
tx->dispose(tx);
|
||||
VIDEO_FRAME_DISPOSE(tx);
|
||||
platform_spin_unlock(&s->spin);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,9 @@ extern "C" {
|
||||
#define PARAM_TILE_COUNT (1<<6u)
|
||||
/**@}*/
|
||||
|
||||
#define VIDEO_FRAME_DISPOSE(frame) if (frame && frame->dispose) \
|
||||
frame->dispose(frame)
|
||||
|
||||
/**
|
||||
* @brief Allocates blank video frame
|
||||
* @param count number of allocated tiles
|
||||
|
||||
Reference in New Issue
Block a user