From 3b3a5273e5902f08b350d2980c380710fd2d83e3 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Thu, 4 Nov 2010 12:47:14 +0200 Subject: [PATCH] info: show human readable container format name Update the patch for vala bindings. Update README as getting the contaienr caps is already possible. --- mediainfo/README | 3 ++- mediainfo/src/mi-info.vala | 25 ++++++++++++++++--- .../vapi/vapi.gstreamer-pbutils-0.10.patch | 5 ++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/mediainfo/README b/mediainfo/README index 4e4eb7590e..5117db13bb 100644 --- a/mediainfo/README +++ b/mediainfo/README @@ -67,8 +67,9 @@ Duration: == unsorted == - handle chapters +- if there is a "language-code" in the tags (or subtitles?) use flag icons = TODO for discoverer = -- get caps for container - get duration per stream + - this would need individual queries on the demuxer src pads diff --git a/mediainfo/src/mi-info.vala b/mediainfo/src/mi-info.vala index 1e69b7e9aa..b62eacbff8 100644 --- a/mediainfo/src/mi-info.vala +++ b/mediainfo/src/mi-info.vala @@ -26,6 +26,7 @@ we need to update the vapi for yet unreleased gstreamer api: cd vala/mediainfo/vapi vala-gen-introspect gstreamer-pbutils-0.10 packages/gstreamer-pbutils-0.10 vapigen --vapidir . --library gstreamer-pbutils-0.10 packages/gstreamer-pbutils-0.10/gstreamer-pbutils-0.10.gi +git diff packages/gstreamer-pbutils-0.10/gstreamer-pbutils-0.10.metadata >vapi.gstreamer-pbutils-0.10.patch # suse sudo cp gstreamer-pbutils-0.10.vapi /usr/share/vala/mediainfo/vapi/ # ubuntu @@ -200,9 +201,27 @@ public class MediaInfo.Info : VBox this.duration.set_text (str); //stdout.printf ("Duration: %s\n", dur_str); - // TODO: need caps for the container, so that we can have human readable container name - //container_name.set_text (pb_utils_get_codec_description (Caps.from_string("application/ogg"))); - + /* + < ensonic> bilboed-pi: is gst_discoverer_info_get_container_streams() containing the info for the conatiner or can those be multiple ones as well? + < bilboed-pi> ensonic, if you have DV system-stream in MXF .... you'll have two container streams + < bilboed-pi> (yes, they exist) + < bilboed-pi> I'd recommend grabbing the top-level stream_info and walking your way down + */ + /* + l = info.get_container_streams (); + for (int i = 0; i < l.length (); i++) { + sinfo = l.nth_data (i); + stdout.printf ("container[%d]: %s\n", i, sinfo.get_caps ().to_string ()); + } + l = info.get_stream_list (); + for (int i = 0; i < l.length (); i++) { + sinfo = l.nth_data (i); + stdout.printf ("stream[%d:%s]: %s\n", i, sinfo.get_stream_type_nick(), sinfo.get_caps ().to_string ()); + } + */ + sinfo = info.get_stream_info (); + container_name.set_text (pb_utils_get_codec_description (sinfo.get_caps ())); + // get stream info while (video_streams.get_n_pages() > 0) { video_streams.remove_page (-1); diff --git a/mediainfo/vapi/vapi.gstreamer-pbutils-0.10.patch b/mediainfo/vapi/vapi.gstreamer-pbutils-0.10.patch index 5993a7beae..b71d124d11 100644 --- a/mediainfo/vapi/vapi.gstreamer-pbutils-0.10.patch +++ b/mediainfo/vapi/vapi.gstreamer-pbutils-0.10.patch @@ -1,12 +1,13 @@ diff --git a/mediainfo/vapi/packages/gstreamer-pbutils-0.10/gstreamer-pbutils-0.10.metadata b/mediainfo/vapi/packages/gstreamer-pbutils-0.10/gstreamer-pbutils-0.10.metadata -index f873f19..114a893 100644 +index f873f19..333bef2 100644 --- a/mediainfo/vapi/packages/gstreamer-pbutils-0.10/gstreamer-pbutils-0.10.metadata +++ b/mediainfo/vapi/packages/gstreamer-pbutils-0.10/gstreamer-pbutils-0.10.metadata -@@ -13,3 +13,11 @@ gst_missing_decoder_installer_detail_new transfer_ownership="1" +@@ -13,3 +13,12 @@ gst_missing_decoder_installer_detail_new transfer_ownership="1" gst_missing_encoder_installer_detail_new transfer_ownership="1" gst_install_plugins_async.details is_array="1" no_array_length="1" gst_install_plugins_async.ctx nullable="1" +gst_discoverer_discover_uri transfer_ownership="1" ++gst_discoverer_info_get_stream_list type_arguments="DiscovererStreamInfo" transfer_ownership="1" +gst_discoverer_info_get_audio_streams type_arguments="DiscovererStreamInfo" transfer_ownership="1" +gst_discoverer_info_get_video_streams type_arguments="DiscovererStreamInfo" transfer_ownership="1" +gst_discoverer_info_get_container_streams type_arguments="DiscovererStreamInfo" transfer_ownership="1"