static GstDiscovererVideoInfo
* gst_discoverer_video_info_copy_int (GstDiscovererVideoInfo * ptr);
+static GstDiscovererSubtitleInfo
+ * gst_discoverer_subtitle_info_copy_int (GstDiscovererSubtitleInfo * ptr);
+
/* Per-stream information */
G_DEFINE_TYPE (GstDiscovererStreamInfo, gst_discoverer_stream_info,
ret = (GstDiscovererStreamInfo *)
gst_discoverer_video_info_copy_int ((GstDiscovererVideoInfo *) info);
+ } else if (ltyp == GST_TYPE_DISCOVERER_SUBTITLE_INFO) {
+ ret = (GstDiscovererStreamInfo *)
+ gst_discoverer_subtitle_info_copy_int ((GstDiscovererSubtitleInfo *)
+ info);
+
} else
ret = gst_discoverer_stream_info_new ();
GST_TYPE_DISCOVERER_STREAM_INFO);
static void
+gst_discoverer_audio_info_finalize (GstDiscovererAudioInfo * info)
+{
+ g_free (info->language);
+ gst_discoverer_stream_info_finalize ((GstDiscovererStreamInfo *) info);
+}
+
+static void
gst_discoverer_audio_info_class_init (GstDiscovererAudioInfoClass * klass)
{
- /* Nothing to initialize */
+ klass->finalize =
+ (GstMiniObjectFinalizeFunction) gst_discoverer_audio_info_finalize;
}
static void
gst_discoverer_audio_info_init (GstDiscovererAudioInfo * info)
{
- /* Nothing to initialize */
+ info->language = NULL;
}
static GstDiscovererAudioInfo *
ret->depth = ptr->depth;
ret->bitrate = ptr->bitrate;
ret->max_bitrate = ptr->max_bitrate;
+ ret->language = g_strdup (ptr->language);
+
+ return ret;
+}
+
+/* Subtitle information */
+G_DEFINE_TYPE (GstDiscovererSubtitleInfo, gst_discoverer_subtitle_info,
+ GST_TYPE_DISCOVERER_STREAM_INFO);
+
+static void
+gst_discoverer_subtitle_info_init (GstDiscovererSubtitleInfo * info)
+{
+ info->language = NULL;
+}
+
+static void
+gst_discoverer_subtitle_info_finalize (GstDiscovererSubtitleInfo * info)
+{
+ g_free (info->language);
+ gst_discoverer_stream_info_finalize ((GstDiscovererStreamInfo *) info);
+}
+
+static void
+gst_discoverer_subtitle_info_class_init (GstMiniObjectClass * klass)
+{
+ klass->finalize =
+ (GstMiniObjectFinalizeFunction) gst_discoverer_subtitle_info_finalize;
+}
+
+static GstDiscovererSubtitleInfo *
+gst_discoverer_subtitle_info_new (void)
+{
+ return (GstDiscovererSubtitleInfo *)
+ gst_mini_object_new (GST_TYPE_DISCOVERER_SUBTITLE_INFO);
+}
+
+static GstDiscovererSubtitleInfo *
+gst_discoverer_subtitle_info_copy_int (GstDiscovererSubtitleInfo * ptr)
+{
+ GstDiscovererSubtitleInfo *ret;
+
+ ret = gst_discoverer_subtitle_info_new ();
+
+ ret->language = g_strdup (ptr->language);
return ret;
}
gst_discoverer_info_copy (GstDiscovererInfo * ptr)
{
GstDiscovererInfo *ret;
- GHashTable *stream_map = g_hash_table_new (g_direct_hash, NULL);
+ GHashTable *stream_map;
GList *tmp;
g_return_val_if_fail (ptr != NULL, NULL);
+ stream_map = g_hash_table_new (g_direct_hash, NULL);
+
ret = gst_discoverer_info_new ();
ret->uri = g_strdup (ptr->uri);
}
/**
+ * gst_discoverer_info_get_subtitle_streams:
+ * @info: a #GstDiscovererInfo
+ *
+ * Finds all the #GstDiscovererSubtitleInfo contained in @info
+ *
+ * Returns: (transfer full) (element-type Gst.DiscovererStreamInfo): A #GList of
+ * matching #GstDiscovererStreamInfo. The caller should free it with
+ * gst_discoverer_stream_info_list_free().
+ *
+ * Since: 0.10.36
+ */
+GList *
+gst_discoverer_info_get_subtitle_streams (GstDiscovererInfo * info)
+{
+ return gst_discoverer_info_get_streams (info,
+ GST_TYPE_DISCOVERER_SUBTITLE_INFO);
+}
+
+/**
* gst_discoverer_info_get_container_streams:
* @info: a #GstDiscovererInfo
*
else
return "video";
}
+ if (GST_IS_DISCOVERER_SUBTITLE_INFO (info))
+ return "subtitles";
return "unknown";
}
AUDIO_INFO_ACCESSOR_CODE (max_bitrate, guint, 0);
+/**
+ * gst_discoverer_audio_info_get_language:
+ * @info: a #GstDiscovererAudioInfo
+ *
+ * Returns: the language of the stream, or NULL if unknown.
+ *
+ * Since: 0.10.36
+ */
+
+AUDIO_INFO_ACCESSOR_CODE (language, const gchar *, NULL);
+
/* GstDiscovererVideoInfo */
#define VIDEO_INFO_ACCESSOR_CODE(fieldname, type, failval) \
return info->is_image;
}
+/* GstDiscovererSubtitleInfo */
+
+#define SUBTITLE_INFO_ACCESSOR_CODE(fieldname, type, failval) \
+ GENERIC_ACCESSOR_CODE(gst_discoverer_subtitle_info, GstDiscovererSubtitleInfo*, \
+ GST_TYPE_DISCOVERER_SUBTITLE_INFO, \
+ fieldname, type, failval)
+
+/**
+ * gst_discoverer_subtitle_info_get_language:
+ * @info: a #GstDiscovererSubtitleInfo
+ *
+ * Returns: the language of the stream, or NULL if unknown.
+ *
+ * Since: 0.10.36
+ */
+
+SUBTITLE_INFO_ACCESSOR_CODE (language, const gchar *, NULL);
+
/* GstDiscovererInfo */
#define DISCOVERER_INFO_ACCESSOR_CODE(fieldname, type, failval) \
* gst_discoverer_info_get_seekable:
* @info: a #GstDiscovererInfo
*
- * Returns: the wheter the URI is seekable.
+ * Returns: the whether the URI is seekable.
*
* Since: 0.10.32
*/
* gst_discoverer_info_get_tags:
* @info: a #GstDiscovererInfo
*
- * Returns: (transfer none): all tags contained in the %URI. If you wish to use
+ * Returns: (transfer none): all tags contained in the URI. If you wish to use
* the tags after the life-time of @info, you will need to copy them.
*
* Since: 0.10.31