Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] dash metadata: Added other supported fields besides title only
@ 2023-02-23  1:15 Davy Durham
  0 siblings, 0 replies; only message in thread
From: Davy Durham @ 2023-02-23  1:15 UTC (permalink / raw)
  To: ffmpeg-devel

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".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-23  1:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23  1:15 [FFmpeg-devel] [PATCH] dash metadata: Added other supported fields besides title only Davy Durham

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