Removing some comments, storing framerate.

Original commit message from CVS:
Removing some comments, storing framerate.
This commit is contained in:
Julien Moutte 2003-11-12 11:02:31 +00:00
parent fb844d50ec
commit b48e87becf
2 changed files with 19 additions and 14 deletions

View file

@ -92,6 +92,8 @@ gst_xvimagesink_navigation_send_event (GstNavigation *navigation, GstStructure *
event = gst_event_new (GST_EVENT_NAVIGATION); event = gst_event_new (GST_EVENT_NAVIGATION);
event->event_data.structure.structure = structure; event->event_data.structure.structure = structure;
/* Converting pointer coordinates to the non scaled geometry */
if (gst_structure_get_double (structure, "pointer_x", &x)) { if (gst_structure_get_double (structure, "pointer_x", &x)) {
x *= xvimagesink->width; x *= xvimagesink->width;
x /= attr.width; x /= attr.width;
@ -136,7 +138,7 @@ gst_xvimagesink_xvimage_new (GstXvImageSink *xvimagesink,
#ifdef HAVE_XSHM #ifdef HAVE_XSHM
if (xvimagesink->xcontext->use_xshm) if (xvimagesink->xcontext->use_xshm)
{ /* FIXME FORMAT !!! */ {
xvimage->xvimage = XvShmCreateImage (xvimagesink->xcontext->disp, xvimage->xvimage = XvShmCreateImage (xvimagesink->xcontext->disp,
xvimagesink->xcontext->xv_port_id, xvimagesink->xcontext->xv_port_id,
xvimagesink->xcontext->im_format, xvimagesink->xcontext->im_format,
@ -154,7 +156,7 @@ gst_xvimagesink_xvimage_new (GstXvImageSink *xvimagesink,
XShmAttach (xvimagesink->xcontext->disp, &xvimage->SHMInfo); XShmAttach (xvimagesink->xcontext->disp, &xvimage->SHMInfo);
} }
else else
{ /* FIXME FORMAT !!! */ {
xvimage->xvimage = XvCreateImage (xvimagesink->xcontext->disp, xvimage->xvimage = XvCreateImage (xvimagesink->xcontext->disp,
xvimagesink->xcontext->xv_port_id, xvimagesink->xcontext->xv_port_id,
xvimagesink->xcontext->im_format, xvimagesink->xcontext->im_format,
@ -164,7 +166,6 @@ gst_xvimagesink_xvimage_new (GstXvImageSink *xvimagesink,
xvimage->data = g_malloc (xvimage->xvimage->data_size); xvimage->data = g_malloc (xvimage->xvimage->data_size);
} }
#else #else
/* FIXME FORMAT !!! */
xvimage->xvimage = XvCreateImage (xvimagesink->xcontext->disp, xvimage->xvimage = XvCreateImage (xvimagesink->xcontext->disp,
xvimagesink->xcontext->xv_port_id, xvimagesink->xcontext->xv_port_id,
xvimagesink->xcontext->im_format, xvimagesink->xcontext->im_format,
@ -246,7 +247,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink *xvimagesink, GstXvImage *xvimage)
g_mutex_lock (xvimagesink->x_lock); g_mutex_lock (xvimagesink->x_lock);
/* We center the image in the window */ /* We scale to the window's geometry */
XGetWindowAttributes (xvimagesink->xcontext->disp, XGetWindowAttributes (xvimagesink->xcontext->disp,
xvimagesink->xwindow->win, &attr); xvimagesink->xwindow->win, &attr);
@ -591,7 +592,6 @@ gst_xvimagesink_xcontext_get (GstXvImageSink *xvimagesink)
} }
#endif /* HAVE_XSHM */ #endif /* HAVE_XSHM */
/* What the hell is that ? */
if (xcontext->endianness == G_LITTLE_ENDIAN && xcontext->depth == 24) if (xcontext->endianness == G_LITTLE_ENDIAN && xcontext->depth == 24)
{ {
xcontext->endianness = G_BIG_ENDIAN; xcontext->endianness = G_BIG_ENDIAN;
@ -685,6 +685,8 @@ gst_xvimagesink_sinkconnect (GstPad *pad, GstCaps *caps)
return GST_PAD_LINK_REFUSED; return GST_PAD_LINK_REFUSED;
if (!gst_caps_get_int (caps, "height", &xvimagesink->height)) if (!gst_caps_get_int (caps, "height", &xvimagesink->height))
return GST_PAD_LINK_REFUSED; return GST_PAD_LINK_REFUSED;
if (!gst_caps_get_float (caps, "framerate", &xvimagesink->framerate))
return GST_PAD_LINK_REFUSED;
if (gst_caps_has_fixed_property (caps, "format")) if (gst_caps_has_fixed_property (caps, "format"))
gst_caps_get_fourcc_int (caps, "format", &xvimagesink->xcontext->im_format); gst_caps_get_fourcc_int (caps, "format", &xvimagesink->xcontext->im_format);
@ -1022,6 +1024,8 @@ gst_xvimagesink_init (GstXvImageSink *xvimagesink)
xvimagesink->width = xvimagesink->height = 0; xvimagesink->width = xvimagesink->height = 0;
xvimagesink->framerate = 0;
xvimagesink->x_lock = g_mutex_new (); xvimagesink->x_lock = g_mutex_new ();
xvimagesink->pixel_width = xvimagesink->pixel_height = 1; xvimagesink->pixel_width = xvimagesink->pixel_height = 1;

View file

@ -122,6 +122,7 @@ struct _GstXvImageSink {
GstXvImage *xvimage; GstXvImage *xvimage;
gint width, height; gint width, height;
gfloat framerate;
GMutex *x_lock; GMutex *x_lock;
/* Unused */ /* Unused */