From: Hendrik Leppkes <h.leppkes@gmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/avformat: Added codec_name to AVCodecContext and AVCodecParameters
Date: Wed, 3 Jul 2024 10:02:16 +0200
Message-ID: <CA+anqdxyZ5gj0KKT2w3yHpWygOzcJ00GVnZ35ck9MWq0H7_8dg@mail.gmail.com> (raw)
In-Reply-To: <c08ed165-636b-44fa-80f8-ba91f294ebc0@aitek.it>
On Wed, Jul 3, 2024 at 9:48 AM Bernardo Pilarz via ffmpeg-devel
<ffmpeg-devel@ffmpeg.org> wrote:
>
> Added the codec_name field, in which the unprocessed, not-interpreted codec
> name is stored.
> This is useful when codecs that are not handled by the libav
> (i.e. AV_CODEC_ID_NONE) are encountered, since the application might still
> want to handle them.
> Having this field allows the application to determine the codec type.
>
> As of this commit, the codec_name field is only filled when opening an RTSP
> stream, during the parsing of the SDP.
>
> Signed-off-by: bpilarz <bernardo.pilarz@aitek.it>
> ---
> libavcodec/avcodec.h | 10 ++++++++++
> libavcodec/codec_par.c | 19 +++++++++++++++++++
> libavcodec/codec_par.h | 10 ++++++++++
> libavcodec/options.c | 1 +
> libavformat/rtsp.c | 5 +++++
> 5 files changed, 45 insertions(+)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 2da63c87ea..464b4078fc 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -451,6 +451,16 @@ typedef struct AVCodecContext {
> int log_level_offset;
>
> enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
> + /**
> + * Generic codec name of the encoded data.
> + *
> + * Null-terminated string, can be NULL.
> + * Contents may vary depending on the source of the data stream.
> + * This is typically the string that's interpreted to determine
> 'codec_id'.
> + * Must be allocated with av_malloc() or av_strdup() and will be
> freed by
> + * avcodec_free_context().
> + */
> + char *codec_name;
> const struct AVCodec *codec;
> enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */
>
Adding a new field here is an ABI break, it would need to go at the
end of the struct.
In general, I feel like this might be better served to go into
metadata though, especially as very few containers have a string codec
identifier to begin with.
- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-07-03 8:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 7:47 Bernardo Pilarz via ffmpeg-devel
2024-07-03 8:02 ` Hendrik Leppkes [this message]
2024-07-03 8:10 ` Bernardo Pilarz via ffmpeg-devel
2024-07-03 9:10 ` Anton Khirnov
2024-07-03 9:56 ` Bernardo Pilarz via ffmpeg-devel
2024-07-03 12:30 ` Bernardo Pilarz via ffmpeg-devel
-- strict thread matches above, loose matches on Subject: below --
2024-07-02 13:03 Bernardo Pilarz via ffmpeg-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+anqdxyZ5gj0KKT2w3yHpWygOzcJ00GVnZ35ck9MWq0H7_8dg@mail.gmail.com \
--to=h.leppkes@gmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git