#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_demux.h>
-#include <vlc_charset.h>
+#include <vlc_fs.h>
#include <vlc_picture.h>
#ifdef HAVE_FCNTL_H
dc1394camera_t *camera;
int selected_camera;
uint64_t selected_uid;
- picture_t pic;
uint32_t dma_buffers;
dc1394featureset_t features;
quadlet_t supported_framerates;
}
if( !found )
{
- msg_Err( p_demux, "Can't find camera with uid : 0x%llx.",
+ msg_Err( p_demux, "Can't find camera with uid : 0x%"PRIx64".",
sys->selected_uid );
goto end;
}
demux_sys_t *p_sys;
es_format_t fmt;
dc1394error_t res;
- int i_width;
- int i_height;
if( strncmp(p_demux->psz_access, "dc1394", 6) != 0 )
return VLC_EGENERIC;
{
msg_Err( p_demux, "Bad MRL, please check the option line "
"(MRL was: %s)",
- p_demux->psz_path );
+ p_demux->psz_location );
free( p_sys );
return VLC_EGENERIC;
}
/* TODO - UYV444 chroma converter is missing, when it will be available
* fourcc will become variable (and not just a fixed value for UYVY)
*/
- i_width = p_sys->width;
- i_height = p_sys->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_CODEC_UYVY );
- fmt.video.i_width = i_width;
- fmt.video.i_height = i_height;
+ fmt.video.i_width = p_sys->width;
+ fmt.video.i_height = p_sys->height;
msg_Dbg( p_demux, "Added new video es %4.4s %dx%d",
(char*)&fmt.i_codec, fmt.video.i_width, fmt.video.i_height );
int i_format = AFMT_S16_LE;
int result;
- p_sys->fd_audio = utf8_open( psz_device, O_RDONLY | O_NONBLOCK );
+ p_sys->fd_audio = vlc_open( psz_device, O_RDONLY | O_NONBLOCK );
if( p_sys->fd_audio < 0 )
{
msg_Err( p_demux, "Cannot open audio device (%s)", psz_device );
dc1394_camera_free(p_sys->camera);
dc1394_free(p_sys->p_dccontext);
+ free( p_sys->video_device );
free( p_sys->audio_device );
free( p_sys );
}
p_sys->i_audio_max_frame_size );
if( i_read <= 0 )
+ {
+ block_Release( p_block );
return NULL;
+ }
p_block->i_buffer = i_read;
const char *in_fmt = NULL;
float rate_f;
- psz_dup = strdup( p_demux->psz_path );
+ psz_dup = strdup( p_demux->psz_location );
psz_parser = psz_dup;
for( token = strtok_r( psz_parser,":",&state); token;
token = strtok_r( NULL, ":", &state ) )
else if( strncmp( token, "uid=", strlen("uid=") ) == 0)
{
token += strlen("uid=");
- sscanf( token, "0x%llx", &p_sys->selected_uid );
+ sscanf( token, "0x%"SCNx64, &p_sys->selected_uid );
}
}
else // YUV422 default
p_sys->video_mode = DC1394_VIDEO_MODE_640x480_YUV422;
}
+
+ free( psz_dup );
return VLC_SUCCESS;
}