* Preamble
*****************************************************************************/
extern "C" {
-#include <errno.h> /* ENOMEM */
-#include <stdlib.h> /* free() */
-#include <string.h> /* strerror() */
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_vout.h>
#include <vlc_playlist.h>
}
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-vlc_module_begin();
- set_description( _("HD1000 video output") );
- set_capability( "video output", 100 );
- add_shortcut( "hd1000v" );
- set_callbacks( Create, Destroy );
-vlc_module_end();
+vlc_module_begin ()
+ set_description( N_("HD1000 video output") )
+ set_capability( "video output", 100 )
+ add_shortcut( "hd1000v" )
+ set_callbacks( Create, Destroy )
+vlc_module_end ()
/*****************************************************************************
* vout_sys_t: video output method descriptor
uint32_t i_width; /* width of main window */
uint32_t i_height; /* height of main window */
uint32_t i_screen_depth;
- vlc_bool_t b_double_buffered;
-
+ bool b_double_buffered;
+
uint32_t u_current; /* Current output resolution. */
CascadeScreen *p_screen;
};
{
vout_thread_t *p_vout = (vout_thread_t *)p_this;
bool b_double_buffered = false;
-
+
p_vout->p_sys = (struct vout_sys_t*) malloc( sizeof(struct vout_sys_t) );
if( p_vout->p_sys == NULL )
- {
- msg_Err( p_vout, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Allocate a screen for VLC vout. */
p_vout->p_sys->p_screen = new CascadeScreen();
/* Get current screen resolution */
msg_Dbg( p_vout, "number of screen resolutions supported %u",
p_vout->p_sys->p_screen->GetNumScreenResolutionsSupported() );
-
+
p_vout->p_sys->p_screen->GetCurrentScreenResolution( (u32) p_vout->p_sys->u_current );
p_vout->p_sys->p_screen->SetScreenResolution( (u32) p_vout->p_sys->u_current );
msg_Dbg( p_vout, "available screen resolutions:" );
for (u32 i=0; i<p_vout->p_sys->p_screen->GetNumScreenResolutionsSupported(); i++)
{
- u32 i_width=0;
- u32 i_height=0;
- u8 i_screen_depth=0;
- bool b_buffered;
-
+ u32 i_width=0;
+ u32 i_height=0;
+ u8 i_screen_depth=0;
+ bool b_buffered;
+
p_vout->p_sys->p_screen->GetSupportedScreenResolutionAt( i,
i_width, i_height, i_screen_depth, b_buffered);
msg_Dbg( p_vout, " screen index = %u, width = %u, height = %u, depth = %u, double buffered = %s",
i, i_width, i_height, i_screen_depth, (b_buffered ? "yes" : "no") );
}
-#endif
-
+#endif
+
p_vout->p_sys->p_screen->GetSupportedScreenResolutionAt( (u32) p_vout->p_sys->u_current,
(u32) p_vout->p_sys->i_width,
(u32) p_vout->p_sys->i_height,
(u8) p_vout->p_sys->i_screen_depth,
b_double_buffered );
- p_vout->p_sys->b_double_buffered = (vlc_bool_t) b_double_buffered;
+ p_vout->p_sys->b_double_buffered = (bool) b_double_buffered;
msg_Dbg( p_vout, "using screen index = %u, width = %u, height = %u, depth = %u, double buffered = %d",
p_vout->p_sys->u_current, /* Current screen. */
p_vout->p_sys->i_width,
p_vout->p_sys->i_height,
p_vout->p_sys->i_screen_depth,
p_vout->p_sys->b_double_buffered );
-
+
return VLC_SUCCESS;
}
I_OUTPUTPICTURES = 0;
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->output.i_width = p_vout->p_sys->i_width;
p_vout->output.i_height = p_vout->p_sys->i_height;
p_vout->output.i_aspect = p_vout->p_sys->i_width
switch( p_vout->p_sys->i_screen_depth )
{
case 8: /* FIXME: set the palette */
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB8; break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB15; break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB16; break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB24; break;
case 32:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2'); break;
+ p_vout->output.i_chroma = VLC_CODEC_RGB32; break;
default:
msg_Err( p_vout, "unknown screen depth %i",
p_vout->p_sys->i_screen_depth );
}
/* Fill in picture_t fields */
- vout_InitPicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
- p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_aspect );
+ picture_Setup( p_pic, p_vout->output.i_chroma,
+ p_vout->output.i_width, p_vout->output.i_height,
+ p_vout->output.i_aspect * p_vout->output.i_height,
+ VOUT_ASPECT_FACTOR * p_vout->output.i_width );
p_pic->p_sys->p_image = new CascadeSharedMemZone();
if( p_pic->p_sys->p_image == NULL )
free( p_pic->p_sys );
return -1;
}
-
+
p_pic->p->i_lines = p_vout->output.i_height;
p_pic->p->i_visible_lines = p_vout->output.i_height;
p_pic->p->p_pixels = (uint8_t*) p_pic->p_sys->p_image->MapLock();
p_pic->p->i_visible_pitch = p_pic->p->i_pixel_pitch
* p_vout->output.i_width;
- return VLC_SUCCESS;
+ return VLC_SUCCESS;
}
/*****************************************************************************
{ /* Just a test to see the effect described above. REMOVE THIS */
msg_Err( p_vout, "unlocking shared memory failed, already unlocked" );
}
-
+
if( p_pic->p_sys->p_image->Close() )
{
msg_Err( p_vout, "closing shared memory failed. Leaking memory of %ul",
p_pic->p_sys->p_image->GetSize() );
}
-
+
delete p_pic->p_sys->p_image;
free( p_pic->p_sys );
}
{
uint32_t i_width, i_height, i_x, i_y;
uint32_t i_offset = 0;
-
+
vout_PlacePicture( p_vout, p_vout->p_sys->i_width,
p_vout->p_sys->i_height,
&i_x, &i_y, &i_width, &i_height );
/* Currently the only pixel format supported is 32bpp RGBA.*/
p_vout->p_sys->p_screen->LockScreen();
-
+
/* Unlock the shared memory region first. */
- if( p_pic->p_sys->p_image->Unlock() )
+ if( p_pic->p_sys->p_image->Unlock() )
{
msg_Err( p_vout, "unlocking shared memory failed. Expect threading problems." );
}
-
+
p_vout->p_sys->p_screen->Blit( CascadePoint( (u32) i_x, (u32) i_y ), /* Place bitmap at */
(*p_pic->p_sys->p_image) , /* Image data */
(u32) i_offset, /* Offset in SharedMemoryZone */
(u32) i_height, /* Source bitmap height */
(u32) p_vout->p_sys->i_screen_depth, /* Source pixel depth */
CascadeRect( (u32) i_x, (u32) i_y, (u32) i_width, (u32) i_height ) );
-
+
p_vout->p_sys->p_screen->UnlockScreen();
}