player: Add get track number media info API

https://bugzilla.gnome.org/show_bug.cgi?id=773570
This commit is contained in:
Lyon Wang 2016-12-20 18:20:02 +08:00 committed by Sebastian Dröge
parent 9b5de05399
commit 9294dc4ac7
4 changed files with 78 additions and 0 deletions

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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