Commit 2a4afa38 authored by Eric Petit's avatar Eric Petit

beos/VideoOutput.cpp: added yet another overlay mode (minimum VRAM usage)

parent 5b567860
...@@ -334,7 +334,7 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame, ...@@ -334,7 +334,7 @@ VideoWindow::VideoWindow(int v_width, int v_height, BRect frame,
{ {
overlay_restrictions r; overlay_restrictions r;
bitmap[1]->GetOverlayRestrictions(&r); bitmap[0]->GetOverlayRestrictions(&r);
SetSizeLimits((i_width * r.min_width_scale), i_width * r.max_width_scale, SetSizeLimits((i_width * r.min_width_scale), i_width * r.max_width_scale,
(i_height * r.min_height_scale), i_height * r.max_height_scale); (i_height * r.min_height_scale), i_height * r.max_height_scale);
} }
...@@ -724,12 +724,13 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode) ...@@ -724,12 +724,13 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode)
int noOverlay = !config_GetInt( p_vout, "overlay" ); int noOverlay = !config_GetInt( p_vout, "overlay" );
/* Test for overlay capability: for every chroma in colspace, /* Test for overlay capability: for every chroma in colspace,
we try to do double-buffered overlay, or we fallback on we try to do double-buffered overlay, single-buffered overlay
single-buffered overlay. In nothing worked, we then have or basic overlay. If nothing worked, we then have to work with
to work with a non-overlay BBitmap. */ a non-overlay BBitmap. */
for( int i = 0; i < COLOR_COUNT; i++ ) for( int i = 0; i < COLOR_COUNT; i++ )
{ {
if (noOverlay) break; if( noOverlay )
break;
bitmap[0] = new BBitmap( bitmapFrame, bitmap[0] = new BBitmap( bitmapFrame,
B_BITMAP_WILL_OVERLAY | B_BITMAP_WILL_OVERLAY |
...@@ -739,10 +740,6 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode) ...@@ -739,10 +740,6 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode)
{ {
colspace_index = i; colspace_index = i;
bitmap[1] = new BBitmap( bitmapFrame, B_BITMAP_WILL_OVERLAY,
colspace[colspace_index].colspace);
if( bitmap[1] && bitmap[1]->InitCheck() == B_OK )
{
*mode = OVERLAY; *mode = OVERLAY;
rgb_color key; rgb_color key;
view->SetViewOverlay( bitmap[0], bitmap[0]->Bounds(), view->SetViewOverlay( bitmap[0], bitmap[0]->Bounds(),
...@@ -752,6 +749,11 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode) ...@@ -752,6 +749,11 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode)
view->SetViewColor( key ); view->SetViewColor( key );
SetTitle( "VLC " PACKAGE_VERSION " (Overlay)" ); SetTitle( "VLC " PACKAGE_VERSION " (Overlay)" );
bitmap[1] = new BBitmap( bitmapFrame, B_BITMAP_WILL_OVERLAY,
colspace[colspace_index].colspace);
if( bitmap[1] && bitmap[1]->InitCheck() == B_OK )
{
bitmap[2] = new BBitmap( bitmapFrame, B_BITMAP_WILL_OVERLAY, bitmap[2] = new BBitmap( bitmapFrame, B_BITMAP_WILL_OVERLAY,
colspace[colspace_index].colspace); colspace[colspace_index].colspace);
if( bitmap[2] && bitmap[2]->InitCheck() == B_OK ) if( bitmap[2] && bitmap[2]->InitCheck() == B_OK )
...@@ -764,17 +766,18 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode) ...@@ -764,17 +766,18 @@ VideoWindow::_AllocateBuffers(int width, int height, int* mode)
bitmap_count = 2; bitmap_count = 2;
if( bitmap[2] ) { delete bitmap[2]; bitmap[2] = NULL; } if( bitmap[2] ) { delete bitmap[2]; bitmap[2] = NULL; }
} }
break;
} }
else else
{ {
*mode = BITMAP; msg_Dbg( p_vout, "using simple overlay" );
_FreeBuffers(); bitmap_count = 1;
if( bitmap[1] ) { delete bitmap[1]; bitmap[1] = NULL; }
} }
break;
} }
else else
{ {
delete bitmap[0]; if( bitmap[0] ) { delete bitmap[0]; bitmap[0] = NULL; }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment