2015-12-22 13:24:00 +00:00
|
|
|
/* GStreamer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2015 Brijesh Singh <brijesh.ksingh@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* SECTION:gstplayer-mediainfo
|
2017-03-08 18:01:13 +00:00
|
|
|
* @title: GstPlayerMediaInfo
|
2015-12-22 13:24:00 +00:00
|
|
|
* @short_description: Player Media Information
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "gstplayer-media-info.h"
|
|
|
|
#include "gstplayer-media-info-private.h"
|
|
|
|
|
|
|
|
/* Per-stream information */
|
|
|
|
G_DEFINE_ABSTRACT_TYPE (GstPlayerStreamInfo, gst_player_stream_info,
|
|
|
|
G_TYPE_OBJECT);
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_stream_info_init (GstPlayerStreamInfo * sinfo)
|
|
|
|
{
|
|
|
|
sinfo->stream_index = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_stream_info_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstPlayerStreamInfo *sinfo = GST_PLAYER_STREAM_INFO (object);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
g_clear_object (&sinfo->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (gst_player_stream_info_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_stream_info_class_init (GstPlayerStreamInfoClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
|
|
|
|
|
|
|
gobject_class->finalize = gst_player_stream_info_finalize;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_stream_info_get_index:
|
|
|
|
* @info: a #GstPlayerStreamInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Function to get stream index from #GstPlayerStreamInfo instance or -1 if
|
|
|
|
* unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*
|
|
|
|
* Returns: the stream index of this stream.
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_stream_info_get_index (const GstPlayerStreamInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_STREAM_INFO (info), -1);
|
|
|
|
|
|
|
|
return info->stream_index;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_stream_info_get_stream_type:
|
|
|
|
* @info: a #GstPlayerStreamInfo
|
|
|
|
*
|
|
|
|
* Function to return human readable name for the stream type
|
|
|
|
* of the given @info (ex: "audio", "video", "subtitle")
|
|
|
|
*
|
|
|
|
* Returns: a human readable name
|
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
gst_player_stream_info_get_stream_type (const GstPlayerStreamInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_STREAM_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_stream_info_get_stream_type (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_stream_info_get_tags:
|
|
|
|
* @info: a #GstPlayerStreamInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (transfer none) (nullable): the tags contained in this stream.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
GstTagList *
|
|
|
|
gst_player_stream_info_get_tags (const GstPlayerStreamInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_STREAM_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_stream_info_get_tags (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_stream_info_get_codec:
|
|
|
|
* @info: a #GstPlayerStreamInfo
|
|
|
|
*
|
|
|
|
* A string describing codec used in #GstPlayerStreamInfo.
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (nullable): codec string or %NULL on unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
gst_player_stream_info_get_codec (const GstPlayerStreamInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_STREAM_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_stream_info_get_codec (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_stream_info_get_caps:
|
|
|
|
* @info: a #GstPlayerStreamInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (transfer none) (nullable): the #GstCaps of the stream.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
GstCaps *
|
|
|
|
gst_player_stream_info_get_caps (const GstPlayerStreamInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_STREAM_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_stream_info_get_caps (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Video information */
|
|
|
|
G_DEFINE_TYPE (GstPlayerVideoInfo, gst_player_video_info,
|
|
|
|
GST_TYPE_PLAYER_STREAM_INFO);
|
|
|
|
|
|
|
|
static void
|
2020-12-07 10:47:30 +00:00
|
|
|
gst_player_video_info_init (G_GNUC_UNUSED GstPlayerVideoInfo * info)
|
2015-12-22 13:24:00 +00:00
|
|
|
{
|
2020-12-07 10:47:30 +00:00
|
|
|
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_video_info_class_init (G_GNUC_UNUSED GstPlayerVideoInfoClass * klass)
|
|
|
|
{
|
|
|
|
/* nothing to do here */
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_video_info_get_width:
|
|
|
|
* @info: a #GstPlayerVideoInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the width of video in #GstPlayerVideoInfo or -1 if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_video_info_get_width (const GstPlayerVideoInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_VIDEO_INFO (info), -1);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_video_info_get_width (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_video_info_get_height:
|
|
|
|
* @info: a #GstPlayerVideoInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the height of video in #GstPlayerVideoInfo or -1 if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_video_info_get_height (const GstPlayerVideoInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_VIDEO_INFO (info), -1);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_video_info_get_height (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-05-23 11:30:22 +00:00
|
|
|
* gst_player_video_info_get_framerate:
|
2015-12-22 13:24:00 +00:00
|
|
|
* @info: a #GstPlayerVideoInfo
|
2016-05-23 11:30:22 +00:00
|
|
|
* @fps_n: (out): Numerator of frame rate
|
|
|
|
* @fps_d: (out): Denominator of frame rate
|
2015-12-22 13:24:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_player_video_info_get_framerate (const GstPlayerVideoInfo * info,
|
|
|
|
gint * fps_n, gint * fps_d)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_PLAYER_VIDEO_INFO (info));
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
gst_play_video_info_get_framerate (info->info, fps_n, fps_d);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_video_info_get_pixel_aspect_ratio:
|
|
|
|
* @info: a #GstPlayerVideoInfo
|
|
|
|
* @par_n: (out): numerator
|
|
|
|
* @par_d: (out): denominator
|
|
|
|
*
|
|
|
|
* Returns the pixel aspect ratio in @par_n and @par_d
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
gst_player_video_info_get_pixel_aspect_ratio (const GstPlayerVideoInfo * info,
|
|
|
|
guint * par_n, guint * par_d)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GST_IS_PLAYER_VIDEO_INFO (info));
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
gst_play_video_info_get_pixel_aspect_ratio (info->info, par_n, par_d);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_video_info_get_bitrate:
|
|
|
|
* @info: a #GstPlayerVideoInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the current bitrate of video in #GstPlayerVideoInfo or -1 if
|
|
|
|
* unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_video_info_get_bitrate (const GstPlayerVideoInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_VIDEO_INFO (info), -1);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_video_info_get_bitrate (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_video_info_get_max_bitrate:
|
|
|
|
* @info: a #GstPlayerVideoInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the maximum bitrate of video in #GstPlayerVideoInfo or -1 if
|
|
|
|
* unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_video_info_get_max_bitrate (const GstPlayerVideoInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_VIDEO_INFO (info), -1);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_video_info_get_max_bitrate (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Audio information */
|
|
|
|
G_DEFINE_TYPE (GstPlayerAudioInfo, gst_player_audio_info,
|
|
|
|
GST_TYPE_PLAYER_STREAM_INFO);
|
|
|
|
|
|
|
|
static void
|
2020-12-07 10:47:30 +00:00
|
|
|
gst_player_audio_info_init (G_GNUC_UNUSED GstPlayerAudioInfo * info)
|
2015-12-22 13:24:00 +00:00
|
|
|
{
|
2020-12-07 10:47:30 +00:00
|
|
|
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_audio_info_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstPlayerAudioInfo *info = GST_PLAYER_AUDIO_INFO (object);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
g_clear_object (&info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (gst_player_audio_info_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_audio_info_class_init (GstPlayerAudioInfoClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
|
|
|
|
|
|
|
gobject_class->finalize = gst_player_audio_info_finalize;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_audio_info_get_language:
|
|
|
|
* @info: a #GstPlayerAudioInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (nullable): the language of the stream, or NULL if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
gst_player_audio_info_get_language (const GstPlayerAudioInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_AUDIO_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_audio_info_get_language (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_audio_info_get_channels:
|
|
|
|
* @info: a #GstPlayerAudioInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the number of audio channels in #GstPlayerAudioInfo or 0 if
|
|
|
|
* unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_audio_info_get_channels (const GstPlayerAudioInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_AUDIO_INFO (info), 0);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_audio_info_get_channels (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_audio_info_get_sample_rate:
|
|
|
|
* @info: a #GstPlayerAudioInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the audio sample rate in #GstPlayerAudioInfo or 0 if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_audio_info_get_sample_rate (const GstPlayerAudioInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_AUDIO_INFO (info), 0);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_audio_info_get_sample_rate (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_audio_info_get_bitrate:
|
|
|
|
* @info: a #GstPlayerAudioInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the audio bitrate in #GstPlayerAudioInfo or -1 if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_audio_info_get_bitrate (const GstPlayerAudioInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_AUDIO_INFO (info), -1);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_audio_info_get_bitrate (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_audio_info_get_max_bitrate:
|
|
|
|
* @info: a #GstPlayerAudioInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: the audio maximum bitrate in #GstPlayerAudioInfo or -1 if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gst_player_audio_info_get_max_bitrate (const GstPlayerAudioInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_AUDIO_INFO (info), -1);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_audio_info_get_max_bitrate (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Subtitle information */
|
|
|
|
G_DEFINE_TYPE (GstPlayerSubtitleInfo, gst_player_subtitle_info,
|
|
|
|
GST_TYPE_PLAYER_STREAM_INFO);
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_subtitle_info_init (G_GNUC_UNUSED GstPlayerSubtitleInfo * info)
|
|
|
|
{
|
|
|
|
/* nothing to do */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_subtitle_info_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstPlayerSubtitleInfo *info = GST_PLAYER_SUBTITLE_INFO (object);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
g_clear_object (&info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (gst_player_subtitle_info_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_subtitle_info_class_init (GstPlayerSubtitleInfoClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
|
|
|
|
|
|
|
gobject_class->finalize = gst_player_subtitle_info_finalize;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_subtitle_info_get_language:
|
|
|
|
* @info: a #GstPlayerSubtitleInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (nullable): the language of the stream, or %NULL if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
gst_player_subtitle_info_get_language (const GstPlayerSubtitleInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_SUBTITLE_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_subtitle_info_get_language (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Global media information */
|
|
|
|
G_DEFINE_TYPE (GstPlayerMediaInfo, gst_player_media_info, G_TYPE_OBJECT);
|
|
|
|
|
|
|
|
static void
|
2020-12-07 10:47:30 +00:00
|
|
|
gst_player_media_info_init (G_GNUC_UNUSED GstPlayerMediaInfo * info)
|
2015-12-22 13:24:00 +00:00
|
|
|
{
|
2020-12-07 10:47:30 +00:00
|
|
|
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_media_info_finalize (GObject * object)
|
|
|
|
{
|
|
|
|
GstPlayerMediaInfo *info = GST_PLAYER_MEDIA_INFO (object);
|
|
|
|
|
|
|
|
if (info->audio_stream_list)
|
|
|
|
g_list_free (info->audio_stream_list);
|
|
|
|
|
|
|
|
if (info->video_stream_list)
|
|
|
|
g_list_free (info->video_stream_list);
|
|
|
|
|
|
|
|
if (info->subtitle_stream_list)
|
|
|
|
g_list_free (info->subtitle_stream_list);
|
|
|
|
|
|
|
|
if (info->stream_list)
|
|
|
|
g_list_free_full (info->stream_list, g_object_unref);
|
2020-12-07 10:47:30 +00:00
|
|
|
g_clear_object (&info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (gst_player_media_info_parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_player_media_info_class_init (GstPlayerMediaInfoClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *oclass = (GObjectClass *) klass;
|
|
|
|
|
|
|
|
oclass->finalize = gst_player_media_info_finalize;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstPlayerVideoInfo *
|
|
|
|
gst_player_video_info_new (void)
|
|
|
|
{
|
|
|
|
return g_object_new (GST_TYPE_PLAYER_VIDEO_INFO, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstPlayerAudioInfo *
|
|
|
|
gst_player_audio_info_new (void)
|
|
|
|
{
|
|
|
|
return g_object_new (GST_TYPE_PLAYER_AUDIO_INFO, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstPlayerSubtitleInfo *
|
|
|
|
gst_player_subtitle_info_new (void)
|
|
|
|
{
|
|
|
|
return g_object_new (GST_TYPE_PLAYER_SUBTITLE_INFO, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstPlayerStreamInfo *
|
|
|
|
gst_player_video_info_copy (GstPlayerVideoInfo * ref)
|
|
|
|
{
|
|
|
|
GstPlayerVideoInfo *ret;
|
|
|
|
|
|
|
|
ret = gst_player_video_info_new ();
|
2020-12-07 10:47:30 +00:00
|
|
|
ret->info = g_object_ref (ref->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
|
|
|
return (GstPlayerStreamInfo *) ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstPlayerStreamInfo *
|
|
|
|
gst_player_audio_info_copy (GstPlayerAudioInfo * ref)
|
|
|
|
{
|
|
|
|
GstPlayerAudioInfo *ret;
|
|
|
|
|
|
|
|
ret = gst_player_audio_info_new ();
|
2020-12-07 10:47:30 +00:00
|
|
|
ret->info = g_object_ref (ref->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
|
|
|
return (GstPlayerStreamInfo *) ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GstPlayerStreamInfo *
|
|
|
|
gst_player_subtitle_info_copy (GstPlayerSubtitleInfo * ref)
|
|
|
|
{
|
|
|
|
GstPlayerSubtitleInfo *ret;
|
|
|
|
|
|
|
|
ret = gst_player_subtitle_info_new ();
|
2020-12-07 10:47:30 +00:00
|
|
|
ret->info = g_object_ref (ref->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
|
|
|
return (GstPlayerStreamInfo *) ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPlayerStreamInfo *
|
|
|
|
gst_player_stream_info_copy (GstPlayerStreamInfo * ref)
|
|
|
|
{
|
|
|
|
GstPlayerStreamInfo *info = NULL;
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
if (GST_IS_PLAYER_VIDEO_INFO (ref))
|
|
|
|
info = gst_player_video_info_copy ((GstPlayerVideoInfo *) ref);
|
|
|
|
else if (GST_IS_PLAYER_AUDIO_INFO (ref))
|
|
|
|
info = gst_player_audio_info_copy ((GstPlayerAudioInfo *) ref);
|
|
|
|
else
|
|
|
|
info = gst_player_subtitle_info_copy ((GstPlayerSubtitleInfo *) ref);
|
|
|
|
|
|
|
|
info->stream_index = ref->stream_index;
|
|
|
|
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPlayerMediaInfo *
|
|
|
|
gst_player_media_info_copy (GstPlayerMediaInfo * ref)
|
|
|
|
{
|
|
|
|
GList *l;
|
|
|
|
GstPlayerMediaInfo *info;
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
return NULL;
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
info = gst_player_media_info_new ();
|
|
|
|
|
|
|
|
for (l = gst_player_media_info_get_stream_list (ref); l != NULL; l = l->next) {
|
2015-12-22 13:24:00 +00:00
|
|
|
GstPlayerStreamInfo *s;
|
|
|
|
|
|
|
|
s = gst_player_stream_info_copy ((GstPlayerStreamInfo *) l->data);
|
|
|
|
info->stream_list = g_list_append (info->stream_list, s);
|
|
|
|
|
|
|
|
if (GST_IS_PLAYER_AUDIO_INFO (s))
|
|
|
|
info->audio_stream_list = g_list_append (info->audio_stream_list, s);
|
|
|
|
else if (GST_IS_PLAYER_VIDEO_INFO (s))
|
|
|
|
info->video_stream_list = g_list_append (info->video_stream_list, s);
|
|
|
|
else
|
|
|
|
info->subtitle_stream_list =
|
|
|
|
g_list_append (info->subtitle_stream_list, s);
|
|
|
|
}
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
info->info = g_object_ref (ref->info);
|
|
|
|
|
2015-12-22 13:24:00 +00:00
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPlayerStreamInfo *
|
|
|
|
gst_player_stream_info_new (gint stream_index, GType type)
|
|
|
|
{
|
|
|
|
GstPlayerStreamInfo *info = NULL;
|
|
|
|
|
|
|
|
if (type == GST_TYPE_PLAYER_AUDIO_INFO)
|
|
|
|
info = (GstPlayerStreamInfo *) gst_player_audio_info_new ();
|
|
|
|
else if (type == GST_TYPE_PLAYER_VIDEO_INFO)
|
|
|
|
info = (GstPlayerStreamInfo *) gst_player_video_info_new ();
|
|
|
|
else
|
|
|
|
info = (GstPlayerStreamInfo *) gst_player_subtitle_info_new ();
|
|
|
|
|
|
|
|
info->stream_index = stream_index;
|
|
|
|
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
GstPlayerStreamInfo *
|
|
|
|
gst_player_stream_info_wrapped (GstPlayStreamInfo * info)
|
|
|
|
{
|
|
|
|
GstPlayerStreamInfo *ret;
|
|
|
|
GType type;
|
|
|
|
|
|
|
|
if (GST_IS_PLAY_AUDIO_INFO (info)) {
|
|
|
|
type = GST_TYPE_PLAYER_AUDIO_INFO;
|
|
|
|
} else if (GST_IS_PLAY_VIDEO_INFO (info)) {
|
|
|
|
type = GST_TYPE_PLAYER_VIDEO_INFO;
|
|
|
|
} else {
|
|
|
|
type = GST_TYPE_PLAYER_SUBTITLE_INFO;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret =
|
|
|
|
gst_player_stream_info_new (gst_play_stream_info_get_index (info), type);
|
|
|
|
ret->info = g_object_ref (info);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2015-12-22 13:24:00 +00:00
|
|
|
GstPlayerMediaInfo *
|
2020-12-07 10:47:30 +00:00
|
|
|
gst_player_media_info_new (void)
|
2015-12-22 13:24:00 +00:00
|
|
|
{
|
2020-12-07 10:47:30 +00:00
|
|
|
return g_object_new (GST_TYPE_PLAYER_MEDIA_INFO, NULL);
|
|
|
|
}
|
2015-12-22 13:24:00 +00:00
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
GstPlayerMediaInfo *
|
|
|
|
gst_player_media_info_wrapped (GstPlayMediaInfo * info)
|
|
|
|
{
|
|
|
|
GstPlayerMediaInfo *ret;
|
|
|
|
GList *l;
|
2015-12-22 13:24:00 +00:00
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
ret = gst_player_media_info_new ();
|
|
|
|
ret->info = g_object_ref (info);
|
2015-12-22 13:24:00 +00:00
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
for (l = gst_play_media_info_get_stream_list (info); l != NULL; l = l->next) {
|
|
|
|
GstPlayerStreamInfo *s;
|
|
|
|
|
|
|
|
s = gst_player_stream_info_wrapped ((GstPlayStreamInfo *) l->data);
|
|
|
|
ret->stream_list = g_list_append (ret->stream_list, s);
|
|
|
|
|
|
|
|
if (GST_IS_PLAYER_AUDIO_INFO (s)) {
|
|
|
|
GstPlayerAudioInfo *i = GST_PLAYER_AUDIO_INFO (s);
|
|
|
|
i->info = g_object_ref (GST_PLAY_AUDIO_INFO (l->data));
|
|
|
|
ret->audio_stream_list = g_list_append (ret->audio_stream_list, i);
|
|
|
|
} else if (GST_IS_PLAYER_VIDEO_INFO (s)) {
|
|
|
|
GstPlayerVideoInfo *i = GST_PLAYER_VIDEO_INFO (s);
|
|
|
|
i->info = g_object_ref (GST_PLAY_VIDEO_INFO (l->data));
|
|
|
|
ret->video_stream_list = g_list_append (ret->video_stream_list, i);
|
|
|
|
} else {
|
|
|
|
GstPlayerSubtitleInfo *i = GST_PLAYER_SUBTITLE_INFO (s);
|
|
|
|
i->info = g_object_ref (GST_PLAY_SUBTITLE_INFO (l->data));
|
|
|
|
ret->subtitle_stream_list = g_list_append (ret->subtitle_stream_list, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPlayerAudioInfo *
|
|
|
|
gst_player_audio_info_wrapped (GstPlayAudioInfo * info)
|
|
|
|
{
|
|
|
|
GstPlayerStreamInfo *s;
|
|
|
|
GstPlayerAudioInfo *i;
|
|
|
|
|
|
|
|
s = gst_player_stream_info_wrapped ((GstPlayStreamInfo *) info);
|
|
|
|
i = GST_PLAYER_AUDIO_INFO (s);
|
|
|
|
i->info = g_object_ref (info);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPlayerVideoInfo *
|
|
|
|
gst_player_video_info_wrapped (GstPlayVideoInfo * info)
|
|
|
|
{
|
|
|
|
GstPlayerStreamInfo *s;
|
|
|
|
GstPlayerVideoInfo *i;
|
|
|
|
|
|
|
|
s = gst_player_stream_info_wrapped ((GstPlayStreamInfo *) info);
|
|
|
|
i = GST_PLAYER_VIDEO_INFO (s);
|
|
|
|
i->info = g_object_ref (info);
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPlayerSubtitleInfo *
|
|
|
|
gst_player_subtitle_info_wrapped (GstPlaySubtitleInfo * info)
|
|
|
|
{
|
|
|
|
GstPlayerStreamInfo *s;
|
|
|
|
GstPlayerSubtitleInfo *i;
|
|
|
|
|
|
|
|
s = gst_player_stream_info_wrapped ((GstPlayStreamInfo *) info);
|
|
|
|
i = GST_PLAYER_SUBTITLE_INFO (s);
|
|
|
|
i->info = g_object_ref (info);
|
|
|
|
return i;
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_uri:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: the URI associated with #GstPlayerMediaInfo.
|
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
gst_player_media_info_get_uri (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_get_uri (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_is_seekable:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the media is seekable.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_player_media_info_is_seekable (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), FALSE);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_is_seekable (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
2016-03-05 07:47:27 +00:00
|
|
|
/**
|
|
|
|
* gst_player_media_info_is_live:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if the media is live.
|
|
|
|
*/
|
|
|
|
gboolean
|
|
|
|
gst_player_media_info_is_live (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), FALSE);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_is_live (info->info);
|
2016-03-05 07:47:27 +00:00
|
|
|
}
|
|
|
|
|
2015-12-22 13:24:00 +00:00
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_stream_list:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type GstPlayerStreamInfo): A #GList of
|
|
|
|
* matching #GstPlayerStreamInfo.
|
|
|
|
*/
|
|
|
|
GList *
|
|
|
|
gst_player_media_info_get_stream_list (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
|
|
|
return info->stream_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-21 09:32:52 +00:00
|
|
|
* gst_player_media_info_get_video_streams:
|
2015-12-22 13:24:00 +00:00
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type GstPlayerVideoInfo): A #GList of
|
|
|
|
* matching #GstPlayerVideoInfo.
|
|
|
|
*/
|
|
|
|
GList *
|
2016-12-21 09:32:52 +00:00
|
|
|
gst_player_media_info_get_video_streams (const GstPlayerMediaInfo * info)
|
2015-12-22 13:24:00 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
|
|
|
return info->video_stream_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-21 09:32:52 +00:00
|
|
|
* gst_player_media_info_get_subtitle_streams:
|
2015-12-22 13:24:00 +00:00
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type GstPlayerSubtitleInfo): A #GList of
|
|
|
|
* matching #GstPlayerSubtitleInfo.
|
|
|
|
*/
|
|
|
|
GList *
|
2016-12-21 09:32:52 +00:00
|
|
|
gst_player_media_info_get_subtitle_streams (const GstPlayerMediaInfo * info)
|
2015-12-22 13:24:00 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
|
|
|
return info->subtitle_stream_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-12-21 09:32:52 +00:00
|
|
|
* gst_player_media_info_get_audio_streams:
|
2015-12-22 13:24:00 +00:00
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type GstPlayerAudioInfo): A #GList of
|
|
|
|
* matching #GstPlayerAudioInfo.
|
|
|
|
*/
|
|
|
|
GList *
|
2016-12-21 09:32:52 +00:00
|
|
|
gst_player_media_info_get_audio_streams (const GstPlayerMediaInfo * info)
|
2015-12-22 13:24:00 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
|
|
|
return info->audio_stream_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_duration:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: duration of the media or %GST_CLOCK_TIME_NONE if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
GstClockTime
|
|
|
|
gst_player_media_info_get_duration (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), -1);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_get_duration (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_tags:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (transfer none) (nullable): the tags contained in media info.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
GstTagList *
|
|
|
|
gst_player_media_info_get_tags (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_get_tags (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_title:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (nullable): the media title or %NULL if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
gst_player_media_info_get_title (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_get_title (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_container_format:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (nullable): the container format or %NULL if unknown.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
const gchar *
|
|
|
|
gst_player_media_info_get_container_format (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_get_container_format (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_image_sample:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Function to get the image (or preview-image) stored in taglist.
|
2018-08-11 00:32:30 +00:00
|
|
|
* Application can use `gst_sample_*_()` API's to get caps, buffer etc.
|
2015-12-22 13:24:00 +00:00
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: (transfer none) (nullable): GstSample or %NULL.
|
2015-12-22 13:24:00 +00:00
|
|
|
*/
|
|
|
|
GstSample *
|
|
|
|
gst_player_media_info_get_image_sample (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GST_IS_PLAYER_MEDIA_INFO (info), NULL);
|
|
|
|
|
2020-12-07 10:47:30 +00:00
|
|
|
return gst_play_media_info_get_image_sample (info->info);
|
2015-12-22 13:24:00 +00:00
|
|
|
}
|
2016-12-20 10:20:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_player_media_info_get_number_of_streams:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: number of total streams or 0 if unknown.
|
|
|
|
*
|
2016-12-20 10:20:02 +00:00
|
|
|
* 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
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: number of video streams or 0 if unknown.
|
|
|
|
*
|
2016-12-20 10:20:02 +00:00
|
|
|
* 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
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: number of audio streams or 0 if unknown.
|
|
|
|
*
|
2016-12-20 10:20:02 +00:00
|
|
|
* 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
|
|
|
|
*
|
2021-09-20 08:35:51 +00:00
|
|
|
* Returns: number of subtitle streams or 0 if unknown.
|
|
|
|
*
|
2016-12-20 10:20:02 +00:00
|
|
|
* 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);
|
|
|
|
}
|
2016-12-21 09:38:11 +00:00
|
|
|
|
2017-01-17 11:07:57 +00:00
|
|
|
/**
|
|
|
|
* gst_player_get_video_streams:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type GstPlayerVideoInfo): A #GList of
|
|
|
|
* matching #GstPlayerVideoInfo.
|
|
|
|
*/
|
2017-07-18 11:43:26 +00:00
|
|
|
#ifndef GST_REMOVE_DEPRECATED
|
2016-12-21 09:38:11 +00:00
|
|
|
GList *
|
|
|
|
gst_player_get_video_streams (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
return gst_player_media_info_get_video_streams (info);
|
|
|
|
}
|
2017-07-18 11:43:26 +00:00
|
|
|
#endif
|
2016-12-21 09:38:11 +00:00
|
|
|
|
2017-01-17 11:07:57 +00:00
|
|
|
/**
|
|
|
|
* gst_player_get_audio_streams:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type GstPlayerAudioInfo): A #GList of
|
|
|
|
* matching #GstPlayerAudioInfo.
|
|
|
|
*/
|
2017-07-18 11:43:26 +00:00
|
|
|
#ifndef GST_REMOVE_DEPRECATED
|
2016-12-21 09:38:11 +00:00
|
|
|
GList *
|
|
|
|
gst_player_get_audio_streams (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
return gst_player_media_info_get_audio_streams (info);
|
|
|
|
}
|
2017-07-18 11:43:26 +00:00
|
|
|
#endif
|
2016-12-21 09:38:11 +00:00
|
|
|
|
2017-01-17 11:07:57 +00:00
|
|
|
/**
|
|
|
|
* gst_player_get_subtitle_streams:
|
|
|
|
* @info: a #GstPlayerMediaInfo
|
|
|
|
*
|
|
|
|
* Returns: (transfer none) (element-type GstPlayerSubtitleInfo): A #GList of
|
|
|
|
* matching #GstPlayerSubtitleInfo.
|
|
|
|
*/
|
2017-07-18 11:43:26 +00:00
|
|
|
#ifndef GST_REMOVE_DEPRECATED
|
2016-12-21 09:38:11 +00:00
|
|
|
GList *
|
|
|
|
gst_player_get_subtitle_streams (const GstPlayerMediaInfo * info)
|
|
|
|
{
|
|
|
|
return gst_player_media_info_get_subtitle_streams (info);
|
|
|
|
}
|
|
|
|
#endif
|