packages: tvtime/tvtime-autodetect_textured_overlay.patch (NEW) - check for...
pluto
pluto at pld-linux.org
Wed Jan 20 22:43:36 CET 2010
Author: pluto Date: Wed Jan 20 21:43:36 2010 GMT
Module: packages Tag: HEAD
---- Log message:
- check for presence of textured overlay and use if not grabbed.
---- Files affected:
packages/tvtime:
tvtime-autodetect_textured_overlay.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/tvtime/tvtime-autodetect_textured_overlay.patch
diff -u /dev/null packages/tvtime/tvtime-autodetect_textured_overlay.patch:1.1
--- /dev/null Wed Jan 20 22:43:36 2010
+++ packages/tvtime/tvtime-autodetect_textured_overlay.patch Wed Jan 20 22:43:31 2010
@@ -0,0 +1,70 @@
+--- tvtime-1.0.2/src/xvoutput.c.orig 2005-08-14 19:35:50.000000000 +0200
++++ tvtime-1.0.2/src/xvoutput.c 2010-01-20 22:37:29.062165988 +0100
+@@ -102,6 +102,25 @@
+ return 0;
+ }
+
++static int xv_port_has_textured_overlay( XvPortID port )
++{
++ int attributes, i;
++ XvAttribute* attributeValues = XvQueryPortAttributes( display, port, &attributes );
++ if ( !attributes )
++ return 0;
++ for ( i = 0; i < attributes; i++ )
++ {
++ XvAttribute attrib = attributeValues[ i ];
++ if ( strcmp( attrib.name, "XV_HWPLANAR" ) == 0 )
++ {
++ XFree( attributeValues );
++ return 1;
++ }
++ }
++ XFree( attributeValues );
++ return 0;
++}
++
+ static int xv_check_extension( void )
+ {
+ unsigned int version;
+@@ -123,15 +142,37 @@
+
+ XvQueryAdaptors( display, output_window, &adaptors, &adaptorInfo );
+
++ /* first attempt: check for textured layers with yuv2... */
++ for( i = 0; i < adaptors; i++ ) {
++ if( adaptorInfo[ i ].type & XvImageMask ) {
++ for( j = 0; j < adaptorInfo[ i ].num_ports; j++ ) {
++ XvPortID port = adaptorInfo[ i ].base_id + j;
++ if( xv_port_has_textured_overlay( port ) && xv_port_has_yuy2( port ) ) {
++ if( XvGrabPort( display, port, 0 ) == Success ) {
++ xv_port = port;
++ if( xvoutput_verbose ) {
++ fprintf( stderr, "xvoutput: Using TEXTURED XVIDEO adaptor %lu: %s.\n",
++ port, adaptorInfo[ i ].name );
++ }
++ XvFreeAdaptorInfo( adaptorInfo );
++ return 1;
++ }
++ has_yuy2 = 1;
++ }
++ }
++ }
++ }
++ /* second attempt: check only for layers with yuv2... */
+ for( i = 0; i < adaptors; i++ ) {
+ if( adaptorInfo[ i ].type & XvImageMask ) {
+ for( j = 0; j < adaptorInfo[ i ].num_ports; j++ ) {
+- if( xv_port_has_yuy2( adaptorInfo[ i ].base_id + j ) ) {
+- if( XvGrabPort( display, adaptorInfo[ i ].base_id + j, 0 ) == Success ) {
+- xv_port = adaptorInfo[ i ].base_id + j;
++ XvPortID port = adaptorInfo[ i ].base_id + j;
++ if( xv_port_has_yuy2( port ) ) {
++ if( XvGrabPort( display, port, 0 ) == Success ) {
++ xv_port = port;
+ if( xvoutput_verbose ) {
+ fprintf( stderr, "xvoutput: Using XVIDEO adaptor %lu: %s.\n",
+- adaptorInfo[ i ].base_id + j, adaptorInfo[ i ].name );
++ port, adaptorInfo[ i ].name );
+ }
+ XvFreeAdaptorInfo( adaptorInfo );
+ return 1;
================================================================
More information about the pld-cvs-commit
mailing list