Mercurial > mplayer.hg
comparison libvo/mga_common.c @ 7472:c4434bdf6e51
tons of warning fixes, also some 10l bugfixes, including Dominik's PVA bug
author | arpi |
---|---|
date | Sun, 22 Sep 2002 02:33:28 +0000 |
parents | 60a7886834af |
children | 711b3d844c47 |
comparison
equal
deleted
inserted
replaced
7471:5e56ce70b551 | 7472:c4434bdf6e51 |
---|---|
13 static mga_vid_config_t mga_vid_config; | 13 static mga_vid_config_t mga_vid_config; |
14 static uint8_t *vid_data, *frames[4]; | 14 static uint8_t *vid_data, *frames[4]; |
15 static int f = -1; | 15 static int f = -1; |
16 | 16 |
17 static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ | 17 static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){ |
18 int x,y; | |
19 uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31; | 18 uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31; |
20 switch(mga_vid_config.format){ | 19 switch(mga_vid_config.format){ |
21 case MGA_VID_FORMAT_YV12: | 20 case MGA_VID_FORMAT_YV12: |
22 case MGA_VID_FORMAT_IYUV: | 21 case MGA_VID_FORMAT_IYUV: |
23 case MGA_VID_FORMAT_I420: | 22 case MGA_VID_FORMAT_I420: |
36 //write_slice_g200(uint8_t *y,uint8_t *cr, uint8_t *cb,uint32_t slice_num) | 35 //write_slice_g200(uint8_t *y,uint8_t *cr, uint8_t *cb,uint32_t slice_num) |
37 | 36 |
38 static void | 37 static void |
39 draw_slice_g200(uint8_t *image[], int stride[], int width,int height,int x,int y) | 38 draw_slice_g200(uint8_t *image[], int stride[], int width,int height,int x,int y) |
40 { | 39 { |
41 uint8_t *src; | |
42 uint8_t *src2; | |
43 uint8_t *dest; | 40 uint8_t *dest; |
44 uint32_t bespitch,h,w; | 41 uint32_t bespitch = (mga_vid_config.src_width + 31) & ~31; |
45 | |
46 bespitch = (mga_vid_config.src_width + 31) & ~31; | |
47 | 42 |
48 dest = vid_data + bespitch*y + x; | 43 dest = vid_data + bespitch*y + x; |
49 mem2agpcpy_pic(dest, image[0], width, height, bespitch, stride[0]); | 44 mem2agpcpy_pic(dest, image[0], width, height, bespitch, stride[0]); |
50 | 45 |
51 width/=2;height/=2;x/=2;y/=2; | 46 width/=2;height/=2;x/=2;y/=2; |
58 } | 53 } |
59 | 54 |
60 static void | 55 static void |
61 draw_slice_g400(uint8_t *image[], int stride[], int w,int h,int x,int y) | 56 draw_slice_g400(uint8_t *image[], int stride[], int w,int h,int x,int y) |
62 { | 57 { |
63 uint8_t *src; | |
64 uint8_t *dest; | 58 uint8_t *dest; |
65 uint8_t *dest2; | 59 uint8_t *dest2; |
66 uint32_t bespitch,bespitch2; | 60 uint32_t bespitch,bespitch2; |
67 int i; | |
68 | 61 |
69 bespitch = (mga_vid_config.src_width + 31) & ~31; | 62 bespitch = (mga_vid_config.src_width + 31) & ~31; |
70 bespitch2 = bespitch/2; | 63 bespitch2 = bespitch/2; |
71 | 64 |
72 dest = vid_data + bespitch * y + x; | 65 dest = vid_data + bespitch * y + x; |
325 return VO_NOTIMPL; | 318 return VO_NOTIMPL; |
326 } | 319 } |
327 | 320 |
328 | 321 |
329 static int mga_init(){ | 322 static int mga_init(){ |
330 char *frame_mem; | |
331 | 323 |
332 mga_vid_config.num_frames=(vo_directrendering && !vo_doublebuffering)?1:3; | 324 mga_vid_config.num_frames=(vo_directrendering && !vo_doublebuffering)?1:3; |
333 mga_vid_config.version=MGA_VID_VERSION; | 325 mga_vid_config.version=MGA_VID_VERSION; |
334 if (ioctl(f,MGA_VID_CONFIG,&mga_vid_config)) | 326 if (ioctl(f,MGA_VID_CONFIG,&mga_vid_config)) |
335 { | 327 { |
358 static int mga_uninit(){ | 350 static int mga_uninit(){ |
359 ioctl( f,MGA_VID_OFF,0 ); | 351 ioctl( f,MGA_VID_OFF,0 ); |
360 munmap(frames[0],mga_vid_config.frame_size*mga_vid_config.num_frames); | 352 munmap(frames[0],mga_vid_config.frame_size*mga_vid_config.num_frames); |
361 close(f); | 353 close(f); |
362 f = -1; | 354 f = -1; |
355 return 0; | |
363 } | 356 } |
364 | 357 |
365 static uint32_t preinit(const char *arg) | 358 static uint32_t preinit(const char *arg) |
366 { | 359 { |
367 char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid"; | 360 char *devname=vo_subdevice?vo_subdevice:"/dev/mga_vid"; |