After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 566605 - Support the new libav metadata API
Support the new libav metadata API
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
git master
Other Linux
: Normal enhancement
: 1.5.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-05 11:11 UTC by Sebastian Dröge (slomo)
Modified: 2015-08-16 13:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Map ffmpeg metadata to GStreamer tags (9.33 KB, patch)
2015-07-30 13:10 UTC, Jan Schmidt
needs-work Details | Review
Map ffmpeg metadata to GStreamer tags (9.87 KB, patch)
2015-07-30 16:46 UTC, Jan Schmidt
committed Details | Review

Description Sebastian Dröge (slomo) 2009-01-05 11:11:52 UTC
It'd be nice if we support ffmpeg's metadata API that was added recently:

http://svn.ffmpeg.org/ffmpeg/trunk/libavcodec/avcodec.h?r1=16424&r2=16423&pathrev=16424

AVCodecContext and AVFormatContext now have a metadata field.
Comment 1 Edward Hervey 2011-04-20 15:24:46 UTC
Old metadata API has been removed, we need to switch before the upcoming release.
Comment 2 Edward Hervey 2011-07-18 10:12:53 UTC
Bumping to next release
Comment 3 Jan Schmidt 2015-07-30 13:10:23 UTC
Created attachment 308453 [details] [review]
Map ffmpeg metadata to GStreamer tags

Update to the metadata API ffmpeg has had in
place for a long time now, and reenable output
of GStreamer tags from the demuxer.
Comment 4 Nicolas Dufresne (ndufresne) 2015-07-30 14:55:59 UTC
Review of attachment 308453 [details] [review]:

::: ext/libav/gstavutils.c
@@ +494,3 @@
+
+static gchar *
+my_safe_copy (gchar * input)

Hmm, using my_ is uncommon in gstreamer ;-P

@@ +524,3 @@
+    g_hash_table_insert (tmp, (void *) "comment", (void *) GST_TAG_COMMENT);
+    g_hash_table_insert (tmp, (void *) "composer", (void *) GST_TAG_COMPOSER);
+    g_hash_table_insert (tmp, (void *) "copyright", (void *) GST_TAG_COPYRIGHT);

There is usually no reason in C to cast to void *.

@@ +526,3 @@
+    g_hash_table_insert (tmp, (void *) "copyright", (void *) GST_TAG_COPYRIGHT);
+    //g_hash_table_insert (tmp, "creation_time", GST_TAG_DATE_TIME); /* Need to convert ISO 8601 to GstDateTime */
+    //g_hash_table_insert (tmp, "date", GST_TAG_DATE); /* ditto */

C++ style comments. And why is there something commented out ?

::: ext/libav/gstavutils.h
@@ +96,3 @@
 
+GstTagList *
+gst_ffmpeg_metadata_to_tag_list (AVDictionary * metadata);

Should on same line, but I see you are following already in place style.
Comment 5 Jan Schmidt 2015-07-30 15:08:56 UTC
(In reply to Nicolas Dufresne (stormer) from comment #4)
> Review of attachment 308453 [details] [review] [review]:

Thanks for the review :)

> ::: ext/libav/gstavutils.c
> @@ +494,3 @@
> +
> +static gchar *
> +my_safe_copy (gchar * input)
> 
> Hmm, using my_ is uncommon in gstreamer ;-P

Yeah - I just moved the existing function to the new file without renaming. Turns out it should probably all just stay in gstavdemux.c

> @@ +524,3 @@
> +    g_hash_table_insert (tmp, (void *) "comment", (void *) GST_TAG_COMMENT);
> +    g_hash_table_insert (tmp, (void *) "composer", (void *)
> GST_TAG_COMPOSER);
> +    g_hash_table_insert (tmp, (void *) "copyright", (void *)
> GST_TAG_COPYRIGHT);
> 
> There is usually no reason in C to cast to void *.

It's a const thing - g_hash_table takes non-const pointers.


> @@ +526,3 @@
> +    g_hash_table_insert (tmp, (void *) "copyright", (void *)
> GST_TAG_COPYRIGHT);
> +    //g_hash_table_insert (tmp, "creation_time", GST_TAG_DATE_TIME); /*
> Need to convert ISO 8601 to GstDateTime */
> +    //g_hash_table_insert (tmp, "date", GST_TAG_DATE); /* ditto */
> 
> C++ style comments. And why is there something commented out ?

I cut and pasted the list of all standard tag names from the ffmpeg header, but ran out of time to implement them all. I wanted to put the patch up so it doesn't get lost. I'll add a FIXME.

> 
> ::: ext/libav/gstavutils.h
> @@ +96,3 @@
>  
> +GstTagList *
> +gst_ffmpeg_metadata_to_tag_list (AVDictionary * metadata);
> 
> Should on same line, but I see you are following already in place style.

Ja.
Comment 6 Jan Schmidt 2015-07-30 16:46:01 UTC
Created attachment 308474 [details] [review]
Map ffmpeg metadata to GStreamer tags

Update to the metadata API ffmpeg has had in
place for a long time now, and reenable output
of GStreamer tags from the demuxer.
Comment 7 Nicolas Dufresne (ndufresne) 2015-07-30 18:30:16 UTC
Review of attachment 308474 [details] [review]:

Looks good. Arguably a feature, but I think it can. Ask Tim if unsure.
Comment 8 Nicolas Dufresne (ndufresne) 2015-08-05 20:53:45 UTC
Attachment 308474 [details] pushed as 51896af - Map ffmpeg metadata to GStreamer tags