2003-11-06 21:51:14 +00:00
/* GStreamer
* Copyright ( C ) < 2003 > Julien Moutte < julien @ moutte . net >
*
* This library is free software ; you can redistribute it and / or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation ; either
* version 2 of the License , or ( at your option ) any later version .
*
* This library is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* Library General Public License for more details .
*
* You should have received a copy of the GNU Library General Public
* License along with this library ; if not , write to the
* Free Software Foundation , Inc . , 59 Temple Place - Suite 330 ,
* Boston , MA 02111 - 1307 , USA .
*/
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
/* Our interfaces */
2003-11-22 04:06:50 +00:00
# include <gst/navigation/navigation.h>
# include <gst/xoverlay/xoverlay.h>
2003-11-06 21:51:14 +00:00
/* Object header */
# include "ximagesink.h"
2004-03-14 22:34:34 +00:00
static void gst_ximagesink_buffer_free ( GstBuffer * buffer ) ;
2004-01-15 22:03:45 +00:00
2003-11-06 21:51:14 +00:00
/* ElementFactory information */
2004-03-14 22:34:34 +00:00
static GstElementDetails gst_ximagesink_details =
GST_ELEMENT_DETAILS ( " Video sink " ,
" Sink/Video " ,
" A standard X based videosink " ,
" Julien Moutte <julien@moutte.net> " ) ;
2003-11-06 21:51:14 +00:00
/* Default template - initiated with class struct to allow gst-register to work
without X running */
2003-12-22 01:47:09 +00:00
static GstStaticPadTemplate gst_ximagesink_sink_template_factory =
2004-03-14 22:34:34 +00:00
GST_STATIC_PAD_TEMPLATE ( " sink " ,
GST_PAD_SINK ,
GST_PAD_ALWAYS ,
GST_STATIC_CAPS ( " video/x-raw-rgb, "
" framerate = (double) [ 1.0, 100.0 ], "
" width = (int) [ 0, MAX ], " " height = (int) [ 0, MAX ] " )
) ;
enum
{
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
ARG_0 ,
2004-01-18 12:32:19 +00:00
ARG_DISPLAY ,
ARG_SYNCHRONOUS
2004-03-14 22:34:34 +00:00
/* FILL ME */
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
} ;
2003-11-19 20:43:49 +00:00
static GstVideoSinkClass * parent_class = NULL ;
2004-01-28 00:29:42 +00:00
static gboolean error_catched = FALSE ;
2003-11-06 21:51:14 +00:00
/* ============================================================= */
/* */
/* Private Methods */
/* */
/* ============================================================= */
/* X11 stuff */
2004-01-28 00:29:42 +00:00
static int
2004-03-14 22:34:34 +00:00
gst_ximagesink_handle_xerror ( Display * display , XErrorEvent * xevent )
2004-01-28 00:29:42 +00:00
{
2004-03-14 22:34:34 +00:00
char error_msg [ 1024 ] ;
2004-01-28 00:29:42 +00:00
XGetErrorText ( display , xevent - > error_code , error_msg , 1024 ) ;
2004-03-14 22:34:34 +00:00
GST_DEBUG ( " ximagesink failed to use XShm calls. error: %s " , error_msg ) ;
2004-01-28 00:29:42 +00:00
error_catched = TRUE ;
return 0 ;
}
/* This function checks that it is actually really possible to create an image
using XShm */
static gboolean
2004-03-14 22:34:34 +00:00
gst_ximagesink_check_xshm_calls ( GstXContext * xcontext )
2004-01-28 00:29:42 +00:00
{
GstXImage * ximage = NULL ;
2004-03-14 22:34:34 +00:00
int ( * handler ) ( Display * , XErrorEvent * ) ;
2004-01-28 00:29:42 +00:00
g_return_val_if_fail ( xcontext ! = NULL , FALSE ) ;
2004-03-14 22:34:34 +00:00
2004-01-28 00:29:42 +00:00
# ifdef HAVE_XSHM
ximage = g_new0 ( GstXImage , 1 ) ;
2004-03-14 22:34:34 +00:00
2004-01-28 00:29:42 +00:00
/* Setting an error handler to catch failure */
handler = XSetErrorHandler ( gst_ximagesink_handle_xerror ) ;
2004-03-14 22:34:34 +00:00
ximage - > size = ( xcontext - > bpp / 8 ) ;
2004-01-28 00:29:42 +00:00
/* Trying to create a 1x1 picture */
ximage - > ximage = XShmCreateImage ( xcontext - > disp , xcontext - > visual ,
2004-03-14 22:34:34 +00:00
xcontext - > depth , ZPixmap , NULL , & ximage - > SHMInfo , 1 , 1 ) ;
2004-01-28 00:29:42 +00:00
ximage - > SHMInfo . shmid = shmget ( IPC_PRIVATE , ximage - > size , IPC_CREAT | 0777 ) ;
ximage - > SHMInfo . shmaddr = shmat ( ximage - > SHMInfo . shmid , 0 , 0 ) ;
ximage - > ximage - > data = ximage - > SHMInfo . shmaddr ;
ximage - > SHMInfo . readOnly = FALSE ;
2004-03-14 22:34:34 +00:00
2004-01-28 00:29:42 +00:00
XShmAttach ( xcontext - > disp , & ximage - > SHMInfo ) ;
error_catched = FALSE ;
2004-03-14 22:34:34 +00:00
XSync ( xcontext - > disp , 0 ) ;
2004-01-28 00:29:42 +00:00
XSetErrorHandler ( handler ) ;
2004-03-14 22:34:34 +00:00
if ( error_catched ) { /* Failed, detaching shared memory, destroying image and telling we can't
use XShm */
error_catched = FALSE ;
XDestroyImage ( ximage - > ximage ) ;
shmdt ( ximage - > SHMInfo . shmaddr ) ;
shmctl ( ximage - > SHMInfo . shmid , IPC_RMID , 0 ) ;
g_free ( ximage ) ;
XSync ( xcontext - > disp , FALSE ) ;
return FALSE ;
} else {
XShmDetach ( xcontext - > disp , & ximage - > SHMInfo ) ;
XDestroyImage ( ximage - > ximage ) ;
shmdt ( ximage - > SHMInfo . shmaddr ) ;
shmctl ( ximage - > SHMInfo . shmid , IPC_RMID , 0 ) ;
g_free ( ximage ) ;
XSync ( xcontext - > disp , FALSE ) ;
}
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
# endif /* HAVE_XSHM */
2004-03-14 22:34:34 +00:00
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
return TRUE ;
2004-01-28 00:29:42 +00:00
}
2003-11-11 11:32:27 +00:00
/* This function handles GstXImage creation depending on XShm availability */
2003-11-06 21:51:14 +00:00
static GstXImage *
2004-03-14 22:34:34 +00:00
gst_ximagesink_ximage_new ( GstXImageSink * ximagesink , gint width , gint height )
2003-11-06 21:51:14 +00:00
{
GstXImage * ximage = NULL ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_return_val_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) , NULL ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
ximage = g_new0 ( GstXImage , 1 ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
ximage - > width = width ;
ximage - > height = height ;
ximage - > data = NULL ;
2004-01-11 22:52:29 +00:00
ximage - > ximagesink = ximagesink ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
ximage - > size =
( ximagesink - > xcontext - > bpp / 8 ) * ximage - > width * ximage - > height ;
2003-11-12 03:06:07 +00:00
# ifdef HAVE_XSHM
2004-03-14 22:34:34 +00:00
if ( ximagesink - > xcontext - > use_xshm ) {
ximage - > ximage = XShmCreateImage ( ximagesink - > xcontext - > disp ,
ximagesink - > xcontext - > visual ,
ximagesink - > xcontext - > depth ,
ZPixmap , NULL , & ximage - > SHMInfo , ximage - > width , ximage - > height ) ;
ximage - > SHMInfo . shmid = shmget ( IPC_PRIVATE , ximage - > size ,
IPC_CREAT | 0777 ) ;
ximage - > SHMInfo . shmaddr = shmat ( ximage - > SHMInfo . shmid , 0 , 0 ) ;
ximage - > ximage - > data = ximage - > SHMInfo . shmaddr ;
ximage - > SHMInfo . readOnly = FALSE ;
XShmAttach ( ximagesink - > xcontext - > disp , & ximage - > SHMInfo ) ;
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
shmctl ( ximage - > SHMInfo . shmid , IPC_RMID , 0 ) ;
ximage - > SHMInfo . shmid = - 1 ;
} else
2003-11-25 04:48:04 +00:00
# endif /* HAVE_XSHM */
2004-03-14 22:34:34 +00:00
{
ximage - > data = g_malloc ( ximage - > size ) ;
ximage - > ximage = XCreateImage ( ximagesink - > xcontext - > disp ,
ximagesink - > xcontext - > visual ,
ximagesink - > xcontext - > depth ,
ZPixmap , 0 , ximage - > data ,
ximage - > width , ximage - > height ,
ximagesink - > xcontext - > bpp ,
ximage - > width * ( ximagesink - > xcontext - > bpp / 8 ) ) ;
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
}
if ( ! ximage - > ximage ) {
if ( ximage - > data )
g_free ( ximage - > data ) ;
g_free ( ximage ) ;
ximage = NULL ;
}
2003-11-06 21:51:14 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
return ximage ;
}
2004-03-14 22:34:34 +00:00
/* This function destroys a GstXImage handling XShm availability */
2003-11-06 21:51:14 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_ximage_destroy ( GstXImageSink * ximagesink , GstXImage * ximage )
2003-11-06 21:51:14 +00:00
{
g_return_if_fail ( ximage ! = NULL ) ;
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
2004-02-03 23:05:46 +00:00
/* If the destroyed image is the current one we destroy our reference too */
if ( ximagesink - > cur_image = = ximage )
ximagesink - > cur_image = NULL ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-12 03:06:07 +00:00
# ifdef HAVE_XSHM
2004-03-14 22:34:34 +00:00
if ( ximagesink - > xcontext - > use_xshm ) {
if ( ximage - > SHMInfo . shmaddr )
XShmDetach ( ximagesink - > xcontext - > disp , & ximage - > SHMInfo ) ;
if ( ximage - > ximage )
XDestroyImage ( ximage - > ximage ) ;
if ( ximage - > SHMInfo . shmaddr )
shmdt ( ximage - > SHMInfo . shmaddr ) ;
if ( ximage - > SHMInfo . shmid > 0 )
shmctl ( ximage - > SHMInfo . shmid , IPC_RMID , 0 ) ;
} else
# endif /* HAVE_XSHM */
{
if ( ximage - > ximage )
XDestroyImage ( ximage - > ximage ) ;
}
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_free ( ximage ) ;
}
2003-11-09 19:11:26 +00:00
/* This function puts a GstXImage on a GstXImageSink's window */
2003-11-06 21:51:14 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_ximage_put ( GstXImageSink * ximagesink , GstXImage * ximage )
2003-11-06 21:51:14 +00:00
{
gint x , y ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_return_if_fail ( ximage ! = NULL ) ;
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
2004-02-03 23:05:46 +00:00
/* Store a reference to the last image we put */
if ( ximagesink - > cur_image ! = ximage )
ximagesink - > cur_image = ximage ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
/* We center the image in the window */
2003-11-13 10:46:12 +00:00
x = MAX ( 0 , ( ximagesink - > xwindow - > width - ximage - > width ) / 2 ) ;
2004-03-14 22:34:34 +00:00
y = MAX ( 0 , ( ximagesink - > xwindow - > height - ximage - > height ) / 2 ) ;
2003-11-06 21:51:14 +00:00
2003-11-15 11:48:55 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2003-11-12 03:06:07 +00:00
# ifdef HAVE_XSHM
2004-03-14 22:34:34 +00:00
if ( ximagesink - > xcontext - > use_xshm ) {
XShmPutImage ( ximagesink - > xcontext - > disp , ximagesink - > xwindow - > win ,
ximagesink - > xwindow - > gc , ximage - > ximage ,
0 , 0 , x , y , ximage - > width , ximage - > height , FALSE ) ;
} else
2003-11-26 10:12:05 +00:00
# endif /* HAVE_XSHM */
2004-03-14 22:34:34 +00:00
{
XPutImage ( ximagesink - > xcontext - > disp , ximagesink - > xwindow - > win ,
ximagesink - > xwindow - > gc , ximage - > ximage ,
0 , 0 , x , y , ximage - > width , ximage - > height ) ;
}
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
}
2003-11-09 19:11:26 +00:00
/* This function handles a GstXWindow creation */
2003-11-06 21:51:14 +00:00
static GstXWindow *
2004-03-14 22:34:34 +00:00
gst_ximagesink_xwindow_new ( GstXImageSink * ximagesink , gint width , gint height )
2003-11-06 21:51:14 +00:00
{
GstXWindow * xwindow = NULL ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_return_val_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) , NULL ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
xwindow = g_new0 ( GstXWindow , 1 ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
xwindow - > width = width ;
xwindow - > height = height ;
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
xwindow - > internal = TRUE ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
xwindow - > win = XCreateSimpleWindow ( ximagesink - > xcontext - > disp ,
2004-03-14 22:34:34 +00:00
ximagesink - > xcontext - > root ,
0 , 0 , xwindow - > width , xwindow - > height , 0 , 0 , ximagesink - > xcontext - > black ) ;
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
2003-11-07 18:00:39 +00:00
XSelectInput ( ximagesink - > xcontext - > disp , xwindow - > win , ExposureMask |
2004-03-14 22:34:34 +00:00
StructureNotifyMask | PointerMotionMask | KeyPressMask |
KeyReleaseMask | ButtonPressMask | ButtonReleaseMask ) ;
xwindow - > gc = XCreateGC ( ximagesink - > xcontext - > disp , xwindow - > win , 0 , NULL ) ;
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
XMapRaised ( ximagesink - > xcontext - > disp , xwindow - > win ) ;
2004-03-14 22:34:34 +00:00
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2004-01-29 10:02:48 +00:00
gst_x_overlay_got_xwindow_id ( GST_X_OVERLAY ( ximagesink ) , xwindow - > win ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
return xwindow ;
}
2003-11-09 19:11:26 +00:00
/* This function destroys a GstXWindow */
2003-11-06 21:51:14 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_xwindow_destroy ( GstXImageSink * ximagesink ,
GstXWindow * xwindow )
2003-11-06 21:51:14 +00:00
{
g_return_if_fail ( xwindow ! = NULL ) ;
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-17 16:32:29 +00:00
/* If we did not create that window we just free the GC and let it live */
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
if ( xwindow - > internal )
2003-11-17 16:32:29 +00:00
XDestroyWindow ( ximagesink - > xcontext - > disp , xwindow - > win ) ;
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
else
2004-01-04 18:53:53 +00:00
XSelectInput ( ximagesink - > xcontext - > disp , xwindow - > win , 0 ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
XFreeGC ( ximagesink - > xcontext - > disp , xwindow - > gc ) ;
2004-03-14 22:34:34 +00:00
sys/: Removing some useless debugs messages, correctly cleaning the image created to check xshm calls on succes, adde...
Original commit message from CVS:
2004-01-28 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_check_xshm_calls),
(gst_ximagesink_ximage_new), (gst_ximagesink_ximage_destroy),
(gst_ximagesink_ximage_put), (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_check_xshm_calls),
(gst_xvimagesink_xvimage_new), (gst_xvimagesink_xvimage_destroy),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_xcontext_get): Removing some useless debugs messages,
correctly cleaning the image created to check xshm calls on succes,
added a lot of XSync calls in X11 functions, and fixed a segfault when
no image format was defined before negotiation happened.
2004-01-28 10:45:33 +00:00
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_free ( xwindow ) ;
}
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
/* This function resizes a GstXWindow */
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_xwindow_resize ( GstXImageSink * ximagesink , GstXWindow * xwindow ,
guint width , guint height )
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
{
g_return_if_fail ( xwindow ! = NULL ) ;
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
xwindow - > width = width ;
xwindow - > height = height ;
2004-03-14 22:34:34 +00:00
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
XResizeWindow ( ximagesink - > xcontext - > disp , xwindow - > win ,
2004-03-14 22:34:34 +00:00
xwindow - > width , xwindow - > height ) ;
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
2004-03-14 22:34:34 +00:00
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
}
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_xwindow_clear ( GstXImageSink * ximagesink , GstXWindow * xwindow )
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
{
g_return_if_fail ( xwindow ! = NULL ) ;
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
XSetForeground ( ximagesink - > xcontext - > disp , xwindow - > gc ,
2004-03-14 22:34:34 +00:00
ximagesink - > xcontext - > black ) ;
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
XFillRectangle ( ximagesink - > xcontext - > disp , xwindow - > win , xwindow - > gc ,
2004-03-14 22:34:34 +00:00
0 , 0 , xwindow - > width , xwindow - > height ) ;
ext/alsa/gstalsa.c: Alsa should trigger an error if it failed opening the audio device.
Original commit message from CVS:
2004-02-16 Julien MOUTTE <julien@moutte.net>
* ext/alsa/gstalsa.c: (gst_alsa_open_audio),
(gst_alsa_timestamp_to_bytes): Alsa should trigger an error if it
failed opening the audio device.
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_new),
(gst_ximagesink_ximage_destroy), (gst_ximagesink_ximage_put),
(gst_ximagesink_xwindow_new), (gst_ximagesink_xwindow_destroy),
(gst_ximagesink_xwindow_resize), (gst_ximagesink_xwindow_clear),
(gst_ximagesink_renegotiate_size), (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_xcontext_clear),
(gst_ximagesink_change_state), (gst_ximagesink_chain),
(gst_ximagesink_set_xwindow_id): Clearing window in READY TO PAUSED.
Removing some useless g_return_if_fail like wingo suggested.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
(gst_xvimagesink_xvimage_destroy), (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_xwindow_new), (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_xwindow_clear),
(gst_xvimagesink_update_colorbalance),
(gst_xvimagesink_handle_xevents), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_xcontext_clear),
(gst_xvimagesink_get_fourcc_from_caps),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_colorbalance_list_channels),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value): Clearing window in READY TO
PAUSED. Removing some useless g_return_if_fail like wingo suggested.
2004-02-16 16:24:51 +00:00
XSync ( ximagesink - > xcontext - > disp , FALSE ) ;
2004-03-14 22:34:34 +00:00
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
}
2004-02-18 21:16:50 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_xwindow_update_geometry ( GstXImageSink * ximagesink ,
GstXWindow * xwindow )
2004-02-18 21:16:50 +00:00
{
XWindowAttributes attr ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
g_return_if_fail ( xwindow ! = NULL ) ;
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
/* Update the window geometry */
g_mutex_lock ( ximagesink - > x_lock ) ;
XGetWindowAttributes ( ximagesink - > xcontext - > disp ,
2004-03-14 22:34:34 +00:00
ximagesink - > xwindow - > win , & attr ) ;
2004-02-18 21:16:50 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
ximagesink - > xwindow - > width = attr . width ;
ximagesink - > xwindow - > height = attr . height ;
}
2004-02-02 21:59:35 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_renegotiate_size ( GstXImageSink * ximagesink )
2004-02-02 21:59:35 +00:00
{
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
2004-02-16 23:45:55 +00:00
if ( ! ximagesink - > xwindow )
return ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
gst_ximagesink_xwindow_update_geometry ( ximagesink , ximagesink - > xwindow ) ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
if ( ximagesink - > sw_scaling_failed )
return ;
2004-03-14 22:34:34 +00:00
2004-02-18 13:06:49 +00:00
if ( ximagesink - > xwindow - > width < = 1 | | ximagesink - > xwindow - > height < = 1 )
return ;
2004-03-14 22:34:34 +00:00
2004-02-18 13:06:49 +00:00
if ( GST_PAD_IS_NEGOTIATING ( GST_VIDEOSINK_PAD ( ximagesink ) ) | |
! gst_pad_is_negotiated ( GST_VIDEOSINK_PAD ( ximagesink ) ) )
return ;
2004-03-14 22:34:34 +00:00
2004-02-02 21:59:35 +00:00
/* Window got resized or moved. We do caps negotiation again to get video
2004-02-16 23:45:55 +00:00
scaler to fit that new size only if size of the window differs from our
size . */
2004-03-14 22:34:34 +00:00
2004-02-18 13:06:49 +00:00
if ( GST_VIDEOSINK_WIDTH ( ximagesink ) ! = ximagesink - > xwindow - > width | |
2004-03-14 22:34:34 +00:00
GST_VIDEOSINK_HEIGHT ( ximagesink ) ! = ximagesink - > xwindow - > height ) {
GstPadLinkReturn r ;
r = gst_pad_try_set_caps ( GST_VIDEOSINK_PAD ( ximagesink ) ,
gst_caps_new_simple ( " video/x-raw-rgb " ,
" bpp " , G_TYPE_INT , ximagesink - > xcontext - > bpp ,
" depth " , G_TYPE_INT , ximagesink - > xcontext - > depth ,
" endianness " , G_TYPE_INT , ximagesink - > xcontext - > endianness ,
" red_mask " , G_TYPE_INT , ximagesink - > xcontext - > visual - > red_mask ,
" green_mask " , G_TYPE_INT , ximagesink - > xcontext - > visual - > green_mask ,
" blue_mask " , G_TYPE_INT , ximagesink - > xcontext - > visual - > blue_mask ,
" width " , G_TYPE_INT , ximagesink - > xwindow - > width ,
" height " , G_TYPE_INT , ximagesink - > xwindow - > height ,
" framerate " , G_TYPE_DOUBLE , ximagesink - > framerate , NULL ) ) ;
if ( ( r = = GST_PAD_LINK_OK ) | | ( r = = GST_PAD_LINK_DONE ) ) {
/* Renegotiation succeeded, we update our size and image */
GST_VIDEOSINK_WIDTH ( ximagesink ) = ximagesink - > xwindow - > width ;
GST_VIDEOSINK_HEIGHT ( ximagesink ) = ximagesink - > xwindow - > height ;
if ( ( ximagesink - > ximage ) & &
( ( GST_VIDEOSINK_WIDTH ( ximagesink ) ! = ximagesink - > ximage - > width ) | |
( GST_VIDEOSINK_HEIGHT ( ximagesink ) ! =
ximagesink - > ximage - > height ) ) ) {
/* We renew our ximage only if size changed */
gst_ximagesink_ximage_destroy ( ximagesink , ximagesink - > ximage ) ;
ximagesink - > ximage = gst_ximagesink_ximage_new ( ximagesink ,
GST_VIDEOSINK_WIDTH ( ximagesink ) ,
GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
}
} else {
ximagesink - > sw_scaling_failed = TRUE ;
2004-02-02 21:59:35 +00:00
}
2004-03-14 22:34:34 +00:00
}
2004-02-02 21:59:35 +00:00
}
2003-11-09 19:11:26 +00:00
/* This function handles XEvents that might be in the queue. It generates
GstEvent that will be sent upstream in the pipeline to handle interactivity
and navigation . It will also listen for configure events on the window to
trigger caps renegotiation so on the fly software scaling can work . */
2003-11-08 14:58:35 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_handle_xevents ( GstXImageSink * ximagesink , GstPad * pad )
2003-11-08 14:58:35 +00:00
{
XEvent e ;
2004-02-18 13:06:49 +00:00
guint pointer_x = 0 , pointer_y = 0 ;
2004-02-18 21:16:50 +00:00
gboolean pointer_moved = FALSE ;
2004-03-14 22:34:34 +00:00
2003-11-08 14:58:35 +00:00
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
gst_ximagesink_renegotiate_size ( ximagesink ) ;
2004-03-14 22:34:34 +00:00
2004-02-02 21:59:35 +00:00
/* Then we get all pointer motion events, only the last position is
interesting . */
g_mutex_lock ( ximagesink - > x_lock ) ;
while ( XCheckWindowEvent ( ximagesink - > xcontext - > disp ,
2004-03-14 22:34:34 +00:00
ximagesink - > xwindow - > win , PointerMotionMask , & e ) ) {
g_mutex_unlock ( ximagesink - > x_lock ) ;
switch ( e . type ) {
case MotionNotify :
pointer_x = e . xmotion . x ;
pointer_y = e . xmotion . y ;
pointer_moved = TRUE ;
break ;
default :
break ;
2004-02-02 21:59:35 +00:00
}
2004-03-14 22:34:34 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
}
2004-02-02 21:59:35 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
if ( pointer_moved ) {
GST_DEBUG ( " ximagesink pointer moved over window at %d,%d " ,
pointer_x , pointer_y ) ;
gst_navigation_send_mouse_event ( GST_NAVIGATION ( ximagesink ) ,
" mouse-move " , 0 , pointer_x , pointer_y ) ;
}
2004-02-02 21:59:35 +00:00
/* We get all remaining events on our window to throw them upstream */
g_mutex_lock ( ximagesink - > x_lock ) ;
while ( XCheckWindowEvent ( ximagesink - > xcontext - > disp ,
2004-03-14 22:34:34 +00:00
ximagesink - > xwindow - > win ,
KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask , & e ) ) {
KeySym keysym ;
/* We lock only for the X function call */
g_mutex_unlock ( ximagesink - > x_lock ) ;
switch ( e . type ) {
case ButtonPress :
/* Mouse button pressed/released over our window. We send upstream
events for interactivity / navigation */
GST_DEBUG ( " ximagesink button %d pressed over window at %d,%d " ,
e . xbutton . button , e . xbutton . x , e . xbutton . x ) ;
gst_navigation_send_mouse_event ( GST_NAVIGATION ( ximagesink ) ,
" mouse-button-press " , e . xbutton . button , e . xbutton . x , e . xbutton . y ) ;
break ;
case ButtonRelease :
GST_DEBUG ( " ximagesink button %d release over window at %d,%d " ,
e . xbutton . button , e . xbutton . x , e . xbutton . x ) ;
gst_navigation_send_mouse_event ( GST_NAVIGATION ( ximagesink ) ,
" mouse-button-release " , e . xbutton . button , e . xbutton . x , e . xbutton . y ) ;
break ;
case KeyPress :
case KeyRelease :
/* Key pressed/released over our window. We send upstream
events for interactivity / navigation */
GST_DEBUG ( " ximagesink key %d pressed over window at %d,%d " ,
e . xkey . keycode , e . xkey . x , e . xkey . x ) ;
keysym = XKeycodeToKeysym ( ximagesink - > xcontext - > disp ,
e . xkey . keycode , 0 ) ;
if ( keysym ! = NoSymbol ) {
gst_navigation_send_key_event ( GST_NAVIGATION ( ximagesink ) ,
e . type = = KeyPress ?
" key-press " : " key-release " , XKeysymToString ( keysym ) ) ;
} else {
gst_navigation_send_key_event ( GST_NAVIGATION ( ximagesink ) ,
e . type = = KeyPress ? " key-press " : " key-release " , " unknown " ) ;
}
break ;
default :
GST_DEBUG ( " ximagesink unhandled X event (%d) " , e . type ) ;
2003-11-08 14:58:35 +00:00
}
2004-03-14 22:34:34 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
}
2003-11-09 19:11:26 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2003-11-08 14:58:35 +00:00
}
2003-11-09 19:11:26 +00:00
2003-11-11 11:32:27 +00:00
/* This function get the X Display and global infos about it. Everything is
2003-11-06 21:51:14 +00:00
stored in our object and will be cleaned when the object is disposed . Note
here that caps for supported format are generated without any window or
2003-11-11 11:32:27 +00:00
image creation */
2003-11-06 21:51:14 +00:00
static GstXContext *
2004-03-14 22:34:34 +00:00
gst_ximagesink_xcontext_get ( GstXImageSink * ximagesink )
2003-11-06 21:51:14 +00:00
{
GstXContext * xcontext = NULL ;
XPixmapFormatValues * px_formats = NULL ;
gint nb_formats = 0 , i ;
2004-03-14 22:34:34 +00:00
2003-11-10 19:57:57 +00:00
g_return_val_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) , NULL ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
xcontext = g_new0 ( GstXContext , 1 ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
xcontext - > disp = XOpenDisplay ( ximagesink - > display_name ) ;
2004-03-14 22:34:34 +00:00
if ( ! xcontext - > disp ) {
g_mutex_unlock ( ximagesink - > x_lock ) ;
g_free ( xcontext ) ;
GST_ELEMENT_ERROR ( ximagesink , RESOURCE , TOO_LAZY , ( NULL ) ,
( " Could not open display " ) ) ;
return NULL ;
}
2003-11-06 21:51:14 +00:00
xcontext - > screen = DefaultScreenOfDisplay ( xcontext - > disp ) ;
xcontext - > screen_num = DefaultScreen ( xcontext - > disp ) ;
2004-03-14 22:34:34 +00:00
xcontext - > visual = DefaultVisual ( xcontext - > disp , xcontext - > screen_num ) ;
2003-11-06 21:51:14 +00:00
xcontext - > root = DefaultRootWindow ( xcontext - > disp ) ;
xcontext - > white = XWhitePixel ( xcontext - > disp , xcontext - > screen_num ) ;
xcontext - > black = XBlackPixel ( xcontext - > disp , xcontext - > screen_num ) ;
xcontext - > depth = DefaultDepthOfScreen ( xcontext - > screen ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
/* We get supported pixmap formats at supported depth */
px_formats = XListPixmapFormats ( xcontext - > disp , & nb_formats ) ;
2004-03-14 22:34:34 +00:00
if ( ! px_formats ) {
XCloseDisplay ( xcontext - > disp ) ;
g_mutex_unlock ( ximagesink - > x_lock ) ;
g_free ( xcontext ) ;
return NULL ;
}
2003-11-06 21:51:14 +00:00
/* We get bpp value corresponding to our running depth */
2004-03-14 22:34:34 +00:00
for ( i = 0 ; i < nb_formats ; i + + ) {
if ( px_formats [ i ] . depth = = xcontext - > depth )
xcontext - > bpp = px_formats [ i ] . bits_per_pixel ;
}
2003-11-06 21:51:14 +00:00
XFree ( px_formats ) ;
2004-03-14 22:34:34 +00:00
xcontext - > endianness =
( ImageByteOrder ( xcontext - > disp ) = =
LSBFirst ) ? G_LITTLE_ENDIAN : G_BIG_ENDIAN ;
2003-11-12 03:06:07 +00:00
# ifdef HAVE_XSHM
2003-11-06 21:51:14 +00:00
/* Search for XShm extension support */
2004-01-28 00:29:42 +00:00
if ( XShmQueryExtension ( xcontext - > disp ) & &
2004-03-14 22:34:34 +00:00
gst_ximagesink_check_xshm_calls ( xcontext ) ) {
xcontext - > use_xshm = TRUE ;
GST_DEBUG ( " ximagesink is using XShm extension " ) ;
} else {
xcontext - > use_xshm = FALSE ;
GST_DEBUG ( " ximagesink is not using XShm extension " ) ;
}
2003-11-12 03:06:07 +00:00
# endif /* HAVE_XSHM */
2003-12-17 22:37:26 +00:00
/* our caps system handles 24/32bpp RGB as big-endian. */
if ( ( xcontext - > bpp = = 24 | | xcontext - > bpp = = 32 ) & &
xcontext - > endianness = = G_LITTLE_ENDIAN ) {
xcontext - > endianness = G_BIG_ENDIAN ;
2003-12-23 22:41:37 +00:00
xcontext - > visual - > red_mask = GUINT32_TO_BE ( xcontext - > visual - > red_mask ) ;
xcontext - > visual - > green_mask = GUINT32_TO_BE ( xcontext - > visual - > green_mask ) ;
xcontext - > visual - > blue_mask = GUINT32_TO_BE ( xcontext - > visual - > blue_mask ) ;
if ( xcontext - > bpp = = 24 ) {
xcontext - > visual - > red_mask > > = 8 ;
xcontext - > visual - > green_mask > > = 8 ;
xcontext - > visual - > blue_mask > > = 8 ;
}
2003-12-17 22:37:26 +00:00
}
2004-03-14 22:34:34 +00:00
2003-12-22 01:47:09 +00:00
xcontext - > caps = gst_caps_new_simple ( " video/x-raw-rgb " ,
2004-03-14 22:34:34 +00:00
" bpp " , G_TYPE_INT , xcontext - > bpp ,
" depth " , G_TYPE_INT , xcontext - > depth ,
2003-12-22 01:47:09 +00:00
" endianness " , G_TYPE_INT , xcontext - > endianness ,
2004-03-14 22:34:34 +00:00
" red_mask " , G_TYPE_INT , xcontext - > visual - > red_mask ,
2003-12-22 01:47:09 +00:00
" green_mask " , G_TYPE_INT , xcontext - > visual - > green_mask ,
2004-03-14 22:34:34 +00:00
" blue_mask " , G_TYPE_INT , xcontext - > visual - > blue_mask ,
" width " , GST_TYPE_INT_RANGE , 0 , G_MAXINT ,
" height " , GST_TYPE_INT_RANGE , 0 , G_MAXINT ,
" framerate " , GST_TYPE_DOUBLE_RANGE , 1.0 , 100.0 , NULL ) ;
2003-11-06 21:51:14 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
return xcontext ;
}
/* This function cleans the X context. Closing the Display and unrefing the
caps for supported formats . */
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_xcontext_clear ( GstXImageSink * ximagesink )
2003-11-06 21:51:14 +00:00
{
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
2003-12-22 01:47:09 +00:00
gst_caps_free ( ximagesink - > xcontext - > caps ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_mutex_lock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
XCloseDisplay ( ximagesink - > xcontext - > disp ) ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
g_mutex_unlock ( ximagesink - > x_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
ximagesink - > xcontext = NULL ;
2003-11-06 21:51:14 +00:00
}
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_imagepool_clear ( GstXImageSink * ximagesink )
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
{
2004-03-14 22:34:34 +00:00
g_mutex_lock ( ximagesink - > pool_lock ) ;
while ( ximagesink - > image_pool ) {
GstXImage * ximage = ximagesink - > image_pool - > data ;
ximagesink - > image_pool = g_slist_delete_link ( ximagesink - > image_pool ,
ximagesink - > image_pool ) ;
gst_ximagesink_ximage_destroy ( ximagesink , ximage ) ;
}
g_mutex_unlock ( ximagesink - > pool_lock ) ;
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
}
2003-11-11 11:32:27 +00:00
/* Element stuff */
2003-12-31 08:02:04 +00:00
static GstCaps *
2004-03-14 22:34:34 +00:00
gst_ximagesink_fixate ( GstPad * pad , const GstCaps * caps )
2003-12-31 08:02:04 +00:00
{
GstStructure * structure ;
GstCaps * newcaps ;
2004-03-14 22:34:34 +00:00
if ( gst_caps_get_size ( caps ) > 1 )
return NULL ;
2003-12-31 08:02:04 +00:00
newcaps = gst_caps_copy ( caps ) ;
structure = gst_caps_get_structure ( newcaps , 0 ) ;
if ( gst_caps_structure_fixate_field_nearest_int ( structure , " width " , 320 ) ) {
return newcaps ;
}
if ( gst_caps_structure_fixate_field_nearest_int ( structure , " height " , 240 ) ) {
return newcaps ;
}
if ( gst_caps_structure_fixate_field_nearest_double ( structure , " framerate " ,
2004-03-14 22:34:34 +00:00
30.0 ) ) {
2003-12-31 08:02:04 +00:00
return newcaps ;
}
gst_caps_free ( newcaps ) ;
return NULL ;
}
2003-11-11 11:32:27 +00:00
static GstCaps *
2004-03-14 22:34:34 +00:00
gst_ximagesink_getcaps ( GstPad * pad )
2003-11-06 21:51:14 +00:00
{
GstXImageSink * ximagesink ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
ximagesink = GST_XIMAGESINK ( gst_pad_get_parent ( pad ) ) ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
if ( ximagesink - > xcontext )
return gst_caps_copy ( ximagesink - > xcontext - > caps ) ;
2003-11-06 22:48:03 +00:00
2003-12-22 01:47:09 +00:00
return gst_caps_from_string ( " video/x-raw-rgb, "
sys/ximage/ximagesink.c: Change to using a framerate of [1,100] instead of [0,MAX], since 0 isn't handled correctly, ...
Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_handle_xevents),
(gst_ximagesink_xcontext_get), (gst_ximagesink_getcaps),
(gst_ximagesink_set_xwindow_id): Change to using a framerate
of [1,100] instead of [0,MAX], since 0 isn't handled correctly,
and neither is 100+, most likely.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support),
(gst_xvimagesink_getcaps): same
2004-01-20 09:25:51 +00:00
" framerate = (double) [ 1, 100 ], "
2004-03-14 22:34:34 +00:00
" width = (int) [ 0, MAX ], " " height = (int) [ 0, MAX ] " ) ;
2003-11-06 21:51:14 +00:00
}
2003-11-11 11:32:27 +00:00
static GstPadLinkReturn
2004-03-14 22:34:34 +00:00
gst_ximagesink_sink_link ( GstPad * pad , const GstCaps * caps )
2003-11-06 21:51:14 +00:00
{
GstXImageSink * ximagesink ;
2003-11-26 10:12:05 +00:00
char * caps_str1 , * caps_str2 ;
2003-12-22 01:47:09 +00:00
gboolean ret ;
GstStructure * structure ;
2003-11-06 21:51:14 +00:00
2003-11-11 11:32:27 +00:00
ximagesink = GST_XIMAGESINK ( gst_pad_get_parent ( pad ) ) ;
2003-11-06 21:51:14 +00:00
2003-11-22 04:06:50 +00:00
if ( ! ximagesink - > xcontext )
return GST_PAD_LINK_DELAYED ;
2004-03-14 22:34:34 +00:00
2003-11-26 10:12:05 +00:00
caps_str1 = gst_caps_to_string ( ximagesink - > xcontext - > caps ) ;
caps_str2 = gst_caps_to_string ( caps ) ;
GST_DEBUG ( " sinkconnect %s with %s " , caps_str1 , caps_str2 ) ;
2003-12-22 01:47:09 +00:00
g_free ( caps_str1 ) ;
g_free ( caps_str2 ) ;
2003-11-26 10:12:05 +00:00
2003-12-22 01:47:09 +00:00
structure = gst_caps_get_structure ( caps , 0 ) ;
ret = gst_structure_get_int ( structure , " width " ,
2004-03-14 22:34:34 +00:00
& ( GST_VIDEOSINK_WIDTH ( ximagesink ) ) ) ;
2003-12-22 01:47:09 +00:00
ret & = gst_structure_get_int ( structure , " height " ,
2004-03-14 22:34:34 +00:00
& ( GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ) ;
2003-12-22 01:47:09 +00:00
ret & = gst_structure_get_double ( structure ,
2004-03-14 22:34:34 +00:00
" framerate " , & ximagesink - > framerate ) ;
if ( ! ret )
return GST_PAD_LINK_REFUSED ;
2003-12-22 01:47:09 +00:00
ximagesink - > pixel_width = 1 ;
2004-03-14 22:34:34 +00:00
gst_structure_get_int ( structure , " pixel_width " , & ximagesink - > pixel_width ) ;
2003-11-11 11:32:27 +00:00
2003-12-22 01:47:09 +00:00
ximagesink - > pixel_height = 1 ;
2004-03-14 22:34:34 +00:00
gst_structure_get_int ( structure , " pixel_height " , & ximagesink - > pixel_height ) ;
2003-11-11 11:32:27 +00:00
/* Creating our window and our image */
if ( ! ximagesink - > xwindow )
ximagesink - > xwindow = gst_ximagesink_xwindow_new ( ximagesink ,
2004-03-14 22:34:34 +00:00
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
else {
if ( ximagesink - > xwindow - > internal )
gst_ximagesink_xwindow_resize ( ximagesink , ximagesink - > xwindow ,
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
}
if ( ( ximagesink - > ximage ) & & ( ( GST_VIDEOSINK_WIDTH ( ximagesink ) ! = ximagesink - > ximage - > width ) | | ( GST_VIDEOSINK_HEIGHT ( ximagesink ) ! = ximagesink - > ximage - > height ) ) ) { /* We renew our ximage only if size changed */
gst_ximagesink_ximage_destroy ( ximagesink , ximagesink - > ximage ) ;
ximagesink - > ximage = gst_ximagesink_ximage_new ( ximagesink ,
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
} else if ( ! ximagesink - > ximage ) /* If no ximage, creating one */
2003-11-11 11:32:27 +00:00
ximagesink - > ximage = gst_ximagesink_ximage_new ( ximagesink ,
2004-03-14 22:34:34 +00:00
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
2004-01-04 18:53:53 +00:00
gst_x_overlay_got_desired_size ( GST_X_OVERLAY ( ximagesink ) ,
2004-03-14 22:34:34 +00:00
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
2003-11-11 11:32:27 +00:00
return GST_PAD_LINK_OK ;
2003-11-06 21:51:14 +00:00
}
2003-11-11 11:32:27 +00:00
static GstElementStateReturn
2004-03-14 22:34:34 +00:00
gst_ximagesink_change_state ( GstElement * element )
2003-11-06 21:51:14 +00:00
{
GstXImageSink * ximagesink ;
2003-11-11 11:32:27 +00:00
ximagesink = GST_XIMAGESINK ( element ) ;
switch ( GST_STATE_TRANSITION ( element ) ) {
case GST_STATE_NULL_TO_READY :
/* Initializing the XContext */
2003-11-17 16:32:29 +00:00
if ( ! ximagesink - > xcontext )
2004-03-14 22:34:34 +00:00
ximagesink - > xcontext = gst_ximagesink_xcontext_get ( ximagesink ) ;
2003-11-11 11:32:27 +00:00
if ( ! ximagesink - > xcontext )
2004-03-14 22:34:34 +00:00
return GST_STATE_FAILURE ;
2003-11-11 11:32:27 +00:00
break ;
case GST_STATE_READY_TO_PAUSED :
2004-03-05 14:40:41 +00:00
if ( ximagesink - > xwindow )
2004-03-14 22:34:34 +00:00
gst_ximagesink_xwindow_clear ( ximagesink , ximagesink - > xwindow ) ;
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
ximagesink - > time = 0 ;
2003-11-11 11:32:27 +00:00
break ;
case GST_STATE_PAUSED_TO_PLAYING :
break ;
case GST_STATE_PLAYING_TO_PAUSED :
break ;
case GST_STATE_PAUSED_TO_READY :
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
ximagesink - > framerate = 0 ;
2004-02-18 21:16:50 +00:00
ximagesink - > sw_scaling_failed = FALSE ;
2004-01-04 18:53:53 +00:00
GST_VIDEOSINK_WIDTH ( ximagesink ) = 0 ;
GST_VIDEOSINK_HEIGHT ( ximagesink ) = 0 ;
2003-11-11 11:32:27 +00:00
break ;
case GST_STATE_READY_TO_NULL :
2004-03-14 22:34:34 +00:00
if ( ximagesink - > ximage ) {
gst_ximagesink_ximage_destroy ( ximagesink , ximagesink - > ximage ) ;
ximagesink - > ximage = NULL ;
}
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
if ( ximagesink - > image_pool )
2004-03-14 22:34:34 +00:00
gst_ximagesink_imagepool_clear ( ximagesink ) ;
if ( ximagesink - > xwindow ) {
gst_ximagesink_xwindow_destroy ( ximagesink , ximagesink - > xwindow ) ;
ximagesink - > xwindow = NULL ;
}
if ( ximagesink - > xcontext ) {
gst_ximagesink_xcontext_clear ( ximagesink ) ;
ximagesink - > xcontext = NULL ;
}
2003-11-11 11:32:27 +00:00
break ;
2003-11-06 21:51:14 +00:00
}
2003-11-19 22:31:46 +00:00
if ( GST_ELEMENT_CLASS ( parent_class ) - > change_state )
return GST_ELEMENT_CLASS ( parent_class ) - > change_state ( element ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
return GST_STATE_SUCCESS ;
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_chain ( GstPad * pad , GstData * data )
2003-11-06 21:51:14 +00:00
{
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
GstBuffer * buf = GST_BUFFER ( data ) ;
2003-11-06 21:51:14 +00:00
GstXImageSink * ximagesink ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
g_return_if_fail ( GST_IS_PAD ( pad ) ) ;
g_return_if_fail ( buf ! = NULL ) ;
ximagesink = GST_XIMAGESINK ( gst_pad_get_parent ( pad ) ) ;
2004-03-14 22:34:34 +00:00
if ( GST_IS_EVENT ( data ) ) {
gst_pad_event_default ( pad , GST_EVENT ( data ) ) ;
return ;
}
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
buf = GST_BUFFER ( data ) ;
/* update time */
if ( GST_BUFFER_TIMESTAMP_IS_VALID ( buf ) ) {
ximagesink - > time = GST_BUFFER_TIMESTAMP ( buf ) ;
}
GST_DEBUG ( " videosink: clock wait: % " G_GUINT64_FORMAT , ximagesink - > time ) ;
2004-02-01 22:33:07 +00:00
2003-11-19 20:43:49 +00:00
if ( GST_VIDEOSINK_CLOCK ( ximagesink ) ) {
2004-01-14 00:53:52 +00:00
gst_element_wait ( GST_ELEMENT ( ximagesink ) , ximagesink - > time ) ;
2003-11-06 21:51:14 +00:00
}
2004-03-14 22:34:34 +00:00
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* If this buffer has been allocated using our buffer management we simply
put the ximage which is in the PRIVATE pointer */
2004-03-14 22:34:34 +00:00
if ( GST_BUFFER_FREE_DATA_FUNC ( buf ) = = gst_ximagesink_buffer_free ) {
gst_ximagesink_ximage_put ( ximagesink , GST_BUFFER_PRIVATE ( buf ) ) ;
} else { /* Else we have to copy the data into our private image, */
/* if we have one... */
if ( ximagesink - > ximage ) {
memcpy ( ximagesink - > ximage - > ximage - > data ,
GST_BUFFER_DATA ( buf ) ,
MIN ( GST_BUFFER_SIZE ( buf ) , ximagesink - > ximage - > size ) ) ;
gst_ximagesink_ximage_put ( ximagesink , ximagesink - > ximage ) ;
} else { /* No image available. Something went wrong during capsnego ! */
gst_buffer_unref ( buf ) ;
GST_ELEMENT_ERROR ( ximagesink , CORE , NEGOTIATION , ( NULL ) ,
( " no format defined before chain function " ) ) ;
return ;
2003-11-06 21:51:14 +00:00
}
2004-03-14 22:34:34 +00:00
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
/* set correct time for next buffer */
if ( ! GST_BUFFER_TIMESTAMP_IS_VALID ( buf ) & & ximagesink - > framerate > 0 ) {
ximagesink - > time + = GST_SECOND / ximagesink - > framerate ;
}
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
gst_buffer_unref ( buf ) ;
2004-03-14 22:34:34 +00:00
2003-11-08 14:58:35 +00:00
gst_ximagesink_handle_xevents ( ximagesink , pad ) ;
2003-11-06 21:51:14 +00:00
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* Buffer management */
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_buffer_free ( GstBuffer * buffer )
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
{
GstXImageSink * ximagesink ;
GstXImage * ximage ;
2004-03-14 22:34:34 +00:00
2004-01-12 02:01:52 +00:00
ximage = GST_BUFFER_PRIVATE ( buffer ) ;
2004-03-14 22:34:34 +00:00
2004-01-11 22:52:29 +00:00
g_assert ( GST_IS_XIMAGESINK ( ximage - > ximagesink ) ) ;
ximagesink = ximage - > ximagesink ;
2004-03-14 22:34:34 +00:00
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* If our geometry changed we can't reuse that image. */
2004-03-14 22:34:34 +00:00
if ( ( ximage - > width ! = GST_VIDEOSINK_WIDTH ( ximagesink ) ) | |
( ximage - > height ! = GST_VIDEOSINK_HEIGHT ( ximagesink ) ) )
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
gst_ximagesink_ximage_destroy ( ximagesink , ximage ) ;
2004-03-14 22:34:34 +00:00
else { /* In that case we can reuse the image and add it to our image pool. */
g_mutex_lock ( ximagesink - > pool_lock ) ;
ximagesink - > image_pool = g_slist_prepend ( ximagesink - > image_pool , ximage ) ;
g_mutex_unlock ( ximagesink - > pool_lock ) ;
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
}
static GstBuffer *
2004-03-14 22:34:34 +00:00
gst_ximagesink_buffer_alloc ( GstPad * pad , guint64 offset , guint size )
2003-11-06 21:51:14 +00:00
{
GstXImageSink * ximagesink ;
GstBuffer * buffer ;
GstXImage * ximage = NULL ;
gboolean not_found = TRUE ;
2004-03-14 22:34:34 +00:00
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
ximagesink = GST_XIMAGESINK ( gst_pad_get_parent ( pad ) ) ;
2003-11-06 21:51:14 +00:00
g_mutex_lock ( ximagesink - > pool_lock ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
/* Walking through the pool cleaning unsuable images and searching for a
suitable one */
2004-03-14 22:34:34 +00:00
while ( not_found & & ximagesink - > image_pool ) {
ximage = ximagesink - > image_pool - > data ;
if ( ximage ) {
/* Removing from the pool */
ximagesink - > image_pool = g_slist_delete_link ( ximagesink - > image_pool ,
ximagesink - > image_pool ) ;
if ( ( ximage - > width ! = GST_VIDEOSINK_WIDTH ( ximagesink ) ) | | ( ximage - > height ! = GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ) { /* This image is unusable. Destroying... */
gst_ximagesink_ximage_destroy ( ximagesink , ximage ) ;
ximage = NULL ;
} else { /* We found a suitable image */
break ;
}
2003-11-06 21:51:14 +00:00
}
2004-03-14 22:34:34 +00:00
}
2003-11-11 11:32:27 +00:00
g_mutex_unlock ( ximagesink - > pool_lock ) ;
2004-03-14 22:34:34 +00:00
if ( ! ximage ) { /* We found no suitable image in the pool. Creating... */
ximage = gst_ximagesink_ximage_new ( ximagesink ,
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
}
if ( ximage ) {
buffer = gst_buffer_new ( ) ;
/* Storing some pointers in the buffer */
GST_BUFFER_PRIVATE ( buffer ) = ximage ;
GST_BUFFER_DATA ( buffer ) = ximage - > ximage - > data ;
GST_BUFFER_FREE_DATA_FUNC ( buffer ) = gst_ximagesink_buffer_free ;
GST_BUFFER_SIZE ( buffer ) = ximage - > size ;
return buffer ;
} else
2003-11-11 11:32:27 +00:00
return NULL ;
}
2003-11-17 16:32:29 +00:00
/* Interfaces stuff */
static gboolean
2004-03-14 22:34:34 +00:00
gst_ximagesink_interface_supported ( GstImplementsInterface * iface , GType type )
2003-11-17 16:32:29 +00:00
{
g_assert ( type = = GST_TYPE_NAVIGATION | | type = = GST_TYPE_X_OVERLAY ) ;
return TRUE ;
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_interface_init ( GstImplementsInterfaceClass * klass )
2003-11-17 16:32:29 +00:00
{
klass - > supported = gst_ximagesink_interface_supported ;
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_navigation_send_event ( GstNavigation * navigation ,
GstStructure * structure )
2003-11-17 16:32:29 +00:00
{
GstXImageSink * ximagesink = GST_XIMAGESINK ( navigation ) ;
GstEvent * event ;
gint x_offset , y_offset ;
2004-03-14 22:34:34 +00:00
double x , y ;
2003-11-17 16:32:29 +00:00
event = gst_event_new ( GST_EVENT_NAVIGATION ) ;
event - > event_data . structure . structure = structure ;
/* We are not converting the pointer coordinates as there's no hardware
scaling done here . The only possible scaling is done by videoscale and
videoscale will have to catch those events and tranform the coordinates
to match the applied scaling . So here we just add the offset if the image
is centered in the window . */
2004-03-14 22:34:34 +00:00
2003-11-19 20:43:49 +00:00
x_offset = ximagesink - > xwindow - > width - GST_VIDEOSINK_WIDTH ( ximagesink ) ;
y_offset = ximagesink - > xwindow - > height - GST_VIDEOSINK_HEIGHT ( ximagesink ) ;
2004-03-14 22:34:34 +00:00
if ( gst_structure_get_double ( structure , " pointer_x " , & x ) ) {
x + = x_offset ;
gst_structure_set ( structure , " pointer_x " , G_TYPE_DOUBLE , x , NULL ) ;
}
if ( gst_structure_get_double ( structure , " pointer_y " , & y ) ) {
y + = y_offset ;
gst_structure_set ( structure , " pointer_y " , G_TYPE_DOUBLE , y , NULL ) ;
}
2003-11-19 20:43:49 +00:00
gst_pad_send_event ( gst_pad_get_peer ( GST_VIDEOSINK_PAD ( ximagesink ) ) , event ) ;
2003-11-17 16:32:29 +00:00
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_navigation_init ( GstNavigationInterface * iface )
2003-11-17 16:32:29 +00:00
{
iface - > send_event = gst_ximagesink_navigation_send_event ;
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_set_xwindow_id ( GstXOverlay * overlay , XID xwindow_id )
2003-11-17 16:32:29 +00:00
{
GstXImageSink * ximagesink = GST_XIMAGESINK ( overlay ) ;
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
GstXWindow * xwindow = NULL ;
XWindowAttributes attr ;
2004-03-14 22:34:34 +00:00
2003-11-17 16:32:29 +00:00
g_return_if_fail ( GST_IS_XIMAGESINK ( ximagesink ) ) ;
2004-03-14 22:34:34 +00:00
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* If we already use that window return */
if ( ximagesink - > xwindow & & ( xwindow_id = = ximagesink - > xwindow - > win ) )
return ;
2004-03-14 22:34:34 +00:00
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* If the element has not initialized the X11 context try to do so */
2003-11-17 16:32:29 +00:00
if ( ! ximagesink - > xcontext )
examples/gstplay/player.c: Adding some new lines in g_print calls.
Original commit message from CVS:
* examples/gstplay/player.c: (got_time_tick), (got_stream_length),
(got_video_size): Adding some new lines in g_print calls.
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_new),
(gst_ximagesink_xwindow_destroy), (gst_ximagesink_xwindow_resize),
(gst_ximagesink_handle_xevents), (gst_ximagesink_fixate),
(gst_ximagesink_sinkconnect), (gst_ximagesink_change_state),
(gst_ximagesink_chain), (gst_ximagesink_buffer_new),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_get_desired_size):
Complete code review, reverting some stuff i disagree with, adding
some fixes : time synchronization on invalid timestamps, renegotiation
of private window.
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_destroy),
(gst_xvimagesink_xwindow_resize), (gst_xvimagesink_handle_xevents),
(gst_xvimagesink_get_xv_support), (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_fixate), (gst_xvimagesink_sinkconnect),
(gst_xvimagesink_change_state), (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_new),
(gst_xvimagesink_navigation_send_event),
(gst_xvimagesink_set_xwindow_id),
(gst_xvimagesink_get_desired_size),
(gst_xvimagesink_xoverlay_init): Complete code review, reverting some
stuff i disagree with, adding some fixes : Renegotiation of private
window, implementing get_desired_size.
2004-01-07 15:33:42 +00:00
ximagesink - > xcontext = gst_ximagesink_xcontext_get ( ximagesink ) ;
2004-03-14 22:34:34 +00:00
if ( ! ximagesink - > xcontext ) {
g_warning ( " ximagesink was unable to obtain the X11 context. " ) ;
return ;
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* Clear image pool as the images are unusable anyway */
gst_ximagesink_imagepool_clear ( ximagesink ) ;
2004-03-14 22:34:34 +00:00
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* Clear the ximage */
2004-03-14 22:34:34 +00:00
if ( ximagesink - > ximage ) {
gst_ximagesink_ximage_destroy ( ximagesink , ximagesink - > ximage ) ;
ximagesink - > ximage = NULL ;
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* If a window is there already we destroy it */
2004-03-14 22:34:34 +00:00
if ( ximagesink - > xwindow ) {
gst_ximagesink_xwindow_destroy ( ximagesink , ximagesink - > xwindow ) ;
ximagesink - > xwindow = NULL ;
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* If the xid is 0 we go back to an internal window */
2004-03-14 22:34:34 +00:00
if ( xwindow_id = = 0 ) {
/* If no width/height caps nego did not happen window will be created
during caps nego then */
if ( GST_VIDEOSINK_WIDTH ( ximagesink ) & & GST_VIDEOSINK_HEIGHT ( ximagesink ) ) {
xwindow = gst_ximagesink_xwindow_new ( ximagesink ,
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
}
2004-03-14 22:34:34 +00:00
} else {
xwindow = g_new0 ( GstXWindow , 1 ) ;
xwindow - > win = xwindow_id ;
/* We get window geometry, set the event we want to receive,
and create a GC */
g_mutex_lock ( ximagesink - > x_lock ) ;
XGetWindowAttributes ( ximagesink - > xcontext - > disp , xwindow - > win , & attr ) ;
xwindow - > width = attr . width ;
xwindow - > height = attr . height ;
xwindow - > internal = FALSE ;
XSelectInput ( ximagesink - > xcontext - > disp , xwindow - > win , ExposureMask |
StructureNotifyMask | PointerMotionMask | KeyPressMask |
KeyReleaseMask ) ;
xwindow - > gc = XCreateGC ( ximagesink - > xcontext - > disp , xwindow - > win , 0 , NULL ) ;
g_mutex_unlock ( ximagesink - > x_lock ) ;
/* If that new window geometry differs from our one we try to
renegotiate caps */
if ( gst_pad_is_negotiated ( GST_VIDEOSINK_PAD ( ximagesink ) ) & &
( xwindow - > width ! = GST_VIDEOSINK_WIDTH ( ximagesink ) | |
xwindow - > height ! = GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ) {
GstPadLinkReturn r ;
r = gst_pad_try_set_caps ( GST_VIDEOSINK_PAD ( ximagesink ) ,
gst_caps_new_simple ( " video/x-raw-rgb " ,
" bpp " , G_TYPE_INT , ximagesink - > xcontext - > bpp ,
" depth " , G_TYPE_INT , ximagesink - > xcontext - > depth ,
" endianness " , G_TYPE_INT , ximagesink - > xcontext - > endianness ,
" red_mask " , G_TYPE_INT , ximagesink - > xcontext - > visual - > red_mask ,
" green_mask " , G_TYPE_INT ,
ximagesink - > xcontext - > visual - > green_mask , " blue_mask " , G_TYPE_INT ,
ximagesink - > xcontext - > visual - > blue_mask , " width " , G_TYPE_INT ,
xwindow - > width , " height " , G_TYPE_INT , xwindow - > height ,
" framerate " , G_TYPE_DOUBLE , ximagesink - > framerate , NULL ) ) ;
/* If caps nego succeded updating our size */
if ( ( r = = GST_PAD_LINK_OK ) | | ( r = = GST_PAD_LINK_DONE ) ) {
GST_VIDEOSINK_WIDTH ( ximagesink ) = xwindow - > width ;
GST_VIDEOSINK_HEIGHT ( ximagesink ) = xwindow - > height ;
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
}
2004-03-14 22:34:34 +00:00
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
/* Recreating our ximage */
if ( ! ximagesink - > ximage & &
2004-03-14 22:34:34 +00:00
GST_VIDEOSINK_WIDTH ( ximagesink ) & & GST_VIDEOSINK_HEIGHT ( ximagesink ) ) {
ximagesink - > ximage = gst_ximagesink_ximage_new ( ximagesink ,
GST_VIDEOSINK_WIDTH ( ximagesink ) , GST_VIDEOSINK_HEIGHT ( ximagesink ) ) ;
}
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
if ( xwindow )
ximagesink - > xwindow = xwindow ;
2004-01-04 18:53:53 +00:00
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_get_desired_size ( GstXOverlay * overlay ,
guint * width , guint * height )
2004-01-04 18:53:53 +00:00
{
GstXImageSink * ximagesink = GST_XIMAGESINK ( overlay ) ;
* width = GST_VIDEOSINK_WIDTH ( ximagesink ) ;
* height = GST_VIDEOSINK_HEIGHT ( ximagesink ) ;
2003-11-17 16:32:29 +00:00
}
2004-02-03 23:05:46 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_expose ( GstXOverlay * overlay )
2004-02-03 23:05:46 +00:00
{
GstXImageSink * ximagesink = GST_XIMAGESINK ( overlay ) ;
2004-03-14 22:34:34 +00:00
2004-02-16 23:45:55 +00:00
if ( ! ximagesink - > xwindow )
return ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
gst_ximagesink_xwindow_update_geometry ( ximagesink , ximagesink - > xwindow ) ;
2004-03-14 22:34:34 +00:00
2004-02-18 13:06:49 +00:00
/* We don't act on internal window from outside that could cause some thread
race with the video sink own thread checking for configure event */
if ( ximagesink - > xwindow - > internal )
return ;
2004-03-14 22:34:34 +00:00
2004-02-16 23:45:55 +00:00
gst_ximagesink_xwindow_clear ( ximagesink , ximagesink - > xwindow ) ;
2004-03-14 22:34:34 +00:00
2004-02-18 13:06:49 +00:00
if ( ximagesink - > cur_image )
2004-02-03 23:05:46 +00:00
gst_ximagesink_ximage_put ( ximagesink , ximagesink - > cur_image ) ;
}
2003-11-17 16:32:29 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_xoverlay_init ( GstXOverlayClass * iface )
2003-11-17 16:32:29 +00:00
{
iface - > set_xwindow_id = gst_ximagesink_set_xwindow_id ;
2004-01-04 18:53:53 +00:00
iface - > get_desired_size = gst_ximagesink_get_desired_size ;
2004-02-03 23:05:46 +00:00
iface - > expose = gst_ximagesink_expose ;
2003-11-17 16:32:29 +00:00
}
2003-11-11 11:32:27 +00:00
/* =========================================== */
/* */
/* Init & Class init */
/* */
/* =========================================== */
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_set_property ( GObject * object , guint prop_id ,
const GValue * value , GParamSpec * pspec )
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
{
GstXImageSink * ximagesink ;
2004-03-14 22:34:34 +00:00
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
g_return_if_fail ( GST_IS_XIMAGESINK ( object ) ) ;
2004-03-14 22:34:34 +00:00
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
ximagesink = GST_XIMAGESINK ( object ) ;
2004-03-14 22:34:34 +00:00
switch ( prop_id ) {
case ARG_DISPLAY :
ximagesink - > display_name = g_strdup ( g_value_get_string ( value ) ) ;
break ;
case ARG_SYNCHRONOUS :
ximagesink - > synchronous = g_value_get_boolean ( value ) ;
if ( ximagesink - > xcontext ) {
XSynchronize ( ximagesink - > xcontext - > disp , ximagesink - > synchronous ) ;
}
break ;
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
break ;
}
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_get_property ( GObject * object , guint prop_id ,
GValue * value , GParamSpec * pspec )
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
{
GstXImageSink * ximagesink ;
2004-03-14 22:34:34 +00:00
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
g_return_if_fail ( GST_IS_XIMAGESINK ( object ) ) ;
2004-03-14 22:34:34 +00:00
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
ximagesink = GST_XIMAGESINK ( object ) ;
2004-03-14 22:34:34 +00:00
switch ( prop_id ) {
case ARG_DISPLAY :
g_value_set_string ( value , g_strdup ( ximagesink - > display_name ) ) ;
break ;
case ARG_SYNCHRONOUS :
g_value_set_boolean ( value , ximagesink - > synchronous ) ;
break ;
default :
G_OBJECT_WARN_INVALID_PROPERTY_ID ( object , prop_id , pspec ) ;
break ;
}
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
}
2003-11-11 11:32:27 +00:00
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_dispose ( GObject * object )
2003-11-11 11:32:27 +00:00
{
GstXImageSink * ximagesink ;
ximagesink = GST_XIMAGESINK ( object ) ;
2004-03-14 22:34:34 +00:00
if ( ximagesink - > display_name ) {
g_free ( ximagesink - > display_name ) ;
ximagesink - > display_name = NULL ;
}
gst-libs/gst/play/gstplay.c: Reworked the pipeline from scratch. Visualization is back and switch went out as i reali...
Original commit message from CVS:
2004-01-23 Julien MOUTTE <julien@moutte.net>
* gst-libs/gst/play/gstplay.c: (gst_play_pipeline_setup),
(gst_play_set_location), (gst_play_seek_to_time),
(gst_play_set_audio_sink), (gst_play_set_visualization),
(gst_play_connect_visualization), (gst_play_get_sink_element): Reworked
the pipeline from scratch. Visualization is back and switch went out as
i realized it was not possible to use the way i wanted.
* sys/ximage/ximagesink.c: (gst_ximagesink_imagepool_clear),
(gst_ximagesink_change_state), (gst_ximagesink_dispose): Move xcontext
clearing in state change from READY to NULL. So that one can clean the
X ressources keeping the element.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_imagepool_clear), (gst_xvimagesink_change_state),
(gst_xvimagesink_colorbalance_set_value),
(gst_xvimagesink_colorbalance_get_value),
(gst_xvimagesink_set_property), (gst_xvimagesink_dispose),
(gst_xvimagesink_init): Same xcontext cleaning than ximagesink in state
change from READY to NULL and fixed some stupid bugs in colorbalance
get/set values. Also added the following feature : when nobody tries to
set some values to the colorbalance levels before the xcontext is
grabbed, then when creating channels list from Xv attributes we set the
internal values to the Xv defaults. This way we handle buggy Xv drivers
that set default hue values far from the middle of the range (Thanks
to Jon Trowbridge for pointing that issue).
* sys/xvimage/xvimagesink.h: Adding a cb_changed boolean to know if
colorbalance levels have been set before xcontext is grabbed.
2004-01-22 23:54:34 +00:00
2003-11-11 11:32:27 +00:00
g_mutex_free ( ximagesink - > x_lock ) ;
g_mutex_free ( ximagesink - > pool_lock ) ;
G_OBJECT_CLASS ( parent_class ) - > dispose ( object ) ;
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_init ( GstXImageSink * ximagesink )
2003-11-11 11:32:27 +00:00
{
2004-03-14 22:34:34 +00:00
GST_VIDEOSINK_PAD ( ximagesink ) =
gst_pad_new_from_template ( gst_static_pad_template_get
( & gst_ximagesink_sink_template_factory ) , " sink " ) ;
2003-11-19 20:43:49 +00:00
gst_element_add_pad ( GST_ELEMENT ( ximagesink ) ,
2004-03-14 22:34:34 +00:00
GST_VIDEOSINK_PAD ( ximagesink ) ) ;
2003-11-19 20:43:49 +00:00
gst_pad_set_chain_function ( GST_VIDEOSINK_PAD ( ximagesink ) ,
2004-03-14 22:34:34 +00:00
gst_ximagesink_chain ) ;
2003-11-19 20:43:49 +00:00
gst_pad_set_link_function ( GST_VIDEOSINK_PAD ( ximagesink ) ,
2004-03-14 22:34:34 +00:00
gst_ximagesink_sink_link ) ;
2003-11-19 20:43:49 +00:00
gst_pad_set_getcaps_function ( GST_VIDEOSINK_PAD ( ximagesink ) ,
2004-03-14 22:34:34 +00:00
gst_ximagesink_getcaps ) ;
2003-12-31 08:02:04 +00:00
gst_pad_set_fixate_function ( GST_VIDEOSINK_PAD ( ximagesink ) ,
2004-03-14 22:34:34 +00:00
gst_ximagesink_fixate ) ;
ext/ffmpeg/gstffmpegcolorspace.c: Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst-libs/gst/xoverlay/xoverlay.c:
(gst_x_overlay_got_desired_size): Updating doc for the xid being 0.
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* gst/videotestsrc/gstvideotestsrc.c: (gst_videotestsrc_get):
Implementing gst_pad_alloc_buffer to use optimized buffer allocation.
* sys/ximage/ximagesink.c: (gst_ximagesink_chain),
(gst_ximagesink_buffer_free), (gst_ximagesink_buffer_alloc),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_chain),
(gst_xvimagesink_buffer_free), (gst_xvimagesink_buffer_alloc),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init): Implementing
the bufferalloc_function to replace bufferpools, fixing the XOverlay
interface implementation to handle xid being 0 and fix some bugs
triggered by Benjamin's testcase.
2004-01-09 18:05:57 +00:00
gst_pad_set_bufferalloc_function ( GST_VIDEOSINK_PAD ( ximagesink ) ,
2004-03-14 22:34:34 +00:00
gst_ximagesink_buffer_alloc ) ;
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
ximagesink - > display_name = NULL ;
2003-11-11 11:32:27 +00:00
ximagesink - > xcontext = NULL ;
ximagesink - > xwindow = NULL ;
ximagesink - > ximage = NULL ;
2004-02-03 23:05:46 +00:00
ximagesink - > cur_image = NULL ;
2004-03-14 22:34:34 +00:00
2003-11-12 13:06:21 +00:00
ximagesink - > framerate = 0 ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
ximagesink - > x_lock = g_mutex_new ( ) ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
ximagesink - > pixel_width = ximagesink - > pixel_height = 1 ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
ximagesink - > image_pool = NULL ;
ximagesink - > pool_lock = g_mutex_new ( ) ;
2004-03-14 22:34:34 +00:00
2004-02-18 21:16:50 +00:00
ximagesink - > sw_scaling_failed = FALSE ;
ximagesink - > synchronous = FALSE ;
2003-11-11 11:32:27 +00:00
2004-03-14 22:34:34 +00:00
GST_FLAG_SET ( ximagesink , GST_ELEMENT_THREAD_SUGGESTED ) ;
GST_FLAG_SET ( ximagesink , GST_ELEMENT_EVENT_AWARE ) ;
2003-11-06 21:51:14 +00:00
}
static void
gst_ximagesink_base_init ( gpointer g_class )
{
GstElementClass * element_class = GST_ELEMENT_CLASS ( g_class ) ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
gst_element_class_set_details ( element_class , & gst_ximagesink_details ) ;
2004-03-14 22:34:34 +00:00
gst_element_class_add_pad_template ( element_class ,
gst_static_pad_template_get ( & gst_ximagesink_sink_template_factory ) ) ;
2003-11-06 21:51:14 +00:00
}
static void
2004-03-14 22:34:34 +00:00
gst_ximagesink_class_init ( GstXImageSinkClass * klass )
2003-11-06 21:51:14 +00:00
{
GObjectClass * gobject_class ;
GstElementClass * gstelement_class ;
gobject_class = ( GObjectClass * ) klass ;
gstelement_class = ( GstElementClass * ) klass ;
2003-11-19 20:43:49 +00:00
parent_class = g_type_class_ref ( GST_TYPE_VIDEOSINK ) ;
2004-03-14 22:34:34 +00:00
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
g_object_class_install_property ( gobject_class , ARG_DISPLAY ,
2004-03-14 22:34:34 +00:00
g_param_spec_string ( " display " , " Display " , " X Display name " ,
NULL , G_PARAM_READWRITE ) ) ;
2004-01-18 12:32:19 +00:00
g_object_class_install_property ( gobject_class , ARG_SYNCHRONOUS ,
2004-03-14 22:34:34 +00:00
g_param_spec_boolean ( " synchronous " , " Synchronous " , " When enabled, runs "
" the X display in synchronous mode. (used only for debugging) " , FALSE ,
G_PARAM_READWRITE ) ) ;
2003-11-11 11:32:27 +00:00
gobject_class - > dispose = gst_ximagesink_dispose ;
gst/videofilter/gstvideobalance.c: Fixing videobalance ranges for colorbalance interface implementation.
Original commit message from CVS:
2004-01-14 Julien MOUTTE <julien@moutte.net>
* gst/videofilter/gstvideobalance.c: (gst_videobalance_init),
(gst_videobalance_colorbalance_set_value),
(gst_videobalance_colorbalance_get_value): Fixing videobalance ranges
for colorbalance interface implementation.
* sys/ximage/ximagesink.c: (gst_ximagesink_xcontext_get),
(gst_ximagesink_set_property), (gst_ximagesink_get_property),
(gst_ximagesink_dispose), (gst_ximagesink_init),
(gst_ximagesink_class_init): Adding DISPLAY property.
* sys/ximage/ximagesink.h: Adding display_name to store display.
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xcontext_get),
(gst_xvimagesink_set_property), (gst_xvimagesink_get_property),
(gst_xvimagesink_dispose), (gst_xvimagesink_init),
(gst_xvimagesink_class_init): Adding DISPLAY property and colorbalance
properties (they still need polishing though for gst-launch use : no
xcontext yet, i ll do that tomorrow).
* sys/xvimage/xvimagesink.h: Adding display_name to store display.
2004-01-14 23:01:49 +00:00
gobject_class - > set_property = gst_ximagesink_set_property ;
gobject_class - > get_property = gst_ximagesink_get_property ;
2004-03-14 22:34:34 +00:00
2003-11-06 21:51:14 +00:00
gstelement_class - > change_state = gst_ximagesink_change_state ;
}
/* ============================================================= */
/* */
/* Public Methods */
/* */
/* ============================================================= */
/* =========================================== */
/* */
/* Object typing & Creation */
/* */
/* =========================================== */
GType
gst_ximagesink_get_type ( void )
{
static GType ximagesink_type = 0 ;
2004-03-14 22:34:34 +00:00
if ( ! ximagesink_type ) {
static const GTypeInfo ximagesink_info = {
sizeof ( GstXImageSinkClass ) ,
gst_ximagesink_base_init ,
NULL ,
( GClassInitFunc ) gst_ximagesink_class_init ,
NULL ,
NULL ,
sizeof ( GstXImageSink ) ,
0 ,
( GInstanceInitFunc ) gst_ximagesink_init ,
} ;
static const GInterfaceInfo iface_info = {
( GInterfaceInitFunc ) gst_ximagesink_interface_init ,
NULL ,
NULL ,
} ;
static const GInterfaceInfo navigation_info = {
( GInterfaceInitFunc ) gst_ximagesink_navigation_init ,
NULL ,
NULL ,
} ;
static const GInterfaceInfo overlay_info = {
( GInterfaceInitFunc ) gst_ximagesink_xoverlay_init ,
NULL ,
NULL ,
} ;
ximagesink_type = g_type_register_static ( GST_TYPE_VIDEOSINK ,
" GstXImageSink " , & ximagesink_info , 0 ) ;
g_type_add_interface_static ( ximagesink_type , GST_TYPE_IMPLEMENTS_INTERFACE ,
& iface_info ) ;
g_type_add_interface_static ( ximagesink_type , GST_TYPE_NAVIGATION ,
& navigation_info ) ;
g_type_add_interface_static ( ximagesink_type , GST_TYPE_X_OVERLAY ,
& overlay_info ) ;
}
2003-11-06 21:51:14 +00:00
return ximagesink_type ;
}
static gboolean
2004-03-14 22:34:34 +00:00
plugin_init ( GstPlugin * plugin )
2003-11-06 21:51:14 +00:00
{
2003-11-19 20:43:49 +00:00
/* Loading the library containing GstVideoSink, our parent object */
if ( ! gst_library_load ( " gstvideo " ) )
return FALSE ;
2004-03-14 22:34:34 +00:00
2003-11-11 11:32:27 +00:00
if ( ! gst_element_register ( plugin , " ximagesink " ,
2004-03-14 22:34:34 +00:00
GST_RANK_SECONDARY , GST_TYPE_XIMAGESINK ) )
2003-11-06 21:51:14 +00:00
return FALSE ;
return TRUE ;
}
2004-03-14 22:34:34 +00:00
GST_PLUGIN_DEFINE ( GST_VERSION_MAJOR ,
GST_VERSION_MINOR ,
" ximagesink " ,
" XFree86 video output plugin based on standard Xlib calls " ,
plugin_init , VERSION , GST_LICENSE , GST_PACKAGE , GST_ORIGIN )