summaryrefslogtreecommitdiffstats
path: root/sys/glsink
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-03-15 19:32:27 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-03-15 19:32:27 +0000
commit4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69 (patch)
tree8f41b30e571aa6ed88b53f5471d5e38461136e60 /sys/glsink
parent9f4226fe55f09cf5809376b467aa3f46dbf7b5c2 (diff)
downloadgst-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 'sys/glsink')
-rw-r--r--sys/glsink/gstgl_nvimage.c20
-rw-r--r--sys/glsink/gstgl_pdrimage.c24
-rw-r--r--sys/glsink/gstgl_rgbimage.c30
-rw-r--r--sys/glsink/gstglsink.c81
-rw-r--r--sys/glsink/gstglxwindow.c26
-rw-r--r--sys/glsink/regcomb_yuvrgb.c39
6 files changed, 111 insertions, 109 deletions
diff --git a/sys/glsink/gstgl_nvimage.c b/sys/glsink/gstgl_nvimage.c
index 1aab5c4f..38e6dece 100644
--- a/sys/glsink/gstgl_nvimage.c
+++ b/sys/glsink/gstgl_nvimage.c
@@ -55,7 +55,7 @@ typedef struct _GstNvImage GstNvImage;
struct _GstNvImage
{
GstImageData data;
- int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem
+ int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem
GstGLImageConnection *conn;
};
@@ -154,10 +154,10 @@ gst_gl_nvimage_get_caps (GstImageInfo * info)
}
caps = gst_caps_append (caps, GST_CAPS_NEW ("nvimage_caps",
- "video/x-raw-yuv",
- "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'V', '1', '2')),
- "width", GST_PROPS_INT_RANGE (0, 1024),
- "height", GST_PROPS_INT_RANGE (0, 1024))
+ "video/x-raw-yuv",
+ "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'V', '1', '2')),
+ "width", GST_PROPS_INT_RANGE (0, 1024),
+ "height", GST_PROPS_INT_RANGE (0, 1024))
);
g_warning ("nvimage returns caps !\n");
return caps;
@@ -190,7 +190,7 @@ gst_gl_nvimage_set_caps (GstImageInfo * info, GstCaps * caps)
GST_DEBUG ("GL_NVImage: Format is invalid !\n");
return NULL;
}
- if (0) //conn->port == (XvPortID) -1)
+ if (0) //conn->port == (XvPortID) -1)
{
/* this happens if the plugin can't handle the caps, so no warning */
g_free (conn);
@@ -266,7 +266,7 @@ gst_gl_nvimage_put_image (GstImageInfo * info, GstImageData * image)
if (xinfo->info.demo) {
//g_print("Putting image, context is %p\n", glXGetCurrentContext());
- glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead
+ glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead
glRotatef (180.0 * sin (xinfo->rotX), 1, 0, 0);
glRotatef (180.0 * cos (xinfo->rotY), 0, 1, 0);
@@ -348,11 +348,11 @@ gst_gl_nvimage_put_image (GstImageInfo * info, GstImageData * image)
printf ("Recording frame #%d\n", framenr);
glReadPixels (0, 0, img_width, img_height, GL_RGB, GL_UNSIGNED_BYTE,
- cap_image_data);
+ cap_image_data);
// invert the pixels
for (i = 0; i < img_height; i++)
memcpy (cap_image_data2 + i * img_width * 3,
- cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3);
+ cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3);
sprintf (capfilename, "cap%04d.ppm", framenr);
FILE *outfile = fopen (capfilename, "wb");
@@ -363,7 +363,7 @@ gst_gl_nvimage_put_image (GstImageInfo * info, GstImageData * image)
fprintf (outfile, "%d %d\n", img_width, img_height);
fprintf (outfile, "255\n");
fwrite (cap_image_data2, sizeof (char), img_width * img_height * 3,
- outfile);
+ outfile);
fclose (outfile);
}
framenr++;
diff --git a/sys/glsink/gstgl_pdrimage.c b/sys/glsink/gstgl_pdrimage.c
index 20582ebf..82ac254a 100644
--- a/sys/glsink/gstgl_pdrimage.c
+++ b/sys/glsink/gstgl_pdrimage.c
@@ -55,7 +55,7 @@ typedef struct _GstNvImage GstNvImage;
struct _GstNvImage
{
GstImageData data;
- int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem
+ int slot; // < AGP_BUFSLOTS: allocated from AGP mem, otherwise from CPU mem
GstGLImageConnection *conn;
};
@@ -143,10 +143,10 @@ gst_gl_nvimage_get_caps (GstImageInfo * info)
}
caps = gst_caps_append (caps, GST_CAPS_NEW ("xvimage_caps",
- "video/raw",
- "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'C', '1', '2')),
- "width", GST_PROPS_INT_RANGE (0, 1024),
- "height", GST_PROPS_INT_RANGE (0, 1024))
+ "video/raw",
+ "format", GST_PROPS_FOURCC (GST_MAKE_FOURCC ('Y', 'C', '1', '2')),
+ "width", GST_PROPS_INT_RANGE (0, 1024),
+ "height", GST_PROPS_INT_RANGE (0, 1024))
);
return caps;
}
@@ -178,7 +178,7 @@ gst_gl_nvimage_set_caps (GstImageInfo * info, GstCaps * caps)
GST_DEBUG (GST_CAT_PLUGIN_INFO, "GL_NVImage: Format is invalid !\n");
return NULL;
}
- if (0) //conn->port == (XvPortID) -1)
+ if (0) //conn->port == (XvPortID) -1)
{
/* this happens if the plugin can't handle the caps, so no warning */
g_free (conn);
@@ -216,15 +216,15 @@ gst_gl_nvimage_get_image (GstImageInfo * info, GstImageConnection * conn)
image->data.size = nvconn->w * nvconn->h * 3 / 2;
- if (slot < AGP_BUFSLOTS) // found an AGP buffer slot
+ if (slot < AGP_BUFSLOTS) // found an AGP buffer slot
{
image->data.data = nvconn->m_memory + slot * YUVTEX_SIZE;
- image->slot = slot; // store for freeing
- nvconn->m_bufslots[slot] = 1; // it is now taken
+ image->slot = slot; // store for freeing
+ nvconn->m_bufslots[slot] = 1; // it is now taken
} else {
g_warning ("Allocating from main memory !");
image->data.data = g_malloc (image->data.size);
- image->slot = AGP_BUFSLOTS; // no AGP slot
+ image->slot = AGP_BUFSLOTS; // no AGP slot
}
image->conn = nvconn;
@@ -325,13 +325,13 @@ gst_gl_nvimage_open_conn (GstImageConnection * conn, GstImageInfo * info)
if (!xconn->m_memory) {
printf
- ("Unable to acquire graphics card mem... will acquire in normal memory.\n");
+ ("Unable to acquire graphics card mem... will acquire in normal memory.\n");
for (slot = 0; slot < AGP_BUFSLOTS; slot++)
xconn->m_bufslots[slot] = 1;
} else {
// maybe this fast writable memory, awfully slow to read from, though
glPixelDataRangeNV (GL_WRITE_PIXEL_DATA_RANGE_NV,
- AGP_BUFSLOTS * YUVTEX_SIZE, xconn->m_memory);
+ AGP_BUFSLOTS * YUVTEX_SIZE, xconn->m_memory);
glEnableClientState (GL_WRITE_PIXEL_DATA_RANGE_NV);
for (slot = 0; slot < AGP_BUFSLOTS; slot++)
diff --git a/sys/glsink/gstgl_rgbimage.c b/sys/glsink/gstgl_rgbimage.c
index 8c61e390..f836bc50 100644
--- a/sys/glsink/gstgl_rgbimage.c
+++ b/sys/glsink/gstgl_rgbimage.c
@@ -32,8 +32,8 @@ typedef struct _GstGLImageConnection GstGLImageConnection;
struct _GstGLImageConnection
{
GstImageConnection conn;
- Display *dpy; // the Xlib drawing context
- GLXContext ctx; // The GLX drawing context
+ Display *dpy; // the Xlib drawing context
+ GLXContext ctx; // The GLX drawing context
gint w, h;
gint bpp;
@@ -131,15 +131,15 @@ gst_gl_rgbimage_get_caps (GstImageInfo * info)
100, 100, xpad, (attrib.depth + 7) / 8 * 100);
if (ximage != NULL) {
caps =
- GST_CAPS_NEW ("forcing Video RGB", "video/x-raw-rgb", "format",
- GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")), "depth", GST_PROPS_INT (24),
- "bpp", GST_PROPS_INT (24), "red_mask", GST_PROPS_INT (0xff),
- "green_mask", GST_PROPS_INT (0xff00), "blue_mask",
- GST_PROPS_INT (0xff0000), "endianness", GST_PROPS_INT (G_BIG_ENDIAN),
- /*= 1234/4321 (INT) <- endianness */
- "width", GST_PROPS_INT_RANGE (0, TEX_XSIZE), /* can't have videos larger than TEX_SIZE */
- "height", GST_PROPS_INT_RANGE (0, TEX_YSIZE)
- );
+ GST_CAPS_NEW ("forcing Video RGB", "video/x-raw-rgb", "format",
+ GST_PROPS_FOURCC (GST_STR_FOURCC ("RGB ")), "depth", GST_PROPS_INT (24),
+ "bpp", GST_PROPS_INT (24), "red_mask", GST_PROPS_INT (0xff),
+ "green_mask", GST_PROPS_INT (0xff00), "blue_mask",
+ GST_PROPS_INT (0xff0000), "endianness", GST_PROPS_INT (G_BIG_ENDIAN),
+ /*= 1234/4321 (INT) <- endianness */
+ "width", GST_PROPS_INT_RANGE (0, TEX_XSIZE), /* can't have videos larger than TEX_SIZE */
+ "height", GST_PROPS_INT_RANGE (0, TEX_YSIZE)
+ );
XDestroyImage (ximage);
}
@@ -260,7 +260,7 @@ gst_gl_rgbimage_put_image (GstImageInfo * info, GstImageData * image)
glEnable (GL_TEXTURE_2D);
if (xinfo->info.demo) {
- glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead
+ glTranslatef (0.0, 0.0, -5.0); // make it avoid the clipping plane, zoom 2.0 instead
glRotatef (180.0 * sin (xinfo->rotX), 1, 0, 0);
glRotatef (180.0 * cos (xinfo->rotY), 0, 1, 0);
@@ -321,11 +321,11 @@ gst_gl_rgbimage_put_image (GstImageInfo * info, GstImageData * image)
printf ("Recording frame #%d\n", framenr);
glReadPixels (0, 0, img_width, img_height, GL_RGB, GL_UNSIGNED_BYTE,
- cap_image_data);
+ cap_image_data);
// invert the pixels
for (i = 0; i < img_height; i++)
memcpy (cap_image_data2 + i * img_width * 3,
- cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3);
+ cap_image_data + (img_height - 1 - i) * img_width * 3, img_width * 3);
sprintf (capfilename, "cap%04d.ppm", framenr);
FILE *outfile = fopen (capfilename, "wb");
@@ -336,7 +336,7 @@ gst_gl_rgbimage_put_image (GstImageInfo * info, GstImageData * image)
fprintf (outfile, "%d %d\n", img_width, img_height);
fprintf (outfile, "255\n");
fwrite (cap_image_data2, sizeof (char), img_width * img_height * 3,
- outfile);
+ outfile);
fclose (outfile);
}
framenr++;
diff --git a/sys/glsink/gstglsink.c b/sys/glsink/gstglsink.c
index a545c2a8..6773b31f 100644
--- a/sys/glsink/gstglsink.c
+++ b/sys/glsink/gstglsink.c
@@ -56,13 +56,13 @@ GST_PAD_TEMPLATE_FACTORY (gst_glsink_sink_template_factory,
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_NEW ("glsink_rgbsink", "video/x-raw-rgb",
- "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
- "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "height", GST_PROPS_INT_RANGE (0, G_MAXINT)),
+ "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
+ "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "height", GST_PROPS_INT_RANGE (0, G_MAXINT)),
GST_CAPS_NEW ("glsink_yuvsink", "video/x-raw-yuv",
- "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
- "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
- "height", GST_PROPS_INT_RANGE (0, G_MAXINT))
+ "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT),
+ "width", GST_PROPS_INT_RANGE (0, G_MAXINT),
+ "height", GST_PROPS_INT_RANGE (0, G_MAXINT))
)
/* glsink signals and args */
@@ -106,9 +106,9 @@ GST_PAD_TEMPLATE_FACTORY (gst_glsink_sink_template_factory,
guint64 frame_time;
gint width, height;
gboolean muted;
- gint demo; // some kind of fun demo mode to let GL show its 3D capabilities
- gboolean dumpvideo; // dump the video down to .ppm:s
- GstBuffer *last_image; /* not thread safe ? */
+ gint demo; // some kind of fun demo mode to let GL show its 3D capabilities
+ gboolean dumpvideo; // dump the video down to .ppm:s
+ GstBuffer *last_image; /* not thread safe ? */
GstClock *clock;
@@ -189,9 +189,10 @@ GST_PAD_TEMPLATE_FACTORY (gst_glsink_sink_template_factory,
0,
(GInstanceInitFunc) gst_glsink_init,
};
+
videosink_type =
- g_type_register_static (GST_TYPE_ELEMENT, "GstGLSink", &videosink_info,
- 0);
+ g_type_register_static (GST_TYPE_ELEMENT, "GstGLSink", &videosink_info,
+ 0);
}
return videosink_type;
}
@@ -218,25 +219,25 @@ gst_glsink_class_init (GstGLSinkClass * klass)
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
- g_object_class_install_property (gobject_class, ARG_WIDTH, g_param_spec_int ("width", "Width", "The video width", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */
- g_object_class_install_property (gobject_class, ARG_HEIGHT, g_param_spec_int ("height", "Height", "The video height", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */
- g_object_class_install_property (gobject_class, ARG_FRAMES_DISPLAYED, g_param_spec_int ("frames_displayed", "Frames Displayed", "The number of frames displayed so far", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (gobject_class, ARG_FRAME_TIME, g_param_spec_int ("frame_time", "Frame time", "The interval between frames", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (gobject_class, ARG_WIDTH, g_param_spec_int ("width", "Width", "The video width", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */
+ g_object_class_install_property (gobject_class, ARG_HEIGHT, g_param_spec_int ("height", "Height", "The video height", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */
+ g_object_class_install_property (gobject_class, ARG_FRAMES_DISPLAYED, g_param_spec_int ("frames_displayed", "Frames Displayed", "The number of frames displayed so far", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (gobject_class, ARG_FRAME_TIME, g_param_spec_int ("frame_time", "Frame time", "The interval between frames", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */
g_object_class_install_property (gobject_class, ARG_HOOK,
g_param_spec_pointer ("hook", "Hook", "The object receiving the output",
- G_PARAM_WRITABLE));
+ G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class, ARG_MUTE,
g_param_spec_boolean ("mute", "Mute", "mute the output ?", FALSE,
- G_PARAM_READWRITE));
+ G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_REPAINT,
g_param_spec_boolean ("repaint", "Repaint", "repaint the current frame",
- FALSE, G_PARAM_WRITABLE));
+ FALSE, G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class, ARG_DEMO,
g_param_spec_int ("demo", "Demo", "demo mode (shows 3D capabilities)", 0,
- 1, 0, G_PARAM_READWRITE));
+ 1, 0, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_DUMP,
g_param_spec_boolean ("dump", "Dump",
- "stores sequence of frames in .ppm files", FALSE, G_PARAM_READWRITE));
+ "stores sequence of frames in .ppm files", FALSE, G_PARAM_READWRITE));
gobject_class->set_property = gst_glsink_set_property;
gobject_class->get_property = gst_glsink_get_property;
@@ -366,7 +367,7 @@ gst_glsink_buffer_free (GstBufferPool * pool, GstBuffer * buffer,
{
GstGLSink *sink =
GST_GLSINK (gst_buffer_pool_get_user_data (GST_BUFFER_BUFFERPOOL
- (buffer)));
+ (buffer)));
gst_glsink_append_cache (sink,
(GstImageData *) GST_BUFFER_POOL_PRIVATE (buffer));
@@ -463,8 +464,8 @@ gst_glsink_getcaps (GstPad * pad, GstCaps * caps)
gst_glxwindow_hook_context (sink->hook);
while (list) {
ret =
- gst_caps_append (ret,
- ((GstImagePlugin *) list->data)->get_caps (sink->hook));
+ gst_caps_append (ret,
+ ((GstImagePlugin *) list->data)->get_caps (sink->hook));
list = g_list_next (list);
}
@@ -499,7 +500,7 @@ gst_glsink_chain (GstPad * pad, GstData * _data)
switch (GST_EVENT_TYPE (event)) {
default:
- gst_pad_event_default (pad, event);
+ gst_pad_event_default (pad, event);
}
return;
}
@@ -518,11 +519,11 @@ gst_glsink_chain (GstPad * pad, GstData * _data)
frame_drops++;
return;
}
- frame_drops = 0; // we made it - reset time
+ frame_drops = 0; // we made it - reset time
GstClockReturn ret;
GstClockID id =
- gst_clock_new_single_shot_id (sink->clock, GST_BUFFER_TIMESTAMP (buf));
+ gst_clock_new_single_shot_id (sink->clock, GST_BUFFER_TIMESTAMP (buf));
ret = gst_element_clock_wait (GST_ELEMENT (sink), id, NULL);
gst_clock_id_free (id);
@@ -552,7 +553,7 @@ gst_glsink_chain (GstPad * pad, GstData * _data)
glClearDepth (1.0f);
glClearColor (0, 0, 0, 0);
- glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals
+ glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals
glDisable (GL_BLEND);
glDisable (GL_CULL_FACE);
@@ -594,19 +595,19 @@ gst_glsink_chain (GstPad * pad, GstData * _data)
sink->hook->dumpvideo = sink->dumpvideo;
sink->plugin->put_image (sink->hook,
- (GstImageData *) GST_BUFFER_POOL_PRIVATE (buf));
+ (GstImageData *) GST_BUFFER_POOL_PRIVATE (buf));
sink->last_image = buf;
} else {
buffer =
- gst_buffer_new_from_pool (gst_glsink_get_bufferpool (sink->sinkpad),
- 0, GST_BUFFER_SIZE (buf));
+ gst_buffer_new_from_pool (gst_glsink_get_bufferpool (sink->sinkpad),
+ 0, GST_BUFFER_SIZE (buf));
memcpy (GST_BUFFER_DATA (buffer), GST_BUFFER_DATA (buf),
- GST_BUFFER_SIZE (buf) >
- GST_BUFFER_SIZE (buffer) ? GST_BUFFER_SIZE (buffer) :
- GST_BUFFER_SIZE (buf));
+ GST_BUFFER_SIZE (buf) >
+ GST_BUFFER_SIZE (buffer) ? GST_BUFFER_SIZE (buffer) :
+ GST_BUFFER_SIZE (buf));
sink->plugin->put_image (sink->hook,
- (GstImageData *) GST_BUFFER_POOL_PRIVATE (buffer));
+ (GstImageData *) GST_BUFFER_POOL_PRIVATE (buffer));
sink->last_image = buffer;
gst_buffer_unref (buf);
@@ -640,7 +641,7 @@ gst_glsink_set_property (GObject * object, guint prop_id, const GValue * value,
break;
case ARG_HOOK:
if (sink->hook) {
- sink->hook->free_info (sink->hook);
+ sink->hook->free_info (sink->hook);
}
sink->hook = g_value_get_pointer (value);
break;
@@ -658,8 +659,8 @@ gst_glsink_set_property (GObject * object, guint prop_id, const GValue * value,
break;
case ARG_REPAINT:
if (sink->last_image != NULL) {
- sink->plugin->put_image (sink->hook,
- (GstImageData *) GST_BUFFER_POOL_PRIVATE (sink->last_image));
+ sink->plugin->put_image (sink->hook,
+ (GstImageData *) GST_BUFFER_POOL_PRIVATE (sink->last_image));
}
break;
default:
@@ -732,10 +733,10 @@ gst_glsink_change_state (GstElement * element)
break;
case GST_STATE_PAUSED_TO_READY:
if (sink->conn)
- sink->conn->close_conn (sink->conn, sink->hook);
+ sink->conn->close_conn (sink->conn, sink->hook);
if (sink->last_image) {
- gst_buffer_unref (sink->last_image);
- sink->last_image = NULL;
+ gst_buffer_unref (sink->last_image);
+ sink->last_image = NULL;
}
break;
case GST_STATE_READY_TO_NULL:
diff --git a/sys/glsink/gstglxwindow.c b/sys/glsink/gstglxwindow.c
index 8fdacb2f..cc4da88c 100644
--- a/sys/glsink/gstglxwindow.c
+++ b/sys/glsink/gstglxwindow.c
@@ -17,7 +17,7 @@
#include <GL/gl.h>
#include <GL/glu.h>
#include "gstglsink.h"
-#include <string.h> /* strncmp */
+#include <string.h> /* strncmp */
/* attributes for a single buffered visual in RGBA format with at least
* 4 bits per color and a 16 bit depth buffer */
@@ -41,9 +41,9 @@ static int attrListDbl[] = {
};
-GLfloat LightAmbient[] = { 0.1, 0.1, 0.1, 1.0 }; /* reddish ambient light */
-GLfloat LightDiffuse[] = { 0.6, 0.6, 0.6, 1.0 }; /* bluish diffuse light. */
-GLfloat LightPosition[] = { 1.5, 1.5, 1.5, 0.0 }; /* position */
+GLfloat LightAmbient[] = { 0.1, 0.1, 0.1, 1.0 }; /* reddish ambient light */
+GLfloat LightDiffuse[] = { 0.6, 0.6, 0.6, 1.0 }; /* bluish diffuse light. */
+GLfloat LightPosition[] = { 1.5, 1.5, 1.5, 0.0 }; /* position */
void
@@ -202,10 +202,10 @@ gst_glxwindow_new (GstElement * sink)
{
/* create a window in window mode */
new->attr.event_mask = ExposureMask | KeyPressMask | ButtonPressMask |
- StructureNotifyMask;
+ StructureNotifyMask;
new->win = XCreateWindow (new->dpy, RootWindow (new->dpy, vi->screen),
- new->x, new->y, new->width, new->height, 0, vi->depth, InputOutput,
- vi->visual, CWBorderPixel | CWColormap | CWEventMask, &new->attr);
+ new->x, new->y, new->width, new->height, 0, vi->depth, InputOutput,
+ vi->visual, CWBorderPixel | CWColormap | CWEventMask, &new->attr);
if (!new->win) {
g_warning ("create window failed\n");
g_free (new);
@@ -215,7 +215,7 @@ gst_glxwindow_new (GstElement * sink)
wmDelete = XInternAtom (new->dpy, "WM_DELETE_WINDOW", True);
XSetWMProtocols (new->dpy, new->win, &wmDelete, 1);
XSetStandardProperties (new->dpy, new->win, title,
- title, None, NULL, 0, NULL);
+ title, None, NULL, 0, NULL);
XMapRaised (new->dpy, new->win);
}
/* connect the glx-context to the window */
@@ -238,14 +238,14 @@ gst_glxwindow_new (GstElement * sink)
glClearDepth (1.0f);
glClearColor (0, 0, 0, 0);
- glLightfv (GL_LIGHT0, GL_AMBIENT, LightAmbient); /* add lighting. (ambient) */
- glLightfv (GL_LIGHT0, GL_DIFFUSE, LightDiffuse); /* add lighting. (diffuse). */
- glLightfv (GL_LIGHT0, GL_POSITION, LightPosition); /* set light position. */
+ glLightfv (GL_LIGHT0, GL_AMBIENT, LightAmbient); /* add lighting. (ambient) */
+ glLightfv (GL_LIGHT0, GL_DIFFUSE, LightDiffuse); /* add lighting. (diffuse). */
+ glLightfv (GL_LIGHT0, GL_POSITION, LightPosition); /* set light position. */
//glEnable(GL_LIGHT0); // Quick And Dirty Lighting (Assumes Light0 Is Set Up)
//glEnable(GL_LIGHTING); // Enable Lighting
- glDisable (GL_COLOR_MATERIAL); // Enable Material Coloring
- glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals
+ glDisable (GL_COLOR_MATERIAL); // Enable Material Coloring
+ glEnable (GL_AUTO_NORMAL); // let OpenGL generate the Normals
glDisable (GL_BLEND);
diff --git a/sys/glsink/regcomb_yuvrgb.c b/sys/glsink/regcomb_yuvrgb.c
index 54727d1e..151b8e18 100644
--- a/sys/glsink/regcomb_yuvrgb.c
+++ b/sys/glsink/regcomb_yuvrgb.c
@@ -29,22 +29,23 @@ unsigned int UVwidth = 256, UVheight = 512;
int tex_xsize, tex_ysize;
void
-GenerateRGBTables (unsigned char *Ytable, // Y-palette
- unsigned char *Utable, // U-palette
- unsigned char *Vtable, // V-palette
- float *bias, // bias (fourth vector to be added)
- float *Uscale, // scaling color for U
- float *Vscale) // scaling color for V
+GenerateRGBTables (unsigned char *Ytable, // Y-palette
+ unsigned char *Utable, // U-palette
+ unsigned char *Vtable, // V-palette
+ float *bias, // bias (fourth vector to be added)
+ float *Uscale, // scaling color for U
+ float *Vscale) // scaling color for V
{
int i;
- const float mat[9] = { // the modified YUV->RGB matrix
+ const float mat[9] = { // the modified YUV->RGB matrix
+1.130469478f, -0.058755723f, +1.596026304f,
+1.130469478f, -0.450515935f, -0.812967512f,
+1.130469478f, +1.958477882f, 0.0f
};
-#define COMPRESS(a)(0.5f*(a)+128.0f) // counter-piece to EXPAND_NORMAL
+
+#define COMPRESS(a)(0.5f*(a)+128.0f) // counter-piece to EXPAND_NORMAL
#define fCOMPRESS(a) (0.5f*(a)+0.5f);
-#define XCLAMP(a) ((a)<0.0f ? 0.0f : ((a)>255.0f ? 255.0f : (a))) // should not be necessary, but what do you know.
+#define XCLAMP(a) ((a)<0.0f ? 0.0f : ((a)>255.0f ? 255.0f : (a))) // should not be necessary, but what do you know.
bias[0] = fCOMPRESS (-0.842580964f);
bias[1] = fCOMPRESS (+0.563287723f);
bias[2] = fCOMPRESS (-1.0f);
@@ -59,17 +60,17 @@ GenerateRGBTables (unsigned char *Ytable, // Y-palette
Vscale[3] = 0.0f;
for (i = 0; i < 256; i++) {
// Y-table holds unsigned values
- Ytable[3 * i] = (unsigned char) XCLAMP (mat[0] * (float) i); // R
- Ytable[3 * i + 1] = (unsigned char) XCLAMP (mat[3] * (float) i); // G
- Ytable[3 * i + 2] = (unsigned char) XCLAMP (mat[6] * (float) i); // B
+ Ytable[3 * i] = (unsigned char) XCLAMP (mat[0] * (float) i); // R
+ Ytable[3 * i + 1] = (unsigned char) XCLAMP (mat[3] * (float) i); // G
+ Ytable[3 * i + 2] = (unsigned char) XCLAMP (mat[6] * (float) i); // B
// U-table holds signed values
- Utable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 16.0f * mat[1] * (float) i)); // R
- Utable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 120.0f * mat[4] * (float) i)); // G
- Utable[3 * i + 2] = (unsigned char) XCLAMP (COMPRESS (255.0f / 500.0f * mat[7] * (float) i)); // B
+ Utable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 16.0f * mat[1] * (float) i)); // R
+ Utable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 120.0f * mat[4] * (float) i)); // G
+ Utable[3 * i + 2] = (unsigned char) XCLAMP (COMPRESS (255.0f / 500.0f * mat[7] * (float) i)); // B
// V-table holds signed values
- Vtable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 408.0f * mat[2] * (float) i)); // R
- Vtable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 210.0f * mat[5] * (float) i)); // G
- Vtable[3 * i + 2] = (unsigned char) (128.0f - 14.0f); // G constant
+ Vtable[3 * i] = (unsigned char) XCLAMP (COMPRESS (255.0f / 408.0f * mat[2] * (float) i)); // R
+ Vtable[3 * i + 1] = (unsigned char) XCLAMP (COMPRESS (255.0f / 210.0f * mat[5] * (float) i)); // G
+ Vtable[3 * i + 2] = (unsigned char) (128.0f - 14.0f); // G constant
}
#undef fCOMPRESS
#undef COMPRESS
@@ -315,7 +316,7 @@ PowerOfTwo (unsigned int i)
// Initializes textures. Call once prior to rendering
void
-InitYUVPlanes (GLuint * Yhandle, GLuint * Uhandle, GLuint * Vhandle, unsigned int Ywidth, unsigned int Yheight, unsigned int UVwidth, unsigned int UVheight, GLenum filter, // filter should be either GL_NEAREST or GL_LINEAR. Test this!
+InitYUVPlanes (GLuint * Yhandle, GLuint * Uhandle, GLuint * Vhandle, unsigned int Ywidth, unsigned int Yheight, unsigned int UVwidth, unsigned int UVheight, GLenum filter, // filter should be either GL_NEAREST or GL_LINEAR. Test this!
unsigned char *Ypal, unsigned char *Upal, unsigned char *Vpal)
{
glGenTextures (1, Yhandle);