2013-11-23 10:43:13 +00:00
|
|
|
/*
|
2016-04-17 17:47:25 +00:00
|
|
|
* This file is part of FFmpeg.
|
2013-11-23 10:43:13 +00:00
|
|
|
*
|
2016-04-17 17:47:25 +00:00
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2013-11-23 10:43:13 +00: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 17:47:25 +00:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2013-11-23 10:43:13 +00: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 17:47:25 +00:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2013-11-23 10:43:13 +00: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"
|
|
|
|
#include "bsf.h"
|
|
|
|
|
|
|
|
extern const AVBitStreamFilter ff_aac_adtstoasc_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_chomp_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_dump_extradata_bsf;
|
2016-04-17 17:47:25 +00:00
|
|
|
extern const AVBitStreamFilter ff_dca_core_bsf;
|
2016-08-21 15:08:34 +00:00
|
|
|
extern const AVBitStreamFilter ff_extract_extradata_bsf;
|
2017-05-04 22:09:02 +00:00
|
|
|
extern const AVBitStreamFilter ff_h264_metadata_bsf;
|
2013-11-23 10:43:13 +00:00
|
|
|
extern const AVBitStreamFilter ff_h264_mp4toannexb_bsf;
|
2017-05-04 22:10:19 +00:00
|
|
|
extern const AVBitStreamFilter ff_h264_redundant_pps_bsf;
|
2018-03-11 18:16:09 +00:00
|
|
|
extern const AVBitStreamFilter ff_hapqa_extract_bsf;
|
2017-07-23 15:23:51 +00:00
|
|
|
extern const AVBitStreamFilter ff_hevc_metadata_bsf;
|
2013-11-23 10:43:13 +00: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 17:47:25 +00:00
|
|
|
extern const AVBitStreamFilter ff_mp3_header_decompress_bsf;
|
2017-08-01 14:35:14 +00:00
|
|
|
extern const AVBitStreamFilter ff_mpeg2_metadata_bsf;
|
2016-04-17 17:47:25 +00:00
|
|
|
extern const AVBitStreamFilter ff_mpeg4_unpack_bframes_bsf;
|
2013-11-23 10:43:13 +00:00
|
|
|
extern const AVBitStreamFilter ff_mov2textsub_bsf;
|
|
|
|
extern const AVBitStreamFilter ff_noise_bsf;
|
2017-04-17 12:01:31 +00:00
|
|
|
extern const AVBitStreamFilter ff_null_bsf;
|
2013-11-23 10:43:13 +00:00
|
|
|
extern const AVBitStreamFilter ff_remove_extradata_bsf;
|
2016-04-17 17:47:25 +00:00
|
|
|
extern const AVBitStreamFilter ff_text2movsub_bsf;
|
2017-05-04 22:06:20 +00:00
|
|
|
extern const AVBitStreamFilter ff_trace_headers_bsf;
|
2017-01-09 23:08:49 +00:00
|
|
|
extern const AVBitStreamFilter ff_vp9_raw_reorder_bsf;
|
2016-04-17 17:47:25 +00:00
|
|
|
extern const AVBitStreamFilter ff_vp9_superframe_bsf;
|
2016-11-13 10:00:02 +00:00
|
|
|
extern const AVBitStreamFilter ff_vp9_superframe_split_bsf;
|
2013-11-23 10:43:13 +00:00
|
|
|
|
2016-03-20 09:00:58 +00:00
|
|
|
#include "libavcodec/bsf_list.c"
|
2013-11-23 10:43:13 +00:00
|
|
|
|
2018-02-02 19:25:36 +00:00
|
|
|
const AVBitStreamFilter *av_bsf_iterate(void **opaque)
|
2013-11-23 10:43:13 +00:00
|
|
|
{
|
|
|
|
uintptr_t i = (uintptr_t)*opaque;
|
|
|
|
const AVBitStreamFilter *f = bitstream_filters[i];
|
|
|
|
|
|
|
|
if (f)
|
|
|
|
*opaque = (void*)(i + 1);
|
|
|
|
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
2018-02-02 19:25:36 +00:00
|
|
|
#if FF_API_NEXT
|
|
|
|
const AVBitStreamFilter *av_bsf_next(void **opaque) {
|
|
|
|
return av_bsf_iterate(opaque);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-11-23 10:43:13 +00:00
|
|
|
const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
|
|
|
|
{
|
2018-02-02 19:25:36 +00:00
|
|
|
const AVBitStreamFilter *f = NULL;
|
|
|
|
void *i = 0;
|
2013-11-23 10:43:13 +00:00
|
|
|
|
2018-02-02 19:25:36 +00:00
|
|
|
while ((f = av_bsf_iterate(&i))) {
|
2013-11-23 10:43:13 +00:00
|
|
|
if (!strcmp(f->name, name))
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
const AVClass *ff_bsf_child_class_next(const AVClass *prev)
|
|
|
|
{
|
2018-02-02 19:25:36 +00:00
|
|
|
const AVBitStreamFilter *f = NULL;
|
|
|
|
void *i = 0;
|
2013-11-23 10:43:13 +00:00
|
|
|
|
|
|
|
/* find the filter that corresponds to prev */
|
2018-02-02 19:25:36 +00:00
|
|
|
while (prev && (f = av_bsf_iterate(&i))) {
|
|
|
|
if (f->priv_class == prev) {
|
2013-11-23 10:43:13 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find next filter with priv options */
|
2018-02-02 19:25:36 +00:00
|
|
|
while ((f = av_bsf_iterate(&i))) {
|
|
|
|
if (f->priv_class)
|
|
|
|
return f->priv_class;
|
|
|
|
}
|
2013-11-23 10:43:13 +00:00
|
|
|
return NULL;
|
|
|
|
}
|