diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2004-03-15 19:32:27 +0000 |
commit | 4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69 (patch) | |
tree | 8f41b30e571aa6ed88b53f5471d5e38461136e60 /ext/hermes | |
parent | 9f4226fe55f09cf5809376b467aa3f46dbf7b5c2 (diff) | |
download | gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.gz gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.bz2 gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.zip |
don't mix tabs and spaces
Original commit message from CVS:
don't mix tabs and spaces
Diffstat (limited to 'ext/hermes')
-rw-r--r-- | ext/hermes/gsthermescolorspace.c | 255 |
1 files changed, 129 insertions, 126 deletions
diff --git a/ext/hermes/gsthermescolorspace.c b/ext/hermes/gsthermescolorspace.c index d6cbe965..03ea4dfe 100644 --- a/ext/hermes/gsthermescolorspace.c +++ b/ext/hermes/gsthermescolorspace.c @@ -48,7 +48,8 @@ typedef enum GST_HERMES_COLORSPACE_RGB32_I420, GST_HERMES_COLORSPACE_RGB32_YV12, GST_HERMES_COLORSPACE_420_SWAP, -} GstColorSpaceConverterType; +} +GstColorSpaceConverterType; struct _GstHermesColorspace { @@ -85,7 +86,8 @@ typedef struct _GstHermesColorspaceFormat { GstStaticCaps caps; -} GstHermesColorspaceFormat; +} +GstHermesColorspaceFormat; static GstHermesColorspaceFormat gst_hermes_colorspace_formats[] = { {GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB)}, @@ -174,125 +176,125 @@ colorspace_setup_converter (GstHermesColorspace * space, GstCaps * from_caps, gst_structure_get_int (from_struct, "bpp", &from_bpp); switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): #ifdef HAVE_HERMES - { - gint to_bpp; - - gst_structure_get_int (to_struct, "bpp", &to_bpp); - - gst_structure_get_int (from_struct, "red_mask", &space->source.r); - gst_structure_get_int (from_struct, "green_mask", &space->source.g); - gst_structure_get_int (from_struct, "blue_mask", &space->source.b); - space->source.a = 0; - space->srcbpp = space->source.bits = from_bpp; - space->source.indexed = 0; - space->source.has_colorkey = 0; - - GST_INFO ("source red mask %08x", space->source.r); - GST_INFO ("source green mask %08x", space->source.g); - GST_INFO ("source blue mask %08x", space->source.b); - GST_INFO ("source bpp %08x", space->srcbpp); - - gst_structure_get_int (to_struct, "red_mask", &space->dest.r); - gst_structure_get_int (to_struct, "green_mask", &space->dest.g); - gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); - space->dest.a = 0; - space->destbpp = space->dest.bits = to_bpp; - space->dest.indexed = 0; - space->dest.has_colorkey = 0; - - GST_INFO ("dest red mask %08x", space->dest.r); - GST_INFO ("dest green mask %08x", space->dest.g); - GST_INFO ("dest blue mask %08x", space->dest.b); - GST_INFO ("dest bpp %08x", space->destbpp); - - if (!Hermes_ConverterRequest (space->h_handle, &space->source, - &space->dest)) { - g_warning ("Hermes: could not get converter\n"); - return FALSE; - } - GST_INFO ("converter set up"); - space->type = GST_HERMES_COLORSPACE_HERMES; - return TRUE; - } + { + gint to_bpp; + + gst_structure_get_int (to_struct, "bpp", &to_bpp); + + gst_structure_get_int (from_struct, "red_mask", &space->source.r); + gst_structure_get_int (from_struct, "green_mask", &space->source.g); + gst_structure_get_int (from_struct, "blue_mask", &space->source.b); + space->source.a = 0; + space->srcbpp = space->source.bits = from_bpp; + space->source.indexed = 0; + space->source.has_colorkey = 0; + + GST_INFO ("source red mask %08x", space->source.r); + GST_INFO ("source green mask %08x", space->source.g); + GST_INFO ("source blue mask %08x", space->source.b); + GST_INFO ("source bpp %08x", space->srcbpp); + + gst_structure_get_int (to_struct, "red_mask", &space->dest.r); + gst_structure_get_int (to_struct, "green_mask", &space->dest.g); + gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); + space->dest.a = 0; + space->destbpp = space->dest.bits = to_bpp; + space->dest.indexed = 0; + space->dest.has_colorkey = 0; + + GST_INFO ("dest red mask %08x", space->dest.r); + GST_INFO ("dest green mask %08x", space->dest.g); + GST_INFO ("dest blue mask %08x", space->dest.b); + GST_INFO ("dest bpp %08x", space->destbpp); + + if (!Hermes_ConverterRequest (space->h_handle, &space->source, + &space->dest)) { + g_warning ("Hermes: could not get converter\n"); + return FALSE; + } + GST_INFO ("converter set up"); + space->type = GST_HERMES_COLORSPACE_HERMES; + return TRUE; + } #else - g_warning ("colorspace: compiled without hermes!"); - return FALSE; + g_warning ("colorspace: compiled without hermes!"); + return FALSE; #endif - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - if (from_bpp == 32) { - space->type = GST_HERMES_COLORSPACE_RGB32_YV12; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - if (from_bpp == 32) { - space->type = GST_HERMES_COLORSPACE_RGB32_I420; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", - from_bpp); - return FALSE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + if (from_bpp == 32) { + space->type = GST_HERMES_COLORSPACE_RGB32_YV12; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + if (from_bpp == 32) { + space->type = GST_HERMES_COLORSPACE_RGB32_I420; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", + from_bpp); + return FALSE; } break; } case GST_MAKE_FOURCC ('I', '4', '2', '0'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUV to RGB"); - - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_HERMES_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_HERMES_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_HERMES_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUV to RGB"); + + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_HERMES_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_HERMES_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_HERMES_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; } break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_HERMES_COLORSPACE_YUY2_I420; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - space->type = GST_HERMES_COLORSPACE_NONE; - space->destbpp = 16; - return TRUE; - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); - return FALSE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_HERMES_COLORSPACE_YUY2_I420; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + space->type = GST_HERMES_COLORSPACE_NONE; + space->destbpp = 16; + return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); + return FALSE; } break; case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YV12 to RGB"); - - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_HERMES_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_HERMES_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_HERMES_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YV12 to RGB"); + + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_hermes_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_HERMES_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_HERMES_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_HERMES_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; } break; } @@ -387,8 +389,8 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) GstCaps *fcaps; fcaps = - gst_caps_copy (gst_static_caps_get (&gst_hermes_colorspace_formats[i]. - caps)); + gst_caps_copy (gst_static_caps_get (&gst_hermes_colorspace_formats[i]. + caps)); icaps = gst_caps_intersect (caps, fcaps); if (!gst_caps_is_empty (icaps)) { @@ -413,8 +415,8 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad)); gst_caps_set_simple (othercaps, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); link_ret = gst_pad_try_set_caps (otherpad, othercaps); if (link_ret != GST_PAD_LINK_OK) { @@ -425,11 +427,11 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) if (pad == space->srcpad) { space->src_format_index = i; gst_hermes_colorspace_structure_to_hermes_format (&space->src_format, - structure); + structure); } else { space->sink_format_index = i; gst_hermes_colorspace_structure_to_hermes_format (&space->sink_format, - structure); + structure); } space->sink_stride = width * (space->sink_format.bits / 8); @@ -442,7 +444,7 @@ gst_hermes_colorspace_link (GstPad * pad, const GstCaps * caps) if (gst_pad_is_negotiated (otherpad)) { if (!Hermes_ConverterRequest (space->h_handle, &space->sink_format, - &space->src_format)) { + &space->src_format)) { g_warning ("Hermes: could not get converter\n"); return GST_PAD_LINK_REFUSED; } @@ -469,9 +471,10 @@ gst_hermes_colorspace_get_type (void) 0, (GInstanceInitFunc) gst_hermes_colorspace_init, }; + colorspace_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstHermesColorspace", - &colorspace_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstHermesColorspace", + &colorspace_info, 0); } return colorspace_type; } @@ -481,12 +484,12 @@ static GstStaticPadTemplate gst_hermes_colorspace_src_pad_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_RGBx "; " - GST_VIDEO_CAPS_BGRx "; " - GST_VIDEO_CAPS_xBGR "; " - GST_VIDEO_CAPS_BGR "; " - GST_VIDEO_CAPS_RGB "; " - GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) + GST_VIDEO_CAPS_RGBx "; " + GST_VIDEO_CAPS_BGRx "; " + GST_VIDEO_CAPS_xBGR "; " + GST_VIDEO_CAPS_BGR "; " + GST_VIDEO_CAPS_RGB "; " + GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) ); static GstStaticPadTemplate gst_hermes_colorspace_sink_pad_template = @@ -494,12 +497,12 @@ static GstStaticPadTemplate gst_hermes_colorspace_sink_pad_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_RGBx "; " - GST_VIDEO_CAPS_BGRx "; " - GST_VIDEO_CAPS_xBGR "; " - GST_VIDEO_CAPS_BGR "; " - GST_VIDEO_CAPS_RGB "; " - GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) + GST_VIDEO_CAPS_RGBx "; " + GST_VIDEO_CAPS_BGRx "; " + GST_VIDEO_CAPS_xBGR "; " + GST_VIDEO_CAPS_BGR "; " + GST_VIDEO_CAPS_RGB "; " + GST_VIDEO_CAPS_RGB_16 "; " GST_VIDEO_CAPS_RGB_15) ); static void @@ -654,7 +657,7 @@ plugin_init (GstPlugin * plugin) g_return_val_if_fail (hermes_res != 0, FALSE); if (!gst_element_register (plugin, "hermescolorspace", GST_RANK_PRIMARY, - GST_TYPE_COLORSPACE)) + GST_TYPE_COLORSPACE)) return FALSE; return TRUE; |