From: Julien M. <do...@us...> - 2003-09-11 19:14:48
|
CVS Root: /cvsroot/gstreamer Module: gst-plugins Changes by: dolphy Date: Thu Sep 11 2003 12:14:47 PDT Branch: BRANCH-GSTREAMER-0_6 Log message: Just run indent on source files because the indentation was so ugly.. Modified files: gst-libs/gst/play: play.c play.h playpipelines.c Links: http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst-libs/gst/play/play.c.diff?r1=1.8.4.5&r2=1.8.4.6 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst-libs/gst/play/play.h.diff?r1=1.4.4.2&r2=1.4.4.3 http://cvs.sf.net/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/gst-libs/gst/play/playpipelines.c.diff?r1=1.5.4.3&r2=1.5.4.4 ====Begin Diffs==== Index: play.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst-libs/gst/play/play.c,v retrieving revision 1.8.4.5 retrieving revision 1.8.4.6 diff -u -d -r1.8.4.5 -r1.8.4.6 --- play.c 7 Jun 2003 22:17:05 -0000 1.8.4.5 +++ play.c 11 Sep 2003 19:14:34 -0000 1.8.4.6 @@ -24,60 +24,67 @@ #include "play.h" -enum { - STREAM_END, - INFORMATION, - STATE_CHANGE, - STREAM_LENGTH, - TIME_TICK, - HAVE_XID, - HAVE_VIS_XID, [...2060 lines suppressed...] + g_object_set (G_OBJECT (play->vol_dparam), + "update_period", 2000000LL, NULL); + + g_object_set (G_OBJECT (play->vol_dparam), + "slope_delta_float", 0.1F, NULL); + g_object_set (G_OBJECT (play->vol_dparam), + "slope_time", 10000000LL, NULL); + + if (!gst_dpman_attach_dparam (play->vol_dpman, + "volume", play->vol_dparam)) + g_warning ("could not attach dparam to volume element\n"); + + gst_dpman_set_mode (play->vol_dpman, "asynchronous"); + gst_play_set_volume (play, 0.9); + } + + play->signal_queue = g_async_queue_new (); + + return play; } Index: play.h =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst-libs/gst/play/play.h,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -u -d -r1.4.4.2 -r1.4.4.3 --- play.h 31 May 2003 16:21:39 -0000 1.4.4.2 +++ play.h 11 Sep 2003 19:14:34 -0000 1.4.4.3 @@ -40,35 +40,39 @@ * playing state. */ -typedef enum { - GST_PLAY_OK, - GST_PLAY_UNKNOWN_MEDIA, - GST_PLAY_CANNOT_PLAY, - GST_PLAY_ERROR, +typedef enum +{ + GST_PLAY_OK, + GST_PLAY_UNKNOWN_MEDIA, + GST_PLAY_CANNOT_PLAY, + GST_PLAY_ERROR, } GstPlayReturn; -typedef enum { - GST_PLAY_PIPE_AUDIO, - GST_PLAY_PIPE_AUDIO_THREADED, - GST_PLAY_PIPE_AUDIO_HYPER_THREADED, - GST_PLAY_PIPE_VIDEO, - GST_PLAY_PIPE_VIDEO_VISUALISATION, +typedef enum +{ + GST_PLAY_PIPE_AUDIO, + GST_PLAY_PIPE_AUDIO_THREADED, + GST_PLAY_PIPE_AUDIO_HYPER_THREADED, + GST_PLAY_PIPE_VIDEO, + GST_PLAY_PIPE_VIDEO_VISUALISATION, } GstPlayPipeType; -typedef enum { - GST_PLAY_ERROR_FAKESINK, - GST_PLAY_ERROR_THREAD, - GST_PLAY_ERROR_QUEUE, - GST_PLAY_ERROR_GNOMEVFSSRC, - GST_PLAY_ERROR_VOLUME, - GST_PLAY_ERROR_COLORSPACE, - GST_PLAY_ERROR_LAST, +typedef enum +{ + GST_PLAY_ERROR_FAKESINK, + GST_PLAY_ERROR_THREAD, + GST_PLAY_ERROR_QUEUE, + GST_PLAY_ERROR_GNOMEVFSSRC, + GST_PLAY_ERROR_VOLUME, + GST_PLAY_ERROR_COLORSPACE, + GST_PLAY_ERROR_LAST, } GstPlayError; -typedef enum { - GST_PLAY_SINK_TYPE_AUDIO, - GST_PLAY_SINK_TYPE_VIDEO, - GST_PLAY_SINK_TYPE_ANY, +typedef enum +{ + GST_PLAY_SINK_TYPE_AUDIO, + GST_PLAY_SINK_TYPE_VIDEO, + GST_PLAY_SINK_TYPE_ANY, } GstPlaySinkType; #define GST_PLAY_ERROR gst_play_error_quark () @@ -80,168 +84,131 @@ #define GST_IS_PLAY_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLAY)) #define GST_PLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLAY, GstPlayClass)) -typedef struct _GstPlay GstPlay; -typedef struct _GstPlayClass GstPlayClass; -typedef struct _GstPlayIdleData GstPlayIdleData; +typedef struct _GstPlay GstPlay; +typedef struct _GstPlayClass GstPlayClass; +typedef struct _GstPlayIdleData GstPlayIdleData; -typedef guint (*GstPlayTimeoutAdd) ( guint interval, - GSourceFunc function, - gpointer data); -typedef guint (*GstPlayIdleAdd) (GSourceFunc function, gpointer data); +typedef guint (*GstPlayTimeoutAdd) (guint interval, + GSourceFunc function, gpointer data); +typedef guint (*GstPlayIdleAdd) (GSourceFunc function, gpointer data); struct _GstPlay { - GObject parent; - - gboolean (*setup_pipeline) (GstPlay *play, GError **error); - void (*teardown_pipeline) (GstPlay *play); - gboolean (*set_data_src) (GstPlay *play, GstElement *datasrc); - gboolean (*set_autoplugger) (GstPlay *play, GstElement *autoplugger); - gboolean (*set_video_sink) (GstPlay *play, GstElement *videosink); - gboolean (*set_audio_sink) (GstPlay *play, GstElement *audiosink); - - /* core elements */ - GstElement *pipeline; - GstElement *volume; - GstElement *source; - GstElement *autoplugger; - GstElement *video_sink; - GstElement *video_sink_element; - GstElement *audio_sink; - GstElement *audio_sink_element; - GstElement *visualisation_sink_element; + GObject parent; - GstDParamManager *vol_dpman; - GstDParam *vol_dparam; - GHashTable *other_elements; + gboolean (*setup_pipeline) (GstPlay * play, GError ** error); + void (*teardown_pipeline) (GstPlay * play); + gboolean (*set_data_src) (GstPlay * play, GstElement * datasrc); + gboolean (*set_autoplugger) (GstPlay * play, GstElement * autoplugger); + gboolean (*set_video_sink) (GstPlay * play, GstElement * videosink); + gboolean (*set_audio_sink) (GstPlay * play, GstElement * audiosink); - GstClock *clock; + /* core elements */ + GstElement *pipeline; + GstElement *volume; + GstElement *source; + GstElement *autoplugger; + GstElement *video_sink; + GstElement *video_sink_element; + GstElement *audio_sink; + GstElement *audio_sink_element; + GstElement *visualisation_sink_element; - gboolean need_stream_length; - gboolean need_seek; - gint time_seconds; - gint get_length_attempt; - gint64 seek_time; - gint64 time_nanos; - gint64 length_nanos; - - GAsyncQueue *signal_queue; + GstDParamManager *vol_dpman; + GstDParam *vol_dparam; + GHashTable *other_elements; - GstPlayTimeoutAdd timeout_add_func; - GstPlayIdleAdd idle_add_func; + GstClock *clock; + + gboolean need_stream_length; + gboolean need_seek; + gint time_seconds; + gint get_length_attempt; + gint64 seek_time; + gint64 time_nanos; + gint64 length_nanos; + + GAsyncQueue *signal_queue; + + GstPlayTimeoutAdd timeout_add_func; + GstPlayIdleAdd idle_add_func; }; struct _GstPlayClass { - GObjectClass parent_class; - - /* signals */ - void (*information) (GstPlay* play, - GstObject* element, - GParamSpec *param); - void (*pipeline_error) (GstPlay* play, - GstElement* element, - char *error); - void (*state_changed) (GstPlay* play, - GstElementState old_state, - GstElementState new_state); - void (*stream_end) (GstPlay* play); - void (*time_tick) (GstPlay* play, - gint64 time_nanos); - void (*stream_length) (GstPlay* play, - gint64 length_nanos); - void (*have_xid) (GstPlay* play, - gint xid); - void (*have_vis_xid) (GstPlay* play, - gint xid); - void (*have_video_size) (GstPlay* play, - gint width, - gint height); + GObjectClass parent_class; + + /* signals */ + void (*information) (GstPlay * play, + GstObject * element, GParamSpec * param); + void (*pipeline_error) (GstPlay * play, GstElement * element, char *error); + void (*state_changed) (GstPlay * play, + GstElementState old_state, + GstElementState new_state); + void (*stream_end) (GstPlay * play); + void (*time_tick) (GstPlay * play, gint64 time_nanos); + void (*stream_length) (GstPlay * play, gint64 length_nanos); + void (*have_xid) (GstPlay * play, gint xid); + void (*have_vis_xid) (GstPlay * play, gint xid); + void (*have_video_size) (GstPlay * play, gint width, gint height); }; struct _GstPlayIdleData { - GSourceFunc func; - gpointer data; + GSourceFunc func; + gpointer data; }; -void -gst_play_seek_to_time ( GstPlay *play, - gint64 time_nanos); +void gst_play_seek_to_time (GstPlay * play, gint64 time_nanos); -void -gst_play_need_new_video_window (GstPlay *play); +void gst_play_need_new_video_window (GstPlay * play); void -gst_play_set_idle_timeout_funcs ( GstPlay *play, - GstPlayTimeoutAdd timeout_add_func, - GstPlayIdleAdd idle_add_func); -GstElement* -gst_play_get_sink_element ( GstPlay *play, - GstElement *element, - GstPlaySinkType sink_type); +gst_play_set_idle_timeout_funcs (GstPlay * play, + GstPlayTimeoutAdd timeout_add_func, + GstPlayIdleAdd idle_add_func); +GstElement *gst_play_get_sink_element (GstPlay * play, + GstElement * element, + GstPlaySinkType sink_type); /* Set/Get state */ GstElementStateReturn -gst_play_set_state ( GstPlay *play, - GstElementState state); -GstElementState -gst_play_get_state (GstPlay *play); +gst_play_set_state (GstPlay * play, GstElementState state); +GstElementState gst_play_get_state (GstPlay * play); /* Set/Get location */ -gboolean -gst_play_set_location ( GstPlay *play, - const gchar *location); -gchar* -gst_play_get_location (GstPlay *play); +gboolean gst_play_set_location (GstPlay * play, const gchar * location); +gchar *gst_play_get_location (GstPlay * play); /* Set/Get volume */ -void -gst_play_set_volume ( GstPlay *play, - gfloat volume); -gfloat -gst_play_get_volume (GstPlay *play); +void gst_play_set_volume (GstPlay * play, gfloat volume); +gfloat gst_play_get_volume (GstPlay * play); /* Set/Get mute */ -void -gst_play_set_mute ( GstPlay *play, - gboolean mute); -gboolean -gst_play_get_mute (GstPlay *play); +void gst_play_set_mute (GstPlay * play, gboolean mute); +gboolean gst_play_get_mute (GstPlay * play); /* Set sinks and data src */ +gboolean gst_play_set_data_src (GstPlay * play, GstElement * data_src); +gboolean gst_play_set_video_sink (GstPlay * play, GstElement * video_sink); gboolean -gst_play_set_data_src ( GstPlay *play, - GstElement *data_src); -gboolean -gst_play_set_video_sink ( GstPlay *play, - GstElement *video_sink); -gboolean -gst_play_set_visualisation_video_sink ( GstPlay *play, - GstElement *video_sink); -gboolean -gst_play_set_audio_sink ( GstPlay *play, - GstElement *audio_sink); +gst_play_set_visualisation_video_sink (GstPlay * play, + GstElement * video_sink); +gboolean gst_play_set_audio_sink (GstPlay * play, GstElement * audio_sink); gboolean -gst_play_set_visualisation_element ( GstPlay *play, - GstElement *element); - -gboolean -gst_play_connect_visualisation ( GstPlay *play, - gboolean connect); - -GType -gst_play_get_type (void); +gst_play_set_visualisation_element (GstPlay * play, GstElement * element); -GstPlay * -gst_play_new ( GstPlayPipeType pipe_type, - GError **error); +gboolean gst_play_connect_visualisation (GstPlay * play, gboolean connect); + +GType gst_play_get_type (void); + +GstPlay *gst_play_new (GstPlayPipeType pipe_type, GError ** error); #endif /* __GSTPLAY_H__ */ Index: playpipelines.c =================================================================== RCS file: /cvsroot/gstreamer/gst-plugins/gst-libs/gst/play/playpipelines.c,v retrieving revision 1.5.4.3 retrieving revision 1.5.4.4 diff -u -d -r1.5.4.3 -r1.5.4.4 --- playpipelines.c 31 May 2003 16:21:39 -0000 1.5.4.3 +++ playpipelines.c 11 Sep 2003 19:14:34 -0000 1.5.4.4 @@ -23,32 +23,34 @@ */ static gboolean -gst_play_default_set_data_src ( GstPlay *play, - GstElement *datasrc, - GstElement* parent) +gst_play_default_set_data_src (GstPlay * play, + GstElement * datasrc, GstElement * parent) { - g_return_val_if_fail (play != NULL, FALSE); - g_return_val_if_fail (datasrc != NULL, FALSE); [...1889 lines suppressed...] + "vis_video_thread_pad"); + + if (gst_pad_get_peer (vis_video_thread_pad) != NULL) + connected = TRUE; + else + connected = FALSE; + + if ((connect) && (!connected)) + { + gst_pad_link (tee_vis_pad, vis_video_thread_pad); + } + else if ((!connect) && (connected)) + { + gst_pad_unlink (tee_vis_pad, vis_video_thread_pad); + } + + return TRUE; } /* modelines */ |