diff --git a/gst/gl/gltestsrc.c b/gst/gl/gltestsrc.c index a3a550f757..4b5f9f0ab8 100644 --- a/gst/gl/gltestsrc.c +++ b/gst/gl/gltestsrc.c @@ -96,9 +96,6 @@ gst_gl_test_src_smpte (GstGLTestSrc * v, GstGLBuffer * buffer, int w, int h) glMatrixMode (GL_PROJECTION); glLoadIdentity (); - glMatrixMode (GL_MODELVIEW); - glLoadIdentity (); - for (i = 0; i < 7; i++) { glColor4f (vts_colors[i].R * (1 / 255.0f), vts_colors[i].G * (1 / 255.0f), vts_colors[i].B * (1 / 255.0f), 1.0f); @@ -173,7 +170,7 @@ gst_gl_test_src_smpte (GstGLTestSrc * v, GstGLBuffer * buffer, int w, int h) glEnd (); } - glColor4f (0.5, 0.5, 0.5, 1.0); + glColor4f (1.0, 1.0, 1.0, 1.0); glBegin (GL_QUADS); glVertex3f (-1.0 + 2.0 * (0.75), -1.0 + 2.0 * 1, 0); glVertex3f (-1.0 + 2.0 * (1.0), -1.0 + 2.0 * 1, 0); diff --git a/gst/gl/gstglbumper.c b/gst/gl/gstglbumper.c index 38cd10ec61..61fd4f49aa 100644 --- a/gst/gl/gstglbumper.c +++ b/gst/gl/gstglbumper.c @@ -19,6 +19,20 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-glbumper + * + * Bump mapping using the normal method. + * + * + * Examples + * |[ + * gst-launch -v videotestsrc ! glupload ! glbumper location=normalmap.bmp ! glimagesink + * ]| A pipeline to test normal mapping. + * FBO and GLSL are required. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstglcolorscale.c b/gst/gl/gstglcolorscale.c index dae92af6cb..9812a38c13 100644 --- a/gst/gl/gstglcolorscale.c +++ b/gst/gl/gstglcolorscale.c @@ -18,6 +18,30 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-glcolorscale + * + * video frame scaling and colorspace conversion. + * + * + * Scaling and Color space conversion + * + * Equivalent to glupload ! gldownload. + * + * + * Examples + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-yuv" ! glcolorscale ! ximagesink + * ]| A pipeline to test colorspace conversion. + * FBO is required. + |[ + * gst-launch -v videotestsrc ! "video/x-raw-yuv, width=640, height=480, format=(fourcc)AYUV" ! glcolorscale ! \ + * "video/x-raw-yuv, width=320, height=240, format=(fourcc)YV12" ! autovideosink + * ]| A pipeline to test hardware scaling and colorspace conversion. + * FBO and GLSL are required. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstgldownload.c b/gst/gl/gstgldownload.c index 3ed24dad46..345c74b097 100644 --- a/gst/gl/gstgldownload.c +++ b/gst/gl/gstgldownload.c @@ -19,6 +19,45 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-gldownload + * + * download opengl textures into video frames. + * + * + * Color space conversion + * + * When needed, the color space conversion is made in a fragment shader using + * one frame buffer object instance. + * + * + * Examples + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-rgb" ! glupload ! gldownload ! \ + * "video/x-raw-rgb" ! ximagesink + * ]| A pipeline to test downloading. + * No special opengl extension is used in this pipeline, that's why it should work + * with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3. + |[ + * gst-launch -v videotestsrc ! "video/x-raw-rgb, width=640, height=480" ! glupload ! gldownload ! \ + * "video/x-raw-rgb, width=320, height=240" ! ximagesink + * ]| A pipeline to test hardware scaling. + * Frame buffer extension is required. Inded one FBO is used bettween glupload and gldownload, + * because the texture needs to be resized. + * |[ + * gst-launch -v gltestsrc ! gldownload ! xvimagesink + * ]| A pipeline to test hardware colorspace conversion. + * Your driver must support GLSL (OpenGL Shading Language needs OpenGL >= 2.1). + * Texture RGB32T is converted to one of the 4 following format YUY2, UYVY, I420, YV12 and AYUV, + * through some fragment shaders and using one framebuffer (FBO extension OpenGL >= 1.4). + * MESA >= 7.1 supports GLSL but it's made in software. + * |[ + * gst-launch -v videotestsrc ! glupload ! gldownload ! "video/x-raw-yuv, format=(fourcc)YUY2" ! glimagesink + * ]| A pipeline to test hardware colorspace conversion + * FBO and GLSL are required. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstglfilterapp.c b/gst/gl/gstglfilterapp.c index 0cfcd9f703..df93c9d00e 100644 --- a/gst/gl/gstglfilterapp.c +++ b/gst/gl/gstglfilterapp.c @@ -18,6 +18,24 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-glfilterapp + * + * The resize and redraw callbacks can be set from a client code. + * + * + * CLient callbacks + * + * The graphic scene can be written from a client code through the + * two glfilterapp properties. + * + * + * + * Examples + * see gst-plugins-gl/tests/examples/generic/recordgraphic + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstglfiltercube.c b/gst/gl/gstglfiltercube.c index bb82ad0dad..0178af7158 100644 --- a/gst/gl/gstglfiltercube.c +++ b/gst/gl/gstglfiltercube.c @@ -18,6 +18,28 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-glfiltercube + * + * The resize and redraw callbacks can be set from a client code. + * + * + * Examples + * |[ + * gst-launch -v videotestsrc ! glupload ! glfiltercube ! glimagesink + * ]| A pipeline to mpa textures on the 6 cube faces.. + * FBO is required. + * |[ + * gst-launch -v videotestsrc ! glupload ! glfiltercube ! video/x-raw-gl, width=640, height=480 ! glimagesink + * ]| Resize scene after drawing the cube. + * The scene size is greater than the input video size. + |[ + * gst-launch -v videotestsrc ! glupload ! video/x-raw-gl, width=640, height=480 ! glfiltercube ! glimagesink + * ]| Resize scene before drawing the cube. + * The scene size is greater than the input video size. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstglfilterglass.c b/gst/gl/gstglfilterglass.c index e38b6c4e75..d65d99b711 100644 --- a/gst/gl/gstglfilterglass.c +++ b/gst/gl/gstglfilterglass.c @@ -19,6 +19,23 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-glfilterglass + * + * Map textures on moving glass. + * + * + * Examples + * |[ + * gst-launch -v videotestsrc ! glupload ! glfilterglass ! glimagesink + * ]| A pipeline inspired from http://www.mdk.org.pl/2007/11/17/gl-colorspace-conversions + * FBO is required. + * |[ + * gst-launch -v videotestsrc ! glupload ! glfilterglass ! "video/x-raw-gl, width=640, height=480" ! glimagesink + * ]| The scene is greater than the input size. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstglimagesink.c b/gst/gl/gstglimagesink.c index 3683dc795d..87a4bbb044 100644 --- a/gst/gl/gstglimagesink.c +++ b/gst/gl/gstglimagesink.c @@ -20,6 +20,65 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-glimagesink + * + * glimagesink renders video frames to a drawable on a local or remote + * display using OpenGL. This element can receive a Window ID from the + * application through the XOverlay interface and will then render video + * frames in this drawable. + * If no Window ID was provided by the application, the element will + * create its own internal window and render into it. + * + * + * Scaling + * + * Depends on the driver, OpenGL handles hardware accelerated + * scaling of video frames. This means that the element will just accept + * incoming video frames no matter their geometry and will then put them to the + * drawable scaling them on the fly. Using the #GstXvImageSink:force-aspect-ratio + * property it is possible to enforce scaling with a constant aspect ratio, + * which means drawing black borders around the video frame. + * + * + * + * Events + * + * Through the gl thread, glimagesink handle some events coming from the drawable + * to manage its appearance even when the data is not flowing (GST_STATE_PAUSED). + * That means that even when the element is paused, it will receive expose events + * from the drawable and draw the latest frame with correct borders/aspect-ratio. + * + * + * + * Examples + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-rgb" ! glimagesink + * ]| A pipeline to test hardware scaling. + * No special opengl extension is used in this pipeline, that's why it should work + * with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3. + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-yuv, format=(fourcc)I420" ! glimagesink + * ]| A pipeline to test hardware scaling and hardware colorspace conversion. + * When your driver supports GLSL (OpenGL Shading Language needs OpenGL >= 2.1), + * the 4 following format YUY2, UYVY, I420, YV12 and AYUV are converted to RGB32 + * through some fragment shaders and using one framebuffer (FBO extension OpenGL >= 1.4). + * If your driver does not support GLSL but supports MESA_YCbCr extension then + * the you can use YUY2 and UYVY. In this case the colorspace conversion is automatically + * made when loading the texture and therefore no framebuffer is used. + * |[ + * gst-launch -v gltestsrc ! glimagesink + * ]| A pipeline 100% OpenGL. + * No special opengl extension is used in this pipeline, that's why it should work + * with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3. + * |[ + * gst-plugins-gl/tests/examples/generic/cube + * ]| The graphic FPS scene can be greater than the input video FPS. + * The graphic scene can be written from a client code through the + * two glfilterapp properties. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstgltestsrc.c b/gst/gl/gstgltestsrc.c index 1e26f3ad31..0113e48bcd 100644 --- a/gst/gl/gstgltestsrc.c +++ b/gst/gl/gstgltestsrc.c @@ -25,16 +25,16 @@ * * * - * The gltestsrc element is used to produce test video data in a wide variaty - * of formats. The video test data produced can be controlled with the "pattern" + * The gltestsrc element is used to produce test video texture. + * The video test produced can be controlled with the "pattern" * property. * * Example launch line * * - * gst-launch -v gltestsrc pattern=snow ! ximagesink + * gst-launch -v gltestsrc pattern=smpte ! glimagesink * - * Shows random noise in an X window. + * Shows original SMPTE color bars in a window. * * */ diff --git a/gst/gl/gstglupload.c b/gst/gl/gstglupload.c index 5eb30145fc..2b9cd60800 100644 --- a/gst/gl/gstglupload.c +++ b/gst/gl/gstglupload.c @@ -19,6 +19,51 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:element-glupload + * + * upload video frames video frames into opengl textures. + * + * + * Color space conversion + * + * Depends on the driver and when needed, the color space conversion is made + * in a fragment shader using one frame buffer object instance, or using + * mesa ycbcr . + * + * + * + * Examples + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-rgb" ! glupload ! glimagesink + * ]| A pipeline to test hardware scaling. + * No special opengl extension is used in this pipeline, that's why it should work + * with OpenGL >= 1.1. That's the case if you are using the MESA3D driver v1.3. + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-yuv, format=(fourcc)I420" ! glupload ! glimagesink + * ]| A pipeline to test hardware scaling and hardware colorspace conversion. + * When your driver supports GLSL (OpenGL Shading Language needs OpenGL >= 2.1), + * the 4 following format YUY2, UYVY, I420, YV12 and AYUV are converted to RGB32 + * through some fragment shaders and using one framebuffer (FBO extension OpenGL >= 1.4). + * If your driver does not support GLSL but supports MESA_YCbCr extension then + * the you can use YUY2 and UYVY. In this case the colorspace conversion is automatically + * made when loading the texture and therefore no framebuffer is used. + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-rgb, width=320, height=240" ! glupload ! \ + * "video/x-raw-gl, width=640, height=480" ! glimagesink + * ]| A pipeline to test hardware scaling. + * Frame buffer extension is required. Inded one FBO is used bettween glupload and glimagesink, + * because the texture needs to be resized. + * |[ + * gst-launch -v videotestsrc ! "video/x-raw-yuv, width=320, height=240" ! glupload ! \ + * "video/x-raw-gl, width=640, height=480" ! glimagesink + * ]| A pipeline to test hardware scaling. + * Frame buffer extension is required. Inded one FBO is used bettween glupload and glimagesink, + * because the texture needs to be resized. Depends on your driver the color space conversion + * is made in a fragment shader using one frame buffer object instance, or using mesa ycbcr . + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/gl/gstopengl.c b/gst/gl/gstopengl.c index aa70612491..4dec7fec51 100644 --- a/gst/gl/gstopengl.c +++ b/gst/gl/gstopengl.c @@ -21,6 +21,24 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:plugin-opengl + * + * Cross-platform OpenGL plugin. + * + * Debugging + * + * + * Examples + * |[ + * gst-launch-0.10 --gst-debug=gldisplay:3 videotestsrc ! glimagesink + * ]| A debugging pipeline. + |[ + * GST_GL_SHADER_DEBUG=1 gst-launch-0.10 videotestsrc ! glimagesink + * ]| A debugging pipelines related to shaders. + * + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif