Commit ee860753 authored by Tony Castley's avatar Tony Castley

Fixed the slider overflow problem.

Corrected Slider behaviour.
Simplified Code in the vout_beos ready for another developer to implement
more advanced video output.
parent ab0e8717
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* InterfaceWindow.cpp: beos interface * InterfaceWindow.cpp: beos interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: InterfaceWindow.cpp,v 1.2 2001/06/15 09:07:10 tcastley Exp $ * $Id: InterfaceWindow.cpp,v 1.3 2001/09/12 01:30:07 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -216,6 +216,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -216,6 +216,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
p_main->p_playlist->b_stopped = 1; p_main->p_playlist->b_stopped = 1;
vlc_mutex_unlock( &p_main->p_playlist->change_lock ); vlc_mutex_unlock( &p_main->p_playlist->change_lock );
} }
p_mediaControl->SetStatus(NOT_STARTED_S,DEFAULT_RATE);
break; break;
case START_PLAYBACK: case START_PLAYBACK:
...@@ -435,23 +436,21 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -435,23 +436,21 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
*****************************************************************************/ *****************************************************************************/
void InterfaceWindow::updateInterface() void InterfaceWindow::updateInterface()
{ {
float progress;
if ( p_intf->p_input ) if ( p_intf->p_input )
{ {
if ( acquire_sem(p_mediaControl->fScrubSem) == B_OK ) if ( acquire_sem(p_mediaControl->fScrubSem) == B_OK )
{ {
uint32 seekTo = (p_mediaControl->GetSeekTo() * uint64 seekTo = (p_mediaControl->GetSeekTo() *
p_intf->p_input->stream.p_selected_area->i_size) / 100; p_intf->p_input->stream.p_selected_area->i_size) / 100;
input_Seek( p_intf->p_input, seekTo ); intf_Msg("Move to: %u", seekTo);
input_Seek( p_intf->p_input, seekTo);
} }
else if( Lock() ) else if( Lock() )
{ {
progress = (100. * p_intf->p_input->stream.p_selected_area->i_tell) /
p_intf->p_input->stream.p_selected_area->i_size;
p_mediaControl->SetStatus(p_intf->p_input->stream.control.i_status, p_mediaControl->SetStatus(p_intf->p_input->stream.control.i_status,
p_intf->p_input->stream.control.i_rate); p_intf->p_input->stream.control.i_rate);
p_mediaControl->SetProgress(progress); p_mediaControl->SetProgress(p_intf->p_input->stream.p_selected_area->i_tell,
p_intf->p_input->stream.p_selected_area->i_size);
Unlock(); Unlock();
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* VideoWindow.h: BeOS video window class prototype * VideoWindow.h: BeOS video window class prototype
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: VideoWindow.h,v 1.5 2001/08/14 12:09:03 tcastley Exp $ * $Id: VideoWindow.h,v 1.6 2001/09/12 01:30:07 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au> * Tony Castley <tcastley@mail.powerup.com.au>
...@@ -65,6 +65,7 @@ public: ...@@ -65,6 +65,7 @@ public:
bool fDirty; bool fDirty;
thread_id fDrawThreadID; thread_id fDrawThreadID;
BBitmap *bitmap[2]; BBitmap *bitmap[2];
BBitmap *drawthis;
VLCView *view; VLCView *view;
bool teardownwindow; bool teardownwindow;
bool is_zoomed; bool is_zoomed;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method * vout_beos.cpp: beos video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.28 2001/08/14 12:09:03 tcastley Exp $ * $Id: vout_beos.cpp,v 1.29 2001/09/12 01:30:07 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -123,15 +123,14 @@ BWindow *beos_GetAppWindow(char *name) ...@@ -123,15 +123,14 @@ BWindow *beos_GetAppWindow(char *name)
int32 Draw(void *data) int32 Draw(void *data)
{ {
VideoWindow *w; VideoWindow *p_win;
w = (VideoWindow*) data; p_win = (VideoWindow*) data;
if (w->LockLooper()) if (p_win->LockLooper())
{ {
w->view->DrawBitmap( w->bitmap[w->i_buffer_index], p_win->view->DrawBitmap( p_win->bitmap[p_win->i_buffer_index],
w->bitmap[w->i_buffer_index]->Bounds(), p_win->bitmap[p_win->i_buffer_index]->Bounds(),
w->Bounds()); p_win->Bounds());
// w->view->Sync(); p_win->UnlockLooper();
w->UnlockLooper();
} }
return B_OK; return B_OK;
} }
...@@ -149,7 +148,6 @@ VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_o ...@@ -149,7 +148,6 @@ VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_o
is_zoomed = false; is_zoomed = false;
fUsingOverlay = false; fUsingOverlay = false;
p_video_output->b_YCbr = false; p_video_output->b_YCbr = false;
i_screen_depth = 16;
/* create the view to do the display */ /* create the view to do the display */
view = new VLCView(Bounds()); view = new VLCView(Bounds());
...@@ -158,6 +156,7 @@ VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_o ...@@ -158,6 +156,7 @@ VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_o
/* Bitmap mode overlay not available */ /* Bitmap mode overlay not available */
bitmap[0] = new BBitmap(Bounds(), B_RGB32); bitmap[0] = new BBitmap(Bounds(), B_RGB32);
bitmap[1] = new BBitmap(Bounds(), B_RGB32); bitmap[1] = new BBitmap(Bounds(), B_RGB32);
i_screen_depth = 32; i_screen_depth = 32;
SetTitle(VOUT_TITLE " (BBitmap output)"); SetTitle(VOUT_TITLE " (BBitmap output)");
...@@ -332,7 +331,6 @@ static int vout_Probe( probedata_t *p_data ) ...@@ -332,7 +331,6 @@ static int vout_Probe( probedata_t *p_data )
{ {
return( 999 ); return( 999 );
} }
return( 100 ); return( 100 );
} }
...@@ -356,6 +354,11 @@ int vout_Create( vout_thread_t *p_vout ) ...@@ -356,6 +354,11 @@ int vout_Create( vout_thread_t *p_vout )
VOUT_WIDTH_DEFAULT ); VOUT_WIDTH_DEFAULT );
p_vout->i_height = main_GetIntVariable( VOUT_HEIGHT_VAR, p_vout->i_height = main_GetIntVariable( VOUT_HEIGHT_VAR,
VOUT_HEIGHT_DEFAULT ); VOUT_HEIGHT_DEFAULT );
p_vout->b_scale = true;
intf_Msg("Initial Width: %d Height: %d",
p_vout->i_width,
p_vout->i_height);
/* Open and initialize device */ /* Open and initialize device */
if( BeosOpenDisplay( p_vout ) ) if( BeosOpenDisplay( p_vout ) )
...@@ -375,10 +378,7 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -375,10 +378,7 @@ int vout_Init( vout_thread_t *p_vout )
{ {
VideoWindow * p_win = p_vout->p_sys->p_window; VideoWindow * p_win = p_vout->p_sys->p_window;
u32 i_page_size; u32 i_page_size;
i_page_size = p_vout->i_width * p_vout->i_height * p_vout->i_bytes_per_pixel; i_page_size = p_vout->i_width * p_vout->i_height * p_vout->i_bytes_per_pixel;
if((p_win->bitmap[0] != NULL) && (p_win->bitmap[1] != NULL)) if((p_win->bitmap[0] != NULL) && (p_win->bitmap[1] != NULL))
{ {
p_vout->pf_setbuffers( p_vout, p_vout->pf_setbuffers( p_vout,
...@@ -403,7 +403,6 @@ void vout_End( vout_thread_t *p_vout ) ...@@ -403,7 +403,6 @@ void vout_End( vout_thread_t *p_vout )
void vout_Destroy( vout_thread_t *p_vout ) void vout_Destroy( vout_thread_t *p_vout )
{ {
BeosCloseDisplay( p_vout ); BeosCloseDisplay( p_vout );
free( p_vout->p_sys ); free( p_vout->p_sys );
} }
...@@ -415,6 +414,26 @@ void vout_Destroy( vout_thread_t *p_vout ) ...@@ -415,6 +414,26 @@ void vout_Destroy( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
int vout_Manage( vout_thread_t *p_vout ) int vout_Manage( vout_thread_t *p_vout )
{ {
VideoWindow * p_win = p_vout->p_sys->p_window;
if ((p_vout->p_buffer[p_vout->i_buffer_index].i_pic_width != p_win->i_width + 1) &&
(p_vout->p_buffer[p_vout->i_buffer_index].i_pic_height != p_win->i_height + 1) &&
(p_vout->p_buffer[p_vout->i_buffer_index].i_pic_width != 0 ))
{
if (p_win->Lock())
{
p_win->view->ClearViewBitmap();
intf_Msg("Starting Change");
intf_Msg("New width: %d Height: %d",
p_vout->p_buffer[p_vout->i_buffer_index ].i_pic_width,
p_vout->p_buffer[p_vout->i_buffer_index ].i_pic_height);
p_win->i_width = p_vout->p_buffer[p_vout->i_buffer_index].i_pic_width - 1;
p_win->i_height = p_vout->p_buffer[p_vout->i_buffer_index].i_pic_height -1;
p_win->ResizeTo((float) p_win->i_width, (float) p_win->i_height);
p_win->Unlock();
}
}
return( 0 ); return( 0 );
} }
...@@ -436,6 +455,7 @@ void vout_Display( vout_thread_t *p_vout ) ...@@ -436,6 +455,7 @@ void vout_Display( vout_thread_t *p_vout )
p_win->fDrawThreadID = spawn_thread(Draw, "drawing_thread", p_win->fDrawThreadID = spawn_thread(Draw, "drawing_thread",
B_DISPLAY_PRIORITY, (void*) p_win); B_DISPLAY_PRIORITY, (void*) p_win);
wait_for_thread(p_win->fDrawThreadID, &status); wait_for_thread(p_win->fDrawThreadID, &status);
} }
...@@ -469,29 +489,9 @@ static int BeosOpenDisplay( vout_thread_t *p_vout ) ...@@ -469,29 +489,9 @@ static int BeosOpenDisplay( vout_thread_t *p_vout )
p_vout->i_height = p_win->i_height + 1; p_vout->i_height = p_win->i_height + 1;
p_vout->i_bytes_per_line = p_vout->i_width*p_win->i_bytes_per_pixel; p_vout->i_bytes_per_line = p_vout->i_width*p_win->i_bytes_per_pixel;
switch( p_vout->i_screen_depth ) p_vout->i_red_mask = 0xff0000;
{ p_vout->i_green_mask = 0x00ff00;
case 8: p_vout->i_blue_mask = 0x0000ff;
intf_ErrMsg( "vout error: 8 bit mode not fully supported" );
break;
case 15:
p_vout->i_red_mask = 0x7c00;
p_vout->i_green_mask = 0x03e0;
p_vout->i_blue_mask = 0x001f;
break;
case 16:
p_vout->i_red_mask = 0xf800;
p_vout->i_green_mask = 0x07e0;
p_vout->i_blue_mask = 0x001f;
break;
case 24:
case 32:
default:
p_vout->i_red_mask = 0xff0000;
p_vout->i_green_mask = 0x00ff00;
p_vout->i_blue_mask = 0x0000ff;
break;
}
return( 0 ); return( 0 );
} }
......
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