summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/libs/gst-plugins-bad-libs-sections.txt4
-rw-r--r--gst-libs/gst/player/gstplayer-media-info.c62
-rw-r--r--gst-libs/gst/player/gstplayer-media-info.h8
-rw-r--r--win32/common/libgstplayer.def4
4 files changed, 78 insertions, 0 deletions
diff --git a/docs/libs/gst-plugins-bad-libs-sections.txt b/docs/libs/gst-plugins-bad-libs-sections.txt
index 34a42b548..6abb6b9b6 100644
--- a/docs/libs/gst-plugins-bad-libs-sections.txt
+++ b/docs/libs/gst-plugins-bad-libs-sections.txt
@@ -2070,6 +2070,10 @@ gst_player_media_info_is_live
gst_player_media_info_get_image_sample
gst_player_media_info_get_tags
gst_player_media_info_get_stream_list
+gst_player_media_info_get_number_of_streams
+gst_player_media_info_get_number_of_video_streams
+gst_player_media_info_get_number_of_audio_streams
+gst_player_media_info_get_number_of_subtitle_streams
gst_player_stream_info_get_index
gst_player_stream_info_get_caps
diff --git a/gst-libs/gst/player/gstplayer-media-info.c b/gst-libs/gst/player/gstplayer-media-info.c
index bba8ea69d..a6c17c465 100644
--- a/gst-libs/gst/player/gstplayer-media-info.c
+++ b/gst-libs/gst/player/gstplayer-media-info.c
@@ -791,3 +791,65 @@ gst_player_media_info_get_image_sample (const GstPlayerMediaInfo * info)
return info->image_sample;
}
+
+/**
+ * gst_player_media_info_get_number_of_streams:
+ * @info: a #GstPlayerMediaInfo
+ *
+ * Returns: number of total streams.
+ * Since: 1.12
+ */
+guint
+gst_player_media_info_get_number_of_streams (const GstPlayerMediaInfo * info)
+{
+ g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), 0);
+
+ return g_list_length (info->stream_list);
+}
+
+/**
+ * gst_player_media_info_get_number_of_video_streams:
+ * @info: a #GstPlayerMediaInfo
+ *
+ * Returns: number of video streams.
+ * Since: 1.12
+ */
+guint
+gst_player_media_info_get_number_of_video_streams (const GstPlayerMediaInfo *
+ info)
+{
+ g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), 0);
+
+ return g_list_length (info->video_stream_list);
+}
+
+/**
+ * gst_player_media_info_get_number_of_audio_streams:
+ * @info: a #GstPlayerMediaInfo
+ *
+ * Returns: number of audio streams.
+ * Since: 1.12
+ */
+guint
+gst_player_media_info_get_number_of_audio_streams (const GstPlayerMediaInfo *
+ info)
+{
+ g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), 0);
+
+ return g_list_length (info->audio_stream_list);
+}
+
+/**
+ * gst_player_media_info_get_number_of_subtitle_streams:
+ * @info: a #GstPlayerMediaInfo
+ *
+ * Returns: number of subtitle streams.
+ * Since: 1.12
+ */
+guint gst_player_media_info_get_number_of_subtitle_streams
+ (const GstPlayerMediaInfo * info)
+{
+ g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), 0);
+
+ return g_list_length (info->subtitle_stream_list);
+}
diff --git a/gst-libs/gst/player/gstplayer-media-info.h b/gst-libs/gst/player/gstplayer-media-info.h
index 7ffd6b493..6866ff6a8 100644
--- a/gst-libs/gst/player/gstplayer-media-info.h
+++ b/gst-libs/gst/player/gstplayer-media-info.h
@@ -175,12 +175,20 @@ GstClockTime gst_player_media_info_get_duration
(const GstPlayerMediaInfo *info);
GList* gst_player_media_info_get_stream_list
(const GstPlayerMediaInfo *info);
+guint gst_player_media_info_get_number_of_streams
+ (const GstPlayerMediaInfo *info);
GList* gst_player_get_video_streams
(const GstPlayerMediaInfo *info);
+guint gst_player_media_info_get_number_of_video_streams
+ (const GstPlayerMediaInfo *info);
GList* gst_player_get_audio_streams
(const GstPlayerMediaInfo *info);
+guint gst_player_media_info_get_number_of_audio_streams
+ (const GstPlayerMediaInfo *info);
GList* gst_player_get_subtitle_streams
(const GstPlayerMediaInfo *info);
+guint gst_player_media_info_get_number_of_subtitle_streams
+ (const GstPlayerMediaInfo *info);
GstTagList* gst_player_media_info_get_tags
(const GstPlayerMediaInfo *info);
const gchar* gst_player_media_info_get_title
diff --git a/win32/common/libgstplayer.def b/win32/common/libgstplayer.def
index 459ed0838..8aa1d2326 100644
--- a/win32/common/libgstplayer.def
+++ b/win32/common/libgstplayer.def
@@ -44,6 +44,10 @@ EXPORTS
gst_player_media_info_get_container_format
gst_player_media_info_get_duration
gst_player_media_info_get_image_sample
+ gst_player_media_info_get_number_of_audio_streams
+ gst_player_media_info_get_number_of_streams
+ gst_player_media_info_get_number_of_subtitle_streams
+ gst_player_media_info_get_number_of_video_streams
gst_player_media_info_get_stream_list
gst_player_media_info_get_tags
gst_player_media_info_get_title