1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

More correct direct rendering usage

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4742 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nick 2002-02-17 12:22:01 +00:00
parent 68e6328d14
commit 0a83c6ec7b
4 changed files with 15 additions and 10 deletions

View File

@ -779,14 +779,15 @@ if ((sh_video->codec->driver == VFM_QTRLE) && (sh_video->bih->biBitCount != 24))
extern int vaa_use_dr;
static int use_dr=0;
static int use_dr=0,use_dr_422=0;
static bes_da_t bda;
void init_video_vaa( void )
void init_video_vaa( unsigned width )
{
memset(&bda,0,sizeof(bes_da_t));
if(vo_vaa.query_bes_da)
use_dr = vo_vaa.query_bes_da(&bda) ? 0 : 1;
if(!vaa_use_dr) use_dr = 0;
use_dr_422 = use_dr && bda.dest.pitch.y == 16 && (width*2+15)&~15 == width*2;
}
#ifdef USE_LIBVO2
@ -939,7 +940,7 @@ switch(sh_video->codec->driver){
{
/* FIXME: WILL WORK ONLY FOR PACKED FOURCC. BUT WHAT ABOUT PLANAR? */
vmem = 0;
if(use_dr && bda.dest.pitch.y == 16)
if(use_dr_422)
{
vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y;
if(vo_doublebuffering && bda.num_frames>1)
@ -1054,7 +1055,7 @@ if(verbose>1){
if(!in_size) break;
/* FIXME: WILL WORK ONLY FOR PACKED FOURCC. BUT WHAT ABOUT PLANAR? */
vmem = 0;
if(use_dr && bda.dest.pitch.y == 16)
if(use_dr_422)
{
vmem = bda.dga_addr + bda.offsets[0] + bda.offset.y;
if(vo_doublebuffering && bda.num_frames>1)

View File

@ -3,7 +3,7 @@
extern int video_read_properties(sh_video_t *sh_video);
extern int init_video(sh_video_t *sh_video, int *pitches);
extern void init_video_vaa( void );
extern void init_video_vaa( unsigned width );
void uninit_video(sh_video_t *sh_video);
#ifdef USE_LIBVO2

View File

@ -210,6 +210,7 @@ static uint32_t vidix_draw_slice_422(uint8_t *image[], int stride[], int w,int h
src+=stride[0];
dest += bespitch;
}
printf("\nw = %u apitch=%u stride[0] = %u bespitch=%u\n",w,apitch,stride[0],bespitch);
return 0;
}
@ -479,7 +480,7 @@ int vidix_init(unsigned src_width,unsigned src_height,
unsigned vid_w,unsigned vid_h,const void *info)
{
size_t i,awidth;
int err;
int err,is_422_planes_eq;
if(verbose > 1)
printf("vosub_vidix: vidix_init() was called\n"
"src_w=%u src_h=%u dest_x_y_w_h = %u %u %u %u\n"
@ -607,23 +608,26 @@ int vidix_init(unsigned src_width,unsigned src_height,
memset(vidix_mem + vidix_play.offsets[i], 0x80,
vidix_play.frame_size);
/* tune some info here */
is_422_planes_eq = vidix_play.src.pitch.y == vidix_play.dest.pitch.y &&
src_width*2 == (src_width*2+(vidix_play.dest.pitch.y-1))&~
(vidix_play.dest.pitch.y-1);
if(src_format == IMGFMT_YV12 || src_format == IMGFMT_I420 || src_format == IMGFMT_IYUV)
vo_server->draw_slice = vidix_draw_slice_420;
else
if(src_format == IMGFMT_RGB32 || src_format == IMGFMT_BGR32)
vo_server->draw_slice =
vidix_play.src.pitch.y == vidix_play.dest.pitch.y ?
is_422_planes_eq ?
vidix_draw_slice_32_fast:
vidix_draw_slice_32;
else
if(src_format == IMGFMT_RGB24 || src_format == IMGFMT_BGR24)
vo_server->draw_slice =
vidix_play.src.pitch.y == vidix_play.dest.pitch.y ?
is_422_planes_eq ?
vidix_draw_slice_24_fast:
vidix_draw_slice_24;
else
vo_server->draw_slice =
vidix_play.src.pitch.y == vidix_play.dest.pitch.y ?
is_422_planes_eq ?
vidix_draw_slice_422_fast:
vidix_draw_slice_422;
return 0;

View File

@ -1400,7 +1400,7 @@ current_module="init_libvo";
*/
}
}
init_video_vaa();
init_video_vaa(sh_video->disp_w);
fflush(stdout);
//================== MAIN: ==========================