2000-07-05 10:21:53 +00:00
|
|
|
#ifndef __GSTPLAY_H__
|
|
|
|
#define __GSTPLAY_H__
|
|
|
|
|
2001-12-13 23:14:39 +00:00
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#ifdef USE_GLIB2
|
|
|
|
#define gst_glade_xml_new(path,misc) (glade_xml_new (path "2", (misc), NULL))
|
|
|
|
#else
|
|
|
|
#define gst_glade_xml_new(path,misc) (glade_xml_new (path, (misc)))
|
|
|
|
#endif
|
|
|
|
|
2000-07-05 10:21:53 +00:00
|
|
|
#include <gst/gst.h>
|
2001-12-13 23:14:39 +00:00
|
|
|
#include <gtk/gtkhbox.h>
|
2000-07-05 10:21:53 +00:00
|
|
|
|
2001-05-21 01:19:06 +00:00
|
|
|
#define GST_TYPE_PLAY (gst_play_get_type ())
|
|
|
|
#define GST_PLAY(obj) (GTK_CHECK_CAST ((obj), GST_TYPE_PLAY, GstPlay))
|
|
|
|
#define GST_PLAY_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GST_TYPE_PLAY, GstPlayClass))
|
|
|
|
#define GST_IS_PLAY(obj) (GTK_CHECK_TYPE ((obj), GST_TYPE_PLAY))
|
|
|
|
#define GST_IS_PLAY_CLASS(obj) (GTK_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAY))
|
|
|
|
|
2000-10-30 21:02:08 +00:00
|
|
|
typedef struct _GstPlay GstPlay;
|
|
|
|
typedef struct _GstPlayClass GstPlayClass;
|
|
|
|
|
2000-07-05 10:21:53 +00:00
|
|
|
typedef enum {
|
2001-05-21 01:19:06 +00:00
|
|
|
GST_PLAY_STOPPED,
|
|
|
|
GST_PLAY_PLAYING,
|
|
|
|
GST_PLAY_PAUSED,
|
2000-07-05 10:21:53 +00:00
|
|
|
} GstPlayState;
|
|
|
|
|
2000-10-30 21:02:08 +00:00
|
|
|
typedef enum {
|
2001-05-25 21:00:07 +00:00
|
|
|
GST_PLAY_OK,
|
|
|
|
GST_PLAY_UNKNOWN_MEDIA,
|
|
|
|
GST_PLAY_CANNOT_PLAY,
|
|
|
|
GST_PLAY_ERROR,
|
2000-10-30 21:02:08 +00:00
|
|
|
} GstPlayReturn;
|
|
|
|
|
|
|
|
typedef enum {
|
2001-05-21 01:19:06 +00:00
|
|
|
GST_PLAY_TYPE_AUDIO = (1 << 0),
|
|
|
|
GST_PLAY_TYPE_VIDEO = (1 << 1),
|
2000-10-30 21:02:08 +00:00
|
|
|
} GstPlayMediaTypeFlags;
|
|
|
|
|
2001-12-14 18:11:52 +00:00
|
|
|
typedef struct _GstPlayPrivate GstPlayPrivate;
|
|
|
|
|
2000-10-30 21:02:08 +00:00
|
|
|
struct _GstPlay {
|
2001-05-21 01:19:06 +00:00
|
|
|
GtkHBox parent;
|
|
|
|
|
2001-12-14 18:11:52 +00:00
|
|
|
GstPlayState state;
|
2001-05-21 01:19:06 +00:00
|
|
|
GstPlayMediaTypeFlags flags;
|
2001-12-14 18:11:52 +00:00
|
|
|
GstPlayPrivate *priv;
|
2000-10-30 21:02:08 +00:00
|
|
|
};
|
|
|
|
|
2001-05-21 01:19:06 +00:00
|
|
|
#define GST_PLAY_STATE(play) ((play)->state)
|
|
|
|
#define GST_PLAY_MEDIA_TYPE(play) ((play)->flags)
|
2000-10-30 21:02:08 +00:00
|
|
|
#define GST_PLAY_IS_AUDIO_TYPE(play) ((play)->flags & GST_PLAY_TYPE_AUDIO)
|
|
|
|
#define GST_PLAY_IS_VIDEO_TYPE(play) ((play)->flags & GST_PLAY_TYPE_VIDEO)
|
|
|
|
|
|
|
|
struct _GstPlayClass {
|
2001-05-21 01:19:06 +00:00
|
|
|
GtkHBoxClass parent_class;
|
2000-10-30 21:02:08 +00:00
|
|
|
|
2001-05-21 01:19:06 +00:00
|
|
|
void (*state_changed) (GstPlay *play, GstPlayState state);
|
|
|
|
void (*frame_displayed) (GstPlay *play);
|
|
|
|
void (*audio_played) (GstPlay *play);
|
2000-10-30 21:02:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
GtkType gst_play_get_type (void);
|
|
|
|
|
|
|
|
/* setup the player */
|
|
|
|
GstPlay* gst_play_new (void);
|
|
|
|
GstPlayReturn gst_play_set_uri (GstPlay *play, const guchar *uri);
|
|
|
|
|
|
|
|
/* control the player */
|
|
|
|
void gst_play_play (GstPlay *play);
|
|
|
|
void gst_play_pause (GstPlay *play);
|
|
|
|
void gst_play_stop (GstPlay *play);
|
|
|
|
|
|
|
|
void gst_play_mute (GstPlay *play, gboolean mute);
|
|
|
|
|
|
|
|
/* information about the media stream */
|
|
|
|
gulong gst_play_get_media_size (GstPlay *play);
|
|
|
|
gulong gst_play_get_media_offset (GstPlay *play);
|
2000-11-01 13:49:41 +00:00
|
|
|
gboolean gst_play_media_can_seek (GstPlay *play);
|
2000-10-30 21:02:08 +00:00
|
|
|
void gst_play_media_seek (GstPlay *play, gulong offset);
|
|
|
|
|
|
|
|
gulong gst_play_get_media_total_time (GstPlay *play);
|
|
|
|
gulong gst_play_get_media_current_time (GstPlay *play);
|
|
|
|
|
2001-05-21 01:19:06 +00:00
|
|
|
/* set display stuff */
|
2001-06-13 01:18:12 +00:00
|
|
|
GtkWidget * gst_play_get_video_widget (GstPlay *play);
|
|
|
|
gint gst_play_get_source_width (GstPlay *play);
|
|
|
|
gint gst_play_get_source_height (GstPlay *play);
|
2001-05-21 01:19:06 +00:00
|
|
|
|
2000-10-30 21:02:08 +00:00
|
|
|
/* the autoplugged pipeline */
|
|
|
|
GstElement* gst_play_get_pipeline (GstPlay *play);
|
2000-07-05 10:21:53 +00:00
|
|
|
|
|
|
|
#endif /* __GSTPLAY_H__ */
|