#include <photon/PtLabel.h>
#include <photon/PdDirect.h>
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_vout.h>
* vout properties to choose the window size, and change them according to the
* actual properties of the display.
*****************************************************************************/
-int E_(OpenVideo) ( vlc_object_t *p_this )
+int OpenVideo ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
/* allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
- {
- msg_Err( p_vout, "out of memory" );
return( 1 );
- }
memset( p_vout->p_sys, 0, sizeof( vout_sys_t ) );
*****************************************************************************
* Terminate an output method created by QNXCreate
*****************************************************************************/
-void E_(CloseVideo) ( vlc_object_t *p_this )
+void CloseVideo ( vlc_object_t *p_this )
{
vout_thread_t * p_vout = (vout_thread_t *)p_this;
{
int i_ev, i_buflen;
PhEvent_t *p_event;
- vlc_bool_t b_repos = 0;
+ bool b_repos = 0;
- if (p_vout->b_die)
+ if (!vlc_object_alive (p_vout))
{
return ( 0 );
}
/* allocate buffer for event */
i_buflen = sizeof( PhEvent_t ) * 4;
if( ( p_event = malloc( i_buflen ) ) == NULL )
- {
- msg_Err( p_vout, "out of memory" );
return( 1 );
- }
/* event loop */
do
if( i_ev == Ph_RESIZE_MSG )
{
+ PhEvent_t *buf;
+
i_buflen = PhGetMsgSize( p_event );
- if( ( p_event = realloc( p_event, i_buflen ) ) == NULL )
+ buf = realloc( p_event, i_buflen );
+ if( buf == NULL )
{
- msg_Err( p_vout, "out of memory" );
+ free( p_event );
return( 1 );
}
+ p_event = buf;
}
else if( i_ev == Ph_EVENT_MSG )
{
switch( p_ev->event_f )
{
case Ph_WM_CLOSE:
- p_vout->p_libvlc->b_die = VLC_TRUE;
+ p_vout->p_libvlc->b_die = true;
break;
case Ph_WM_MOVE:
{
case Pk_q:
case Pk_Q:
- p_vout->p_libvlc->b_die = VLC_TRUE;
+ p_vout->p_libvlc->b_die = true;
break;
case Pk_f:
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break;
- case Pk_c:
- case Pk_C:
- p_vout->b_grayscale = ! p_vout->b_grayscale;
- p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
- break;
-
default:
break;
}
switch( p_vout->p_sys->i_screen_depth )
{
case 8:
- p_vout->output.i_chroma = VLC_FOURCC('R','G','B','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB8;
p_vout->p_sys->i_bytes_per_pixel = 1;
p_vout->output.pf_setpalette = SetPalette;
break;
case 15:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
p_vout->p_sys->i_bytes_per_pixel = 2;
p_vout->output.i_rmask = 0x7c00;
p_vout->output.i_gmask = 0x03e0;
break;
case 16:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
p_vout->p_sys->i_bytes_per_pixel = 2;
p_vout->output.i_rmask = 0xf800;
p_vout->output.i_gmask = 0x07e0;
break;
case 24:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','2','4');
+ p_vout->output.i_chroma = VLC_CODEC_RGB24;
p_vout->p_sys->i_bytes_per_pixel = 3;
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
case 32:
default:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
p_vout->p_sys->i_bytes_per_pixel = 4;
p_vout->output.i_rmask = 0xff0000;
p_vout->output.i_gmask = 0x00ff00;
switch (p_vout->p_sys->i_vc_format)
{
case Pg_VIDEO_FORMAT_YUV420:
- p_vout->output.i_chroma = VLC_FOURCC('I','4','2','0');
+ p_vout->output.i_chroma = VLC_CODEC_I420;
p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
break;
case Pg_VIDEO_FORMAT_YV12:
- p_vout->output.i_chroma = VLC_FOURCC('Y','V','1','2');
+ p_vout->output.i_chroma = VLC_CODEC_YV12;
p_pic->p_sys->p_buf[U_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[U_PLANE] );
p_pic->p_sys->p_buf[V_PLANE] = PdGetOffscreenContextPtr( p_pic->p_sys->p_ctx[V_PLANE] );
case Pg_VIDEO_FORMAT_YUY2:
if (p_vout->p_sys->i_vc_format == Pg_VIDEO_FORMAT_UYVY)
{
- p_vout->output.i_chroma = VLC_FOURCC('U','Y','V','Y');
+ p_vout->output.i_chroma = VLC_CODEC_UYVY;
}
else
{
- p_vout->output.i_chroma = VLC_FOURCC('Y','U','Y','2');
+ p_vout->output.i_chroma = VLC_CODEC_YUYV;
}
p_pic->p->p_pixels = p_pic->p_sys->p_buf[Y_PLANE];
break;
case Pg_VIDEO_FORMAT_RGB555:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','5');
+ p_vout->output.i_chroma = VLC_CODEC_RGB15;
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x03e0;
p_vout->output.i_bmask = 0x7c00;
break;
case Pg_VIDEO_FORMAT_RGB565:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+ p_vout->output.i_chroma = VLC_CODEC_RGB16;
p_vout->output.i_rmask = 0x001f;
p_vout->output.i_gmask = 0x07e0;
p_vout->output.i_bmask = 0xf800;
break;
case Pg_VIDEO_FORMAT_RGB8888:
- p_vout->output.i_chroma = VLC_FOURCC('R','V','3','2');
+ p_vout->output.i_chroma = VLC_CODEC_RGB32;
p_vout->output.i_rmask = 0x000000ff;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x00ff0000;
switch( p_vout->output.i_chroma )
{
#ifdef MODULE_NAME_IS_xvideo
- case VLC_FOURCC('Y','2','1','1'):
+ case VLC_CODEC_Y211:
p_pic->p->p_pixels = p_pic->p_sys->p_image->data
+ p_pic->p_sys->p_image->offsets[0];