mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
sys/glsink/glimagesink.c: Move local variable declarations to make gcc-2.95 happy.
Original commit message from CVS: * sys/glsink/glimagesink.c: (gst_glimagesink_ximage_put), (gst_glimagesink_xwindow_new), (gst_glimagesink_xcontext_get), (gst_glimagesink_fixate): Move local variable declarations to make gcc-2.95 happy.
This commit is contained in:
parent
5176ff36f6
commit
da2168ed41
2 changed files with 27 additions and 19 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2004-08-27 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
* sys/glsink/glimagesink.c: (gst_glimagesink_ximage_put),
|
||||||
|
(gst_glimagesink_xwindow_new), (gst_glimagesink_xcontext_get),
|
||||||
|
(gst_glimagesink_fixate): Move local variable declarations to
|
||||||
|
make gcc-2.95 happy.
|
||||||
|
|
||||||
2004-08-27 Thomas Vander Stichele <thomas at apestaart dot org>
|
2004-08-27 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* configure.ac:
|
* configure.ac:
|
||||||
|
|
|
@ -164,6 +164,11 @@ gst_glimagesink_ximage_destroy (GstGLImageSink * glimagesink,
|
||||||
static void
|
static void
|
||||||
gst_glimagesink_ximage_put (GstGLImageSink * glimagesink, GstGLImage * ximage)
|
gst_glimagesink_ximage_put (GstGLImageSink * glimagesink, GstGLImage * ximage)
|
||||||
{
|
{
|
||||||
|
float xmax;
|
||||||
|
float ymax;
|
||||||
|
float px;
|
||||||
|
float py;
|
||||||
|
|
||||||
g_return_if_fail (ximage != NULL);
|
g_return_if_fail (ximage != NULL);
|
||||||
g_return_if_fail (GST_IS_GLIMAGESINK (glimagesink));
|
g_return_if_fail (GST_IS_GLIMAGESINK (glimagesink));
|
||||||
|
|
||||||
|
@ -197,8 +202,8 @@ gst_glimagesink_ximage_put (GstGLImageSink * glimagesink, GstGLImage * ximage)
|
||||||
glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, ximage->width, ximage->height,
|
glTexSubImage2D (GL_TEXTURE_2D, 0, 0, 0, ximage->width, ximage->height,
|
||||||
GL_RGB, GL_UNSIGNED_BYTE, ximage->data);
|
GL_RGB, GL_UNSIGNED_BYTE, ximage->data);
|
||||||
|
|
||||||
float xmax = (float) ximage->width / TEX_XSIZE;
|
xmax = (float) ximage->width / TEX_XSIZE;
|
||||||
float ymax = (float) ximage->height / TEX_YSIZE;
|
ymax = (float) ximage->height / TEX_YSIZE;
|
||||||
|
|
||||||
//float aspect = ximage->width/(float)ximage->height;
|
//float aspect = ximage->width/(float)ximage->height;
|
||||||
|
|
||||||
|
@ -236,9 +241,8 @@ gst_glimagesink_ximage_put (GstGLImageSink * glimagesink, GstGLImage * ximage)
|
||||||
if (glimagesink->pointer_button[0])
|
if (glimagesink->pointer_button[0])
|
||||||
glColor3f (1, 0, 0);
|
glColor3f (1, 0, 0);
|
||||||
|
|
||||||
float px = 2 * glimagesink->pointer_x / (float) ximage->width - 1.0;
|
px = 2 * glimagesink->pointer_x / (float) ximage->width - 1.0;
|
||||||
float py = 2 * glimagesink->pointer_y / (float) ximage->height - 1.0;
|
py = 2 * glimagesink->pointer_y / (float) ximage->height - 1.0;
|
||||||
|
|
||||||
glPointSize (10);
|
glPointSize (10);
|
||||||
glBegin (GL_POINTS);
|
glBegin (GL_POINTS);
|
||||||
glVertex2f (px, -py);
|
glVertex2f (px, -py);
|
||||||
|
@ -257,6 +261,8 @@ gst_glimagesink_xwindow_new (GstGLImageSink * glimagesink, gint width,
|
||||||
{
|
{
|
||||||
GstGLWindow *xwindow = NULL;
|
GstGLWindow *xwindow = NULL;
|
||||||
GstXContext *xcontext = glimagesink->xcontext;
|
GstXContext *xcontext = glimagesink->xcontext;
|
||||||
|
Colormap cmap;
|
||||||
|
Atom wmDelete;
|
||||||
|
|
||||||
if (glimagesink->signal_handoffs) {
|
if (glimagesink->signal_handoffs) {
|
||||||
g_warning ("NOT CREATING any window due to signal_handoffs !\n");
|
g_warning ("NOT CREATING any window due to signal_handoffs !\n");
|
||||||
|
@ -273,8 +279,6 @@ gst_glimagesink_xwindow_new (GstGLImageSink * glimagesink, gint width,
|
||||||
|
|
||||||
g_mutex_lock (glimagesink->x_lock);
|
g_mutex_lock (glimagesink->x_lock);
|
||||||
|
|
||||||
Colormap cmap;
|
|
||||||
|
|
||||||
/* create a color map */
|
/* create a color map */
|
||||||
cmap =
|
cmap =
|
||||||
XCreateColormap (xcontext->disp, RootWindow (xcontext->disp,
|
XCreateColormap (xcontext->disp, RootWindow (xcontext->disp,
|
||||||
|
@ -300,16 +304,14 @@ gst_glimagesink_xwindow_new (GstGLImageSink * glimagesink, gint width,
|
||||||
ExposureMask | KeyPressMask | ButtonPressMask | StructureNotifyMask;
|
ExposureMask | KeyPressMask | ButtonPressMask | StructureNotifyMask;
|
||||||
|
|
||||||
/* create a window in window mode */
|
/* create a window in window mode */
|
||||||
xwindow->win =
|
xwindow->win = XCreateWindow (xcontext->disp, /*xcontext->root, */
|
||||||
XCreateWindow (xcontext->disp, /*xcontext->root, */
|
|
||||||
RootWindow (xcontext->disp, xcontext->visualinfo->screen),
|
RootWindow (xcontext->disp, xcontext->visualinfo->screen),
|
||||||
0, 0, xwindow->width, xwindow->height, 0, xcontext->visualinfo->depth,
|
0, 0, xwindow->width, xwindow->height, 0, xcontext->visualinfo->depth,
|
||||||
InputOutput, xcontext->visualinfo->visual,
|
InputOutput, xcontext->visualinfo->visual,
|
||||||
CWBorderPixel | CWColormap | CWEventMask, &xwindow->attr);
|
CWBorderPixel | CWColormap | CWEventMask, &xwindow->attr);
|
||||||
|
|
||||||
/* only set window title and handle wm_delete_events if in windowed mode */
|
/* only set window title and handle wm_delete_events if in windowed mode */
|
||||||
Atom wmDelete = XInternAtom (xcontext->disp, "WM_DELETE_WINDOW", True);
|
wmDelete = XInternAtom (xcontext->disp, "WM_DELETE_WINDOW", True);
|
||||||
|
|
||||||
XSetWMProtocols (xcontext->disp, xwindow->win, &wmDelete, 1);
|
XSetWMProtocols (xcontext->disp, xwindow->win, &wmDelete, 1);
|
||||||
XSetStandardProperties (xcontext->disp, xwindow->win, "glsink",
|
XSetStandardProperties (xcontext->disp, xwindow->win, "glsink",
|
||||||
"glsink", None, NULL, 0, NULL);
|
"glsink", None, NULL, 0, NULL);
|
||||||
|
@ -652,9 +654,12 @@ static int attrListDouble[] = {
|
||||||
static GstXContext *
|
static GstXContext *
|
||||||
gst_glimagesink_xcontext_get (GstGLImageSink * glimagesink)
|
gst_glimagesink_xcontext_get (GstGLImageSink * glimagesink)
|
||||||
{
|
{
|
||||||
printf ("Acquiring X context\n");
|
|
||||||
|
|
||||||
GstXContext *xcontext = NULL;
|
GstXContext *xcontext = NULL;
|
||||||
|
int glxMajorVersion, glxMinorVersion;
|
||||||
|
XPixmapFormatValues *px_formats = NULL;
|
||||||
|
gint nb_formats = 0, i;
|
||||||
|
|
||||||
|
printf ("Acquiring X context\n");
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_GLIMAGESINK (glimagesink), NULL);
|
g_return_val_if_fail (GST_IS_GLIMAGESINK (glimagesink), NULL);
|
||||||
|
|
||||||
|
@ -689,8 +694,6 @@ gst_glimagesink_xcontext_get (GstGLImageSink * glimagesink)
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG ("Got Doublebuffered Visual!\n");
|
GST_DEBUG ("Got Doublebuffered Visual!\n");
|
||||||
}
|
}
|
||||||
int glxMajorVersion, glxMinorVersion;
|
|
||||||
|
|
||||||
glXQueryVersion (xcontext->disp, &glxMajorVersion, &glxMinorVersion);
|
glXQueryVersion (xcontext->disp, &glxMajorVersion, &glxMinorVersion);
|
||||||
GST_DEBUG ("glX-Version %d.%d\n", glxMajorVersion, glxMinorVersion);
|
GST_DEBUG ("glX-Version %d.%d\n", glxMajorVersion, glxMinorVersion);
|
||||||
|
|
||||||
|
@ -713,8 +716,6 @@ gst_glimagesink_xcontext_get (GstGLImageSink * glimagesink)
|
||||||
xcontext->root = DefaultRootWindow (xcontext->disp);
|
xcontext->root = DefaultRootWindow (xcontext->disp);
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
XPixmapFormatValues *px_formats = NULL;
|
|
||||||
gint nb_formats = 0, i;
|
|
||||||
|
|
||||||
xcontext->white = XWhitePixel (xcontext->disp, xcontext->screen_num);
|
xcontext->white = XWhitePixel (xcontext->disp, xcontext->screen_num);
|
||||||
xcontext->black = XBlackPixel (xcontext->disp, xcontext->screen_num);
|
xcontext->black = XBlackPixel (xcontext->disp, xcontext->screen_num);
|
||||||
|
@ -828,11 +829,11 @@ Element stuff
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
gst_glimagesink_fixate (GstPad * pad, const GstCaps * caps)
|
gst_glimagesink_fixate (GstPad * pad, const GstCaps * caps)
|
||||||
{
|
{
|
||||||
printf ("Linking the sink\n");
|
|
||||||
|
|
||||||
GstStructure *structure;
|
GstStructure *structure;
|
||||||
GstCaps *newcaps;
|
GstCaps *newcaps;
|
||||||
|
|
||||||
|
printf ("Linking the sink\n");
|
||||||
|
|
||||||
if (gst_caps_get_size (caps) > 1)
|
if (gst_caps_get_size (caps) > 1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue