#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_input.h>
-#include <vlc_vout.h>
#include <vlc_demux.h>
-
+#include <vlc_charset.h>
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
int i;
int i_width;
int i_height;
- int i_aspect;
int result = 0;
if( strncmp(p_demux->psz_access, "dc1394", 6) != 0 )
i_width = p_sys->camera.frame_width;
i_height = p_sys->camera.frame_height;
- i_aspect = vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic,
- VLC_FOURCC('U', 'Y', 'V', 'Y'),
- i_width, i_height,
- i_width * VOUT_ASPECT_FACTOR / i_height );
+ if( picture_Setup( &p_sys->pic, VLC_CODEC_UYVY,
+ i_width, i_height,
+ i_width * VOUT_ASPECT_FACTOR / i_height ) )
+ {
+ msg_Err( p_demux ,"unknown chroma" );
+ Close( p_this );
+ return VLC_EGENERIC;
+ }
- es_format_Init( &fmt, VIDEO_ES, VLC_FOURCC('U', 'Y', 'V', 'Y') );
+ es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_UYVY );
fmt.video.i_width = i_width;
fmt.video.i_height = i_height;
if( p_sys->fd_audio >= 0 )
{
es_format_t fmt;
- es_format_Init( &fmt, AUDIO_ES, VLC_FOURCC('a','r','a','w') );
+ es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_S16L ); /* FIXME: hmm, ?? */
fmt.audio.i_channels = p_sys->channels ? p_sys->channels : 1;
fmt.audio.i_rate = p_sys->i_sample_rate;
- fmt.audio.i_bitspersample = 16; /* FIXME: hmm, ?? */
+ fmt.audio.i_bitspersample = 16;
fmt.audio.i_blockalign = fmt.audio.i_channels *
fmt.audio.i_bitspersample / 8;
fmt.i_bitrate = fmt.audio.i_channels * fmt.audio.i_rate *
int i_format = AFMT_S16_LE;
int result;
- p_sys->fd_audio = open( psz_device, O_RDONLY | O_NONBLOCK );
+ p_sys->fd_audio = utf8_open( psz_device, O_RDONLY | O_NONBLOCK );
if( p_sys->fd_audio < 0 )
{
msg_Err( p_demux, "cannot open audio device (%s)", psz_device );
*****************************************************************************/
static int Control( demux_t *p_demux, int i_query, va_list args )
{
- bool *pb;
- int64_t *pi64;
-
switch( i_query )
{
/* Special for access_demux */
case DEMUX_CAN_SEEK:
case DEMUX_SET_PAUSE_STATE:
case DEMUX_CAN_CONTROL_PACE:
- pb = (bool*)va_arg( args, bool * );
- *pb = false;
+ *va_arg( args, bool * ) = false;
return VLC_SUCCESS;
case DEMUX_GET_PTS_DELAY:
- pi64 = (int64_t*)va_arg( args, int64_t * );
- *pi64 = (int64_t)DEFAULT_PTS_DELAY;
+ *va_arg( args, int64_t * ) = (int64_t)DEFAULT_PTS_DELAY;
return VLC_SUCCESS;
case DEMUX_GET_TIME:
- pi64 = (int64_t*)va_arg( args, int64_t * );
- *pi64 = mdate();
+ *va_arg( args, int64_t * ) = mdate();
return VLC_SUCCESS;
/* TODO implement others */