1 /*
2  * Clutter-GStreamer.
3  *
4  * GStreamer integration library for Clutter.
5  *
6  * clutter-gst-video-texture.h - ClutterTexture using GStreamer to display a
7  *                               video stream.
8  *
9  * Authored By Matthew Allum  <mallum@openedhand.com>
10  *
11  * Copyright (C) 2006 OpenedHand
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License along with this library; if not, write to the
25  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26  * Boston, MA 02111-1307, USA.
27  */
28 
29 #if !defined(__CLUTTER_GST_H_INSIDE__) && !defined(CLUTTER_GST_COMPILATION)
30 #error "Only <clutter-gst/clutter-gst.h> can be included directly."
31 #endif
32 
33 #ifndef __CLUTTER_GST_VIDEO_TEXTURE_H__
34 #define __CLUTTER_GST_VIDEO_TEXTURE_H__
35 
36 #include <glib-object.h>
37 #include <clutter/clutter.h>
38 #include <gst/gstelement.h>
39 
40 #include <clutter-gst/clutter-gst-types.h>
41 
42 G_BEGIN_DECLS
43 
44 #define CLUTTER_GST_TYPE_VIDEO_TEXTURE clutter_gst_video_texture_get_type()
45 
46 #define CLUTTER_GST_VIDEO_TEXTURE(obj) \
47   (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
48   CLUTTER_GST_TYPE_VIDEO_TEXTURE, ClutterGstVideoTexture))
49 
50 #define CLUTTER_GST_VIDEO_TEXTURE_CLASS(klass) \
51   (G_TYPE_CHECK_CLASS_CAST ((klass), \
52   CLUTTER_GST_TYPE_VIDEO_TEXTURE, ClutterGstVideoTextureClass))
53 
54 #define CLUTTER_GST_IS_VIDEO_TEXTURE(obj) \
55   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
56   CLUTTER_GST_TYPE_VIDEO_TEXTURE))
57 
58 #define CLUTTER_GST_IS_VIDEO_TEXTURE_CLASS(klass) \
59   (G_TYPE_CHECK_CLASS_TYPE ((klass), \
60   CLUTTER_GST_TYPE_VIDEO_TEXTURE))
61 
62 #define CLUTTER_GST_VIDEO_TEXTURE_GET_CLASS(obj) \
63   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
64   CLUTTER_GST_TYPE_VIDEO_TEXTURE, ClutterGstVideoTextureClass))
65 
66 typedef struct _ClutterGstVideoTexture        ClutterGstVideoTexture;
67 typedef struct _ClutterGstVideoTextureClass   ClutterGstVideoTextureClass;
68 typedef struct _ClutterGstVideoTexturePrivate ClutterGstVideoTexturePrivate;
69 
70 /**
71  * ClutterGstVideoTexture:
72  *
73  * Subclass of #ClutterTexture that displays videos using GStreamer.
74  *
75  * The #ClutterGstVideoTexture structure contains only private data and
76  * should not be accessed directly.
77  */
78 struct _ClutterGstVideoTexture
79 {
80   /*< private >*/
81   ClutterTexture              parent;
82   ClutterGstVideoTexturePrivate *priv;
83 };
84 
85 /**
86  * ClutterGstVideoTextureClass:
87  *
88  * Base class for #ClutterGstVideoTexture.
89  */
90 struct _ClutterGstVideoTextureClass
91 {
92   /*< private >*/
93   ClutterTextureClass parent_class;
94 
95   /* Future padding */
96   void (* _clutter_reserved1) (void);
97   void (* _clutter_reserved2) (void);
98   void (* _clutter_reserved3) (void);
99   void (* _clutter_reserved4) (void);
100   void (* _clutter_reserved5) (void);
101   void (* _clutter_reserved6) (void);
102 };
103 
104 GType			  clutter_gst_video_texture_get_type            (void) G_GNUC_CONST;
105 ClutterActor *		  clutter_gst_video_texture_new                 (void);
106 
107 GstElement *		  clutter_gst_video_texture_get_pipeline        (ClutterGstVideoTexture *texture);
108 
109 CoglHandle		  clutter_gst_video_texture_get_idle_material   (ClutterGstVideoTexture *texture);
110 void			  clutter_gst_video_texture_set_idle_material   (ClutterGstVideoTexture *texture,
111 									 CoglHandle              material);
112 gchar *			  clutter_gst_video_texture_get_user_agent      (ClutterGstVideoTexture *texture);
113 void			  clutter_gst_video_texture_set_user_agent      (ClutterGstVideoTexture *texture,
114 									 const gchar *           user_agent);
115 ClutterGstSeekFlags	  clutter_gst_video_texture_get_seek_flags      (ClutterGstVideoTexture *texture);
116 void			  clutter_gst_video_texture_set_seek_flags      (ClutterGstVideoTexture *texture,
117 									 ClutterGstSeekFlags     flags);
118 ClutterGstBufferingMode	  clutter_gst_video_texture_get_buffering_mode	(ClutterGstVideoTexture *texture);
119 void			  clutter_gst_video_texture_set_buffering_mode	(ClutterGstVideoTexture *texture,
120 									 ClutterGstBufferingMode mode);
121 GList *                   clutter_gst_video_texture_get_audio_streams   (ClutterGstVideoTexture *texture);
122 gint                      clutter_gst_video_texture_get_audio_stream    (ClutterGstVideoTexture *texture);
123 void                      clutter_gst_video_texture_set_audio_stream    (ClutterGstVideoTexture *texture,
124                                                                          gint                    index_);
125 GList *                   clutter_gst_video_texture_get_subtitle_tracks (ClutterGstVideoTexture *texture);
126 gint                      clutter_gst_video_texture_get_subtitle_track  (ClutterGstVideoTexture *texture);
127 void                      clutter_gst_video_texture_set_subtitle_track  (ClutterGstVideoTexture *texture,
128                                                                          gint                    index_);
129 
130 G_END_DECLS
131 
132 #endif /* __CLUTTER_GST_VIDEO_TEXTURE_H__ */
133