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
|
|
|
|
*/
|
|
|
|
|
2021-06-11 21:35:33 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
2013-11-23 10:43:13 +00:00
|
|
|
|
|
|
|
#include "libavutil/log.h"
|
|
|
|
|
2021-06-11 21:35:33 +00:00
|
|
|
#include "bsf.h"
|
2020-04-07 14:49:28 +00:00
|
|
|
#include "bsf_internal.h"
|
2013-11-23 10:43:13 +00:00
|
|
|
|
2022-03-21 21:25:27 +00: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 17:46:09 +00:00
|
|
|
extern const FFBitStreamFilter ff_dts2pts_bsf;
|
2022-03-21 21:25:27 +00:00
|
|
|
extern const FFBitStreamFilter ff_dv_error_marker_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_eac3_core_bsf;
|
2024-04-18 10:53:24 +00:00
|
|
|
extern const FFBitStreamFilter ff_evc_frame_merge_bsf;
|
2022-03-21 21:25:27 +00:00
|
|
|
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 09:18:17 +00:00
|
|
|
extern const FFBitStreamFilter ff_media100_to_mjpegb_bsf;
|
2022-03-21 21:25:27 +00:00
|
|
|
extern const FFBitStreamFilter ff_mjpeg2jpeg_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_mjpega_dump_header_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 14:11:24 +00:00
|
|
|
extern const FFBitStreamFilter ff_pgs_frame_merge_bsf;
|
2022-03-21 21:25:27 +00:00
|
|
|
extern const FFBitStreamFilter ff_prores_metadata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_remove_extradata_bsf;
|
|
|
|
extern const FFBitStreamFilter ff_setts_bsf;
|
2024-01-27 11:31:27 +00:00
|
|
|
extern const FFBitStreamFilter ff_showinfo_bsf;
|
2022-03-21 21:25:27 +00:00
|
|
|
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 15:01:17 +00:00
|
|
|
extern const FFBitStreamFilter ff_vvc_metadata_bsf;
|
2023-03-21 15:01:18 +00:00
|
|
|
extern const FFBitStreamFilter ff_vvc_mp4toannexb_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
|
|
|
{
|
2023-06-15 11:47:26 +00:00
|
|
|
uintptr_t i = (uintptr_t) * opaque;
|
2022-03-21 21:25:27 +00:00
|
|
|
const FFBitStreamFilter *f = bitstream_filters[i];
|
2013-11-23 10:43:13 +00:00
|
|
|
|
2022-03-21 21:25:27 +00:00
|
|
|
if (f) {
|
2023-06-15 11:47:26 +00:00
|
|
|
*opaque = (void *)(i + 1);
|
2022-03-21 21:25:27 +00:00
|
|
|
return &f->p;
|
|
|
|
}
|
|
|
|
return NULL;
|
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-07-28 03:51:57 +00:00
|
|
|
if (!name)
|
|
|
|
return NULL;
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-05-27 13:34:07 +00: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;
|
|
|
|
}
|