2013-11-23 13:43:13 +03:00
|
|
|
/*
|
2016-04-17 19:47:25 +02:00
|
|
|
* This file is part of FFmpeg.
|
2013-11-23 13:43:13 +03:00
|
|
|
*
|
2016-04-17 19:47:25 +02:00
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2013-11-23 13:43:13 +03:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
2016-04-17 19:47:25 +02:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2013-11-23 13:43:13 +03:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2016-04-17 19:47:25 +02:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2013-11-23 13:43:13 +03:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include "libavutil/common.h"
|
|
|
|
#include "libavutil/log.h"
|
|
|
|
|
|
|
|
#include "avcodec.h"
|
2020-04-07 16:49:28 +02:00
|
|
|
#include "bsf_internal.h"
|
2013-11-23 13:43:13 +03:00
|
|
|
|
|
|
|
extern const AVBitStreamFilter ff_aac_adtstoasc_bsf;
|
2019-11-11 02:09:02 +02:00
|
|
|
extern const AVBitStreamFilter ff_av1_frame_merge_bsf;
|
2018-12-18 02:56:27 +02:00
|
|
|
extern const AVBitStreamFilter ff_av1_frame_split_bsf;
|
2018-09-10 00:08:12 +02:00
|
|
|
extern const AVBitStreamFilter ff_av1_metadata_bsf;
|
2013-11-23 13:43:13 +03:00
|
|
|
extern const AVBitStreamFilter ff_chomp_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_dump_extradata_bsf;
|
2016-04-17 19:47:25 +02:00
|
|
|
extern const AVBitStreamFilter ff_dca_core_bsf;
|
2018-03-27 16:47:24 +02:00
|
|
|
extern const AVBitStreamFilter ff_eac3_core_bsf;
|
2016-08-21 17:08:34 +02:00
|
|
|
extern const AVBitStreamFilter ff_extract_extradata_bsf;
|
2018-03-06 20:49:27 +02:00
|
|
|
extern const AVBitStreamFilter ff_filter_units_bsf;
|
2017-05-05 00:09:02 +02:00
|
|
|
extern const AVBitStreamFilter ff_h264_metadata_bsf;
|
2013-11-23 13:43:13 +03:00
|
|
|
extern const AVBitStreamFilter ff_h264_mp4toannexb_bsf;
|
2017-05-05 00:10:19 +02:00
|
|
|
extern const AVBitStreamFilter ff_h264_redundant_pps_bsf;
|
2018-03-11 20:16:09 +02:00
|
|
|
extern const AVBitStreamFilter ff_hapqa_extract_bsf;
|
2017-07-23 17:23:51 +02:00
|
|
|
extern const AVBitStreamFilter ff_hevc_metadata_bsf;
|
2013-11-23 13:43:13 +03:00
|
|
|
extern const AVBitStreamFilter ff_hevc_mp4toannexb_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_imx_dump_header_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_mjpeg2jpeg_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_mjpega_dump_header_bsf;
|
2016-04-17 19:47:25 +02:00
|
|
|
extern const AVBitStreamFilter ff_mp3_header_decompress_bsf;
|
2017-08-01 16:35:14 +02:00
|
|
|
extern const AVBitStreamFilter ff_mpeg2_metadata_bsf;
|
2016-04-17 19:47:25 +02:00
|
|
|
extern const AVBitStreamFilter ff_mpeg4_unpack_bframes_bsf;
|
2013-11-23 13:43:13 +03:00
|
|
|
extern const AVBitStreamFilter ff_mov2textsub_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_noise_bsf;
|
2017-04-17 14:01:31 +02:00
|
|
|
extern const AVBitStreamFilter ff_null_bsf;
|
2020-05-03 22:17:33 +02:00
|
|
|
extern const AVBitStreamFilter ff_opus_metadata_bsf;
|
2020-03-25 00:24:22 +02:00
|
|
|
extern const AVBitStreamFilter ff_pcm_rechunk_bsf;
|
2018-10-28 13:53:25 +02:00
|
|
|
extern const AVBitStreamFilter ff_prores_metadata_bsf;
|
2013-11-23 13:43:13 +03:00
|
|
|
extern const AVBitStreamFilter ff_remove_extradata_bsf;
|
2021-02-09 14:26:16 +02:00
|
|
|
extern const AVBitStreamFilter ff_setts_bsf;
|
2016-04-17 19:47:25 +02:00
|
|
|
extern const AVBitStreamFilter ff_text2movsub_bsf;
|
2017-05-05 00:06:20 +02:00
|
|
|
extern const AVBitStreamFilter ff_trace_headers_bsf;
|
2018-11-19 23:52:45 +02:00
|
|
|
extern const AVBitStreamFilter ff_truehd_core_bsf;
|
2018-04-02 03:38:03 +02:00
|
|
|
extern const AVBitStreamFilter ff_vp9_metadata_bsf;
|
2017-01-10 01:08:49 +02:00
|
|
|
extern const AVBitStreamFilter ff_vp9_raw_reorder_bsf;
|
2016-04-17 19:47:25 +02:00
|
|
|
extern const AVBitStreamFilter ff_vp9_superframe_bsf;
|
2016-11-13 12:00:02 +02:00
|
|
|
extern const AVBitStreamFilter ff_vp9_superframe_split_bsf;
|
2013-11-23 13:43:13 +03:00
|
|
|
|
2016-03-20 11:00:58 +02:00
|
|
|
#include "libavcodec/bsf_list.c"
|
2013-11-23 13:43:13 +03:00
|
|
|
|
2018-02-02 21:25:36 +02:00
|
|
|
const AVBitStreamFilter *av_bsf_iterate(void **opaque)
|
2013-11-23 13:43:13 +03:00
|
|
|
{
|
|
|
|
uintptr_t i = (uintptr_t)*opaque;
|
|
|
|
const AVBitStreamFilter *f = bitstream_filters[i];
|
|
|
|
|
|
|
|
if (f)
|
|
|
|
*opaque = (void*)(i + 1);
|
|
|
|
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
2018-02-02 21:25:36 +02:00
|
|
|
#if FF_API_NEXT
|
|
|
|
const AVBitStreamFilter *av_bsf_next(void **opaque) {
|
|
|
|
return av_bsf_iterate(opaque);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-23 13:43:13 +03:00
|
|
|
const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
|
|
|
|
{
|
2018-02-02 21:25:36 +02:00
|
|
|
const AVBitStreamFilter *f = NULL;
|
|
|
|
void *i = 0;
|
2013-11-23 13:43:13 +03:00
|
|
|
|
2018-07-28 05:51:57 +02:00
|
|
|
if (!name)
|
|
|
|
return NULL;
|
|
|
|
|
2018-02-02 21:25:36 +02:00
|
|
|
while ((f = av_bsf_iterate(&i))) {
|
2013-11-23 13:43:13 +03:00
|
|
|
if (!strcmp(f->name, name))
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2020-05-27 15:34:07 +02:00
|
|
|
#if FF_API_CHILD_CLASS_NEXT
|
2013-11-23 13:43:13 +03:00
|
|
|
const AVClass *ff_bsf_child_class_next(const AVClass *prev)
|
|
|
|
{
|
2018-02-02 21:25:36 +02:00
|
|
|
const AVBitStreamFilter *f = NULL;
|
|
|
|
void *i = 0;
|
2013-11-23 13:43:13 +03:00
|
|
|
|
|
|
|
/* find the filter that corresponds to prev */
|
2018-02-02 21:25:36 +02:00
|
|
|
while (prev && (f = av_bsf_iterate(&i))) {
|
|
|
|
if (f->priv_class == prev) {
|
2013-11-23 13:43:13 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find next filter with priv options */
|
2018-02-02 21:25:36 +02:00
|
|
|
while ((f = av_bsf_iterate(&i))) {
|
|
|
|
if (f->priv_class)
|
|
|
|
return f->priv_class;
|
|
|
|
}
|
2013-11-23 13:43:13 +03:00
|
|
|
return NULL;
|
|
|
|
}
|
2020-05-27 15:34:07 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
const AVClass *ff_bsf_child_class_iterate(void **opaque)
|
|
|
|
{
|
|
|
|
const AVBitStreamFilter *f;
|
|
|
|
|
|
|
|
/* find next filter with priv options */
|
|
|
|
while ((f = av_bsf_iterate(opaque))) {
|
|
|
|
if (f->priv_class)
|
|
|
|
return f->priv_class;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|