[Sumover-dev] [svn commit] r3920 - vic/branches/mpeg4/render
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Thu Nov 9 08:59:44 GMT 2006
Author: barz
Date: Thu Nov 9 08:59:24 2006
New Revision: 3920
Modified:
vic/branches/mpeg4/render/vw.cpp
vic/branches/mpeg4/render/xvideo.cpp
Log:
fixed xvideo bug, use the second available port instead
Modified: vic/branches/mpeg4/render/vw.cpp
==============================================================================
--- vic/branches/mpeg4/render/vw.cpp (original)
+++ vic/branches/mpeg4/render/vw.cpp Thu Nov 9 08:59:24 2006
@@ -170,9 +170,9 @@
{
if(render.init(dpy_, FOURCC_I420, Tk_Visual(tk), Tk_Depth(tk), 3) >= 0){
image_ = render.createImage(width, height);
- printf("xvideo: initialie video with %dx%d\n", width, height);
+ debug_msg("xvideo: initialie video with %dx%d\n", width, height);
}else{
- printf("cannot initialize xvideo extension");
+ debug_msg("cannot initialize xvideo extension");
enable_xv = false;
}
}
@@ -182,7 +182,7 @@
if(enable_xv){
XVideoImage* p = new XVideoImage(tk, width, height);
if(enable_xv){
- printf("using Xvideo extension\n");
+ debug_msg("using Xvideo extension\n");
return (p);
}else{
delete p;
Modified: vic/branches/mpeg4/render/xvideo.cpp
==============================================================================
--- vic/branches/mpeg4/render/xvideo.cpp (original)
+++ vic/branches/mpeg4/render/xvideo.cpp Thu Nov 9 08:59:24 2006
@@ -135,7 +135,9 @@
continue;
}
- /* Look for the first available port supporting this format */
+ // Look for the second available port supporting this format
+ // Fist port might be used by X server
+ bool first=1;
for( i_port = p_adaptor[i_adaptor].base_id;
( i_port < (int)(p_adaptor[i_adaptor].base_id
+ p_adaptor[i_adaptor].num_ports) )
@@ -144,8 +146,13 @@
{
if( XvGrabPort( p_display, i_port, CurrentTime ) == Success )
{
+ if(first){
+ first=0;
+ continue;
+ }
i_selected_port = i_port;
*pi_newchroma = p_formats[ i_format ].id;
+ printf("using XVideo render\n");
}
}
@@ -155,15 +162,14 @@
continue;
}
-#if 0
// If we found a port, print information about it
- printf( "adaptor %i, port %i, format 0x%x (%4.4s) %s\n",
+ debug_msg( "adaptor %i, port %i, format 0x%x (%4.4s) %s\n",
i_adaptor, i_selected_port, p_formats[ i_format ].id,
(char *)&p_formats[ i_format ].id,
( p_formats[ i_format ].format == XvPacked ) ?
"packed" : "planar" );
-
+#if 0
XvEncodingInfo *p_enc;
unsigned int i_enc, i_num_encodings;
XvAttribute *p_attr;
@@ -505,11 +511,11 @@
#endif
}
- /* Make sure the command is sent now - do NOT use XFlush !*/
+ /* Make sure the command is sent now - do NOT use XFlush !*/
#ifndef WINDOWS
- XSync( p_display, False );
-#else
- p_display->request++;
+ XSync( p_display, False );
+#else
+ p_display->request++;
#endif
}
More information about the Sumover-dev
mailing list