mirror of https://github.com/mpv-player/mpv
preliminary config interface
dual syncengine git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4007 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
879228a664
commit
4f6a3bb32d
|
@ -56,6 +56,10 @@ static int fd_video = -1;
|
|||
static int fd_spu = -1;
|
||||
static int ioval = 0;
|
||||
|
||||
struct {
|
||||
int se_version;
|
||||
} conf_s;
|
||||
|
||||
static vo_info_t vo_info =
|
||||
{
|
||||
"DXR3/H+ video out",
|
||||
|
@ -68,16 +72,25 @@ static vo_info_t vo_info =
|
|||
void write_dxr3( rte_context* context, void* data, size_t size, void* user_data )
|
||||
{
|
||||
size_t data_left = size;
|
||||
if(ioctl(fd_video,EM8300_IOCTL_VIDEO_SETPTS,&vo_pts) < 0)
|
||||
if(!conf_s.se_version) if(ioctl(fd_video,EM8300_IOCTL_VIDEO_SETPTS,&vo_pts) < 0)
|
||||
printf( "VO: [dxr3] Unable to set pts\n" );
|
||||
while( data_left )
|
||||
data_left -= write( fd_video, (void*) data+(size-data_left), data_left );
|
||||
}
|
||||
#endif
|
||||
|
||||
void parseconfig( )
|
||||
{
|
||||
conf_s.se_version = 0;
|
||||
if(vo_subdevice == NULL) return;
|
||||
conf_s.se_version = 1;
|
||||
}
|
||||
|
||||
static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format)
|
||||
{
|
||||
int tmp1,tmp2;
|
||||
|
||||
parseconfig();
|
||||
fd_control = open( "/dev/em8300", O_WRONLY );
|
||||
if( fd_control < 1 )
|
||||
{
|
||||
|
@ -97,6 +110,11 @@ static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, ui
|
|||
printf( "VO: [dxr3] Error opening /dev/em8300_sp for writing!\n" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!conf_s.se_version)
|
||||
printf( "VO: [dxr3] Using hardware sync\n" );
|
||||
else
|
||||
printf( "VO: [dxr3] Using software sync\n" );
|
||||
|
||||
/* Subpic code isn't working yet, don't set to ON
|
||||
unless you are really sure what you are doing */
|
||||
|
@ -289,7 +307,7 @@ static uint32_t draw_frame(uint8_t * src[])
|
|||
vo_mpegpes_t *p=(vo_mpegpes_t *)src[0];
|
||||
size_t data_left = p->size;
|
||||
|
||||
if(ioctl(fd_video,EM8300_IOCTL_VIDEO_SETPTS,&vo_pts) < 0)
|
||||
if(!conf_s.se_version) if(ioctl(fd_video,EM8300_IOCTL_VIDEO_SETPTS,&vo_pts) < 0)
|
||||
printf( "VO: [dxr3] Unable to set pts\n" );
|
||||
|
||||
while( data_left )
|
||||
|
@ -398,16 +416,18 @@ static uint32_t draw_slice( uint8_t *srcimg[], int stride[], int w, int h, int x
|
|||
static uint32_t
|
||||
query_format(uint32_t format)
|
||||
{
|
||||
if(format==IMGFMT_MPEGPES) return 0x2|0x4|256;
|
||||
uint32_t flag = 0;
|
||||
if(format==IMGFMT_MPEGPES) flag = 0x2|0x4;
|
||||
#ifdef USE_MP1E
|
||||
if(format==IMGFMT_YV12) return 0x1|0x4|256;
|
||||
if(format==IMGFMT_YUY2) return 0x1|0x4|256;
|
||||
if(format==IMGFMT_BGR24) return 0x1|0x4|256;
|
||||
if(format==IMGFMT_YV12) flag = 0x1|0x4;
|
||||
if(format==IMGFMT_YUY2) flag = 0x1|0x4;
|
||||
if(format==IMGFMT_BGR24) flag = 0x1|0x4;
|
||||
else printf( "VO: [dxr3] Format unsupported, mail dholm@iname.com\n" );
|
||||
#else
|
||||
else printf( "VO: [dxr3] You have disabled libmp1e support, you won't be able to play this format!\n" );
|
||||
#endif
|
||||
return 0;
|
||||
if(!conf_s.se_version && flag) flag |= 256;
|
||||
return flag;
|
||||
}
|
||||
|
||||
static void uninit(void)
|
||||
|
|
Loading…
Reference in New Issue