From: Eric Lindvall <ffmpegagent@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: Eric Lindvall <eric@5stops.com>, Aman Gupta Karmani <aman@tmm1.net> Subject: [FFmpeg-devel] [PATCH 2/5] cbs_sei: add ff_cbs_sei_delete_message helper Date: Sat, 04 Feb 2023 00:41:52 +0000 Message-ID: <8164f307e2a4c93dc7ad0dbcfb33d493bbede6b3.1675471315.git.ffmpegagent@gmail.com> (raw) In-Reply-To: <pull.50.ffstaging.FFmpeg.1675471315.ffmpegagent@gmail.com> From: Eric Lindvall <eric@5stops.com> Signed-off-by: Aman Karmani <aman@tmm1.net> --- libavcodec/cbs_sei.c | 25 +++++++++++++++++++++++++ libavcodec/cbs_sei.h | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/libavcodec/cbs_sei.c b/libavcodec/cbs_sei.c index 50a513f592..1ea2bbc109 100644 --- a/libavcodec/cbs_sei.c +++ b/libavcodec/cbs_sei.c @@ -347,6 +347,31 @@ static void cbs_sei_delete_message(SEIRawMessageList *list, } } +int ff_cbs_sei_delete_message(CodedBitstreamContext *ctx, + CodedBitstreamFragment *au, + SEIRawMessage *message) +{ + int err, i, j; + + for (i = 0; i < au->nb_units; i++) { + CodedBitstreamUnit *unit = &au->units[i]; + SEIRawMessageList *list; + + err = cbs_sei_get_message_list(ctx, unit, &list); + if (err < 0) + continue; + + for (j = 0; j < list->nb_messages; j++) { + if (message == &list->messages[j]) { + cbs_sei_delete_message(list, j); + return 0; + } + } + } + + return AVERROR(ENOENT); +} + void ff_cbs_sei_delete_message_type(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type) diff --git a/libavcodec/cbs_sei.h b/libavcodec/cbs_sei.h index 1c327a4689..96bd116a53 100644 --- a/libavcodec/cbs_sei.h +++ b/libavcodec/cbs_sei.h @@ -202,4 +202,11 @@ void ff_cbs_sei_delete_message_type(CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type); +/** + * Delete a message from the access unit. + */ +int ff_cbs_sei_delete_message(CodedBitstreamContext *ctx, + CodedBitstreamFragment *au, + SEIRawMessage *message); + #endif /* AVCODEC_CBS_SEI_H */ -- ffmpeg-codebot _______________________________________________ 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:[~2023-02-04 0:42 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-04 0:41 [FFmpeg-devel] [PATCH 0/5] Bitstream filter support for A/53 Closed Captions ffmpegagent 2023-02-04 0:41 ` [FFmpeg-devel] [PATCH 1/5] cbs: Add some common code for read/write of miscellaneous user data Mark Thompson 2023-02-04 0:41 ` Eric Lindvall [this message] 2023-02-04 0:41 ` [FFmpeg-devel] [PATCH 3/5] avcodec/mpeg2_metadata_bsf: add support for a/53 closed captions Aman Karmani 2023-02-04 0:41 ` [FFmpeg-devel] [PATCH 4/5] avcodec/h264_metadata_bsf: " Aman Karmani 2023-02-04 0:41 ` [FFmpeg-devel] [PATCH 5/5] avcodec/h265_metadata_bsf: " Aman Karmani
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=8164f307e2a4c93dc7ad0dbcfb33d493bbede6b3.1675471315.git.ffmpegagent@gmail.com \ --to=ffmpegagent@gmail.com \ --cc=aman@tmm1.net \ --cc=eric@5stops.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