From: Davy Durham <ddurham@davyandbeth.com>
To: ffmpeg-devel@ffmpeg.org
Subject: [FFmpeg-devel] [PATCH] dash metadata: Added other supported fields besides title only
Date: Wed, 22 Feb 2023 19:15:28 -0600
Message-ID: <7c1044ba-4ec9-ac5b-8bbb-28a28941f7c8@davyandbeth.com> (raw)
Now metadata fields for source, copyright, lang and moreInformationURL
are supported too. Evidence for the need of such support:
https://docs.rs/dash-mpd/0.6.3/dash_mpd/struct.ProgramInformation.html
and
https://github.com/DroidFreak32/myjio_unrestrict/blob/805a8b48d02c5618608bf6fb2bfc2b450f1f057a/smali_classes2/com/google/android/exoplayer2/source/dash/manifest/ProgramInformation.smali#L19
Signed-off-by: Davy Durham <ddurham@users.sourceforge.net>
---
libavformat/dashenc.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 295b01e225..e45eca3468 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1141,6 +1141,10 @@ static int write_manifest(AVFormatContext *s, int
final)
int use_rename = proto && !strcmp(proto, "file");
static unsigned int warned_non_file = 0;
AVDictionaryEntry *title = av_dict_get(s->metadata, "title", NULL, 0);
+ AVDictionaryEntry *source = av_dict_get(s->metadata, "source",
NULL, 0);
+ AVDictionaryEntry *copyright = av_dict_get(s->metadata,
"copyright", NULL, 0);
+ AVDictionaryEntry *lang = av_dict_get(s->metadata, "lang", NULL, 0);
+ AVDictionaryEntry *moreInformationURL = av_dict_get(s->metadata,
"moreInformationURL", NULL, 0);
AVDictionary *opts = NULL;
if (!use_rename && !warned_non_file++)
@@ -1203,6 +1207,26 @@ static int write_manifest(AVFormatContext *s, int
final)
avio_printf(out, "\t\t<Title>%s</Title>\n", escaped);
av_free(escaped);
}
+ if (source) {
+ char *escaped = xmlescape(source->value);
+ avio_printf(out, "\t\t<Source>%s</Source>\n", escaped);
+ av_free(escaped);
+ }
+ if (copyright) {
+ char *escaped = xmlescape(copyright->value);
+ avio_printf(out, "\t\t<Copyright>%s</Copyright>\n", escaped);
+ av_free(escaped);
+ }
+ if (lang) {
+ char *escaped = xmlescape(lang->value);
+ avio_printf(out, "\t\t<lang>%s</lang>\n", escaped);
+ av_free(escaped);
+ }
+ if (moreInformationURL) {
+ char *escaped = xmlescape(moreInformationURL->value);
+ avio_printf(out,
"\t\t<moreInformationURL>%s</moreInformationURL>\n", escaped);
+ av_free(escaped);
+ }
avio_printf(out, "\t</ProgramInformation>\n");
avio_printf(out, "\t<ServiceDescription id=\"0\">\n");
--
2.25.1
_______________________________________________
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".
reply other threads:[~2023-02-23 1:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=7c1044ba-4ec9-ac5b-8bbb-28a28941f7c8@davyandbeth.com \
--to=ddurham@davyandbeth.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