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 | 7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2 (patch) | |
tree | f863b467dea9559a6ec9c48affbfae11f8104164 /sys/glsink/gstgl_pdrimage.c | |
parent | a19db4bbdc4a15ea0d8f4d28e9a1302c9c3d1657 (diff) | |
download | gst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.tar.gz gst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.tar.bz2 gst-plugins-bad-7a778ee4b7ec09a1f5b2185c9cceee3910dfbdf2.zip |
gst-indent
Original commit message from CVS:
gst-indent
Diffstat (limited to 'sys/glsink/gstgl_pdrimage.c')
-rw-r--r-- | sys/glsink/gstgl_pdrimage.c | 411 |
1 files changed, 209 insertions, 202 deletions
diff --git a/sys/glsink/gstgl_pdrimage.c b/sys/glsink/gstgl_pdrimage.c index 3cc5c57f..20582ebf 100644 --- a/sys/glsink/gstgl_pdrimage.c +++ b/sys/glsink/gstgl_pdrimage.c @@ -31,15 +31,16 @@ #include "gstglsink.h" typedef struct _GstGLImageConnection GstGLImageConnection; -struct _GstGLImageConnection { +struct _GstGLImageConnection +{ GstImageConnection conn; Display *dpy; gint w, h; gint bpp; - + int ytex_id; int uvtex_id; - int septex_id; + int septex_id; unsigned char *m_memory; int m_bufslots[4]; }; @@ -54,50 +55,57 @@ 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; }; -static GstGLImageInfo * gst_gl_nvimage_info (GstImageInfo *info); -static GstGLImageConnection * gst_gl_nvimage_connection (GstImageConnection *conn); -static gboolean gst_gl_nvimage_check_xvideo (); - -static GstCaps * gst_gl_nvimage_get_caps (GstImageInfo *info); -static GstImageConnection * gst_gl_nvimage_set_caps (GstImageInfo *info, GstCaps *caps); -static GstImageData * gst_gl_nvimage_get_image (GstImageInfo *info, GstImageConnection *conn); -static void gst_gl_nvimage_put_image (GstImageInfo *info, GstImageData *image); -static void gst_gl_nvimage_free_image (GstImageData *image); -static void gst_gl_nvimage_open_conn (GstImageConnection *conn, GstImageInfo *info); -static void gst_gl_nvimage_close_conn (GstImageConnection *conn, GstImageInfo *info); -static void gst_gl_nvimage_free_conn (GstImageConnection *conn); - -GstImagePlugin* get_gl_nvimage_plugin(void) +static GstGLImageInfo *gst_gl_nvimage_info (GstImageInfo * info); +static GstGLImageConnection *gst_gl_nvimage_connection (GstImageConnection * + conn); +static gboolean gst_gl_nvimage_check_xvideo (); + +static GstCaps *gst_gl_nvimage_get_caps (GstImageInfo * info); +static GstImageConnection *gst_gl_nvimage_set_caps (GstImageInfo * info, + GstCaps * caps); +static GstImageData *gst_gl_nvimage_get_image (GstImageInfo * info, + GstImageConnection * conn); +static void gst_gl_nvimage_put_image (GstImageInfo * info, + GstImageData * image); +static void gst_gl_nvimage_free_image (GstImageData * image); +static void gst_gl_nvimage_open_conn (GstImageConnection * conn, + GstImageInfo * info); +static void gst_gl_nvimage_close_conn (GstImageConnection * conn, + GstImageInfo * info); +static void gst_gl_nvimage_free_conn (GstImageConnection * conn); + +GstImagePlugin * +get_gl_nvimage_plugin (void) { static GstImagePlugin plugin = { gst_gl_nvimage_get_caps, - gst_gl_nvimage_set_caps, - gst_gl_nvimage_get_image, - gst_gl_nvimage_put_image, - gst_gl_nvimage_free_image}; + gst_gl_nvimage_set_caps, + gst_gl_nvimage_get_image, + gst_gl_nvimage_put_image, + gst_gl_nvimage_free_image + }; return &plugin; } static GstGLImageInfo * -gst_gl_nvimage_info (GstImageInfo *info) +gst_gl_nvimage_info (GstImageInfo * info) { - if (info == NULL || info->id != GST_MAKE_FOURCC ('X', 'l', 'i', 'b')) - { + if (info == NULL || info->id != GST_MAKE_FOURCC ('X', 'l', 'i', 'b')) { return NULL; } return (GstGLImageInfo *) info; } static GstGLImageConnection * -gst_gl_nvimage_connection (GstImageConnection *conn) +gst_gl_nvimage_connection (GstImageConnection * conn) { if (conn == NULL || conn->free_conn != gst_gl_nvimage_free_conn) - return NULL; + return NULL; return (GstGLImageConnection *) conn; } @@ -105,47 +113,46 @@ gboolean gst_gl_nvimage_check_xvideo () { int ver, rel, req, ev, err; - -#if 0 + +#if 0 if (display == NULL) return FALSE; - if (Success == XvQueryExtension (display,&ver,&rel,&req,&ev,&err)) + if (Success == XvQueryExtension (display, &ver, &rel, &req, &ev, &err)) return TRUE; #endif return FALSE; } -static GstCaps * -gst_gl_nvimage_get_caps (GstImageInfo *info) +static GstCaps * +gst_gl_nvimage_get_caps (GstImageInfo * info) { gint i; int adaptors; int formats; GstCaps *caps = NULL; GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); - + /* we don't handle these image information */ - if (xinfo == NULL) return NULL; + if (xinfo == NULL) + return NULL; - if (gst_gl_nvimage_check_xvideo () == FALSE) - { - g_warning("GL_NVImage: Server has no NVidia extension support\n"); + if (gst_gl_nvimage_check_xvideo () == FALSE) { + g_warning ("GL_NVImage: Server has no NVidia extension support\n"); return NULL; } - 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)) - ); + 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)) + ); return caps; } static GstImageConnection * -gst_gl_nvimage_set_caps (GstImageInfo *info, GstCaps *caps) +gst_gl_nvimage_set_caps (GstImageInfo * info, GstCaps * caps) { gint i, j = 0; int adaptors; @@ -153,78 +160,75 @@ gst_gl_nvimage_set_caps (GstImageInfo *info, GstCaps *caps) GstGLImageConnection *conn; GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); guint32 format; - + /* we don't handle these image information */ - if (xinfo == NULL) return NULL; - + if (xinfo == NULL) + return NULL; + conn = g_new0 (GstGLImageConnection, 1); conn->conn.open_conn = gst_gl_nvimage_open_conn; conn->conn.close_conn = gst_gl_nvimage_close_conn; conn->conn.free_conn = gst_gl_nvimage_free_conn; - gst_caps_get (caps, - "width", &conn->w, - "height", &conn->h, - "format", &format, - NULL); + gst_caps_get (caps, + "width", &conn->w, "height", &conn->h, "format", &format, NULL); // maybe I should a bit more checking here, e.g. maximum size smaller than maximum texture extents - if (format != GST_MAKE_FOURCC ('R', 'G', 'B', ' ')) - { - GST_DEBUG (GST_CAT_PLUGIN_INFO, "GL_NVImage: Format is invalid !\n"); - return NULL; - } - if (0) //conn->port == (XvPortID) -1) + if (format != GST_MAKE_FOURCC ('R', 'G', 'B', ' ')) { + GST_DEBUG (GST_CAT_PLUGIN_INFO, "GL_NVImage: Format is invalid !\n"); + return NULL; + } + if (0) //conn->port == (XvPortID) -1) { /* this happens if the plugin can't handle the caps, so no warning */ g_free (conn); return NULL; } - - GST_DEBUG (GST_CAT_PLUGIN_INFO, "GL_NVImage: caps %p are ok, creating image", caps); + + GST_DEBUG (GST_CAT_PLUGIN_INFO, "GL_NVImage: caps %p are ok, creating image", + caps); return (GstImageConnection *) conn; } static GstImageData * -gst_gl_nvimage_get_image (GstImageInfo *info, GstImageConnection *conn) +gst_gl_nvimage_get_image (GstImageInfo * info, GstImageConnection * conn) { GstNvImage *image; - GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); - GstGLImageConnection *nvconn = gst_gl_nvimage_connection (conn); + GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); + GstGLImageConnection *nvconn = gst_gl_nvimage_connection (conn); int slot = 0; - + /* checks */ - if (xinfo == NULL) return NULL; - if (nvconn == NULL) return NULL; + if (xinfo == NULL) + return NULL; + if (nvconn == NULL) + return NULL; // I should also check the current GLX context ! // Ah, Don't have to, I am guarantueed to always be in the same thread - image = g_new0(GstNvImage, 1); - - for (slot = 0; slot < AGP_BUFSLOTS; slot++) - { - if (!nvconn->m_bufslots[slot]) break; - } - - image->data.size = nvconn->w * nvconn->h * 3/2; - - 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 - } - else - { - g_warning("Allocating from main memory !"); - image->data.data = g_malloc(image->data.size); - image->slot = AGP_BUFSLOTS; // no AGP slot - } - image->conn = nvconn; + image = g_new0 (GstNvImage, 1); - if (image->data.data == NULL) + for (slot = 0; slot < AGP_BUFSLOTS; slot++) { + if (!nvconn->m_bufslots[slot]) + break; + } + + image->data.size = nvconn->w * nvconn->h * 3 / 2; + + 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 + } else { + g_warning ("Allocating from main memory !"); + image->data.data = g_malloc (image->data.size); + image->slot = AGP_BUFSLOTS; // no AGP slot + } + image->conn = nvconn; + + if (image->data.data == NULL) { g_warning ("GL_NvImage: data allocation failed!"); g_free (image); return NULL; @@ -233,166 +237,169 @@ gst_gl_nvimage_get_image (GstImageInfo *info, GstImageConnection *conn) return (GstImageData *) image; } -static void -gst_gl_nvimage_put_image (GstImageInfo *info, GstImageData *image) +static void +gst_gl_nvimage_put_image (GstImageInfo * info, GstImageData * image) { GstNvImage *im = (GstNvImage *) image; - GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); - + GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); + /* checks omitted for speed (and lazyness), do we need them? */ g_assert (xinfo != NULL); - + /* Upload the texture here */ - g_warning("PUTTING IMAGE - BROOOKEN"); + g_warning ("PUTTING IMAGE - BROOOKEN"); // both upload the video, and redraw the screen - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); + glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable(GL_TEXTURE_2D); + glEnable (GL_TEXTURE_2D); - glPushMatrix(); + glPushMatrix (); //glTranslatef(0,1,0); - glRotatef(xinfo->rotX-250,1,0,0); - glRotatef(xinfo->rotY,0,1,0); + glRotatef (xinfo->rotX - 250, 1, 0, 0); + glRotatef (xinfo->rotY, 0, 1, 0); int zoom = xinfo->zoom; - glScaled(zoom,zoom,zoom); + + glScaled (zoom, zoom, zoom); //Draws the surface rectangle - glBindTexture(GL_TEXTURE_2D, im->conn->ytex_id); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, im->conn->w, im->conn->h, GL_RGBA, - GL_UNSIGNED_BYTE, im->data.data); - float xmax = (float)im->conn->w/TEX_XSIZE; - float ymax = (float)im->conn->h/TEX_YSIZE; + glBindTexture (GL_TEXTURE_2D, im->conn->ytex_id); + glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, im->conn->w, im->conn->h, GL_RGBA, + GL_UNSIGNED_BYTE, im->data.data); + float xmax = (float) im->conn->w / TEX_XSIZE; + float ymax = (float) im->conn->h / TEX_YSIZE; + + glColor4f (1, 1, 1, 1); + glBegin (GL_QUADS); - glColor4f(1,1,1,1); - glBegin(GL_QUADS); + glNormal3f (0, -1, 0); - glNormal3f(0, -1, 0); - - glTexCoord2f(xmax, 0); - glVertex3f(4,0,-4); + glTexCoord2f (xmax, 0); + glVertex3f (4, 0, -4); - glTexCoord2f(0, 0); - glVertex3f(-4,0,-4); + glTexCoord2f (0, 0); + glVertex3f (-4, 0, -4); - glTexCoord2f(0, ymax); - glVertex3f(-4,0,4); + glTexCoord2f (0, ymax); + glVertex3f (-4, 0, 4); - glTexCoord2f(xmax, ymax); - glVertex3f(4,0,4); + glTexCoord2f (xmax, ymax); + glVertex3f (4, 0, 4); - glEnd(); + glEnd (); - glPopMatrix(); + glPopMatrix (); - glXSwapBuffers(xinfo->dpy, xinfo->win); + glXSwapBuffers (xinfo->dpy, xinfo->win); } -static void -gst_gl_nvimage_free_image (GstImageData *image) +static void +gst_gl_nvimage_free_image (GstImageData * image) { GstNvImage *im = (GstNvImage *) image; + g_return_if_fail (im != NULL); - GstGLImageConnection *nvconn = im->conn; + GstGLImageConnection *nvconn = im->conn; - if (im->slot < AGP_BUFSLOTS) - { - nvconn->m_bufslots[im->slot] = 0; - } - else - g_free(im->data.data); + if (im->slot < AGP_BUFSLOTS) { + nvconn->m_bufslots[im->slot] = 0; + } else + g_free (im->data.data); g_free (im); } static void -gst_gl_nvimage_open_conn (GstImageConnection *conn, GstImageInfo *info) +gst_gl_nvimage_open_conn (GstImageConnection * conn, GstImageInfo * info) { - GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); + GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); GstGLImageConnection *xconn = gst_gl_nvimage_connection (conn); - unsigned char data_sep[2][2] = {{0, 255}, {0, 255}}; + unsigned char data_sep[2][2] = { {0, 255}, {0, 255} }; int slot; - g_warning("Opening NVidia Connection"); - xconn->m_memory = (unsigned char*)glXAllocateMemoryNV(AGP_BUFSLOTS*YUVTEX_SIZE, 0, 1.0, 1.0); - - if (!xconn->m_memory) - { - printf("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); - glEnableClientState(GL_WRITE_PIXEL_DATA_RANGE_NV); - - for (slot = 0; slot < AGP_BUFSLOTS; slot++) - xconn->m_bufslots[slot] = 0; - } - - glGenTextures(1, &xconn->ytex_id); - glBindTexture(GL_TEXTURE_2D, xconn->ytex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE8_ALPHA8, TEX_XSIZE, TEX_YSIZE, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); - - glActiveTextureARB(GL_TEXTURE1_ARB); - glGenTextures(1, &xconn->uvtex_id); - glBindTexture(GL_TEXTURE_2D, xconn->uvtex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE8_ALPHA8, TEX_XSIZE/2, TEX_YSIZE/2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); - - glActiveTextureARB(GL_TEXTURE2_ARB); - glGenTextures(1, &xconn->septex_id); - glBindTexture(GL_TEXTURE_2D, xconn->septex_id); - glPixelStorei(GL_UNPACK_ALIGNMENT, 1); - glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE8, 2, 2, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, data_sep); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); - - glFlushPixelDataRangeNV(GL_WRITE_PIXEL_DATA_RANGE_NV); + g_warning ("Opening NVidia Connection"); + xconn->m_memory = + (unsigned char *) glXAllocateMemoryNV (AGP_BUFSLOTS * YUVTEX_SIZE, 0, 1.0, + 1.0); + + if (!xconn->m_memory) { + printf + ("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); + glEnableClientState (GL_WRITE_PIXEL_DATA_RANGE_NV); + + for (slot = 0; slot < AGP_BUFSLOTS; slot++) + xconn->m_bufslots[slot] = 0; + } + + glGenTextures (1, &xconn->ytex_id); + glBindTexture (GL_TEXTURE_2D, xconn->ytex_id); + glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + glTexImage2D (GL_TEXTURE_2D, 0, GL_LUMINANCE8_ALPHA8, TEX_XSIZE, TEX_YSIZE, 0, + GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); + + glActiveTextureARB (GL_TEXTURE1_ARB); + glGenTextures (1, &xconn->uvtex_id); + glBindTexture (GL_TEXTURE_2D, xconn->uvtex_id); + glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + glTexImage2D (GL_TEXTURE_2D, 0, GL_LUMINANCE8_ALPHA8, TEX_XSIZE / 2, + TEX_YSIZE / 2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); + + glActiveTextureARB (GL_TEXTURE2_ARB); + glGenTextures (1, &xconn->septex_id); + glBindTexture (GL_TEXTURE_2D, xconn->septex_id); + glPixelStorei (GL_UNPACK_ALIGNMENT, 1); + glTexImage2D (GL_TEXTURE_2D, 0, GL_LUMINANCE8, 2, 2, 0, GL_LUMINANCE, + GL_UNSIGNED_BYTE, data_sep); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD); + + glFlushPixelDataRangeNV (GL_WRITE_PIXEL_DATA_RANGE_NV); //glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE1_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE2_ARB); - glEnable(GL_TEXTURE_2D); - glActiveTextureARB(GL_TEXTURE0_ARB); + glActiveTextureARB (GL_TEXTURE0_ARB); + glEnable (GL_TEXTURE_2D); + glActiveTextureARB (GL_TEXTURE1_ARB); + glEnable (GL_TEXTURE_2D); + glActiveTextureARB (GL_TEXTURE2_ARB); + glEnable (GL_TEXTURE_2D); + glActiveTextureARB (GL_TEXTURE0_ARB); } static void -gst_gl_nvimage_close_conn (GstImageConnection *conn, GstImageInfo *info) +gst_gl_nvimage_close_conn (GstImageConnection * conn, GstImageInfo * info) { GstGLImageConnection *xconn = gst_gl_nvimage_connection (conn); - GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); + GstGLImageInfo *xinfo = gst_gl_nvimage_info (info); // anything needed in here ? Oh, maybe drawing de-init, or something - glDeleteTextures(1, &xconn->ytex_id); - glDeleteTextures(1, &xconn->uvtex_id); - glDeleteTextures(1, &xconn->septex_id); + glDeleteTextures (1, &xconn->ytex_id); + glDeleteTextures (1, &xconn->uvtex_id); + glDeleteTextures (1, &xconn->septex_id); } -static void -gst_gl_nvimage_free_conn (GstImageConnection *conn) +static void +gst_gl_nvimage_free_conn (GstImageConnection * conn) { - GstGLImageConnection *nvconn = gst_gl_nvimage_connection (conn); + GstGLImageConnection *nvconn = gst_gl_nvimage_connection (conn); g_free (nvconn); } - |