diff options
author | George Hazan <ghazan@miranda.im> | 2022-08-03 21:02:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-08-03 21:02:36 +0300 |
commit | 5323a782c4e8c42781f22ce2f488962a18f82554 (patch) | |
tree | f71537197b16f0f8fd0d6937f7120d018d220814 /include/gst/player | |
parent | 50acf9d37183f86f6f623aad410003392b0af41f (diff) |
Jabber: initial version of Jingle support
Diffstat (limited to 'include/gst/player')
-rw-r--r-- | include/gst/player/gstplayer-g-main-context-signal-dispatcher.h | 50 | ||||
-rw-r--r-- | include/gst/player/gstplayer-media-info.h | 255 | ||||
-rw-r--r-- | include/gst/player/gstplayer-signal-dispatcher.h | 54 | ||||
-rw-r--r-- | include/gst/player/gstplayer-types.h | 36 | ||||
-rw-r--r-- | include/gst/player/gstplayer-video-overlay-video-renderer.h | 68 | ||||
-rw-r--r-- | include/gst/player/gstplayer-video-renderer.h | 48 | ||||
-rw-r--r-- | include/gst/player/gstplayer-visualization.h | 60 | ||||
-rw-r--r-- | include/gst/player/gstplayer.h | 306 | ||||
-rw-r--r-- | include/gst/player/player-prelude.h | 43 | ||||
-rw-r--r-- | include/gst/player/player.h | 31 |
10 files changed, 951 insertions, 0 deletions
diff --git a/include/gst/player/gstplayer-g-main-context-signal-dispatcher.h b/include/gst/player/gstplayer-g-main-context-signal-dispatcher.h new file mode 100644 index 0000000000..d27d697497 --- /dev/null +++ b/include/gst/player/gstplayer-g-main-context-signal-dispatcher.h @@ -0,0 +1,50 @@ +/* GStreamer + * + * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.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. + */ + +#ifndef __GST_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER_H__ +#define __GST_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER_H__ + +#include <gst/player/gstplayer-types.h> +#include <gst/player/gstplayer-signal-dispatcher.h> + +G_BEGIN_DECLS + +typedef struct _GstPlayerGMainContextSignalDispatcher + GstPlayerGMainContextSignalDispatcher; +typedef struct _GstPlayerGMainContextSignalDispatcherClass + GstPlayerGMainContextSignalDispatcherClass; + +#define GST_TYPE_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER (gst_player_g_main_context_signal_dispatcher_get_type ()) +#define GST_IS_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER)) +#define GST_IS_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER)) +#define GST_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER, GstPlayerGMainContextSignalDispatcherClass)) +#define GST_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER, GstPlayerGMainContextSignalDispatcher)) +#define GST_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER, GstPlayerGMainContextSignalDispatcherClass)) +#define GST_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER_CAST(obj) ((GstPlayerGMainContextSignalDispatcher*)(obj)) + +GST_PLAYER_API +GType gst_player_g_main_context_signal_dispatcher_get_type (void); + +GST_PLAYER_API +GstPlayerSignalDispatcher * gst_player_g_main_context_signal_dispatcher_new (GMainContext * application_context); + +G_END_DECLS + +#endif /* __GST_PLAYER_G_MAIN_CONTEXT_SIGNAL_DISPATCHER_H__ */ diff --git a/include/gst/player/gstplayer-media-info.h b/include/gst/player/gstplayer-media-info.h new file mode 100644 index 0000000000..ab034b1584 --- /dev/null +++ b/include/gst/player/gstplayer-media-info.h @@ -0,0 +1,255 @@ +/* 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. + */ + +#ifndef __GST_PLAYER_MEDIA_INFO_H__ +#define __GST_PLAYER_MEDIA_INFO_H__ + +#include <gst/gst.h> +#include <gst/player/player-prelude.h> + +G_BEGIN_DECLS + +#define GST_TYPE_PLAYER_STREAM_INFO \ + (gst_player_stream_info_get_type ()) +#define GST_PLAYER_STREAM_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_STREAM_INFO,GstPlayerStreamInfo)) +#define GST_PLAYER_STREAM_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_STREAM_INFO,GstPlayerStreamInfo)) +#define GST_IS_PLAYER_STREAM_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_STREAM_INFO)) +#define GST_IS_PLAYER_STREAM_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_STREAM_INFO)) + +/** + * GstPlayerStreamInfo: + * + * Base structure for information concerning a media stream. Depending on + * the stream type, one can find more media-specific information in + * #GstPlayerVideoInfo, #GstPlayerAudioInfo, #GstPlayerSubtitleInfo. + */ +typedef struct _GstPlayerStreamInfo GstPlayerStreamInfo; +typedef struct _GstPlayerStreamInfoClass GstPlayerStreamInfoClass; + +GST_PLAYER_API +GType gst_player_stream_info_get_type (void); + +GST_PLAYER_API +gint gst_player_stream_info_get_index (const GstPlayerStreamInfo *info); + +GST_PLAYER_API +const gchar* gst_player_stream_info_get_stream_type (const GstPlayerStreamInfo *info); + +GST_PLAYER_API +GstTagList* gst_player_stream_info_get_tags (const GstPlayerStreamInfo *info); + +GST_PLAYER_API +GstCaps* gst_player_stream_info_get_caps (const GstPlayerStreamInfo *info); + +GST_PLAYER_API +const gchar* gst_player_stream_info_get_codec (const GstPlayerStreamInfo *info); + +#define GST_TYPE_PLAYER_VIDEO_INFO \ + (gst_player_video_info_get_type ()) +#define GST_PLAYER_VIDEO_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_VIDEO_INFO, GstPlayerVideoInfo)) +#define GST_PLAYER_VIDEO_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((obj),GST_TYPE_PLAYER_VIDEO_INFO, GstPlayerVideoInfoClass)) +#define GST_IS_PLAYER_VIDEO_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_VIDEO_INFO)) +#define GST_IS_PLAYER_VIDEO_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((obj),GST_TYPE_PLAYER_VIDEO_INFO)) + +/** + * GstPlayerVideoInfo: + * + * #GstPlayerStreamInfo specific to video streams. + */ +typedef struct _GstPlayerVideoInfo GstPlayerVideoInfo; +typedef struct _GstPlayerVideoInfoClass GstPlayerVideoInfoClass; + +GST_PLAYER_API +GType gst_player_video_info_get_type (void); + +GST_PLAYER_API +gint gst_player_video_info_get_bitrate (const GstPlayerVideoInfo * info); + +GST_PLAYER_API +gint gst_player_video_info_get_max_bitrate (const GstPlayerVideoInfo * info); + +GST_PLAYER_API +gint gst_player_video_info_get_width (const GstPlayerVideoInfo * info); + +GST_PLAYER_API +gint gst_player_video_info_get_height (const GstPlayerVideoInfo * info); + +GST_PLAYER_API +void gst_player_video_info_get_framerate (const GstPlayerVideoInfo * info, + gint * fps_n, + gint * fps_d); + +GST_PLAYER_API +void gst_player_video_info_get_pixel_aspect_ratio (const GstPlayerVideoInfo * info, + guint * par_n, + guint * par_d); + +#define GST_TYPE_PLAYER_AUDIO_INFO \ + (gst_player_audio_info_get_type ()) +#define GST_PLAYER_AUDIO_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_AUDIO_INFO, GstPlayerAudioInfo)) +#define GST_PLAYER_AUDIO_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_AUDIO_INFO, GstPlayerAudioInfoClass)) +#define GST_IS_PLAYER_AUDIO_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_AUDIO_INFO)) +#define GST_IS_PLAYER_AUDIO_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_AUDIO_INFO)) + +/** + * GstPlayerAudioInfo: + * + * #GstPlayerStreamInfo specific to audio streams. + */ +typedef struct _GstPlayerAudioInfo GstPlayerAudioInfo; +typedef struct _GstPlayerAudioInfoClass GstPlayerAudioInfoClass; + +GST_PLAYER_API +GType gst_player_audio_info_get_type (void); + +GST_PLAYER_API +gint gst_player_audio_info_get_channels (const GstPlayerAudioInfo* info); + +GST_PLAYER_API +gint gst_player_audio_info_get_sample_rate (const GstPlayerAudioInfo* info); + +GST_PLAYER_API +gint gst_player_audio_info_get_bitrate (const GstPlayerAudioInfo* info); + +GST_PLAYER_API +gint gst_player_audio_info_get_max_bitrate (const GstPlayerAudioInfo* info); + +GST_PLAYER_API +const gchar* gst_player_audio_info_get_language (const GstPlayerAudioInfo* info); + +#define GST_TYPE_PLAYER_SUBTITLE_INFO \ + (gst_player_subtitle_info_get_type ()) +#define GST_PLAYER_SUBTITLE_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_SUBTITLE_INFO, GstPlayerSubtitleInfo)) +#define GST_PLAYER_SUBTITLE_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_SUBTITLE_INFO,GstPlayerSubtitleInfoClass)) +#define GST_IS_PLAYER_SUBTITLE_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_SUBTITLE_INFO)) +#define GST_IS_PLAYER_SUBTITLE_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_SUBTITLE_INFO)) + +/** + * GstPlayerSubtitleInfo: + * + * #GstPlayerStreamInfo specific to subtitle streams. + */ +typedef struct _GstPlayerSubtitleInfo GstPlayerSubtitleInfo; +typedef struct _GstPlayerSubtitleInfoClass GstPlayerSubtitleInfoClass; + +GST_PLAYER_API +GType gst_player_subtitle_info_get_type (void); + +GST_PLAYER_API +const gchar * gst_player_subtitle_info_get_language (const GstPlayerSubtitleInfo* info); + +#define GST_TYPE_PLAYER_MEDIA_INFO \ + (gst_player_media_info_get_type()) +#define GST_PLAYER_MEDIA_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PLAYER_MEDIA_INFO,GstPlayerMediaInfo)) +#define GST_PLAYER_MEDIA_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PLAYER_MEDIA_INFO,GstPlayerMediaInfoClass)) +#define GST_IS_PLAYER_MEDIA_INFO(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PLAYER_MEDIA_INFO)) +#define GST_IS_PLAYER_MEDIA_INFO_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PLAYER_MEDIA_INFO)) + +/** + * GstPlayerMediaInfo: + * + * Structure containing the media information of a URI. + */ +typedef struct _GstPlayerMediaInfo GstPlayerMediaInfo; +typedef struct _GstPlayerMediaInfoClass GstPlayerMediaInfoClass; + +GST_PLAYER_API +GType gst_player_media_info_get_type (void); + +GST_PLAYER_API +const gchar * gst_player_media_info_get_uri (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +gboolean gst_player_media_info_is_seekable (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +gboolean gst_player_media_info_is_live (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +GstClockTime gst_player_media_info_get_duration (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +GList* gst_player_media_info_get_stream_list (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +guint gst_player_media_info_get_number_of_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +GList* gst_player_media_info_get_video_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +guint gst_player_media_info_get_number_of_video_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +GList* gst_player_media_info_get_audio_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +guint gst_player_media_info_get_number_of_audio_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +GList* gst_player_media_info_get_subtitle_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +guint gst_player_media_info_get_number_of_subtitle_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +GstTagList* gst_player_media_info_get_tags (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +const gchar* gst_player_media_info_get_title (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +const gchar* gst_player_media_info_get_container_format (const GstPlayerMediaInfo *info); + +GST_PLAYER_API +GstSample* gst_player_media_info_get_image_sample (const GstPlayerMediaInfo *info); + +GST_PLAYER_DEPRECATED_FOR(gst_player_media_info_get_video_streams) +GList* gst_player_get_video_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_DEPRECATED_FOR(gst_player_media_info_get_audio_streams) +GList* gst_player_get_audio_streams (const GstPlayerMediaInfo *info); + +GST_PLAYER_DEPRECATED_FOR(gst_player_media_info_get_subtitle_streams) +GList* gst_player_get_subtitle_streams (const GstPlayerMediaInfo *info); + +G_END_DECLS + +#endif /* __GST_PLAYER_MEDIA_INFO_H */ diff --git a/include/gst/player/gstplayer-signal-dispatcher.h b/include/gst/player/gstplayer-signal-dispatcher.h new file mode 100644 index 0000000000..554f1e34f2 --- /dev/null +++ b/include/gst/player/gstplayer-signal-dispatcher.h @@ -0,0 +1,54 @@ +/* GStreamer + * + * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.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. + */ + +#ifndef __GST_PLAYER_SIGNAL_DISPATCHER_H__ +#define __GST_PLAYER_SIGNAL_DISPATCHER_H__ + +#include <gst/gst.h> +#include <gst/player/gstplayer-types.h> + +G_BEGIN_DECLS + +typedef struct _GstPlayerSignalDispatcher GstPlayerSignalDispatcher; +typedef struct _GstPlayerSignalDispatcherInterface GstPlayerSignalDispatcherInterface; + +#define GST_TYPE_PLAYER_SIGNAL_DISPATCHER (gst_player_signal_dispatcher_get_type ()) +#define GST_PLAYER_SIGNAL_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER_SIGNAL_DISPATCHER, GstPlayerSignalDispatcher)) +#define GST_IS_PLAYER_SIGNAL_DISPATCHER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER_SIGNAL_DISPATCHER)) +#define GST_PLAYER_SIGNAL_DISPATCHER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_PLAYER_SIGNAL_DISPATCHER, GstPlayerSignalDispatcherInterface)) + +typedef void (*GstPlayerSignalDispatcherFunc) (gpointer data); + +struct _GstPlayerSignalDispatcherInterface { + GTypeInterface parent_iface; + + void (*dispatch) (GstPlayerSignalDispatcher * self, + GstPlayer * player, + GstPlayerSignalDispatcherFunc emitter, + gpointer data, + GDestroyNotify destroy); +}; + +GST_PLAYER_API +GType gst_player_signal_dispatcher_get_type (void); + +G_END_DECLS + +#endif /* __GST_PLAYER_SIGNAL_DISPATCHER_H__ */ diff --git a/include/gst/player/gstplayer-types.h b/include/gst/player/gstplayer-types.h new file mode 100644 index 0000000000..bed2dc34c1 --- /dev/null +++ b/include/gst/player/gstplayer-types.h @@ -0,0 +1,36 @@ +/* GStreamer + * + * Copyright (C) 2015 Sebastian Dröge <sebastian@centricular.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. + */ + +#ifndef __GST_PLAYER_TYPES_H__ +#define __GST_PLAYER_TYPES_H__ + +#include <gst/gst.h> +#include <gst/player/player-prelude.h> + +G_BEGIN_DECLS + +typedef struct _GstPlayer GstPlayer; +typedef struct _GstPlayerClass GstPlayerClass; + +G_END_DECLS + +#endif /* __GST_PLAYER_TYPES_H__ */ + + diff --git a/include/gst/player/gstplayer-video-overlay-video-renderer.h b/include/gst/player/gstplayer-video-overlay-video-renderer.h new file mode 100644 index 0000000000..7068705b59 --- /dev/null +++ b/include/gst/player/gstplayer-video-overlay-video-renderer.h @@ -0,0 +1,68 @@ +/* GStreamer + * + * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.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. + */ + +#ifndef __GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER_H__ +#define __GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER_H__ + +#include <gst/player/gstplayer-types.h> +#include <gst/player/gstplayer-video-renderer.h> + +G_BEGIN_DECLS + +typedef struct _GstPlayerVideoOverlayVideoRenderer + GstPlayerVideoOverlayVideoRenderer; +typedef struct _GstPlayerVideoOverlayVideoRendererClass + GstPlayerVideoOverlayVideoRendererClass; + +#define GST_TYPE_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER (gst_player_video_overlay_video_renderer_get_type ()) +#define GST_IS_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER)) +#define GST_IS_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER)) +#define GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER, GstPlayerVideoOverlayVideoRendererClass)) +#define GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER, GstPlayerVideoOverlayVideoRenderer)) +#define GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER, GstPlayerVideoOverlayVideoRendererClass)) +#define GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER_CAST(obj) ((GstPlayerVideoOverlayVideoRenderer*)(obj)) + +GST_PLAYER_API +GType gst_player_video_overlay_video_renderer_get_type (void); + +GST_PLAYER_API +GstPlayerVideoRenderer * gst_player_video_overlay_video_renderer_new (gpointer window_handle); + +GST_PLAYER_API +GstPlayerVideoRenderer * gst_player_video_overlay_video_renderer_new_with_sink (gpointer window_handle, GstElement * video_sink); + +GST_PLAYER_API +void gst_player_video_overlay_video_renderer_set_window_handle (GstPlayerVideoOverlayVideoRenderer * self, gpointer window_handle); + +GST_PLAYER_API +gpointer gst_player_video_overlay_video_renderer_get_window_handle (GstPlayerVideoOverlayVideoRenderer * self); + +GST_PLAYER_API +void gst_player_video_overlay_video_renderer_expose (GstPlayerVideoOverlayVideoRenderer * self); + +GST_PLAYER_API +void gst_player_video_overlay_video_renderer_set_render_rectangle (GstPlayerVideoOverlayVideoRenderer * self, gint x, gint y, gint width, gint height); + +GST_PLAYER_API +void gst_player_video_overlay_video_renderer_get_render_rectangle (GstPlayerVideoOverlayVideoRenderer * self, gint *x, gint *y, gint *width, gint *height); + +G_END_DECLS + +#endif /* __GST_PLAYER_VIDEO_OVERLAY_VIDEO_RENDERER_H__ */ diff --git a/include/gst/player/gstplayer-video-renderer.h b/include/gst/player/gstplayer-video-renderer.h new file mode 100644 index 0000000000..611670c141 --- /dev/null +++ b/include/gst/player/gstplayer-video-renderer.h @@ -0,0 +1,48 @@ +/* GStreamer + * + * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.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. + */ + +#ifndef __GST_PLAYER_VIDEO_RENDERER_H__ +#define __GST_PLAYER_VIDEO_RENDERER_H__ + +#include <gst/gst.h> +#include <gst/player/gstplayer-types.h> + +G_BEGIN_DECLS + +typedef struct _GstPlayerVideoRenderer GstPlayerVideoRenderer; +typedef struct _GstPlayerVideoRendererInterface GstPlayerVideoRendererInterface; + +#define GST_TYPE_PLAYER_VIDEO_RENDERER (gst_player_video_renderer_get_type ()) +#define GST_PLAYER_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER_VIDEO_RENDERER, GstPlayerVideoRenderer)) +#define GST_IS_PLAYER_VIDEO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER_VIDEO_RENDERER)) +#define GST_PLAYER_VIDEO_RENDERER_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_PLAYER_VIDEO_RENDERER, GstPlayerVideoRendererInterface)) + +struct _GstPlayerVideoRendererInterface { + GTypeInterface parent_iface; + + GstElement * (*create_video_sink) (GstPlayerVideoRenderer * self, GstPlayer * player); +}; + +GST_PLAYER_API +GType gst_player_video_renderer_get_type (void); + +G_END_DECLS + +#endif /* __GST_PLAYER_VIDEO_RENDERER_H__ */ diff --git a/include/gst/player/gstplayer-visualization.h b/include/gst/player/gstplayer-visualization.h new file mode 100644 index 0000000000..c09a4f0c34 --- /dev/null +++ b/include/gst/player/gstplayer-visualization.h @@ -0,0 +1,60 @@ +/* GStreamer + * + * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.com> + * 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. + */ + +#ifndef __GST_PLAYER_VISUALIZATION_H__ +#define __GST_PLAYER_VISUALIZATION_H__ + +#include <gst/gst.h> +#include <gst/player/player-prelude.h> + +G_BEGIN_DECLS + +typedef struct _GstPlayerVisualization GstPlayerVisualization; +/** + * GstPlayerVisualization: + * @name: name of the visualization. + * @description: description of the visualization. + * + * A #GstPlayerVisualization descriptor. + */ +struct _GstPlayerVisualization { + gchar *name; + gchar *description; +}; + +GST_PLAYER_API +GType gst_player_visualization_get_type (void); + +GST_PLAYER_API +GstPlayerVisualization * gst_player_visualization_copy (const GstPlayerVisualization *vis); + +GST_PLAYER_API +void gst_player_visualization_free (GstPlayerVisualization *vis); + +GST_PLAYER_API +GstPlayerVisualization ** gst_player_visualizations_get (void); + +GST_PLAYER_API +void gst_player_visualizations_free (GstPlayerVisualization **viss); + +G_END_DECLS + +#endif /* __GST_PLAYER_VISUALIZATION_H__ */ diff --git a/include/gst/player/gstplayer.h b/include/gst/player/gstplayer.h new file mode 100644 index 0000000000..e853ed8750 --- /dev/null +++ b/include/gst/player/gstplayer.h @@ -0,0 +1,306 @@ +/* GStreamer + * + * Copyright (C) 2014-2015 Sebastian Dröge <sebastian@centricular.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. + */ + +#ifndef __GST_PLAYER_H__ +#define __GST_PLAYER_H__ + +#include <gst/gst.h> +#include <gst/video/video.h> +#include <gst/player/player-prelude.h> +#include <gst/player/gstplayer-types.h> +#include <gst/player/gstplayer-signal-dispatcher.h> +#include <gst/player/gstplayer-video-renderer.h> +#include <gst/player/gstplayer-media-info.h> + +G_BEGIN_DECLS + +GST_PLAYER_API +GType gst_player_state_get_type (void); +#define GST_TYPE_PLAYER_STATE (gst_player_state_get_type ()) + +/** + * GstPlayerState: + * @GST_PLAYER_STATE_STOPPED: the player is stopped. + * @GST_PLAYER_STATE_BUFFERING: the player is buffering. + * @GST_PLAYER_STATE_PAUSED: the player is paused. + * @GST_PLAYER_STATE_PLAYING: the player is currently playing a + * stream. + */ +typedef enum +{ + GST_PLAYER_STATE_STOPPED, + GST_PLAYER_STATE_BUFFERING, + GST_PLAYER_STATE_PAUSED, + GST_PLAYER_STATE_PLAYING +} GstPlayerState; + +GST_PLAYER_API +const gchar *gst_player_state_get_name (GstPlayerState state); + +GST_PLAYER_API +GQuark gst_player_error_quark (void); + +GST_PLAYER_API +GType gst_player_error_get_type (void); +#define GST_PLAYER_ERROR (gst_player_error_quark ()) +#define GST_TYPE_PLAYER_ERROR (gst_player_error_get_type ()) + +/** + * GstPlayerError: + * @GST_PLAYER_ERROR_FAILED: generic error. + */ +typedef enum { + GST_PLAYER_ERROR_FAILED = 0 +} GstPlayerError; + +GST_PLAYER_API +const gchar *gst_player_error_get_name (GstPlayerError error); + +GST_PLAYER_API +GType gst_player_color_balance_type_get_type (void); +#define GST_TYPE_PLAYER_COLOR_BALANCE_TYPE (gst_player_color_balance_type_get_type ()) + +/** + * GstPlayerColorBalanceType: + * @GST_PLAYER_COLOR_BALANCE_BRIGHTNESS: brightness or black level. + * @GST_PLAYER_COLOR_BALANCE_CONTRAST: contrast or luma gain. + * @GST_PLAYER_COLOR_BALANCE_SATURATION: color saturation or chroma + * gain. + * @GST_PLAYER_COLOR_BALANCE_HUE: hue or color balance. + */ +typedef enum +{ + GST_PLAYER_COLOR_BALANCE_BRIGHTNESS, + GST_PLAYER_COLOR_BALANCE_CONTRAST, + GST_PLAYER_COLOR_BALANCE_SATURATION, + GST_PLAYER_COLOR_BALANCE_HUE, +} GstPlayerColorBalanceType; + +GST_PLAYER_API +const gchar *gst_player_color_balance_type_get_name (GstPlayerColorBalanceType type); + +#define GST_TYPE_PLAYER (gst_player_get_type ()) +#define GST_IS_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLAYER)) +#define GST_IS_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAYER)) +#define GST_PLAYER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLAYER, GstPlayerClass)) +#define GST_PLAYER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLAYER, GstPlayer)) +#define GST_PLAYER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAYER, GstPlayerClass)) +#define GST_PLAYER_CAST(obj) ((GstPlayer*)(obj)) + +#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC +G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPlayer, gst_object_unref) +#endif + +GST_PLAYER_API +GType gst_player_get_type (void); + +GST_PLAYER_API +GstPlayer * gst_player_new (GstPlayerVideoRenderer * video_renderer, GstPlayerSignalDispatcher * signal_dispatcher); + +GST_PLAYER_API +void gst_player_play (GstPlayer * player); + +GST_PLAYER_API +void gst_player_pause (GstPlayer * player); + +GST_PLAYER_API +void gst_player_stop (GstPlayer * player); + +GST_PLAYER_API +void gst_player_seek (GstPlayer * player, + GstClockTime position); + +GST_PLAYER_API +void gst_player_set_rate (GstPlayer * player, + gdouble rate); + +GST_PLAYER_API +gdouble gst_player_get_rate (GstPlayer * player); + +GST_PLAYER_API +gchar * gst_player_get_uri (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_uri (GstPlayer * player, + const gchar * uri); + +GST_PLAYER_API +gchar * gst_player_get_subtitle_uri (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_subtitle_uri (GstPlayer * player, + const gchar *uri); + +GST_PLAYER_API +GstClockTime gst_player_get_position (GstPlayer * player); + +GST_PLAYER_API +GstClockTime gst_player_get_duration (GstPlayer * player); + +GST_PLAYER_API +gdouble gst_player_get_volume (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_volume (GstPlayer * player, + gdouble val); + +GST_PLAYER_API +gboolean gst_player_get_mute (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_mute (GstPlayer * player, + gboolean val); + +GST_PLAYER_API +GstElement * gst_player_get_pipeline (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_video_track_enabled (GstPlayer * player, + gboolean enabled); + +GST_PLAYER_API +void gst_player_set_audio_track_enabled (GstPlayer * player, + gboolean enabled); + +GST_PLAYER_API +void gst_player_set_subtitle_track_enabled (GstPlayer * player, + gboolean enabled); + +GST_PLAYER_API +gboolean gst_player_set_audio_track (GstPlayer *player, + gint stream_index); + +GST_PLAYER_API +gboolean gst_player_set_video_track (GstPlayer *player, + gint stream_index); + +GST_PLAYER_API +gboolean gst_player_set_subtitle_track (GstPlayer *player, + gint stream_index); + +GST_PLAYER_API +GstPlayerMediaInfo * gst_player_get_media_info (GstPlayer * player); + +GST_PLAYER_API +GstPlayerAudioInfo * gst_player_get_current_audio_track (GstPlayer * player); + +GST_PLAYER_API +GstPlayerVideoInfo * gst_player_get_current_video_track (GstPlayer * player); + +GST_PLAYER_API +GstPlayerSubtitleInfo * gst_player_get_current_subtitle_track (GstPlayer * player); + +GST_PLAYER_API +gboolean gst_player_set_visualization (GstPlayer * player, + const gchar *name); + +GST_PLAYER_API +void gst_player_set_visualization_enabled (GstPlayer * player, + gboolean enabled); + +GST_PLAYER_API +gchar * gst_player_get_current_visualization (GstPlayer * player); + +GST_PLAYER_API +gboolean gst_player_has_color_balance (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_color_balance (GstPlayer * player, + GstPlayerColorBalanceType type, + gdouble value); + +GST_PLAYER_API +gdouble gst_player_get_color_balance (GstPlayer * player, + GstPlayerColorBalanceType type); + + +GST_PLAYER_API +GstVideoMultiviewFramePacking gst_player_get_multiview_mode (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_multiview_mode (GstPlayer * player, + GstVideoMultiviewFramePacking mode); + +GST_PLAYER_API +GstVideoMultiviewFlags gst_player_get_multiview_flags (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_multiview_flags (GstPlayer * player, + GstVideoMultiviewFlags flags); + +GST_PLAYER_API +gint64 gst_player_get_audio_video_offset (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_audio_video_offset (GstPlayer * player, + gint64 offset); + +GST_PLAYER_API +gint64 gst_player_get_subtitle_video_offset (GstPlayer * player); + +GST_PLAYER_API +void gst_player_set_subtitle_video_offset (GstPlayer * player, + gint64 offset); + +GST_PLAYER_API +gboolean gst_player_set_config (GstPlayer * player, + GstStructure * config); + +GST_PLAYER_API +GstStructure * gst_player_get_config (GstPlayer * player); + +/* helpers for configuring the config structure */ + +GST_PLAYER_API +void gst_player_config_set_user_agent (GstStructure * config, + const gchar * agent); + +GST_PLAYER_API +gchar * gst_player_config_get_user_agent (const GstStructure * config); + +GST_PLAYER_API +void gst_player_config_set_position_update_interval (GstStructure * config, + guint interval); + +GST_PLAYER_API +guint gst_player_config_get_position_update_interval (const GstStructure * config); + +GST_PLAYER_API +void gst_player_config_set_seek_accurate (GstStructure * config, gboolean accurate); + +GST_PLAYER_API +gboolean gst_player_config_get_seek_accurate (const GstStructure * config); + +typedef enum +{ + GST_PLAYER_THUMBNAIL_RAW_NATIVE = 0, + GST_PLAYER_THUMBNAIL_RAW_xRGB, + GST_PLAYER_THUMBNAIL_RAW_BGRx, + GST_PLAYER_THUMBNAIL_JPG, + GST_PLAYER_THUMBNAIL_PNG +} GstPlayerSnapshotFormat; + +GST_PLAYER_API +GstSample * gst_player_get_video_snapshot (GstPlayer * player, + GstPlayerSnapshotFormat format, const GstStructure * config); + +G_END_DECLS + +#endif /* __GST_PLAYER_H__ */ diff --git a/include/gst/player/player-prelude.h b/include/gst/player/player-prelude.h new file mode 100644 index 0000000000..4b70469963 --- /dev/null +++ b/include/gst/player/player-prelude.h @@ -0,0 +1,43 @@ +/* GStreamer Player Library + * Copyright (C) 2018 GStreamer developers + * + * player-prelude.h: prelude include header for gst-player library + * + * 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. + */ + +#ifndef __GST_PLAYER_PRELUDE_H__ +#define __GST_PLAYER_PRELUDE_H__ + +#include <gst/gst.h> + +#ifndef GST_PLAYER_API +# ifdef BUILDING_GST_PLAYER +# define GST_PLAYER_API GST_API_EXPORT /* from config.h */ +# else +# define GST_PLAYER_API GST_API_IMPORT +# endif +#endif + +#ifndef GST_DISABLE_DEPRECATED +#define GST_PLAYER_DEPRECATED GST_PLAYER_API +#define GST_PLAYER_DEPRECATED_FOR(f) GST_PLAYER_API +#else +#define GST_PLAYER_DEPRECATED G_DEPRECATED GST_PLAYER_API +#define GST_PLAYER_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) GST_PLAYER_API +#endif + +#endif /* __GST_PLAYER_PRELUDE_H__ */ diff --git a/include/gst/player/player.h b/include/gst/player/player.h new file mode 100644 index 0000000000..40907c1f4b --- /dev/null +++ b/include/gst/player/player.h @@ -0,0 +1,31 @@ +/* GStreamer + * + * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.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. + */ + +#ifndef __PLAYER_H__ +#define __PLAYER_H__ + +#include <gst/player/player-prelude.h> +#include <gst/player/gstplayer.h> +#include <gst/player/gstplayer-media-info.h> +#include <gst/player/gstplayer-g-main-context-signal-dispatcher.h> +#include <gst/player/gstplayer-video-overlay-video-renderer.h> +#include <gst/player/gstplayer-visualization.h> + +#endif /* __PLAYER_H__ */ |