From: <wt...@fr...> - 2005-05-17 17:45:11
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: wtay Date: Tue May 17 2005 10:45:10 PDT Log message: * ext/libcaca/gstcacasink.c: (gst_cacasink_setcaps), (gst_cacasink_render), (gst_cacasink_open), (gst_cacasink_close), (gst_cacasink_change_state): * ext/libcaca/gstcacasink.h: Cleanups. Modified files: . : ChangeLog ext/libcaca : gstcacasink.c gstcacasink.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1676&r2=1.1677 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/libcaca/gstcacasink.c.diff?r1=1.14&r2=1.15 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/libcaca/gstcacasink.h.diff?r1=1.11&r2=1.12 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1676 retrieving revision 1.1677 diff -u -d -r1.1676 -r1.1677 --- ChangeLog 15 May 2005 23:06:37 -0000 1.1676 +++ ChangeLog 17 May 2005 17:44:57 -0000 1.1677 @@ -1,3 +1,11 @@ +2005-05-17 Wim Taymans <wi...@fl...> + + * ext/libcaca/gstcacasink.c: (gst_cacasink_setcaps), + (gst_cacasink_render), (gst_cacasink_open), (gst_cacasink_close), + (gst_cacasink_change_state): + * ext/libcaca/gstcacasink.h: + Cleanups. 2005-05-15 David Schleef <ds...@sc...> Move core plugins out of core. I don't mind fdsrc/fdsink Index: gstcacasink.c RCS file: /cvs/gstreamer/gst-plugins/ext/libcaca/gstcacasink.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- gstcacasink.c 8 May 2005 12:22:04 -0000 1.14 +++ gstcacasink.c 17 May 2005 17:44:58 -0000 1.15 @@ -191,12 +191,6 @@ cacasink = GST_CACASINK (basesink); - /* We cannot use library functions if the sink is not open */ - if (!GST_FLAG_IS_SET (GST_ELEMENT (cacasink), GST_CACASINK_OPEN)) - return FALSE; - /*if (!GST_CAPS_IS_FIXED (caps)) - return FALSE; */ - structure = gst_caps_get_structure (caps, 0); gst_structure_get_int (structure, "width", &(cacasink->width)); gst_structure_get_int (structure, "height", &(cacasink->height)); @@ -261,10 +255,6 @@ { GstCACASink *cacasink = GST_CACASINK (basesink); - return GST_FLOW_WRONG_STATE; GST_DEBUG ("render"); caca_clear (); @@ -344,8 +334,6 @@ static gboolean gst_cacasink_open (GstCACASink * cacasink) - g_return_val_if_fail (!GST_FLAG_IS_SET (cacasink, GST_CACASINK_OPEN), FALSE); cacasink->bitmap = NULL; caca_init (); @@ -356,45 +344,46 @@ cacasink->dither = 0; caca_set_dithering (CACA_DITHERING_NONE); - GST_FLAG_SET (cacasink, GST_CACASINK_OPEN); return TRUE; } static void gst_cacasink_close (GstCACASink * cacasink) - g_return_if_fail (GST_FLAG_IS_SET (cacasink, GST_CACASINK_OPEN)); if (cacasink->bitmap) { caca_free_bitmap (cacasink->bitmap); cacasink->bitmap = NULL; } caca_end (); - GST_FLAG_UNSET (cacasink, GST_CACASINK_OPEN); static GstElementStateReturn gst_cacasink_change_state (GstElement * element) - g_return_val_if_fail (GST_IS_CACASINK (element), GST_STATE_FAILURE); + GstElementStateReturn ret; + gint transition; - if (GST_STATE_PENDING (element) == GST_STATE_NULL) { - if (GST_FLAG_IS_SET (element, GST_CACASINK_OPEN)) - gst_cacasink_close (GST_CACASINK (element)); - } else { - if (!GST_FLAG_IS_SET (element, GST_CACASINK_OPEN)) { + transition = GST_STATE_TRANSITION (element); + switch (transition) { + case GST_STATE_READY_TO_PAUSED: if (!gst_cacasink_open (GST_CACASINK (element))) return GST_STATE_FAILURE; - } + break; + default: - if (GST_ELEMENT_CLASS (parent_class)->change_state) - return GST_ELEMENT_CLASS (parent_class)->change_state (element); + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element); - return GST_STATE_SUCCESS; + case GST_STATE_PAUSED_TO_READY: + gst_cacasink_close (GST_CACASINK (element)); + } + return ret; Index: gstcacasink.h RCS file: /cvs/gstreamer/gst-plugins/ext/libcaca/gstcacasink.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gstcacasink.h 8 May 2005 12:22:04 -0000 1.11 +++ gstcacasink.h 17 May 2005 17:44:58 -0000 1.12 @@ -53,12 +53,6 @@ #define GST_IS_CACASINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CACASINK)) -typedef enum { - GST_CACASINK_OPEN = GST_ELEMENT_FLAG_LAST, - GST_CACASINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, -} GstCACASinkFlags; typedef struct _GstCACASink GstCACASink; typedef struct _GstCACASinkClass GstCACASinkClass; |