diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-14 22:34:33 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-14 22:34:33 +0000 |
commit | 5d25c00e4b613b9cdf2c04fa3a68dffa03834a68 (patch) | |
tree | 74a5b1eaf3a324b520e64e87404fd0b3018a7829 /ext/aalib | |
parent | 1e83b097f7b732ae49e294a5a398bdc3e88854a8 (diff) |
gst-indent
Original commit message from CVS:
gst-indent
Diffstat (limited to 'ext/aalib')
-rw-r--r-- | ext/aalib/gstaasink.c | 295 | ||||
-rw-r--r-- | ext/aalib/gstaasink.h | 66 |
2 files changed, 172 insertions, 189 deletions
diff --git a/ext/aalib/gstaasink.c b/ext/aalib/gstaasink.c index 6dfdb50cd..e34bcf030 100644 --- a/ext/aalib/gstaasink.c +++ b/ext/aalib/gstaasink.c @@ -36,14 +36,16 @@ static GstElementDetails gst_aasink_details = { }; /* aasink signals and args */ -enum { +enum +{ SIGNAL_FRAME_DISPLAYED, SIGNAL_HAVE_SIZE, LAST_SIGNAL }; -enum { +enum +{ ARG_0, ARG_WIDTH, ARG_HEIGHT, @@ -58,27 +60,25 @@ enum { ARG_FRAME_TIME, }; -static GstStaticPadTemplate sink_template = -GST_STATIC_PAD_TEMPLATE ( - "sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")) -); +static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")) + ); -static void gst_aasink_base_init (gpointer g_class); -static void gst_aasink_class_init (GstAASinkClass *klass); -static void gst_aasink_init (GstAASink *aasink); +static void gst_aasink_base_init (gpointer g_class); +static void gst_aasink_class_init (GstAASinkClass * klass); +static void gst_aasink_init (GstAASink * aasink); -static void gst_aasink_set_clock (GstElement *element, GstClock *clock); -static void gst_aasink_chain (GstPad *pad, GstData *_data); +static void gst_aasink_set_clock (GstElement * element, GstClock * clock); +static void gst_aasink_chain (GstPad * pad, GstData * _data); -static void gst_aasink_set_property (GObject *object, guint prop_id, - const GValue *value, GParamSpec *pspec); -static void gst_aasink_get_property (GObject *object, guint prop_id, - GValue *value, GParamSpec *pspec); +static void gst_aasink_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec); +static void gst_aasink_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec); -static GstElementStateReturn gst_aasink_change_state (GstElement *element); +static GstElementStateReturn gst_aasink_change_state (GstElement * element); static GstElementClass *parent_class = NULL; static guint gst_aasink_signals[LAST_SIGNAL] = { 0 }; @@ -90,17 +90,18 @@ gst_aasink_get_type (void) if (!aasink_type) { static const GTypeInfo aasink_info = { - sizeof(GstAASinkClass), + sizeof (GstAASinkClass), gst_aasink_base_init, NULL, (GClassInitFunc) gst_aasink_class_init, NULL, NULL, - sizeof(GstAASink), + sizeof (GstAASink), 0, - (GInstanceInitFunc)gst_aasink_init, + (GInstanceInitFunc) gst_aasink_init, }; - aasink_type = g_type_register_static(GST_TYPE_ELEMENT, "GstAASink", &aasink_info, 0); + aasink_type = + g_type_register_static (GST_TYPE_ELEMENT, "GstAASink", &aasink_info, 0); } return aasink_type; } @@ -110,19 +111,20 @@ static GType gst_aasink_drivers_get_type (void) { static GType driver_type = 0; + if (!driver_type) { GEnumValue *drivers; const struct aa_driver *driver; gint n_drivers; gint i; - for (n_drivers = 0; aa_drivers[n_drivers]; n_drivers++){ + for (n_drivers = 0; aa_drivers[n_drivers]; n_drivers++) { /* count number of drivers */ } - - drivers = g_new0(GEnumValue, n_drivers + 1); - for (i = 0; i < n_drivers; i++){ + drivers = g_new0 (GEnumValue, n_drivers + 1); + + for (i = 0; i < n_drivers; i++) { driver = aa_drivers[i]; drivers[i].value = i; drivers[i].value_name = g_strdup (driver->shortname); @@ -142,18 +144,19 @@ static GType gst_aasink_dither_get_type (void) { static GType dither_type = 0; + if (!dither_type) { GEnumValue *ditherers; gint n_ditherers; gint i; - for (n_ditherers = 0; aa_dithernames[n_ditherers]; n_ditherers++){ + for (n_ditherers = 0; aa_dithernames[n_ditherers]; n_ditherers++) { /* count number of ditherers */ } - - ditherers = g_new0(GEnumValue, n_ditherers + 1); - for (i = 0; i < n_ditherers; i++){ + ditherers = g_new0 (GEnumValue, n_ditherers + 1); + + for (i = 0; i < n_ditherers; i++) { ditherers[i].value = i; ditherers[i].value_name = g_strdup (aa_dithernames[i]); ditherers[i].value_nick = g_strdup (aa_dithernames[i]); @@ -178,74 +181,52 @@ gst_aasink_base_init (gpointer g_class) } static void -gst_aasink_class_init (GstAASinkClass *klass) +gst_aasink_class_init (GstAASinkClass * klass) { GObjectClass *gobject_class; GstElementClass *gstelement_class; - gobject_class = (GObjectClass*)klass; - gstelement_class = (GstElementClass*)klass; + gobject_class = (GObjectClass *) klass; + gstelement_class = (GstElementClass *) klass; parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_WIDTH, - g_param_spec_int("width","width","width", - G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_HEIGHT, - g_param_spec_int("height","height","height", - G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DRIVER, - g_param_spec_enum("driver","driver","driver", - GST_TYPE_AADRIVERS,0,G_PARAM_READWRITE)); /* CHECKME! */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_DITHER, - g_param_spec_enum("dither","dither","dither", - GST_TYPE_AADITHER,0,G_PARAM_READWRITE)); /* CHECKME! */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_BRIGHTNESS, - g_param_spec_int("brightness","brightness","brightness", - G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_CONTRAST, - g_param_spec_int("contrast","contrast","contrast", - G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_GAMMA, - g_param_spec_float("gamma","gamma","gamma", - 0.0,5.0,1.0,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_INVERSION, - g_param_spec_boolean("inversion","inversion","inversion", - TRUE,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_RANDOMVAL, - g_param_spec_int("randomval","randomval","randomval", - G_MININT,G_MAXINT,0,G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FRAMES_DISPLAYED, - g_param_spec_int("frames_displayed","frames_displayed","frames_displayed", - G_MININT,G_MAXINT,0,G_PARAM_READABLE)); /* CHECKME */ - g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_FRAME_TIME, - g_param_spec_int("frame_time","frame_time","frame_time", - G_MININT,G_MAXINT,0,G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DRIVER, g_param_spec_enum ("driver", "driver", "driver", GST_TYPE_AADRIVERS, 0, G_PARAM_READWRITE)); /* CHECKME! */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DITHER, g_param_spec_enum ("dither", "dither", "dither", GST_TYPE_AADITHER, 0, G_PARAM_READWRITE)); /* CHECKME! */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BRIGHTNESS, g_param_spec_int ("brightness", "brightness", "brightness", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CONTRAST, g_param_spec_int ("contrast", "contrast", "contrast", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_GAMMA, g_param_spec_float ("gamma", "gamma", "gamma", 0.0, 5.0, 1.0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_INVERSION, g_param_spec_boolean ("inversion", "inversion", "inversion", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_RANDOMVAL, g_param_spec_int ("randomval", "randomval", "randomval", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FRAMES_DISPLAYED, g_param_spec_int ("frames_displayed", "frames_displayed", "frames_displayed", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FRAME_TIME, g_param_spec_int ("frame_time", "frame_time", "frame_time", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ gobject_class->set_property = gst_aasink_set_property; gobject_class->get_property = gst_aasink_get_property; gst_aasink_signals[SIGNAL_FRAME_DISPLAYED] = - g_signal_new ("frame-displayed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstAASinkClass, frame_displayed), NULL, NULL, - g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); + g_signal_new ("frame-displayed", G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstAASinkClass, frame_displayed), + NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0); gst_aasink_signals[SIGNAL_HAVE_SIZE] = - g_signal_new ("have-size", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GstAASinkClass, have_size), NULL, NULL, - gst_marshal_VOID__INT_INT, G_TYPE_NONE, 2, - G_TYPE_UINT, G_TYPE_UINT); + g_signal_new ("have-size", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstAASinkClass, have_size), NULL, NULL, + gst_marshal_VOID__INT_INT, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); gstelement_class->change_state = gst_aasink_change_state; - gstelement_class->set_clock = gst_aasink_set_clock; + gstelement_class->set_clock = gst_aasink_set_clock; } static GstCaps * -gst_aasink_fixate (GstPad *pad, const GstCaps *caps) +gst_aasink_fixate (GstPad * pad, const GstCaps * caps) { GstStructure *structure; GstCaps *newcaps; - if (gst_caps_get_size (caps) > 1) return NULL; + if (gst_caps_get_size (caps) > 1) + return NULL; newcaps = gst_caps_copy (caps); structure = gst_caps_get_structure (newcaps, 0); @@ -257,7 +238,7 @@ gst_aasink_fixate (GstPad *pad, const GstCaps *caps) return newcaps; } if (gst_caps_structure_fixate_field_nearest_double (structure, "framerate", - 30.0)) { + 30.0)) { return newcaps; } @@ -266,7 +247,7 @@ gst_aasink_fixate (GstPad *pad, const GstCaps *caps) } static GstPadLinkReturn -gst_aasink_sinkconnect (GstPad *pad, const GstCaps *caps) +gst_aasink_sinkconnect (GstPad * pad, const GstCaps * caps) { GstAASink *aasink; GstStructure *structure; @@ -280,16 +261,16 @@ gst_aasink_sinkconnect (GstPad *pad, const GstCaps *caps) /* FIXME aasink->format is never set */ GST_DEBUG ("aasink: setting %08lx (" GST_FOURCC_FORMAT ")", - aasink->format, GST_FOURCC_ARGS(aasink->format)); - - g_signal_emit( G_OBJECT (aasink), gst_aasink_signals[SIGNAL_HAVE_SIZE], 0, - aasink->width, aasink->height); + aasink->format, GST_FOURCC_ARGS (aasink->format)); + + g_signal_emit (G_OBJECT (aasink), gst_aasink_signals[SIGNAL_HAVE_SIZE], 0, + aasink->width, aasink->height); return GST_PAD_LINK_OK; } static void -gst_aasink_set_clock (GstElement *element, GstClock *clock) +gst_aasink_set_clock (GstElement * element, GstClock * clock) { GstAASink *aasink = GST_AASINK (element); @@ -297,16 +278,18 @@ gst_aasink_set_clock (GstElement *element, GstClock *clock) } static void -gst_aasink_init (GstAASink *aasink) +gst_aasink_init (GstAASink * aasink) { - aasink->sinkpad = gst_pad_new_from_template ( - gst_element_get_pad_template (GST_ELEMENT (aasink), "sink"), "sink"); + aasink->sinkpad = + gst_pad_new_from_template (gst_element_get_pad_template (GST_ELEMENT + (aasink), "sink"), "sink"); gst_element_add_pad (GST_ELEMENT (aasink), aasink->sinkpad); gst_pad_set_chain_function (aasink->sinkpad, gst_aasink_chain); gst_pad_set_link_function (aasink->sinkpad, gst_aasink_sinkconnect); gst_pad_set_fixate_function (aasink->sinkpad, gst_aasink_fixate); - memcpy(&aasink->ascii_surf, &aa_defparams, sizeof (struct aa_hardware_params)); + memcpy (&aasink->ascii_surf, &aa_defparams, + sizeof (struct aa_hardware_params)); aasink->ascii_parms.bright = 0; aasink->ascii_parms.contrast = 16; aasink->ascii_parms.gamma = 1.0; @@ -320,13 +303,12 @@ gst_aasink_init (GstAASink *aasink) aasink->clock = NULL; - GST_FLAG_SET(aasink, GST_ELEMENT_THREAD_SUGGESTED); + GST_FLAG_SET (aasink, GST_ELEMENT_THREAD_SUGGESTED); } static void -gst_aasink_scale (GstAASink *aasink, gchar *src, gchar *dest, - gint sw, gint sh, - gint dw, gint dh) +gst_aasink_scale (GstAASink * aasink, gchar * src, gchar * dest, + gint sw, gint sh, gint dw, gint dh) { gint ypos, yinc, y; gint xpos, xinc, x; @@ -340,20 +322,20 @@ gst_aasink_scale (GstAASink *aasink, gchar *src, gchar *dest, for (y = dh; y; y--) { while (ypos > 0x10000) { ypos -= 0x10000; - src += sw; + src += sw; } xpos = 0x10000; { guchar *destp = dest; guchar *srcp = src; - for ( x=dw; x; x-- ) { - while (xpos >= 0x10000L) { - srcp++; - xpos -= 0x10000L; - } - *destp++ = *srcp; - xpos += xinc; + for (x = dw; x; x--) { + while (xpos >= 0x10000L) { + srcp++; + xpos -= 0x10000L; + } + *destp++ = *srcp; + xpos += xinc; } } dest += dw; @@ -362,7 +344,7 @@ gst_aasink_scale (GstAASink *aasink, gchar *src, gchar *dest, } static void -gst_aasink_chain (GstPad *pad, GstData *_data) +gst_aasink_chain (GstPad * pad, GstData * _data) { GstBuffer *buf = GST_BUFFER (_data); GstAASink *aasink; @@ -373,33 +355,35 @@ gst_aasink_chain (GstPad *pad, GstData *_data) aasink = GST_AASINK (gst_pad_get_parent (pad)); - gst_aasink_scale (aasink, - GST_BUFFER_DATA (buf), /* src */ - aa_image (aasink->context), /* dest */ - aasink->width, /* sw */ - aasink->height, /* sh */ - aa_imgwidth (aasink->context), /* dw */ - aa_imgheight (aasink->context)); /* dh */ + gst_aasink_scale (aasink, GST_BUFFER_DATA (buf), /* src */ + aa_image (aasink->context), /* dest */ + aasink->width, /* sw */ + aasink->height, /* sh */ + aa_imgwidth (aasink->context), /* dw */ + aa_imgheight (aasink->context)); /* dh */ - GST_DEBUG ("videosink: clock wait: %" G_GUINT64_FORMAT, GST_BUFFER_TIMESTAMP(buf)); + GST_DEBUG ("videosink: clock wait: %" G_GUINT64_FORMAT, + GST_BUFFER_TIMESTAMP (buf)); if (aasink->clock && GST_BUFFER_TIMESTAMP_IS_VALID (buf)) { gst_element_wait (GST_ELEMENT (aasink), GST_BUFFER_TIMESTAMP (buf)); } - aa_render (aasink->context, &aasink->ascii_parms, - 0, 0, aa_imgwidth (aasink->context), aa_imgheight (aasink->context)); + aa_render (aasink->context, &aasink->ascii_parms, + 0, 0, aa_imgwidth (aasink->context), aa_imgheight (aasink->context)); aa_flush (aasink->context); aa_getevent (aasink->context, FALSE); - g_signal_emit(G_OBJECT(aasink),gst_aasink_signals[SIGNAL_FRAME_DISPLAYED], 0); + g_signal_emit (G_OBJECT (aasink), gst_aasink_signals[SIGNAL_FRAME_DISPLAYED], + 0); - gst_buffer_unref(buf); + gst_buffer_unref (buf); } static void -gst_aasink_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +gst_aasink_set_property (GObject * object, guint prop_id, const GValue * value, + GParamSpec * pspec) { GstAASink *aasink; @@ -415,31 +399,31 @@ gst_aasink_set_property (GObject *object, guint prop_id, const GValue *value, GP case ARG_HEIGHT: aasink->ascii_surf.height = g_value_get_int (value); break; - case ARG_DRIVER: { + case ARG_DRIVER:{ aasink->aa_driver = g_value_get_enum (value); break; } - case ARG_DITHER: { + case ARG_DITHER:{ aasink->ascii_parms.dither = g_value_get_enum (value); break; } - case ARG_BRIGHTNESS: { + case ARG_BRIGHTNESS:{ aasink->ascii_parms.bright = g_value_get_int (value); break; } - case ARG_CONTRAST: { + case ARG_CONTRAST:{ aasink->ascii_parms.contrast = g_value_get_int (value); break; } - case ARG_GAMMA: { + case ARG_GAMMA:{ aasink->ascii_parms.gamma = g_value_get_float (value); break; } - case ARG_INVERSION: { + case ARG_INVERSION:{ aasink->ascii_parms.inversion = g_value_get_boolean (value); break; } - case ARG_RANDOMVAL: { + case ARG_RANDOMVAL:{ aasink->ascii_parms.randomval = g_value_get_int (value); break; } @@ -449,59 +433,60 @@ gst_aasink_set_property (GObject *object, guint prop_id, const GValue *value, GP } static void -gst_aasink_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +gst_aasink_get_property (GObject * object, guint prop_id, GValue * value, + GParamSpec * pspec) { GstAASink *aasink; /* it's not null if we got it, but it might not be ours */ - aasink = GST_AASINK(object); + aasink = GST_AASINK (object); switch (prop_id) { - case ARG_WIDTH: { + case ARG_WIDTH:{ g_value_set_int (value, aasink->ascii_surf.width); break; } - case ARG_HEIGHT: { + case ARG_HEIGHT:{ g_value_set_int (value, aasink->ascii_surf.height); break; } - case ARG_DRIVER: { + case ARG_DRIVER:{ g_value_set_enum (value, aasink->aa_driver); break; } - case ARG_DITHER: { + case ARG_DITHER:{ g_value_set_enum (value, aasink->ascii_parms.dither); break; } - case ARG_BRIGHTNESS: { + case ARG_BRIGHTNESS:{ g_value_set_int (value, aasink->ascii_parms.bright); break; } - case ARG_CONTRAST: { + case ARG_CONTRAST:{ g_value_set_int (value, aasink->ascii_parms.contrast); break; } - case ARG_GAMMA: { + case ARG_GAMMA:{ g_value_set_float (value, aasink->ascii_parms.gamma); break; } - case ARG_INVERSION: { + case ARG_INVERSION:{ g_value_set_boolean (value, aasink->ascii_parms.inversion); break; } - case ARG_RANDOMVAL: { + case ARG_RANDOMVAL:{ g_value_set_int (value, aasink->ascii_parms.randomval); break; } - case ARG_FRAMES_DISPLAYED: { + case ARG_FRAMES_DISPLAYED:{ g_value_set_int (value, aasink->frames_displayed); break; } - case ARG_FRAME_TIME: { - g_value_set_int (value, aasink->frame_time/1000000); + case ARG_FRAME_TIME:{ + g_value_set_int (value, aasink->frame_time / 1000000); break; } - default: { + default:{ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } @@ -509,20 +494,20 @@ gst_aasink_get_property (GObject *object, guint prop_id, GValue *value, GParamSp } static gboolean -gst_aasink_open (GstAASink *aasink) +gst_aasink_open (GstAASink * aasink) { - g_return_val_if_fail (!GST_FLAG_IS_SET (aasink ,GST_AASINK_OPEN), FALSE); + g_return_val_if_fail (!GST_FLAG_IS_SET (aasink, GST_AASINK_OPEN), FALSE); - aa_recommendhidisplay(aa_drivers[aasink->aa_driver]->shortname); + aa_recommendhidisplay (aa_drivers[aasink->aa_driver]->shortname); aasink->context = aa_autoinit (&aasink->ascii_surf); if (aasink->context == NULL) { GST_ELEMENT_ERROR (GST_ELEMENT (aasink), LIBRARY, TOO_LAZY, (NULL), - ("error opening aalib context")); + ("error opening aalib context")); return FALSE; } - aa_autoinitkbd(aasink->context, 0); - aa_resizehandler(aasink->context, (void *)aa_resize); + aa_autoinitkbd (aasink->context, 0); + aa_resizehandler (aasink->context, (void *) aa_resize); GST_FLAG_SET (aasink, GST_AASINK_OPEN); @@ -530,9 +515,9 @@ gst_aasink_open (GstAASink *aasink) } static void -gst_aasink_close (GstAASink *aasink) +gst_aasink_close (GstAASink * aasink) { - g_return_if_fail (GST_FLAG_IS_SET (aasink ,GST_AASINK_OPEN)); + g_return_if_fail (GST_FLAG_IS_SET (aasink, GST_AASINK_OPEN)); aa_close (aasink->context); @@ -540,7 +525,7 @@ gst_aasink_close (GstAASink *aasink) } static GstElementStateReturn -gst_aasink_change_state (GstElement *element) +gst_aasink_change_state (GstElement * element) { g_return_val_if_fail (GST_IS_AASINK (element), GST_STATE_FAILURE); @@ -550,7 +535,7 @@ gst_aasink_change_state (GstElement *element) } else { if (!GST_FLAG_IS_SET (element, GST_AASINK_OPEN)) { if (!gst_aasink_open (GST_AASINK (element))) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } @@ -561,7 +546,7 @@ gst_aasink_change_state (GstElement *element) } static gboolean -plugin_init (GstPlugin *plugin) +plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "aasink", GST_RANK_NONE, GST_TYPE_AASINK)) return FALSE; @@ -569,14 +554,8 @@ plugin_init (GstPlugin *plugin) return TRUE; } -GST_PLUGIN_DEFINE ( - GST_VERSION_MAJOR, - GST_VERSION_MINOR, - "aasink", - "ASCII Art video sink", - plugin_init, - VERSION, - "GPL", - GST_PACKAGE, - GST_ORIGIN -) +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, + GST_VERSION_MINOR, + "aasink", + "ASCII Art video sink", + plugin_init, VERSION, "GPL", GST_PACKAGE, GST_ORIGIN) diff --git a/ext/aalib/gstaasink.h b/ext/aalib/gstaasink.h index e50362f6c..d11ff20e0 100644 --- a/ext/aalib/gstaasink.h +++ b/ext/aalib/gstaasink.h @@ -26,8 +26,9 @@ #include <aalib.h> #ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ +extern "C" +{ +#endif /* __cplusplus */ #define GST_TYPE_AASINK \ @@ -41,48 +42,51 @@ extern "C" { #define GST_IS_AASINK_CLASS(obj) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AASINK)) -typedef enum { - GST_AASINK_OPEN = GST_ELEMENT_FLAG_LAST, + typedef enum + { + GST_AASINK_OPEN = GST_ELEMENT_FLAG_LAST, - GST_AASINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, -} GstAASinkFlags; + GST_AASINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2, + } GstAASinkFlags; -typedef struct _GstAASink GstAASink; -typedef struct _GstAASinkClass GstAASinkClass; + typedef struct _GstAASink GstAASink; + typedef struct _GstAASinkClass GstAASinkClass; -struct _GstAASink { - GstElement element; + struct _GstAASink + { + GstElement element; - GstPad *sinkpad; + GstPad *sinkpad; - gulong format; - gint width, height; + gulong format; + gint width, height; - gint frames_displayed; - guint64 frame_time; + gint frames_displayed; + guint64 frame_time; - GstClock *clock; + GstClock *clock; - aa_context *context; - struct aa_hardware_params ascii_surf; - struct aa_renderparams ascii_parms; - aa_palette palette; - gint aa_driver; -}; + aa_context *context; + struct aa_hardware_params ascii_surf; + struct aa_renderparams ascii_parms; + aa_palette palette; + gint aa_driver; + }; -struct _GstAASinkClass { - GstElementClass parent_class; + struct _GstAASinkClass + { + GstElementClass parent_class; - /* signals */ - void (*frame_displayed) (GstElement *element); - void (*have_size) (GstElement *element, guint width, guint height); -}; + /* signals */ + void (*frame_displayed) (GstElement * element); + void (*have_size) (GstElement * element, guint width, guint height); + }; -GType gst_aasink_get_type(void); + GType gst_aasink_get_type (void); #ifdef __cplusplus } -#endif /* __cplusplus */ +#endif /* __cplusplus */ -#endif /* __GST_AASINKE_H__ */ +#endif /* __GST_AASINKE_H__ */ |