Mercurial > mplayer.hg
annotate libvo/vo_mga.c @ 498:86c689b3e40e
disable ddebug printfs
author | arpi_esp |
---|---|
date | Wed, 18 Apr 2001 01:25:09 +0000 |
parents | 8e101a5d9dc2 |
children | 77e0094f0cce |
rev | line source |
---|---|
1 | 1 |
2 //#define memcpy(a,b,c) | |
3 | |
4 /* | |
5 * video_out_mga.c | |
6 * | |
7 * Copyright (C) Aaron Holtzman - Aug 1999 | |
8 * | |
9 * This file is part of mpeg2dec, a free MPEG-2 video stream decoder. | |
10 * | |
11 * mpeg2dec is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2, or (at your option) | |
14 * any later version. | |
15 * | |
16 * mpeg2dec is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with GNU Make; see the file COPYING. If not, write to | |
23 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 * | |
25 */ | |
26 | |
27 #include <stdio.h> | |
28 #include <stdlib.h> | |
29 #include <string.h> | |
30 | |
31 #include "config.h" | |
32 #include "video_out.h" | |
33 #include "video_out_internal.h" | |
34 | |
35 LIBVO_EXTERN(mga) | |
36 | |
37 #include <sys/ioctl.h> | |
38 #include <unistd.h> | |
39 #include <fcntl.h> | |
40 #include <sys/mman.h> | |
41 | |
42 #include "drivers/mga_vid.h" | |
43 | |
44 static vo_info_t vo_info = | |
45 { | |
46 "Matrox G200/G400 overlay (/dev/mga_vid)", | |
47 "mga", | |
48 "Aaron Holtzman <aholtzma@ess.engr.uvic.ca>", | |
49 "" | |
50 }; | |
51 | |
52 | |
53 #include "mga_common.c" | |
54 | |
55 static uint32_t | |
56 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format) | |
57 { | |
58 | |
59 f = open("/dev/mga_vid",O_RDWR); | |
60 if(f == -1) | |
61 { | |
62 fprintf(stderr,"Couldn't open /dev/mga_vid\n"); | |
63 return(-1); | |
64 } | |
65 | |
66 switch(format){ | |
67 case IMGFMT_YV12: | |
56 | 68 mga_vid_config.frame_size = ((width + 31) & ~31) * height + (((width + 31) & ~31) * height) / 2; |
1 | 69 mga_vid_config.format=MGA_VID_FORMAT_YV12; break; |
470 | 70 case IMGFMT_I420: |
71 mga_vid_config.frame_size = ((width + 31) & ~31) * height + (((width + 31) & ~31) * height) / 2; | |
72 mga_vid_config.format=MGA_VID_FORMAT_I420; break; | |
73 case IMGFMT_IYUV: | |
74 mga_vid_config.frame_size = ((width + 31) & ~31) * height + (((width + 31) & ~31) * height) / 2; | |
75 mga_vid_config.format=MGA_VID_FORMAT_IYUV; break; | |
1 | 76 case IMGFMT_YUY2: |
56 | 77 mga_vid_config.frame_size = ((width + 31) & ~31) * height * 2; |
1 | 78 mga_vid_config.format=MGA_VID_FORMAT_YUY2; break; |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
213
diff
changeset
|
79 case IMGFMT_UYVY: |
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
213
diff
changeset
|
80 mga_vid_config.frame_size = ((width + 31) & ~31) * height * 2; |
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
213
diff
changeset
|
81 mga_vid_config.format=MGA_VID_FORMAT_UYVY; break; |
1 | 82 default: |
83 fprintf(stderr,"mga: invalid output format %0X\n",format); | |
84 return (-1); | |
85 } | |
86 | |
197 | 87 mga_vid_config.colkey_on=0; |
88 | |
1 | 89 mga_vid_config.src_width = width; |
90 mga_vid_config.src_height= height; | |
91 mga_vid_config.dest_width = d_width; | |
92 mga_vid_config.dest_height= d_height; | |
93 mga_vid_config.x_org= 0; // (720-mga_vid_config.dest_width)/2; | |
94 mga_vid_config.y_org= 0; // (576-mga_vid_config.dest_height)/2; | |
56 | 95 |
96 mga_vid_config.version=MGA_VID_VERSION; | |
1 | 97 |
56 | 98 return mga_init(); |
1 | 99 } |
100 | |
101 static const vo_info_t* | |
102 get_info(void) | |
103 { | |
104 return &vo_info; | |
105 } | |
106 | |
107 static void | |
108 uninit(void) | |
109 { | |
110 ioctl( f,MGA_VID_OFF,0 ); | |
111 printf("vo: uninit!\n"); | |
112 } | |
113 | |
114 | |
31 | 115 static void flip_page(void) |
116 { | |
213 | 117 vo_draw_text(mga_vid_config.src_width,mga_vid_config.src_height,draw_alpha); |
31 | 118 vo_mga_flip_page(); |
119 } | |
1 | 120 |
31 | 121 |
122 static void check_events(void) | |
123 { | |
124 } | |
125 | |
126 | |
127 |