Mercurial > mplayer.hg
annotate libvo/vo_mga.c @ 13800:75644a19873b
ffmpeg mjpeg-b is working
author | rtognimp |
---|---|
date | Fri, 29 Oct 2004 20:48:13 +0000 |
parents | e0b096f0e640 |
children | a0197f7b0784 |
rev | line source |
---|---|
1 | 1 /* |
7679 | 2 * output through mga_vid kernel driver |
1 | 3 */ |
4 | |
5 #include <stdio.h> | |
6 #include <stdlib.h> | |
7 #include <string.h> | |
8 | |
9 #include "config.h" | |
10 #include "video_out.h" | |
11 #include "video_out_internal.h" | |
12 | |
13 #include <sys/ioctl.h> | |
14 #include <unistd.h> | |
15 #include <fcntl.h> | |
16 #include <sys/mman.h> | |
11765
e0b096f0e640
linux 2.6 patch by "ismail 'cartman' d«Ónmez" <ismail.donmez@boun.edu.tr>
attila
parents:
9994
diff
changeset
|
17 #include "kerneltwosix.h" |
4595
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
18 #include <linux/fb.h> |
1 | 19 |
20 #include "drivers/mga_vid.h" | |
616 | 21 #include "sub.h" |
2317
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
22 #include "aspect.h" |
1 | 23 |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7680
diff
changeset
|
24 static vo_info_t info = |
1 | 25 { |
7679 | 26 "Matrox G200/G4x0/G550 overlay (/dev/mga_vid)", |
1 | 27 "mga", |
7679 | 28 "A'rpi", |
29 "Based on some code by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>" | |
1 | 30 }; |
31 | |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7680
diff
changeset
|
32 LIBVO_EXTERN(mga) |
1 | 33 |
34 #include "mga_common.c" | |
35 | |
4595
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
36 #define FBDEV "/dev/fb0" |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
37 |
7679 | 38 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) |
1 | 39 { |
40 | |
5433 | 41 // if (f >= 0) mga_uninit(); |
4595
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
42 if(!vo_screenwidth || !vo_screenheight) { |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
43 int fd; |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
44 struct fb_var_screeninfo fbinfo; |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
45 |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
46 if(-1 != (fd = open(FBDEV, O_RDONLY))) { |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
47 if(0 == ioctl(fd, FBIOGET_VSCREENINFO, &fbinfo)) { |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
48 if(!vo_screenwidth) vo_screenwidth = fbinfo.xres; |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
49 if(!vo_screenheight) vo_screenheight = fbinfo.yres; |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
50 } else { |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
51 perror("FBIOGET_VSCREENINFO"); |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
52 } |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
53 close(fd); |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
54 } else { |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
55 perror(FBDEV); |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
56 } |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
57 } |
6f54ae46ac27
screensize from fbdev ioctl - patch by Jason Lunz <j@falooley.org>
arpi
parents:
4592
diff
changeset
|
58 |
2317
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
59 if(vo_screenwidth && vo_screenheight){ |
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
60 aspect_save_orig(width,height); |
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
61 aspect_save_prescale(d_width,d_height); |
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
62 aspect_save_screenres(vo_screenwidth,vo_screenheight); |
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
63 |
5987 | 64 if(fullscreen&0x01) { /* -fs */ |
2318 | 65 aspect(&d_width,&d_height,A_ZOOM); |
5987 | 66 vo_fs = VO_TRUE; |
67 } else { | |
2317
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
68 aspect(&d_width,&d_height,A_NOZOOM); |
5987 | 69 vo_fs = VO_FALSE; |
70 } | |
2319 | 71 printf("vo_mga aspect(): resized to %dx%d\n",d_width,d_height); |
2317
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
72 } |
1f1880196a1c
Aspect support for vo_mga, you need to use -screenw and -screenh to set your current screen res. Untested!
atmos4
parents:
1637
diff
changeset
|
73 |
9994 | 74 vo_dwidth=d_width; vo_dheight=d_height; |
1 | 75 mga_vid_config.dest_width = d_width; |
76 mga_vid_config.dest_height= d_height; | |
77 mga_vid_config.x_org= 0; // (720-mga_vid_config.dest_width)/2; | |
78 mga_vid_config.y_org= 0; // (576-mga_vid_config.dest_height)/2; | |
2351
c53969b13353
Added image centering, now only screenblanking and hiding the cursor is missing.
atmos4
parents:
2319
diff
changeset
|
79 if(vo_screenwidth && vo_screenheight){ |
c53969b13353
Added image centering, now only screenblanking and hiding the cursor is missing.
atmos4
parents:
2319
diff
changeset
|
80 mga_vid_config.x_org=(vo_screenwidth-d_width)/2; |
c53969b13353
Added image centering, now only screenblanking and hiding the cursor is missing.
atmos4
parents:
2319
diff
changeset
|
81 mga_vid_config.y_org=(vo_screenheight-d_height)/2; |
c53969b13353
Added image centering, now only screenblanking and hiding the cursor is missing.
atmos4
parents:
2319
diff
changeset
|
82 } |
56 | 83 |
7679 | 84 return mga_init(width,height,format); |
1 | 85 } |
86 | |
7679 | 87 static void uninit(void) |
1 | 88 { |
7679 | 89 printf("vo: uninit!\n"); |
90 mga_uninit(); | |
1 | 91 } |
92 | |
31 | 93 static void flip_page(void) |
94 { | |
95 vo_mga_flip_page(); | |
96 } | |
1 | 97 |
31 | 98 |
99 static void check_events(void) | |
100 { | |
101 } | |
102 |