2 * Copyright (C) 2010 Collabora Multimedia
3 * 2010 Nokia Corporation
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
26 #include "pbutils-private.h"
28 static GstDiscovererStreamInfo
29 * gst_discoverer_info_copy_int (GstDiscovererStreamInfo * info,
30 GHashTable * stream_map);
32 static GstDiscovererContainerInfo
33 * gst_stream_container_info_copy_int (GstDiscovererContainerInfo * ptr,
34 GHashTable * stream_map);
36 static GstDiscovererAudioInfo
37 * gst_discoverer_audio_info_copy_int (GstDiscovererAudioInfo * ptr);
39 static GstDiscovererVideoInfo
40 * gst_discoverer_video_info_copy_int (GstDiscovererVideoInfo * ptr);
42 /* Per-stream information */
44 G_DEFINE_TYPE (GstDiscovererStreamInfo, gst_discoverer_stream_info,
45 GST_TYPE_MINI_OBJECT);
48 gst_discoverer_stream_info_init (GstDiscovererStreamInfo * info)
50 /* Nothing needs initialization */
54 gst_discoverer_stream_info_finalize (GstDiscovererStreamInfo * info)
57 gst_mini_object_unref ((GstMiniObject *) info->next);
60 gst_caps_unref (info->caps);
63 gst_tag_list_free (info->tags);
66 gst_structure_free (info->misc);
69 static GstDiscovererStreamInfo *
70 gst_discoverer_stream_info_copy (GstDiscovererStreamInfo * info)
72 return gst_discoverer_info_copy_int (info, NULL);
76 gst_discoverer_stream_info_class_init (GstMiniObjectClass * klass)
79 (GstMiniObjectFinalizeFunction) gst_discoverer_stream_info_finalize;
80 klass->copy = (GstMiniObjectCopyFunction) gst_discoverer_stream_info_copy;
83 static GstDiscovererStreamInfo *
84 gst_discoverer_stream_info_new (void)
86 return (GstDiscovererStreamInfo *)
87 gst_mini_object_new (GST_TYPE_DISCOVERER_STREAM_INFO);
90 static GstDiscovererStreamInfo *
91 gst_discoverer_info_copy_int (GstDiscovererStreamInfo * info,
92 GHashTable * stream_map)
94 GstDiscovererStreamInfo *ret;
97 g_return_val_if_fail (info != NULL, NULL);
99 ltyp = G_TYPE_FROM_INSTANCE (info);
101 if (ltyp == GST_TYPE_DISCOVERER_CONTAINER_INFO) {
102 ret = (GstDiscovererStreamInfo *)
103 gst_stream_container_info_copy_int (
104 (GstDiscovererContainerInfo *) info, stream_map);
105 } else if (ltyp == GST_TYPE_DISCOVERER_AUDIO_INFO) {
106 ret = (GstDiscovererStreamInfo *)
107 gst_discoverer_audio_info_copy_int ((GstDiscovererAudioInfo *) info);
109 } else if (ltyp == GST_TYPE_DISCOVERER_VIDEO_INFO) {
110 ret = (GstDiscovererStreamInfo *)
111 gst_discoverer_video_info_copy_int ((GstDiscovererVideoInfo *) info);
114 ret = gst_discoverer_stream_info_new ();
117 ret->next = gst_discoverer_info_copy_int (info->next, stream_map);
118 ret->next->previous = ret;
122 ret->caps = gst_caps_copy (info->caps);
125 ret->tags = gst_tag_list_copy (info->tags);
128 ret->misc = gst_structure_copy (info->misc);
131 g_hash_table_insert (stream_map, info, ret);
136 /* Container information */
137 G_DEFINE_TYPE (GstDiscovererContainerInfo, gst_discoverer_container_info,
138 GST_TYPE_DISCOVERER_STREAM_INFO);
141 gst_discoverer_container_info_init (GstDiscovererContainerInfo * info)
143 /* Nothing to initialize */
146 static GstDiscovererContainerInfo *
147 gst_discoverer_container_info_new (void)
149 return (GstDiscovererContainerInfo *)
150 gst_mini_object_new (GST_TYPE_DISCOVERER_CONTAINER_INFO);
154 gst_discoverer_container_info_finalize (GstDiscovererContainerInfo * info)
158 for (tmp = ((GstDiscovererContainerInfo *) info)->streams; tmp;
160 gst_mini_object_unref ((GstMiniObject *) tmp->data);
162 gst_discoverer_stream_info_list_free (info->streams);
164 gst_discoverer_stream_info_finalize ((GstDiscovererStreamInfo *) info);
168 gst_discoverer_container_info_class_init (GstMiniObjectClass * klass)
171 (GstMiniObjectFinalizeFunction) gst_discoverer_container_info_finalize;
174 static GstDiscovererContainerInfo *
175 gst_stream_container_info_copy_int (GstDiscovererContainerInfo * ptr,
176 GHashTable * stream_map)
178 GstDiscovererContainerInfo *ret;
181 g_return_val_if_fail (ptr != NULL, NULL);
183 ret = gst_discoverer_container_info_new ();
185 for (tmp = ((GstDiscovererContainerInfo *) ptr)->streams; tmp;
187 GstDiscovererStreamInfo *subtop = gst_discoverer_info_copy_int (tmp->data,
189 ret->streams = g_list_append (ret->streams, subtop);
191 g_hash_table_insert (stream_map, tmp->data, subtop);
197 /* Audio information */
198 G_DEFINE_TYPE (GstDiscovererAudioInfo, gst_discoverer_audio_info,
199 GST_TYPE_DISCOVERER_STREAM_INFO);
202 gst_discoverer_audio_info_class_init (GstDiscovererAudioInfoClass * klass)
204 /* Nothing to initialize */
208 gst_discoverer_audio_info_init (GstDiscovererAudioInfo * info)
210 /* Nothing to initialize */
213 static GstDiscovererAudioInfo *
214 gst_discoverer_audio_info_new (void)
216 return (GstDiscovererAudioInfo *)
217 gst_mini_object_new (GST_TYPE_DISCOVERER_AUDIO_INFO);
220 static GstDiscovererAudioInfo *
221 gst_discoverer_audio_info_copy_int (GstDiscovererAudioInfo * ptr)
223 GstDiscovererAudioInfo *ret;
225 ret = gst_discoverer_audio_info_new ();
227 ret->channels = ptr->channels;
228 ret->sample_rate = ptr->sample_rate;
229 ret->depth = ptr->depth;
230 ret->bitrate = ptr->bitrate;
231 ret->max_bitrate = ptr->max_bitrate;
236 /* Video information */
237 G_DEFINE_TYPE (GstDiscovererVideoInfo, gst_discoverer_video_info,
238 GST_TYPE_DISCOVERER_STREAM_INFO);
241 gst_discoverer_video_info_class_init (GstMiniObjectClass * klass)
243 /* Nothing to initialize */
247 gst_discoverer_video_info_init (GstDiscovererVideoInfo * info)
249 /* Nothing to initialize */
252 static GstDiscovererVideoInfo *
253 gst_discoverer_video_info_new (void)
255 return (GstDiscovererVideoInfo *)
256 gst_mini_object_new (GST_TYPE_DISCOVERER_VIDEO_INFO);
259 static GstDiscovererVideoInfo *
260 gst_discoverer_video_info_copy_int (GstDiscovererVideoInfo * ptr)
262 GstDiscovererVideoInfo *ret;
264 ret = gst_discoverer_video_info_new ();
266 ret->width = ptr->width;
267 ret->height = ptr->height;
268 ret->depth = ptr->depth;
269 ret->framerate_num = ptr->framerate_num;
270 ret->framerate_denom = ptr->framerate_denom;
271 ret->par_num = ptr->par_num;
272 ret->par_denom = ptr->par_denom;
273 ret->interlaced = ptr->interlaced;
274 ret->bitrate = ptr->bitrate;
275 ret->max_bitrate = ptr->max_bitrate;
276 ret->is_image = ptr->is_image;
281 /* Global stream information */
282 G_DEFINE_TYPE (GstDiscovererInfo, gst_discoverer_info, GST_TYPE_MINI_OBJECT);
285 gst_discoverer_info_init (GstDiscovererInfo * info)
287 /* Nothing needs initialization */
291 gst_discoverer_info_finalize (GstDiscovererInfo * info)
295 if (info->stream_info)
296 gst_mini_object_unref ((GstMiniObject *) info->stream_info);
299 gst_structure_free (info->misc);
301 g_list_free (info->stream_list);
304 gst_tag_list_free (info->tags);
307 static GstDiscovererInfo *
308 gst_discoverer_info_new (void)
310 return (GstDiscovererInfo *) gst_mini_object_new (GST_TYPE_DISCOVERER_INFO);
314 gst_discoverer_info_copy (GstDiscovererInfo * ptr)
316 GstDiscovererInfo *ret;
317 GHashTable *stream_map = g_hash_table_new (g_direct_hash, NULL);
320 g_return_val_if_fail (ptr != NULL, NULL);
322 ret = gst_discoverer_info_new ();
324 ret->uri = g_strdup (ptr->uri);
325 if (ptr->stream_info) {
326 ret->stream_info = gst_discoverer_info_copy_int (ptr->stream_info,
329 ret->duration = ptr->duration;
331 ret->misc = gst_structure_copy (ptr->misc);
333 /* We need to set up the new list of streams to correspond to old one. The
334 * list just contains a set of pointers to streams in the stream_info tree,
335 * so we keep a map of old stream info objects to the corresponding new
336 * ones and use that to figure out correspondence in stream_list. */
337 for (tmp = ptr->stream_list; tmp; tmp = tmp->next) {
338 GstDiscovererStreamInfo *old_stream = (GstDiscovererStreamInfo *) tmp->data;
339 GstDiscovererStreamInfo *new_stream = g_hash_table_lookup (stream_map,
341 g_assert (new_stream != NULL);
342 ret->stream_list = g_list_append (ret->stream_list, new_stream);
346 ret->tags = gst_tag_list_copy (ptr->tags);
348 g_hash_table_destroy (stream_map);
353 gst_discoverer_info_class_init (GstMiniObjectClass * klass)
356 (GstMiniObjectFinalizeFunction) gst_discoverer_info_finalize;
357 klass->copy = (GstMiniObjectCopyFunction) gst_discoverer_info_copy;
361 * gst_discoverer_stream_info_list_free:
362 * @infos: a #GList of #GstDiscovererStreamInfo
364 * Decrements the reference count of all contained #GstDiscovererStreamInfo
365 * and fress the #GList.
368 gst_discoverer_stream_info_list_free (GList * infos)
372 for (tmp = infos; tmp; tmp = tmp->next)
373 gst_discoverer_stream_info_unref ((GstDiscovererStreamInfo *) tmp->data);
378 * gst_discoverer_info_get_streams:
379 * @info: a #GstDiscovererInfo
380 * @streamtype: a #GType derived from #GstDiscovererStreamInfo
382 * Finds the #GstDiscovererStreamInfo contained in @info that match the
385 * Returns: (transfer full) (element-type Gst.DiscovererStreamInfo): A #GList of
386 * matching #GstDiscovererStreamInfo. The caller should free it with
387 * gst_discoverer_stream_info_list_free().
392 gst_discoverer_info_get_streams (GstDiscovererInfo * info, GType streamtype)
394 GList *tmp, *res = NULL;
396 for (tmp = info->stream_list; tmp; tmp = tmp->next) {
397 GstDiscovererStreamInfo *stmp = (GstDiscovererStreamInfo *) tmp->data;
399 if (G_TYPE_CHECK_INSTANCE_TYPE (stmp, streamtype))
400 res = g_list_append (res, gst_discoverer_stream_info_ref (stmp));
407 * gst_discoverer_info_get_audio_streams:
408 * @info: a #GstDiscovererInfo
410 * Finds all the #GstDiscovererAudioInfo contained in @info
412 * Returns: (transfer full) (element-type Gst.DiscovererStreamInfo): A #GList of
413 * matching #GstDiscovererStreamInfo. The caller should free it with
414 * gst_discoverer_stream_info_list_free().
419 gst_discoverer_info_get_audio_streams (GstDiscovererInfo * info)
421 return gst_discoverer_info_get_streams (info, GST_TYPE_DISCOVERER_AUDIO_INFO);
425 * gst_discoverer_info_get_video_streams:
426 * @info: a #GstDiscovererInfo
428 * Finds all the #GstDiscovererVideoInfo contained in @info
430 * Returns: (transfer full) (element-type Gst.DiscovererStreamInfo): A #GList of
431 * matching #GstDiscovererStreamInfo. The caller should free it with
432 * gst_discoverer_stream_info_list_free().
437 gst_discoverer_info_get_video_streams (GstDiscovererInfo * info)
439 return gst_discoverer_info_get_streams (info, GST_TYPE_DISCOVERER_VIDEO_INFO);
443 * gst_discoverer_info_get_container_streams:
444 * @info: a #GstDiscovererInfo
446 * Finds all the #GstDiscovererContainerInfo contained in @info
448 * Returns: (transfer full) (element-type Gst.DiscovererStreamInfo): A #GList of
449 * matching #GstDiscovererStreamInfo. The caller should free it with
450 * gst_discoverer_stream_info_list_free().
455 gst_discoverer_info_get_container_streams (GstDiscovererInfo * info)
457 return gst_discoverer_info_get_streams (info,
458 GST_TYPE_DISCOVERER_CONTAINER_INFO);
462 * gst_discoverer_stream_info_get_stream_type_nick:
463 * @info: a #GstDiscovererStreamInfo
465 * Returns: a human readable name for the stream type of the given @info (ex : "audio",
471 gst_discoverer_stream_info_get_stream_type_nick (GstDiscovererStreamInfo * info)
473 if (GST_IS_DISCOVERER_CONTAINER_INFO (info))
475 if (GST_IS_DISCOVERER_AUDIO_INFO (info))
477 if (GST_IS_DISCOVERER_VIDEO_INFO (info)) {
478 if (gst_discoverer_video_info_is_image ((GstDiscovererVideoInfo *)
480 return "video(image)";
490 #define GENERIC_ACCESSOR_CODE(parent, parenttype, parentgtype, fieldname, type, failval) \
491 type parent##_get_##fieldname(const parenttype info) { \
492 g_return_val_if_fail(G_TYPE_CHECK_INSTANCE_TYPE((info), parentgtype), failval); \
493 return (info)->fieldname; \
497 * gst_discoverer_stream_info_get_previous:
498 * @info: a #GstDiscovererStreamInfo
500 * Returns: (transfer full): the previous #GstDiscovererStreamInfo in a chain.
501 * %NULL for starting points. Unref with #gst_discoverer_stream_info_unref
506 GstDiscovererStreamInfo *
507 gst_discoverer_stream_info_get_previous (GstDiscovererStreamInfo * info)
509 g_return_val_if_fail (GST_IS_DISCOVERER_STREAM_INFO (info), NULL);
512 return gst_discoverer_stream_info_ref (info->previous);
517 * gst_discoverer_stream_info_get_next:
518 * @info: a #GstDiscovererStreamInfo
520 * Returns: (transfer full): the next #GstDiscovererStreamInfo in a chain. %NULL
522 * Unref with #gst_discoverer_stream_info_unref after usage.
526 GstDiscovererStreamInfo *
527 gst_discoverer_stream_info_get_next (GstDiscovererStreamInfo * info)
529 g_return_val_if_fail (GST_IS_DISCOVERER_STREAM_INFO (info), NULL);
532 return gst_discoverer_stream_info_ref (info->next);
538 * gst_discoverer_stream_info_get_caps:
539 * @info: a #GstDiscovererStreamInfo
541 * Returns: (transfer full): the #GstCaps of the stream. Unref with
542 * #gst_caps_unref after usage.
547 gst_discoverer_stream_info_get_caps (GstDiscovererStreamInfo * info)
549 g_return_val_if_fail (GST_IS_DISCOVERER_STREAM_INFO (info), NULL);
552 return gst_caps_ref (info->caps);
557 * gst_discoverer_stream_info_get_tags:
558 * @info: a #GstDiscovererStreamInfo
560 * Returns: (transfer none): the tags contained in this stream. If you wish to
561 * use the tags after the life-time of @info you will need to copy them.
567 gst_discoverer_stream_info_get_tags (GstDiscovererStreamInfo * info)
569 g_return_val_if_fail (GST_IS_DISCOVERER_STREAM_INFO (info), NULL);
575 * gst_discoverer_stream_info_get_misc:
576 * @info: a #GstDiscovererStreamInfo
578 * Returns: (transfer none): additional information regarding the stream (for
579 * example codec version, profile, etc..). If you wish to use the #GstStructure
580 * after the life-time of @info you will need to copy it.
585 gst_discoverer_stream_info_get_misc (GstDiscovererStreamInfo * info)
587 g_return_val_if_fail (GST_IS_DISCOVERER_STREAM_INFO (info), NULL);
592 /* GstDiscovererContainerInfo */
595 * gst_discoverer_container_info_get_streams:
596 * @info: a #GstDiscovererStreamInfo
598 * Returns: (transfer full) (element-type Gst.DiscovererStreamInfo): the list of
599 * #GstDiscovererStreamInfo this container stream offers.
600 * Free with gst_discoverer_stream_info_list_free() after usage.
606 gst_discoverer_container_info_get_streams (GstDiscovererContainerInfo * info)
608 GList *res = NULL, *tmp;
610 g_return_val_if_fail (GST_IS_DISCOVERER_CONTAINER_INFO (info), NULL);
612 for (tmp = info->streams; tmp; tmp = tmp->next)
615 gst_discoverer_stream_info_ref ((GstDiscovererStreamInfo *) tmp->data));
620 /* GstDiscovererAudioInfo */
622 #define AUDIO_INFO_ACCESSOR_CODE(fieldname, type, failval) \
623 GENERIC_ACCESSOR_CODE(gst_discoverer_audio_info, GstDiscovererAudioInfo*, \
624 GST_TYPE_DISCOVERER_AUDIO_INFO, \
625 fieldname, type, failval)
628 * gst_discoverer_audio_info_get_channels:
629 * @info: a #GstDiscovererAudioInfo
631 * Returns: the number of channels in the stream.
636 AUDIO_INFO_ACCESSOR_CODE (channels, guint, 0);
639 * gst_discoverer_audio_info_get_sample_rate:
640 * @info: a #GstDiscovererAudioInfo
642 * Returns: the sample rate of the stream in Hertz.
647 AUDIO_INFO_ACCESSOR_CODE (sample_rate, guint, 0);
650 * gst_discoverer_audio_info_get_depth:
651 * @info: a #GstDiscovererAudioInfo
653 * Returns: the number of bits used per sample in each channel.
658 AUDIO_INFO_ACCESSOR_CODE (depth, guint, 0);
661 * gst_discoverer_audio_info_get_bitrate:
662 * @info: a #GstDiscovererAudioInfo
664 * Returns: the average or nominal bitrate of the stream in bits/second.
669 AUDIO_INFO_ACCESSOR_CODE (bitrate, guint, 0);
672 * gst_discoverer_audio_info_get_max_bitrate:
673 * @info: a #GstDiscovererAudioInfo
675 * Returns: the maximum bitrate of the stream in bits/second.
680 AUDIO_INFO_ACCESSOR_CODE (max_bitrate, guint, 0);
682 /* GstDiscovererVideoInfo */
684 #define VIDEO_INFO_ACCESSOR_CODE(fieldname, type, failval) \
685 GENERIC_ACCESSOR_CODE(gst_discoverer_video_info, GstDiscovererVideoInfo*, \
686 GST_TYPE_DISCOVERER_VIDEO_INFO, \
687 fieldname, type, failval)
690 * gst_discoverer_video_info_get_width:
691 * @info: a #GstDiscovererVideoInfo
693 * Returns: the width of the video stream in pixels.
698 VIDEO_INFO_ACCESSOR_CODE (width, guint, 0);
701 * gst_discoverer_video_info_get_height:
702 * @info: a #GstDiscovererVideoInfo
704 * Returns: the height of the video stream in pixels.
709 VIDEO_INFO_ACCESSOR_CODE (height, guint, 0);
712 * gst_discoverer_video_info_get_depth:
713 * @info: a #GstDiscovererVideoInfo
715 * Returns: the depth in bits of the video stream.
720 VIDEO_INFO_ACCESSOR_CODE (depth, guint, 0);
723 * gst_discoverer_video_info_get_framerate_num:
724 * @info: a #GstDiscovererVideoInfo
726 * Returns: the framerate of the video stream (numerator).
731 VIDEO_INFO_ACCESSOR_CODE (framerate_num, guint, 0);
734 * gst_discoverer_video_info_get_framerate_denom:
735 * @info: a #GstDiscovererVideoInfo
737 * Returns: the framerate of the video stream (denominator).
742 VIDEO_INFO_ACCESSOR_CODE (framerate_denom, guint, 0);
745 * gst_discoverer_video_info_get_par_num:
746 * @info: a #GstDiscovererVideoInfo
748 * Returns: the Pixel Aspect Ratio (PAR) of the video stream (numerator).
753 VIDEO_INFO_ACCESSOR_CODE (par_num, guint, 0);
756 * gst_discoverer_video_info_get_par_denom:
757 * @info: a #GstDiscovererVideoInfo
759 * Returns: the Pixel Aspect Ratio (PAR) of the video stream (denominator).
764 VIDEO_INFO_ACCESSOR_CODE (par_denom, guint, 0);
767 * gst_discoverer_video_info_is_interlaced:
768 * @info: a #GstDiscovererVideoInfo
770 * Returns: %TRUE if the stream is interlaced, else %FALSE.
775 gst_discoverer_video_info_is_interlaced (const GstDiscovererVideoInfo * info)
777 g_return_val_if_fail (GST_IS_DISCOVERER_VIDEO_INFO (info), FALSE);
779 return info->interlaced;
783 * gst_discoverer_video_info_get_bitrate:
784 * @info: a #GstDiscovererVideoInfo
786 * Returns: the average or nominal bitrate of the video stream in bits/second.
791 VIDEO_INFO_ACCESSOR_CODE (bitrate, guint, 0);
794 * gst_discoverer_video_info_get_max_bitrate:
795 * @info: a #GstDiscovererVideoInfo
797 * Returns: the maximum bitrate of the video stream in bits/second.
802 VIDEO_INFO_ACCESSOR_CODE (max_bitrate, guint, 0);
805 * gst_discoverer_video_info_is_image:
806 * @info: a #GstDiscovererVideoInfo
808 * Returns: #TRUE if the video stream corresponds to an image (i.e. only contains
814 gst_discoverer_video_info_is_image (const GstDiscovererVideoInfo * info)
816 g_return_val_if_fail (GST_IS_DISCOVERER_VIDEO_INFO (info), FALSE);
818 return info->is_image;
821 /* GstDiscovererInfo */
823 #define DISCOVERER_INFO_ACCESSOR_CODE(fieldname, type, failval) \
824 GENERIC_ACCESSOR_CODE(gst_discoverer_info, GstDiscovererInfo*, \
825 GST_TYPE_DISCOVERER_INFO, \
826 fieldname, type, failval)
829 * gst_discoverer_info_get_uri:
830 * @info: a #GstDiscovererInfo
832 * Returns: (transfer none): the URI to which this information corresponds to.
833 * Copy it if you wish to use it after the life-time of @info.
838 DISCOVERER_INFO_ACCESSOR_CODE (uri, const gchar *, NULL);
841 * gst_discoverer_info_get_result:
842 * @info: a #GstDiscovererInfo
844 * Returns: the result of the discovery as a #GstDiscovererResult.
849 DISCOVERER_INFO_ACCESSOR_CODE (result, GstDiscovererResult, GST_DISCOVERER_OK);
852 * gst_discoverer_info_get_stream_info:
853 * @info: a #GstDiscovererInfo
855 * Returns: (transfer full): the structure (or topology) of the URI as a
856 * #GstDiscovererStreamInfo.
857 * This structure can be traversed to see the original hierarchy. Unref with
858 * gst_discoverer_stream_info_unref() after usage.
863 GstDiscovererStreamInfo *
864 gst_discoverer_info_get_stream_info (GstDiscovererInfo * info)
866 g_return_val_if_fail (GST_IS_DISCOVERER_INFO (info), NULL);
868 if (info->stream_info)
869 return gst_discoverer_stream_info_ref (info->stream_info);
874 * gst_discoverer_info_get_stream_list:
875 * @info: a #GstDiscovererInfo
877 * Returns: (transfer full) (element-type Gst.DiscovererStreamInfo): the list of
878 * all streams contained in the #info. Free after usage
879 * with gst_discoverer_stream_info_list_free().
884 gst_discoverer_info_get_stream_list (GstDiscovererInfo * info)
886 GList *res = NULL, *tmp;
888 g_return_val_if_fail (GST_IS_DISCOVERER_INFO (info), NULL);
890 for (tmp = info->stream_list; tmp; tmp = tmp->next)
893 gst_discoverer_stream_info_ref ((GstDiscovererStreamInfo *) tmp->data));
899 * gst_discoverer_info_get_duration:
900 * @info: a #GstDiscovererInfo
902 * Returns: the duration of the URI in #GstClockTime (nanoseconds).
907 DISCOVERER_INFO_ACCESSOR_CODE (duration, GstClockTime, GST_CLOCK_TIME_NONE);
910 * gst_discoverer_info_get_seekable:
911 * @info: a #GstDiscovererInfo
913 * Returns: the wheter the URI is seekable.
918 DISCOVERER_INFO_ACCESSOR_CODE (seekable, gboolean, FALSE);
921 * gst_discoverer_info_get_misc:
922 * @info: a #GstDiscovererInfo
924 * Returns: (transfer none): Miscellaneous information stored as a #GstStructure
925 * (for example: information about missing plugins). If you wish to use the
926 * #GstStructure after the life-time of @info, you will need to copy it.
931 DISCOVERER_INFO_ACCESSOR_CODE (misc, const GstStructure *, NULL);
934 * gst_discoverer_info_get_tags:
935 * @info: a #GstDiscovererInfo
937 * Returns: (transfer none): all tags contained in the %URI. If you wish to use
938 * the tags after the life-time of @info, you will need to copy them.
943 DISCOVERER_INFO_ACCESSOR_CODE (tags, const GstTagList *, NULL);
946 * gst_discoverer_info_ref:
947 * @info: a #GstDiscovererInfo
949 * Increments the reference count of @info.
951 * Returns: the same #GstDiscovererInfo object
957 * gst_discoverer_info_unref:
958 * @info: a #GstDiscovererInfo
960 * Decrements the reference count of @info.
966 * gst_discoverer_stream_info_ref:
967 * @info: a #GstDiscovererStreamInfo
969 * Increments the reference count of @info.
971 * Returns: the same #GstDiscovererStreamInfo object
977 * gst_discoverer_stream_info_unref:
978 * @info: a #GstDiscovererStreamInfo
980 * Decrements the reference count of @info.