gstplayer-media-info.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /* GStreamer
  2. *
  3. * Copyright (C) 2015 Brijesh Singh <brijesh.ksingh@gmail.com>
  4. *
  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.
  9. *
  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.
  14. *
  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., 51 Franklin St, Fifth Floor,
  18. * Boston, MA 02110-1301, USA.
  19. */
  20. #ifndef __GST_PLAYER_MEDIA_INFO_H__
  21. #define __GST_PLAYER_MEDIA_INFO_H__
  22. #include <gst/gst.h>
  23. G_BEGIN_DECLS
  24. #define GST_TYPE_PLAYER_STREAM_INFO \
  25. (gst_player_stream_info_get_type ())
  26. #define GST_PLAYER_STREAM_INFO(obj) \
  27. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_STREAM_INFO,GstPlayerStreamInfo))
  28. #define GST_PLAYER_STREAM_INFO_CLASS(klass) \
  29. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_STREAM_INFO,GstPlayerStreamInfo))
  30. #define GST_IS_PLAYER_STREAM_INFO(obj) \
  31. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_STREAM_INFO))
  32. #define GST_IS_PLAYER_STREAM_INFO_CLASS(klass) \
  33. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_STREAM_INFO))
  34. /**
  35. * GstPlayerStreamInfo:
  36. *
  37. * Base structure for information concering a media stream. Depending on
  38. * the stream type, one can find more media-specific information in
  39. * #GstPlayerVideoInfo, #GstPlayerAudioInfo, #GstPlayerSubtitleInfo.
  40. */
  41. typedef struct _GstPlayerStreamInfo GstPlayerStreamInfo;
  42. typedef struct _GstPlayerStreamInfoClass GstPlayerStreamInfoClass;
  43. GType gst_player_stream_info_get_type (void);
  44. gint gst_player_stream_info_get_index
  45. (const GstPlayerStreamInfo *info);
  46. const gchar* gst_player_stream_info_get_stream_type
  47. (const GstPlayerStreamInfo *info);
  48. GstTagList* gst_player_stream_info_get_tags
  49. (const GstPlayerStreamInfo *info);
  50. GstCaps* gst_player_stream_info_get_caps
  51. (const GstPlayerStreamInfo *info);
  52. const gchar* gst_player_stream_info_get_codec
  53. (const GstPlayerStreamInfo *info);
  54. #define GST_TYPE_PLAYER_VIDEO_INFO \
  55. (gst_player_video_info_get_type ())
  56. #define GST_PLAYER_VIDEO_INFO(obj) \
  57. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_VIDEO_INFO, GstPlayerVideoInfo))
  58. #define GST_PLAYER_VIDEO_INFO_CLASS(klass) \
  59. (G_TYPE_CHECK_CLASS_CAST((obj),GST_TYPE_PLAYER_VIDEO_INFO, GstPlayerVideoInfoClass))
  60. #define GST_IS_PLAYER_VIDEO_INFO(obj) \
  61. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_VIDEO_INFO))
  62. #define GST_IS_PLAYER_VIDEO_INFO_CLASS(klass) \
  63. (G_TYPE_CHECK_CLASS_TYPE((obj),GST_TYPE_PLAYER_VIDEO_INFO))
  64. /**
  65. * GstPlayerVideoInfo:
  66. *
  67. * #GstPlayerStreamInfo specific to video streams.
  68. */
  69. typedef struct _GstPlayerVideoInfo GstPlayerVideoInfo;
  70. typedef struct _GstPlayerVideoInfoClass GstPlayerVideoInfoClass;
  71. GType gst_player_video_info_get_type (void);
  72. gint gst_player_video_info_get_bitrate
  73. (const GstPlayerVideoInfo* info);
  74. gint gst_player_video_info_get_max_bitrate
  75. (const GstPlayerVideoInfo* info);
  76. gint gst_player_video_info_get_width
  77. (const GstPlayerVideoInfo* info);
  78. gint gst_player_video_info_get_height
  79. (const GstPlayerVideoInfo* info);
  80. void gst_player_video_info_get_framerate
  81. (const GstPlayerVideoInfo* info, gint *fps_n, gint *fps_d);
  82. void gst_player_video_info_get_pixel_aspect_ratio
  83. (const GstPlayerVideoInfo* info, guint *par_n, guint *par_d);
  84. #define GST_TYPE_PLAYER_AUDIO_INFO \
  85. (gst_player_audio_info_get_type ())
  86. #define GST_PLAYER_AUDIO_INFO(obj) \
  87. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_AUDIO_INFO, GstPlayerAudioInfo))
  88. #define GST_PLAYER_AUDIO_INFO_CLASS(klass) \
  89. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_AUDIO_INFO, GstPlayerAudioInfoClass))
  90. #define GST_IS_PLAYER_AUDIO_INFO(obj) \
  91. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_AUDIO_INFO))
  92. #define GST_IS_PLAYER_AUDIO_INFO_CLASS(klass) \
  93. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_AUDIO_INFO))
  94. /**
  95. * GstPlayerAudioInfo:
  96. *
  97. * #GstPlayerStreamInfo specific to audio streams.
  98. */
  99. typedef struct _GstPlayerAudioInfo GstPlayerAudioInfo;
  100. typedef struct _GstPlayerAudioInfoClass GstPlayerAudioInfoClass;
  101. GType gst_player_audio_info_get_type (void);
  102. gint gst_player_audio_info_get_channels
  103. (const GstPlayerAudioInfo* info);
  104. gint gst_player_audio_info_get_sample_rate
  105. (const GstPlayerAudioInfo* info);
  106. gint gst_player_audio_info_get_bitrate
  107. (const GstPlayerAudioInfo* info);
  108. gint gst_player_audio_info_get_max_bitrate
  109. (const GstPlayerAudioInfo* info);
  110. const gchar* gst_player_audio_info_get_language
  111. (const GstPlayerAudioInfo* info);
  112. #define GST_TYPE_PLAYER_SUBTITLE_INFO \
  113. (gst_player_subtitle_info_get_type ())
  114. #define GST_PLAYER_SUBTITLE_INFO(obj) \
  115. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_SUBTITLE_INFO, GstPlayerSubtitleInfo))
  116. #define GST_PLAYER_SUBTITLE_INFO_CLASS(klass) \
  117. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_SUBTITLE_INFO,GstPlayerSubtitleInfoClass))
  118. #define GST_IS_PLAYER_SUBTITLE_INFO(obj) \
  119. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_SUBTITLE_INFO))
  120. #define GST_IS_PLAYER_SUBTITLE_INFO_CLASS(klass) \
  121. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_SUBTITLE_INFO))
  122. /**
  123. * GstPlayerSubtitleInfo:
  124. *
  125. * #GstPlayerStreamInfo specific to subtitle streams.
  126. */
  127. typedef struct _GstPlayerSubtitleInfo GstPlayerSubtitleInfo;
  128. typedef struct _GstPlayerSubtitleInfoClass GstPlayerSubtitleInfoClass;
  129. GType gst_player_subtitle_info_get_type (void);
  130. const gchar* gst_player_subtitle_info_get_language
  131. (const GstPlayerSubtitleInfo* info);
  132. #define GST_TYPE_PLAYER_MEDIA_INFO \
  133. (gst_player_media_info_get_type())
  134. #define GST_PLAYER_MEDIA_INFO(obj) \
  135. (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_MEDIA_INFO,GstPlayerMediaInfo))
  136. #define GST_PLAYER_MEDIA_INFO_CLASS(klass) \
  137. (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_MEDIA_INFO,GstPlayerMediaInfoClass))
  138. #define GST_IS_PLAYER_MEDIA_INFO(obj) \
  139. (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_MEDIA_INFO))
  140. #define GST_IS_PLAYER_MEDIA_INFO_CLASS(klass) \
  141. (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_MEDIA_INFO))
  142. /**
  143. * GstPlayerMediaInfo:
  144. *
  145. * Structure containing the media information of a URI.
  146. */
  147. typedef struct _GstPlayerMediaInfo GstPlayerMediaInfo;
  148. typedef struct _GstPlayerMediaInfoClass GstPlayerMediaInfoClass;
  149. GType gst_player_media_info_get_type (void);
  150. const gchar* gst_player_media_info_get_uri
  151. (const GstPlayerMediaInfo *info);
  152. gboolean gst_player_media_info_is_seekable
  153. (const GstPlayerMediaInfo *info);
  154. GstClockTime gst_player_media_info_get_duration
  155. (const GstPlayerMediaInfo *info);
  156. GList* gst_player_media_info_get_stream_list
  157. (const GstPlayerMediaInfo *info);
  158. GList* gst_player_get_video_streams
  159. (const GstPlayerMediaInfo *info);
  160. GList* gst_player_get_audio_streams
  161. (const GstPlayerMediaInfo *info);
  162. GList* gst_player_get_subtitle_streams
  163. (const GstPlayerMediaInfo *info);
  164. GstTagList* gst_player_media_info_get_tags
  165. (const GstPlayerMediaInfo *info);
  166. const gchar* gst_player_media_info_get_title
  167. (const GstPlayerMediaInfo *info);
  168. const gchar* gst_player_media_info_get_container_format
  169. (const GstPlayerMediaInfo *info);
  170. GstSample* gst_player_media_info_get_image_sample
  171. (const GstPlayerMediaInfo *info);
  172. G_END_DECLS
  173. #endif /* __GST_PLAYER_MEDIA_INFO_H */