Rpi callbacks moved to rpi4_out.cpp

av_frame_wrapper_recycle() and av_frame_wrapper_copy() moved from header
to rpi4_out.cpp.
This commit is contained in:
Martin Pulec
2022-01-28 10:08:32 +01:00
parent 148a93a51d
commit 910bc642f8
2 changed files with 16 additions and 21 deletions

View File

@@ -59,27 +59,6 @@ typedef struct av_frame_wrapper{
struct AVFrame *av_frame;
} av_frame_wrapper;
#ifdef HAVE_LAVC
#include "libavcodec_common.h"
static inline void av_frame_wrapper_recycle(struct video_frame *f){
for(unsigned i = 0; i < f->tile_count; i++){
av_frame_wrapper *wrapper = (av_frame_wrapper *)(void *) f->tiles[i].data;
av_frame_unref(wrapper->av_frame);
}
}
static inline void av_frame_wrapper_copy(struct video_frame *f){
for(unsigned i = 0; i < f->tile_count; i++){
av_frame_wrapper *wrapper = (av_frame_wrapper *)(void *) f->tiles[i].data;
wrapper->av_frame = av_frame_clone(wrapper->av_frame);
}
}
#endif // HAVE_LAVC
#ifdef __cplusplus
}
#endif

View File

@@ -443,6 +443,22 @@ static void frame_data_deleter(struct video_frame *buf){
delete wrapper;
}
static inline void av_frame_wrapper_recycle(struct video_frame *f){
for(unsigned i = 0; i < f->tile_count; i++){
av_frame_wrapper *wrapper = (av_frame_wrapper *)(void *) f->tiles[i].data;
av_frame_unref(wrapper->av_frame);
}
}
static inline void av_frame_wrapper_copy(struct video_frame *f){
for(unsigned i = 0; i < f->tile_count; i++){
av_frame_wrapper *wrapper = (av_frame_wrapper *)(void *) f->tiles[i].data;
wrapper->av_frame = av_frame_clone(wrapper->av_frame);
}
}
static struct video_frame *alloc_new_frame(rpi4_display_state *s){
auto new_frame = vf_alloc_desc(s->current_desc);