You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-09-16 08:36:51 +02:00
lavc: make compilation of frame_thread_encoder.o optional.
Only compile if CONFIG_ENCODERS is enabled, i.e. if at least one encoder is to be compiled. This prevents it from being includes in a decoder-only build. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
committed by
Michael Niedermayer
parent
4a88d81c9e
commit
b76d853697
3
configure
vendored
3
configure
vendored
@@ -1511,6 +1511,7 @@ CONFIG_EXTRA="
|
|||||||
audio_frame_queue
|
audio_frame_queue
|
||||||
dsputil
|
dsputil
|
||||||
error_resilience
|
error_resilience
|
||||||
|
frame_thread_encoder
|
||||||
gcrypt
|
gcrypt
|
||||||
golomb
|
golomb
|
||||||
gplv3
|
gplv3
|
||||||
@@ -1671,6 +1672,7 @@ log2_deps="!msvcrt"
|
|||||||
# subsystems
|
# subsystems
|
||||||
dct_select="rdft"
|
dct_select="rdft"
|
||||||
error_resilience_select="dsputil"
|
error_resilience_select="dsputil"
|
||||||
|
frame_thread_encoder_deps="encoders threads"
|
||||||
mdct_select="fft"
|
mdct_select="fft"
|
||||||
rdft_select="fft"
|
rdft_select="fft"
|
||||||
mpegaudio_select="mpegaudiodsp"
|
mpegaudio_select="mpegaudiodsp"
|
||||||
@@ -4239,6 +4241,7 @@ case $target_os in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
enabled_any $THREADS_LIST && enable threads
|
enabled_any $THREADS_LIST && enable threads
|
||||||
|
enable frame_thread_encoder
|
||||||
|
|
||||||
enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
|
enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
|
||||||
|
|
||||||
|
@@ -773,9 +773,11 @@ OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += remove_extradata_bsf.o
|
|||||||
OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
|
OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o
|
||||||
|
|
||||||
# thread libraries
|
# thread libraries
|
||||||
OBJS-$(HAVE_PTHREADS) += pthread.o frame_thread_encoder.o
|
OBJS-$(HAVE_PTHREADS) += pthread.o
|
||||||
OBJS-$(HAVE_W32THREADS) += pthread.o frame_thread_encoder.o
|
OBJS-$(HAVE_W32THREADS) += pthread.o
|
||||||
OBJS-$(HAVE_OS2THREADS) += pthread.o frame_thread_encoder.o
|
OBJS-$(HAVE_OS2THREADS) += pthread.o
|
||||||
|
|
||||||
|
OBJS-$(CONFIG_FRAME_THREAD_ENCODER) += frame_thread_encoder.o
|
||||||
|
|
||||||
SKIPHEADERS += %_tablegen.h \
|
SKIPHEADERS += %_tablegen.h \
|
||||||
%_tables.h \
|
%_tables.h \
|
||||||
|
@@ -1144,7 +1144,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
|
|||||||
if (!HAVE_THREADS)
|
if (!HAVE_THREADS)
|
||||||
av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n");
|
av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n");
|
||||||
|
|
||||||
if (HAVE_THREADS) {
|
if (CONFIG_FRAME_THREAD_ENCODER) {
|
||||||
ff_unlock_avcodec(); //we will instanciate a few encoders thus kick the counter to prevent false detection of a problem
|
ff_unlock_avcodec(); //we will instanciate a few encoders thus kick the counter to prevent false detection of a problem
|
||||||
ret = ff_frame_thread_encoder_init(avctx, options ? *options : NULL);
|
ret = ff_frame_thread_encoder_init(avctx, options ? *options : NULL);
|
||||||
ff_lock_avcodec(avctx);
|
ff_lock_avcodec(avctx);
|
||||||
@@ -1706,7 +1706,8 @@ int attribute_align_arg avcodec_encode_video2(AVCodecContext *avctx,
|
|||||||
|
|
||||||
*got_packet_ptr = 0;
|
*got_packet_ptr = 0;
|
||||||
|
|
||||||
if(HAVE_THREADS && avctx->internal->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))
|
if(CONFIG_FRAME_THREAD_ENCODER &&
|
||||||
|
avctx->internal->frame_thread_encoder && (avctx->active_thread_type&FF_THREAD_FRAME))
|
||||||
return ff_thread_video_encode_frame(avctx, avpkt, frame, got_packet_ptr);
|
return ff_thread_video_encode_frame(avctx, avpkt, frame, got_packet_ptr);
|
||||||
|
|
||||||
if ((avctx->flags&CODEC_FLAG_PASS1) && avctx->stats_out)
|
if ((avctx->flags&CODEC_FLAG_PASS1) && avctx->stats_out)
|
||||||
@@ -2279,7 +2280,8 @@ av_cold int avcodec_close(AVCodecContext *avctx)
|
|||||||
if (avcodec_is_open(avctx)) {
|
if (avcodec_is_open(avctx)) {
|
||||||
FramePool *pool = avctx->internal->pool;
|
FramePool *pool = avctx->internal->pool;
|
||||||
int i;
|
int i;
|
||||||
if (HAVE_THREADS && avctx->internal->frame_thread_encoder && avctx->thread_count > 1) {
|
if (CONFIG_FRAME_THREAD_ENCODER &&
|
||||||
|
avctx->internal->frame_thread_encoder && avctx->thread_count > 1) {
|
||||||
ff_unlock_avcodec();
|
ff_unlock_avcodec();
|
||||||
ff_frame_thread_encoder_free(avctx);
|
ff_frame_thread_encoder_free(avctx);
|
||||||
ff_lock_avcodec(avctx);
|
ff_lock_avcodec(avctx);
|
||||||
|
Reference in New Issue
Block a user