diff options
author | David Schleef <ds@schleef.org> | 2005-06-07 20:15:01 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2005-06-07 20:15:01 +0000 |
commit | c23bd7e418e9cbcdb186657caac33e1a57c05f4a (patch) | |
tree | a4f5ec559d0437eba1a2f430921e7a4402c6d158 /sys | |
parent | 7a07f4b0a52b17ccdc3e551385c6f593f5157ca8 (diff) | |
download | gst-plugins-bad-c23bd7e418e9cbcdb186657caac33e1a57c05f4a.tar.gz gst-plugins-bad-c23bd7e418e9cbcdb186657caac33e1a57c05f4a.tar.bz2 gst-plugins-bad-c23bd7e418e9cbcdb186657caac33e1a57c05f4a.zip |
sys/glsink/glimagesink.c: Make MESA extensions dependent on having MESA. (fixes #306660)
Original commit message from CVS:
* sys/glsink/glimagesink.c: (gst_glimagesink_getcaps),
(gst_glimagesink_init_display), (gst_glimagesink_chain):
Make MESA extensions dependent on having MESA. (fixes #306660)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/glsink/glimagesink.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/glsink/glimagesink.c b/sys/glsink/glimagesink.c index a6f838cf..d9b4235d 100644 --- a/sys/glsink/glimagesink.c +++ b/sys/glsink/glimagesink.c @@ -18,8 +18,6 @@ * Boston, MA 02111-1307, USA. */ -#define ENABLE_YUV - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -55,7 +53,7 @@ static GstStaticPadTemplate gst_glimagesink_sink_template_factory = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_RGBx ";" GST_VIDEO_CAPS_BGRx -#ifdef ENABLE_YUV +#ifdef GL_YCBCR_MESA ";" GST_VIDEO_CAPS_YUV ("{ UYVY, YUY2 }") #endif ) @@ -153,7 +151,7 @@ gst_glimagesink_getcaps (GstPad * pad) } caps = gst_caps_from_string (GST_VIDEO_CAPS_RGBx ";" GST_VIDEO_CAPS_BGRx); -#ifdef ENABLE_YUV +#ifdef GL_YCBCR_MESA if (glimagesink->have_yuv) { GstCaps *ycaps = gst_caps_from_string (GST_VIDEO_CAPS_YUV ("{ UYVY, YUY2 }")); @@ -292,11 +290,15 @@ gst_glimagesink_init_display (GstGLImageSink * glimagesink) glGetIntegerv (GL_MAX_TEXTURE_SIZE, &glimagesink->max_texture_size); extstring = (const char *) glGetString (GL_EXTENSIONS); +#ifdef GL_YCBCR_MESA if (strstr (extstring, "GL_MESA_ycbcr_texture")) { glimagesink->have_yuv = TRUE; } else { glimagesink->have_yuv = FALSE; } +#else + glimagesink->have_yuv = FALSE; +#endif glXMakeCurrent (glimagesink->display, None, NULL); XDestroyWindow (glimagesink->display, window); @@ -518,6 +520,7 @@ gst_glimagesink_chain (GstPad * pad, GstData * data) GL_BGRA, GL_UNSIGNED_BYTE, GST_BUFFER_DATA (buf)); } } else { +#ifdef GL_YCBCR_MESA glTexImage2D (GL_TEXTURE_2D, 0, GL_YCBCR_MESA, texture_size, texture_size, 0, GL_YCBCR_MESA, GL_UNSIGNED_SHORT_8_8_REV_MESA, NULL); @@ -532,6 +535,9 @@ gst_glimagesink_chain (GstPad * pad, GstData * data) GST_VIDEOSINK (glimagesink)->height, GL_YCBCR_MESA, GL_UNSIGNED_SHORT_8_8_MESA, GST_BUFFER_DATA (buf)); } +#else + g_assert_not_reached (); +#endif } glColor4f (1, 0, 1, 1); |