+// Create new bitmap
+ if( !bitmap ) {
+ int use_direct = 0;
+ bitmap_type = BITMAP_TEMP;
+//printf("VDeviceX11::new_output_buffer %d file_colormodel=%d display_colormodel=%d\n",
+// __LINE__, file_colormodel, display_colormodel);
+
+// Try hardware accelerated
+ switch( display_colormodel ) {
+// blit from the codec directly to the window, using the standard X11 color model.
+// Must scale in the codec. No cropping
+ case BC_BGR8888:
+ if( direct_supported ) {
+ bitmap_type = BITMAP_PRIMARY;
+ use_direct = 1;
+ }
+ break;
+
+ case BC_YUV420P:
+ if( device->out_config->driver == PLAYBACK_X11_XV &&
+ output->get_canvas()->accel_available(display_colormodel, 0) &&
+ !output->use_scrollbars )
+ bitmap_type = BITMAP_PRIMARY;
+ break;
+
+ case BC_YUV422P:
+ if( device->out_config->driver == PLAYBACK_X11_XV &&
+ output->get_canvas()->accel_available(display_colormodel, 0) &&
+ !output->use_scrollbars )
+ bitmap_type = BITMAP_PRIMARY;
+ else if( device->out_config->driver == PLAYBACK_X11_XV &&
+ output->get_canvas()->accel_available(BC_YUV422, 0) ) {
+ bitmap = new BC_Bitmap(output->get_canvas(),
+ device->out_w, device->out_h, BC_YUV422, 1);
+ }
+ break;
+
+ case BC_YUV422:
+ if( device->out_config->driver == PLAYBACK_X11_XV &&
+ output->get_canvas()->accel_available(display_colormodel, 0) &&
+ !output->use_scrollbars ) {
+ bitmap_type = BITMAP_PRIMARY;
+ }
+ else if( device->out_config->driver == PLAYBACK_X11_XV &&
+ output->get_canvas()->accel_available(BC_YUV422P, 0) ) {
+ bitmap = new BC_Bitmap(output->get_canvas(),
+ device->out_w, device->out_h, BC_YUV422P, 1);
+ }
+ break;
+ }
+ if( bitmap_type == BITMAP_PRIMARY ) {
+ int bitmap_w = use_direct ? canvas_w : device->out_w;
+ int bitmap_h = use_direct ? canvas_h : device->out_h;