Skip to content

Commit

Permalink
lavc: add new API for iterating codecs and codec parsers
Browse files Browse the repository at this point in the history
Based on an unfinished patch by atomnuker.
  • Loading branch information
jdek committed Feb 6, 2018
1 parent caa4bd7 commit 7e8eba2
Show file tree
Hide file tree
Showing 9 changed files with 966 additions and 738 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ distclean:: clean
$(RM) .version avversion.h config.asm config.h mapfile \
ffbuild/.config ffbuild/config.* libavutil/avconfig.h \
version.h libavutil/ffversion.h libavcodec/codec_names.h \
libavcodec/bsf_list.c libavformat/protocol_list.c
libavcodec/bsf_list.c libavformat/protocol_list.c \
libavcodec/codec_list.c libavcodec/parser_list.c
ifeq ($(SRC_LINK),src)
$(RM) src
endif
Expand Down
12 changes: 9 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3525,9 +3525,6 @@ find_things(){
sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
}

ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
Expand All @@ -3541,6 +3538,13 @@ find_things_extern(){
sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$thing/p" "$file"
}

ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c)
DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c)
CODEC_LIST="
$ENCODER_LIST
$DECODER_LIST
"
PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parser.c)
BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
HWACCEL_LIST=$(find_things_extern hwaccel AVHWAccel libavcodec/hwaccels.h)
PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
Expand Down Expand Up @@ -7029,6 +7033,8 @@ print_enabled_components(){
cp_if_changed $TMPH $file
}

print_enabled_components libavcodec/codec_list.c AVCodec codec_list $CODEC_LIST
print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST

Expand Down
4 changes: 4 additions & 0 deletions doc/APIchanges
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ libavutil: 2017-10-21

API changes, most recent first:

2018-01-xx - xxxxxxx - lavc 58.9.100 - avcodec.h
Deprecate use of avcodec_register(), avcodec_register_all(), and
av_codec_next(). Add av_codec_iterate().

2018-02-xx - xxxxxxx - lavf 58.8.100 - avformat.h
Deprecate the current names of the RTSP "timeout", "stimeout", "user-agent"
options. Introduce "listen_timeout" as replacement for the current "timeout"
Expand Down
2 changes: 2 additions & 0 deletions libavcodec/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
/*_tables.c
/*_tables.h
/bsf_list.c
/codec_list.c
/parser_list.c
Loading

0 comments on commit 7e8eba2

Please sign in to comment.