diff mbox series

[FFmpeg-devel,2/5] avformat/avformat: Add av_stream_get_codec_properties() to expose internal properties

Message ID 20240705052555.402920-3-marth64@proxyid.net
State New
Headers show
Series Fix probing display of stream codec properties | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Marth64 July 5, 2024, 5:25 a.m. UTC
Signed-off-by: Marth64 <marth64@proxyid.net>
---
 libavformat/avformat.c | 5 +++++
 libavformat/avformat.h | 7 +++++++
 2 files changed, 12 insertions(+)

Comments

Anton Khirnov July 5, 2024, 6:09 a.m. UTC | #1
Quoting Marth64 (2024-07-05 07:25:52)
> Signed-off-by: Marth64 <marth64@proxyid.net>
> ---
>  libavformat/avformat.c | 5 +++++
>  libavformat/avformat.h | 7 +++++++
>  2 files changed, 12 insertions(+)

Strong no.
Internal properties are internal, we should do less exposing of them,
not more.
Marth64 July 5, 2024, 6:14 a.m. UTC | #2
I understand why. Should ffprobe’s closed_caption field just be removed
then? The feature doesn’t work.
diff mbox series

Patch

diff --git a/libavformat/avformat.c b/libavformat/avformat.c
index 140fb5b6aa..35eb0f3b62 100644
--- a/libavformat/avformat.c
+++ b/libavformat/avformat.c
@@ -850,6 +850,11 @@  AVRational av_stream_get_codec_timebase(const AVStream *st)
     return cffstream(st)->avctx ? cffstream(st)->avctx->time_base : cffstream(st)->transferred_mux_tb;
 }
 
+unsigned av_stream_get_codec_properties(const AVStream *st)
+{
+    return cffstream(st)->avctx ? cffstream(st)->avctx->properties : 0;
+}
+
 void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits,
                          unsigned int pts_num, unsigned int pts_den)
 {
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 8afdcd9fd0..f611f7a4a4 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -3072,6 +3072,13 @@  int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt,
  */
 AVRational av_stream_get_codec_timebase(const AVStream *st);
 
+/**
+ * Get the internal codec properties from a stream.
+ *
+ * @param st  input stream to extract the properties from
+ */
+unsigned av_stream_get_codec_properties(const AVStream *st);
+
 /**
  * @}
  */