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
|
|
|
|
*/
|
|
|
|
|
2021-06-11 23:35:33 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
2013-11-23 13:43:13 +03:00
|
|
|
|
|
|
|
#include "libavutil/log.h"
|
|
|
|
|
2021-06-11 23:35:33 +02:00
|
|
|
#include "bsf.h"
|
2020-04-07 16:49:28 +02:00
|
|
|
#include "bsf_internal.h"
|
2013-11-23 13:43:13 +03:00
|
|
|
|
2022-03-21 23:25:27 +02:00
|
|
|
extern const FFBitStreamFilter ff_aac_adtstoasc_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_av1_frame_merge_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_av1_frame_split_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_av1_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_chomp_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_dump_extradata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_dca_core_bsf;
|
2022-08-15 19:46:09 +02:00
|
|
|
extern const FFBitStreamFilter ff_dts2pts_bsf;
|
2022-03-21 23:25:27 +02:00
|
|
|
extern const FFBitStreamFilter ff_dv_error_marker_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_eac3_core_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_extract_extradata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_filter_units_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_h264_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_h264_mp4toannexb_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_h264_redundant_pps_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_hapqa_extract_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_hevc_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_hevc_mp4toannexb_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_imx_dump_header_bsf;
|
2023-01-31 11:18:17 +02:00
|
|
|
extern const FFBitStreamFilter ff_media100_to_mjpegb_bsf;
|
2022-03-21 23:25:27 +02:00
|
|
|
extern const FFBitStreamFilter ff_mjpeg2jpeg_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_mjpega_dump_header_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_mp3_header_decompress_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_mpeg2_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_mpeg4_unpack_bframes_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_mov2textsub_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_noise_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_null_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_opus_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_pcm_rechunk_bsf;
|
2020-05-08 16:11:24 +02:00
|
|
|
extern const FFBitStreamFilter ff_pgs_frame_merge_bsf;
|
2022-03-21 23:25:27 +02:00
|
|
|
extern const FFBitStreamFilter ff_prores_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_remove_extradata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_setts_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_text2movsub_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_trace_headers_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_truehd_core_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_vp9_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_vp9_raw_reorder_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_vp9_superframe_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_vp9_superframe_split_bsf;
|
2023-03-21 17:01:17 +02:00
|
|
|
extern const FFBitStreamFilter ff_vvc_metadata_bsf;
|
2023-03-21 17:01:18 +02:00
|
|
|
extern const FFBitStreamFilter ff_vvc_mp4toannexb_bsf;
|
2023-06-15 13:47:26 +02:00
|
|
|
extern const FFBitStreamFilter ff_evc_frame_merge_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
|
|
|
{
|
2023-06-15 13:47:26 +02:00
|
|
|
uintptr_t i = (uintptr_t) * opaque;
|
2022-03-21 23:25:27 +02:00
|
|
|
const FFBitStreamFilter *f = bitstream_filters[i];
|
2013-11-23 13:43:13 +03:00
|
|
|
|
2022-03-21 23:25:27 +02:00
|
|
|
if (f) {
|
2023-06-15 13:47:26 +02:00
|
|
|
*opaque = (void *)(i + 1);
|
2022-03-21 23:25:27 +02:00
|
|
|
return &f->p;
|
|
|
|
}
|
|
|
|
return NULL;
|
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
|
|
|
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;
|
|
|
|
}
|