Mercurial > mplayer.hg
annotate libvo/vo_zr.c @ 29418:7acdcd4d512a
move truehd to correct section
author | compn |
---|---|
date | Thu, 30 Jul 2009 12:08:20 +0000 |
parents | 0f1b5b68af32 |
children | 358ac046eccc |
rev | line source |
---|---|
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
1 /* |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
2 * playback on Zoran cards |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
3 * copyright (C) 2001, 2003 Rik Snel |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
4 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
5 * This file is part of MPlayer. |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
6 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
7 * MPlayer is free software; you can redistribute it and/or modify |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
8 * it under the terms of the GNU General Public License as published by |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
9 * the Free Software Foundation; either version 2 of the License, or |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
10 * (at your option) any later version. |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
11 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
12 * MPlayer is distributed in the hope that it will be useful, |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
15 * GNU General Public License for more details. |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
16 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
17 * You should have received a copy of the GNU General Public License along |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
18 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
26203
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
20 */ |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
21 |
5666 | 22 /* $Id$ */ |
23 | |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
24 #include <stdio.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
25 #include <stdlib.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
26 #include <string.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
27 #include <unistd.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
28 #include <fcntl.h> |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4668
diff
changeset
|
29 #include <errno.h> |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
30 #include <sys/stat.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
31 #include <sys/types.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
32 #include <sys/time.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
33 #include <sys/mman.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
34 #include <sys/ioctl.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
35 #include <linux/types.h> |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
36 #include <linux/videodev.h> |
26203 | 37 #include "config.h" |
4668
d20978449650
migration of -vo zr to Recommended Interface definition (this obsoletes zoran.h)
rik
parents:
4651
diff
changeset
|
38 #include "videodev_mjpeg.h" |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
39 #include "video_out.h" |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
40 #include "video_out_internal.h" |
13787
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
11376
diff
changeset
|
41 #include "mp_msg.h" |
e047e70a9767
Handle "xxx.h" vs "../xxx.h" include paths in a consistent way.
diego
parents:
11376
diff
changeset
|
42 #include "m_option.h" |
4232 | 43 #include "fastmemcpy.h" |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
44 |
4651
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4596
diff
changeset
|
45 #include "jpeg_enc.h" |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4596
diff
changeset
|
46 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
47 static const vo_info_t info = |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
48 { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
49 "Zoran ZR360[56]7/ZR36060 Driver (DC10(+)/buz/lml33/MatroxRR)", |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
50 "zr", |
14429
90b4a1345b96
replace almost obsolete email address: snel@phys.uu.nl -> rsnel@cube.dyndns.org
rik
parents:
13787
diff
changeset
|
51 "Rik Snel <rsnel@cube.dyndns.org>", |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
52 "" |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
53 }; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
54 |
25220
c9e9ac2008c2
Mark the vo_functions_t definitions as const where possible.
reimar
parents:
25216
diff
changeset
|
55 const LIBVO_EXTERN (zr) |
8148
5b39e79af5fe
removed get_info, using the same sheme as in libmpcodecs instead
alex
parents:
7962
diff
changeset
|
56 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
57 #define ZR_MAX_DEVICES 4 |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
58 /* General variables */ |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
59 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
60 typedef struct { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
61 int width; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
62 int height; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
63 int xoff; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
64 int yoff; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
65 int set; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
66 } geo_t; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
67 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
68 static int zr_count = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
69 static int zr_parsing = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
70 static int framenum; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
71 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
72 typedef struct { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
73 /* commandline args given for this device (and defaults) */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
74 int vdec, hdec; /* requested decimation 1,2,4 */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
75 int fd; /* force decimation */ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
76 int xdoff, ydoff; /* offset from upperleft of screen |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
77 * default is 'centered' */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
78 int quality; /* jpeg quality 1=best, 20=bad */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
79 geo_t g; /* view window (zrcrop) */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
80 char *device; /* /dev/video1 */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
81 int bw; /* if bw == 1, display in black&white */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
82 int norm; /* PAL/NTSC */ |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
83 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
84 /* buffers + pointers + info */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
85 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
86 unsigned char *image; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
87 int image_width, image_height, size; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
88 int off_y, off_c, stride; /* for use by 'draw slice/frame' */ |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
89 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
90 unsigned char *buf; /* the jpeg images will be placed here */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
91 jpeg_enc_t *j; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
92 unsigned char *y_data, *u_data, *v_data; /* used by the jpeg encoder */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
93 int y_stride, u_stride, v_stride; /* these point somewhere in image */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
94 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
95 /* information for (and about) the zoran card */ |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
96 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
97 int vdes; /* file descriptor of card */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
98 int frame, synco, queue; /* buffer management */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
99 struct mjpeg_sync zs; /* state information */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
100 struct mjpeg_params p; |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
101 struct mjpeg_requestbuffers zrq; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
102 struct video_capability vc; /* max resolution and so on */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
103 int fields, stretchy; /* must the *image be interlaced |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
104 or stretched to fit on the screen? */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
105 } zr_info_t; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
106 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
107 static zr_info_t zr_info[ZR_MAX_DEVICES] = { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
108 {1, 1, 1, -1, -1, 2, {0, 0, 0, 0, 0}, NULL, 0, VIDEO_MODE_AUTO, NULL, 0, 0, 0, 0, 0, |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
109 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
110 {1, 1, 1, -1, -1, 2, {0, 0, 0, 0, 0}, NULL, 0, VIDEO_MODE_AUTO, NULL, 0, 0, 0, 0, 0, |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
111 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
112 {1, 1, 1, -1, -1, 2, {0, 0, 0, 0, 0}, NULL, 0, VIDEO_MODE_AUTO, NULL, 0, 0, 0, 0, 0, |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
113 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
114 {1, 1, 1, -1, -1, 2, {0, 0, 0, 0, 0}, NULL, 0, VIDEO_MODE_AUTO, NULL, 0, 0, 0, 0, 0, |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
115 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
116 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
117 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
118 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
119 |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
120 #define MJPEG_NBUFFERS 2 |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
121 #define MJPEG_SIZE 1024*256 |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
122 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
123 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
124 int zoran_getcap(zr_info_t *zr) { |
10319 | 125 char* dev = NULL; |
5666 | 126 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
127 if (zr->device) |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
128 dev = zr->device; |
10319 | 129 else { |
5666 | 130 struct stat vstat; |
10319 | 131 const char *devs[] = { |
132 "/dev/video", | |
133 "/dev/video0", | |
134 "/dev/v4l/video0", | |
135 "/dev/v4l0", | |
136 "/dev/v4l", | |
137 NULL | |
138 }; | |
139 int i = 0; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
140 |
10319 | 141 do |
142 { | |
143 if ((stat(devs[i], &vstat) == 0) && S_ISCHR(vstat.st_mode)) | |
144 { | |
145 dev = devs[i]; | |
146 mp_msg(MSGT_VO, MSGL_V, "zr: found video device %s\n", dev); | |
147 break; | |
148 } | |
149 } while (devs[++i] != NULL); | |
5666 | 150 |
10319 | 151 if (!dev) |
152 { | |
153 mp_msg(MSGT_VO, MSGL_ERR, "zr: unable to find video device\n"); | |
154 return 1; | |
5666 | 155 } |
156 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
157 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
158 zr->vdes = open(dev, O_RDWR); |
5666 | 159 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
160 if (zr->vdes < 0) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
161 mp_msg(MSGT_VO, MSGL_ERR, "zr: error opening %s: %s\n", |
5666 | 162 dev, strerror(errno)); |
163 return 1; | |
164 } | |
165 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
166 /* before we can ask for the maximum resolution, we must set |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
167 * the correct tv norm */ |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
168 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
169 if (ioctl(zr->vdes, MJPIOC_G_PARAMS, &zr->p) < 0) { |
5666 | 170 mp_msg(MSGT_VO, MSGL_ERR, "zr: device at %s is probably not a DC10(+)/buz/lml33\n", dev); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
171 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
172 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
173 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
174 if (zr->p.norm != zr->norm && zr->norm != VIDEO_MODE_AUTO) { |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
175 /* attempt to set requested norm */ |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
176 zr->p.norm = zr->norm; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
177 if (ioctl(zr->vdes, MJPIOC_S_PARAMS, &zr->p) < 0) { |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
178 mp_msg(MSGT_VO, MSGL_ERR, |
5666 | 179 "zr: unable to change video norm, use another program to change it (XawTV)\n"); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
180 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
181 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
182 ioctl(zr->vdes, MJPIOC_G_PARAMS, &zr->p); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
183 if (zr->norm != zr->p.norm) { |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
184 mp_msg(MSGT_VO, MSGL_ERR, |
5666 | 185 "zr: unable to change video norm, use another program to change it (XawTV)\n"); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
186 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
187 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
188 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
189 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
190 if (ioctl(zr->vdes, VIDIOCGCAP, &zr->vc) < 0) { |
10718 | 191 mp_msg(MSGT_VO, MSGL_ERR, "zr: error getting video capabilities from %s\n", dev); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
192 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
193 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
194 mp_msg(MSGT_VO, MSGL_V, "zr: MJPEG card reports maxwidth=%d, maxheight=%d\n", zr->vc.maxwidth, zr->vc.maxheight); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
195 |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
196 return 0; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
197 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
198 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
199 int init_zoran(zr_info_t *zr, int stretchx, int stretchy) { |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
200 /* center the image, and stretch it as far as possible (try to keep |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
201 * aspect) and check if it fits */ |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
202 if (zr->image_width > zr->vc.maxwidth) { |
23873 | 203 mp_msg(MSGT_VO, MSGL_ERR, "zr: movie to be played is too wide, max width currently %d\n", zr->vc.maxwidth); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
204 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
205 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
206 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
207 if (zr->image_height > zr->vc.maxheight) { |
23873 | 208 mp_msg(MSGT_VO, MSGL_ERR, "zr: movie to be played is too high, max height currently %d\n", zr->vc.maxheight); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
209 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
210 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
211 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
212 zr->p.decimation = 0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
213 zr->p.HorDcm = stretchx; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
214 zr->p.VerDcm = stretchy; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
215 zr->p.TmpDcm = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
216 zr->p.field_per_buff = zr->fields; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
217 if (zr->xdoff == -1) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
218 zr->p.img_x = (zr->vc.maxwidth - |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
219 zr->p.HorDcm*(int)zr->image_width/zr->hdec)/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
220 } else { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
221 zr->p.img_x = zr->xdoff; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
222 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
223 if (zr->ydoff == -1) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
224 zr->p.img_y = (zr->vc.maxheight - zr->p.VerDcm* |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
225 (3-zr->fields)*(int)zr->image_height)/4; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
226 } else { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
227 zr->p.img_y = zr->ydoff; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
228 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
229 zr->p.img_width = zr->p.HorDcm*zr->image_width/zr->hdec; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
230 zr->p.img_height = zr->p.VerDcm*zr->image_height/zr->fields; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
231 mp_msg(MSGT_VO, MSGL_V, "zr: geometry (after 'scaling'): %dx%d+%d+%d fields=%d, w=%d, h=%d\n", zr->p.img_width, (3-zr->fields)*zr->p.img_height, zr->p.img_x, zr->p.img_y, zr->fields, zr->image_width/zr->hdec, zr->image_height); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
232 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
233 if (ioctl(zr->vdes, MJPIOC_S_PARAMS, &zr->p) < 0) { |
5666 | 234 mp_msg(MSGT_VO, MSGL_ERR, "zr: error setting display parameters\n"); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
235 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
236 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
237 |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
238 zr->zrq.count = MJPEG_NBUFFERS; |
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
239 zr->zrq.size = MJPEG_SIZE; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
240 |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
241 if (ioctl(zr->vdes, MJPIOC_REQBUFS, &zr->zrq)) { |
25511
93af51aec103
Use proper length specifiers in mp_msg calls, fixes the warnings:
diego
parents:
25426
diff
changeset
|
242 mp_msg(MSGT_VO, MSGL_ERR, "zr: error requesting %ld buffers of size %ld\n", zr->zrq.count, zr->zrq.size); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
243 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
244 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
245 |
9976
5843993013a8
fixes to the zr driver (uninit->reinit) by Stephan Bain <sjbain@akamail.com>
rik
parents:
8148
diff
changeset
|
246 /* the buffer count allocated may be different to the request */ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
247 zr->buf = (unsigned char*)mmap(0, zr->zrq.count*zr->zrq.size, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
248 PROT_READ|PROT_WRITE, MAP_SHARED, zr->vdes, 0); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
249 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
250 if (zr->buf == MAP_FAILED) { |
25511
93af51aec103
Use proper length specifiers in mp_msg calls, fixes the warnings:
diego
parents:
25426
diff
changeset
|
251 mp_msg(MSGT_VO, MSGL_ERR, "zr: error requesting %ld buffers of size %ld\n", zr->zrq.count, zr->zrq.size); |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
252 return 1; |
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
253 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
254 |
25511
93af51aec103
Use proper length specifiers in mp_msg calls, fixes the warnings:
diego
parents:
25426
diff
changeset
|
255 mp_msg(MSGT_VO, MSGL_V, "zr: got %ld buffers of size %ld (wanted %d buffers of size %d)\n", zr->zrq.count, zr->zrq.size, MJPEG_NBUFFERS, MJPEG_SIZE); |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
256 if (zr->zrq.count < MJPEG_NBUFFERS) { |
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
257 mp_msg(MSGT_VO, MSGL_V, "zr: got not enough buffers\n"); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
258 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
259 } |
9976
5843993013a8
fixes to the zr driver (uninit->reinit) by Stephan Bain <sjbain@akamail.com>
rik
parents:
8148
diff
changeset
|
260 |
5843993013a8
fixes to the zr driver (uninit->reinit) by Stephan Bain <sjbain@akamail.com>
rik
parents:
8148
diff
changeset
|
261 zr->queue = 0; |
5843993013a8
fixes to the zr driver (uninit->reinit) by Stephan Bain <sjbain@akamail.com>
rik
parents:
8148
diff
changeset
|
262 zr->synco = 0; |
5843993013a8
fixes to the zr driver (uninit->reinit) by Stephan Bain <sjbain@akamail.com>
rik
parents:
8148
diff
changeset
|
263 |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
264 return 0; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
265 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
266 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
267 void uninit_zoran(zr_info_t *zr) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
268 if (zr->image) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
269 free(zr->image); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
270 zr->image=NULL; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
271 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
272 while (zr->queue > zr->synco + 1) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
273 if (ioctl(zr->vdes, MJPIOC_SYNC, &zr->zs) < 0) |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
274 mp_msg(MSGT_VO, MSGL_ERR, "zr: error waiting for buffers to become free\n"); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
275 zr->synco++; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
276 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
277 /* stop streaming */ |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
278 zr->frame = -1; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
279 if (ioctl(zr->vdes, MJPIOC_QBUF_PLAY, &zr->frame) < 0) |
5666 | 280 mp_msg(MSGT_VO, MSGL_ERR, "zr: error stopping playback of last frame\n"); |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
281 if (munmap(zr->buf,zr->zrq.count*zr->zrq.size)) |
9976
5843993013a8
fixes to the zr driver (uninit->reinit) by Stephan Bain <sjbain@akamail.com>
rik
parents:
8148
diff
changeset
|
282 mp_msg(MSGT_VO, MSGL_ERR, "zr: error unmapping buffer\n"); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
283 close(zr->vdes); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
284 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
285 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
286 int zr_geometry_sane(geo_t *g, unsigned int width, unsigned int height) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
287 if (g->set) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
288 if (g->width%2 != 0 || g->height%2 != 0 || |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
289 g->xoff%2 != 0 || g->yoff%2 != 0) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
290 mp_msg(MSGT_VO, MSGL_ERR, "zr: arguments in -zrcrop must be multiples of 2\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
291 return 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
292 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
293 if (g->width <= 0 || g->height <= 0 || |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
294 g->xoff < 0 || g->yoff < 0) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
295 mp_msg(MSGT_VO, MSGL_ERR, "zr: width and height must be positive and offset nonnegative\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
296 return 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
297 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
298 if (g->width + g->xoff > width) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
299 mp_msg(MSGT_VO, MSGL_ERR, "zr: width+xoffset (%d+%d>%d) is too big\n", g->width, g->xoff, width); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
300 return 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
301 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
302 if (g->height + g->yoff > height) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
303 mp_msg(MSGT_VO, MSGL_ERR, "zr: height+yoffset (%d+%d>%d) is too big\n", g->height, g->yoff, height); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
304 return 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
305 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
306 } else { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
307 g->width = width; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
308 g->height = height; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
309 g->xoff = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
310 g->yoff = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
311 g->set = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
312 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
313 return 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
314 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
315 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
316 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
317 static int config(uint32_t width, uint32_t height, uint32_t d_width, |
15212
05aa13cdf92f
replace VO and VF numeric flags with #defined identifiers
henry
parents:
14429
diff
changeset
|
318 uint32_t d_height, uint32_t flags, char *title, uint32_t format) |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
319 { |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
320 int i, tmp, stretchx, stretchy; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
321 framenum = 0; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
322 if (format != IMGFMT_YV12 && format != IMGFMT_YUY2) { |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
323 printf("vo_zr called with wrong format"); |
10605 | 324 return 1; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
325 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
326 for (i = 0; i < zr_count; i++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
327 zr_info_t *zr = &zr_info[i]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
328 geo_t *g = &zr->g; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
329 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
330 zr->stride = 2*width; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
331 if (zr_geometry_sane(g, width, height)) return 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
332 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
333 /* we must know the maximum resolution of the device |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
334 * it differs for DC10+ and buz for example */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
335 zoran_getcap(zr); /*must be called before init_zoran */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
336 /* make the scaling decision |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
337 * we are capable of stretching the image in the horizontal |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
338 * direction by factors 1, 2 and 4 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
339 * we can stretch the image in the vertical direction by a |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
340 * factor of 1 and 2 AND we must decide about interlacing */ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
341 if (g->width > zr->vc.maxwidth/2 || |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
342 g->height > zr->vc.maxheight/2) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
343 stretchx = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
344 stretchy = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
345 zr->fields = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
346 if (zr->vdec == 2) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
347 zr->fields = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
348 } else if (zr->vdec == 4) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
349 zr->fields = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
350 stretchy = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
351 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
352 stretchx = zr->hdec; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
353 } else if (g->width > zr->vc.maxwidth/4 || |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
354 g->height > zr->vc.maxheight/4) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
355 stretchx = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
356 stretchy = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
357 zr->fields = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
358 if (zr->vdec == 2) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
359 stretchy = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
360 } else if (zr->vdec == 4) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
361 if (!zr->fd) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
362 mp_msg(MSGT_VO, MSGL_WARN, "zr: vertical decimation too high, changing to 2 (use -zrfd to keep vdec=4)\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
363 zr->vdec = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
364 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
365 stretchy = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
366 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
367 if (zr->hdec == 2) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
368 stretchx = 4; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
369 } else if (zr->hdec == 4){ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
370 if (!zr->fd) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
371 mp_msg(MSGT_VO, MSGL_WARN, "zr: horizontal decimation too high, changing to 2 (use -zrfd to keep hdec=4)\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
372 zr->hdec = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
373 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
374 stretchx = 4; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
375 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
376 } else { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
377 /* output image is maximally stretched */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
378 stretchx = 4; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
379 stretchy = 2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
380 zr->fields = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
381 if (zr->vdec != 1 && !zr->fd) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
382 mp_msg(MSGT_VO, MSGL_WARN, "zr: vertical decimation too high, changing to 1 (use -zrfd to keep vdec=%d)\n", zr->vdec); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
383 zr->vdec = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
384 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
385 if (zr->hdec != 1 && !zr->fd) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
386 mp_msg(MSGT_VO, MSGL_WARN, "zr: vertical decimation too high, changing to 1 (use -zrfd to keep hdec=%d)\n", zr->hdec); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
387 zr->hdec = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
388 } |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
389 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
390 /* It can be that the original frame was too big for display, |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
391 * or that the width of the decimated image (for example) after |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
392 * padding up to a multiple of 16 has become too big. (orig |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
393 * width 720 (exactly right for the Buz) after decimation 360, |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
394 * after padding up to a multiple of 16 368, display 736 -> too |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
395 * large). In these situations we auto(re)crop. */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
396 tmp = 16*((g->width - 1)/(zr->hdec*16) + 1); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
397 if (stretchx*tmp > zr->vc.maxwidth) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
398 g->xoff += 2*((g->width - zr->hdec*(tmp-16))/4); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
399 /* g->off must be a multiple of 2 */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
400 g->width = zr->hdec*(tmp - 16); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
401 g->set = 0; /* we abuse this field to |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
402 report that g has changed*/ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
403 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
404 tmp = 8*zr->fields*((g->height - 1)/(zr->vdec*zr->fields*8)+1); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
405 if (stretchy*tmp > zr->vc.maxheight) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
406 g->yoff += 2*((g->height - zr->vdec* |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
407 (tmp - 8*zr->fields))/4); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
408 g->height = zr->vdec*(tmp - 8*zr->fields); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
409 g->set = 0; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
410 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
411 if (!g->set) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
412 mp_msg(MSGT_VO, MSGL_V, "zr: auto(re)cropping %dx%d+%d+%d to make the image fit on the screen\n", g->width, g->height, g->xoff, g->yoff); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
413 |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
414 /* the height must be a multiple of fields*8 and the width |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
415 * must be a multiple of 16 */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
416 /* add some black borders to make it so, and center the image*/ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
417 zr->image_height = zr->fields*8*((g->height/zr->vdec - 1)/ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
418 (zr->fields*8) + 1); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
419 zr->image_width = (zr->hdec*16)*((g->width - 1)/(zr->hdec*16) + 1); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
420 zr->off_y = (zr->image_height - g->height/zr->vdec)/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
421 if (zr->off_y%2 != 0) zr->off_y++; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
422 zr->off_y *= zr->image_width; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
423 zr->off_c = zr->off_y/4; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
424 zr->off_y += (zr->image_width - g->width)/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
425 if (zr->off_y%2 != 0) zr->off_y--; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
426 zr->off_c += (zr->image_width - g->width)/4; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
427 zr->size = zr->image_width*zr->image_height; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
428 mp_msg(MSGT_VO, MSGL_V, "zr: input: %dx%d, cropped: %dx%d, output: %dx%d, off_y=%d, off_c=%d\n", width, height, g->width, g->height, zr->image_width, zr->image_height, zr->off_y, zr->off_c); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
429 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
430 zr->image = malloc(2*zr->size); /* this buffer allows for YUV422 data, |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
431 * so it is a bit too big for YUV420 */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
432 if (!zr->image) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
433 mp_msg(MSGT_VO, MSGL_ERR, "zr: Memory exhausted\n"); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
434 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
435 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
436 /* and make sure that the borders are _really_ black */ |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
437 switch (format) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
438 case IMGFMT_YV12: |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
439 memset(zr->image, 0, zr->size); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
440 memset(zr->image + zr->size, 0x80, zr->size/4); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
441 memset(zr->image + 3*zr->size/2, 0x80, zr->size/4); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
442 zr->y_data = zr->image; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
443 zr->u_data = zr->image + zr->size; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
444 zr->v_data = zr->image + 3*zr->size/2; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
445 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
446 zr->y_stride = zr->image_width; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
447 zr->u_stride = zr->image_width/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
448 zr->v_stride = zr->image_width/2; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
449 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
450 zr->j = jpeg_enc_init(zr->image_width/zr->hdec, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
451 zr->image_height/zr->fields, |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
452 zr->hdec, zr->y_stride*zr->fields, |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
453 zr->hdec, zr->u_stride*zr->fields, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
454 zr->hdec, zr->v_stride*zr->fields, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
455 1, zr->quality, zr->bw); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
456 break; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
457 case IMGFMT_YUY2: |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
458 for (tmp = 0; tmp < 2*zr->size; tmp+=4) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
459 zr->image[tmp] = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
460 zr->image[tmp+1] = 0x80; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
461 zr->image[tmp+2] = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
462 zr->image[tmp+3] = 0x80; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
463 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
464 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
465 zr->y_data = zr->image; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
466 zr->u_data = zr->image + 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
467 zr->v_data = zr->image + 3; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
468 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
469 zr->y_stride = 2*zr->image_width; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
470 zr->u_stride = 2*zr->image_width; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
471 zr->v_stride = 2*zr->image_width; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
472 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
473 zr->j = jpeg_enc_init(zr->image_width/zr->hdec, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
474 zr->image_height/zr->fields, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
475 zr->hdec*2, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
476 zr->y_stride*zr->fields, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
477 zr->hdec*4, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
478 zr->u_stride*zr->fields, |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
479 zr->hdec*4, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
480 zr->v_stride*zr->fields, |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
481 0, zr->quality, zr->bw); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
482 break; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
483 default: |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
484 mp_msg(MSGT_VO, MSGL_FATAL, "zr: internal inconsistency in vo_zr\n"); |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
485 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
486 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
487 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
488 if (zr->j == NULL) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
489 mp_msg(MSGT_VO, MSGL_ERR, "zr: error initializing the jpeg encoder\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
490 return 1; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
491 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
492 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
493 if (init_zoran(zr, stretchx, stretchy)) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
494 return 1; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
495 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
496 |
4361
e7744189e03f
fix a decimation/scaling bug in vo_zr and some verbose messages have changed - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4352
diff
changeset
|
497 } |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
498 return 0; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
499 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
500 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
501 static void draw_osd(void) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
502 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
503 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
504 static void flip_page (void) { |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
505 int i, j, k; |
4651
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4596
diff
changeset
|
506 //FILE *fp; |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4596
diff
changeset
|
507 //char filename[100]; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
508 /* do we have a free buffer? */ |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
509 for (j = 0; j < zr_count; j++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
510 zr_info_t *zr = &zr_info[j]; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
511 /* using MJPEG_NBUFFERS here, using the real number of |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
512 * buffers may give sync issues (real number of buffers |
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
513 * is always sufficient) */ |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
514 if (zr->queue-zr->synco < MJPEG_NBUFFERS) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
515 zr->frame = zr->queue; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
516 } else { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
517 if (ioctl(zr->vdes, MJPIOC_SYNC, &zr->zs) < 0) |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
518 mp_msg(MSGT_VO, MSGL_ERR, "zr: error waiting for buffers to become free\n"); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
519 zr->frame = zr->zs.frame; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
520 zr->synco++; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
521 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
522 k=0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
523 for (i = 0; i < zr->fields; i++) |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
524 k+=jpeg_enc_frame(zr->j, zr->y_data + i*zr->y_stride, |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
525 zr->u_data + i*zr->u_stride, |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
526 zr->v_data + i*zr->v_stride, |
11376
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
527 zr->buf + zr->frame*zr->zrq.size+k); |
70b1673fe399
proper fix for 'some chipsets can't handle buffers > 128kB', vo_zr used
rik
parents:
10718
diff
changeset
|
528 if (k > zr->zrq.size) mp_msg(MSGT_VO, MSGL_WARN, "zr: jpeg image too large for maximum buffer size. Lower the jpeg encoding\nquality or the resolution of the movie.\n"); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
529 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
530 /* Warning: Only the first jpeg image contains huffman- and |
4651
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4596
diff
changeset
|
531 * quantisation tables, so don't expect files other than |
49f2bc22f880
mjpeg encoder cleanup - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4596
diff
changeset
|
532 * test0001.jpg to be readable */ |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
533 /*sprintf(filename, "test%04d.jpg", framenum); |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
534 fp = fopen(filename, "w"); |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
535 if (!fp) exit(1); |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
536 fwrite(buf+frame*zrq.size, 1, k, fp); |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
537 fclose(fp);*/ |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
538 /*fp = fopen("test1.jpg", "r"); |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
539 fread(buf+frame*zrq.size, 1, 2126, fp); |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
540 fclose(fp);*/ |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
541 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
542 for (j = 0; j < zr_count; j++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
543 zr_info_t *zr = &zr_info[j]; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
544 if (ioctl(zr->vdes, MJPIOC_QBUF_PLAY, &zr->frame) < 0) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
545 mp_msg(MSGT_VO, MSGL_ERR, "zr: error queueing buffer for playback\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
546 zr->queue++; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
547 } |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
548 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
549 framenum++; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
550 return; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
551 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
552 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
553 static int draw_frame(uint8_t * src[]) { |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
554 int i, j; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
555 char *source, *dest; |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
556 //printf("draw frame called\n"); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
557 for (j = 0; j < zr_count; j++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
558 zr_info_t *zr = &zr_info[j]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
559 geo_t *g = &zr->g; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
560 source = src[0] + 2*g->yoff*zr->vdec*zr->stride + 2*g->xoff; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
561 dest = zr->image + 2*zr->off_y; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
562 for (i = 0; i < g->height/zr->vdec; i++) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
16171
diff
changeset
|
563 fast_memcpy(dest, source, zr->image_width*2); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
564 dest += 2*zr->image_width; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
565 source += zr->vdec*zr->stride; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
566 } |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
567 } |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
568 return 0; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
569 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
570 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
571 static int query_format(uint32_t format) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
572 if(format==IMGFMT_YV12 || format==IMGFMT_YUY2) |
6235
3fbaae881e40
10l - noticed by Terry Mohan <tmohan@users.sourceforge.net>
arpi
parents:
6213
diff
changeset
|
573 return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
574 return 0; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
575 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
576 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
577 static void uninit(void) { |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
578 int j; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
579 mp_msg(MSGT_VO, MSGL_V, "zr: uninit called\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
580 for (j = 0; j < zr_count; j++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
581 jpeg_enc_uninit(zr_info[j].j); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
582 uninit_zoran(&zr_info[j]); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
583 } |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
584 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
585 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
586 static void check_events(void) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
587 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
588 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
589 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
590 static int draw_slice(uint8_t *srcimg[], int stride[], |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
591 int wf, int hf, int xf, int yf) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
592 int i, j, w, h, x, y; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
593 /* Apply 'geometry', crop unwanted parts */ |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
594 uint8_t *dst; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
595 //printf("before: w=%d, h=%d, x=%d, y=%d, src0=%p, src1=%p, src2=%p\n", w, h, x, y, srcimg[0], srcimg[1], srcimg[2]); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
596 for (j = 0; j < zr_count; j++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
597 uint8_t *src=srcimg[0]; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
598 uint8_t *src1=srcimg[1]; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
599 uint8_t *src2=srcimg[2]; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
600 zr_info_t *zr = &zr_info[j]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
601 geo_t *g = &zr->g; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
602 w = wf; h = hf; x = xf; y = yf; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
603 if (x < g->xoff) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
604 src += g->xoff - x; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
605 src1 += (g->xoff - x)/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
606 src2 += (g->xoff - x)/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
607 w -= g->xoff - x; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
608 if (w < 0) break; //return 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
609 x = 0 /*g.xoff*/; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
610 } else { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
611 x -= g->xoff; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
612 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
613 if (x + w > g->width) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
614 w = g->width - x; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
615 if (w < 0) break; //return 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
616 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
617 if (y < g->yoff) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
618 src += (g->yoff - y)*stride[0]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
619 src1 += ((g->yoff - y)/2)*stride[1]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
620 src2 += ((g->yoff - y)/2)*stride[2]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
621 h -= g->yoff - y; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
622 if (h < 0) break; //return 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
623 y = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
624 } else { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
625 y -= g->yoff; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
626 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
627 if (y + h > g->height) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
628 h = g->height - y; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
629 if (h < 0) break; //return 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
630 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
631 //printf("after: w=%d, h=%d, x=%d, y=%d, src0=%p, src1=%p, src2=%p\n", w, h, x, y, srcimg[0], srcimg[1], srcimg[2]); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
632 dst=zr->image + zr->off_y + zr->image_width*(y/zr->vdec)+x; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
633 // copy Y: |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
634 for (i = 0; i < h; i++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
635 if ((i + x)%zr->vdec == 0) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
16171
diff
changeset
|
636 fast_memcpy(dst,src,w); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
637 dst+=zr->image_width; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
638 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
639 src+=stride[0]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
640 |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
641 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
642 if (!zr->bw) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
643 // copy U+V: |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
644 uint8_t *dst1=zr->image + zr->size + zr->off_c+ (y/(zr->vdec*2))*zr->image_width/2+(x/2); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
645 uint8_t *dst2=zr->image + 3*zr->size/2 + zr->off_c + |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
646 (y/(zr->vdec*2))* |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
647 zr->image_width/2+(x/2); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
648 for (i = 0; i< h/2; i++) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
649 if ((i+x/2)%zr->vdec == 0) { |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
16171
diff
changeset
|
650 fast_memcpy(dst1,src1,w/2); |
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
16171
diff
changeset
|
651 fast_memcpy(dst2,src2,w/2); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
652 dst1+=zr->image_width/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
653 dst2+=zr->image_width/2; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
654 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
655 src1+=stride[1]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
656 src2+=stride[2]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
657 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
658 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
659 } |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
660 return 0; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
661 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
662 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
663 |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
664 /* copied and adapted from vo_aa_parseoption */ |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
665 int |
25232
893db6cc97b2
Add appropriate const specifiers to some custom parse functions.
reimar
parents:
25220
diff
changeset
|
666 vo_zr_parseoption(const m_option_t* conf, const char *opt, const char *param){ |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
667 /* got an option starting with zr */ |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
668 zr_info_t *zr = &zr_info[zr_parsing]; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
669 int i; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
670 /* do WE need it ?, always */ |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
671 if (!strcasecmp(opt, "zrdev")) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
672 if (param == NULL) return ERR_MISSING_PARAM; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
673 //if ((i=getcolor(param))==-1) return ERR_OUT_OF_RANGE; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
674 //aaopt_osdcolor=i; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
675 free(zr->device); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
676 zr->device = malloc(strlen(param)+1); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
677 strcpy(zr->device, param); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
678 mp_msg(MSGT_VO, MSGL_V, "zr: using device %s\n", zr->device); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
679 return 1; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
680 } else if (!strcasecmp(opt, "zrbw")) { |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
681 if (param != NULL) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
682 return ERR_OUT_OF_RANGE; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
683 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
684 zr->bw = 1; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
685 return 1; |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
686 } else if (!strcasecmp(opt, "zrfd")) { |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
687 if (param != NULL) { |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
688 return ERR_OUT_OF_RANGE; |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
689 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
690 zr->fd = 1; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
691 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
692 } else if (!strcasecmp(opt, "zrcrop")){ |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
693 geo_t *g = &zr->g; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
694 if (g->set == 1) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
695 zr_parsing++; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
696 zr_count++; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
697 zr = &zr_info[zr_parsing]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
698 g = &zr->g; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
699 if (zr_count > 4) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
700 mp_msg(MSGT_VO, MSGL_ERR, "zr: too many simultaneus display devices requested (max. is 4)\n"); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
701 return ERR_OUT_OF_RANGE; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
702 } |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
703 } |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
704 if (param == NULL) return ERR_MISSING_PARAM; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
705 if (sscanf(param, "%dx%d+%d+%d", &g->width, &g->height, |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
706 &g->xoff, &g->yoff) != 4) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
707 g->xoff = 0; g->yoff = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
708 if (sscanf(param, "%dx%d", &g->width, &g->height) != 2) { |
5666 | 709 mp_msg(MSGT_VO, MSGL_ERR, "zr: argument to -zrcrop must be of the form 352x288+16+0\n"); |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
710 return ERR_OUT_OF_RANGE; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
711 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
712 } |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
713 g->set = 1; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
714 mp_msg(MSGT_VO, MSGL_V, "zr: cropping %s\n", param); |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
715 return 1; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
716 }else if (!strcasecmp(opt, "zrhdec")) { |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
717 i = atoi(param); |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
718 if (i != 1 && i != 2 && i != 4) return ERR_OUT_OF_RANGE; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
719 zr->hdec = i; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
720 return 1; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
721 }else if (!strcasecmp(opt, "zrvdec")) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
722 i = atoi(param); |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
723 if (i != 1 && i != 2 && i != 4) return ERR_OUT_OF_RANGE; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
724 zr->vdec = i; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
725 return 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
726 }else if (!strcasecmp(opt, "zrxdoff")) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
727 i = atoi(param); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
728 zr->xdoff = i; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
729 return 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
730 }else if (!strcasecmp(opt, "zrydoff")) { |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
731 i = atoi(param); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
732 zr->ydoff = i; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
733 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
734 }else if (!strcasecmp(opt, "zrquality")) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
735 i = atoi(param); |
5865
f4b470b66a99
update: we use the new quantizer in libavcodec, -zrquality 1 is allowed
rik
parents:
5666
diff
changeset
|
736 if (i < 1 || i > 20) return ERR_OUT_OF_RANGE; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
737 zr->quality = i; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
738 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
739 }else if (!strcasecmp(opt, "zrnorm")) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
740 if (param == NULL) return ERR_MISSING_PARAM; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
741 if (!strcasecmp(param, "NTSC")) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
742 mp_msg(MSGT_VO, MSGL_V, "zr: Norm set to NTSC\n"); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
743 zr->norm = VIDEO_MODE_NTSC; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
744 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
745 } else if (!strcasecmp(param, "PAL")) { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
746 mp_msg(MSGT_VO, MSGL_V, "zr: Norm set to PAL\n"); |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
747 zr->norm = VIDEO_MODE_PAL; |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
748 return 1; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
749 } else { |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
750 return ERR_OUT_OF_RANGE; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
751 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
752 }else if (!strcasecmp(opt, "zrhelp")){ |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
753 printf("Help for -vo zr: Zoran ZR360[56]7/ZR36060 based MJPEG capture/playback cards\n"); |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
754 printf("\n"); |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
755 printf("Here are the zr options:\n"); |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
756 printf( |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
757 "\n" |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
758 " -zrcrop specify part of the input image that\n" |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
759 " you want to see as an x-style geometry string\n" |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
760 " example: -zrcrop 352x288+16+0\n" |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
761 " -zrvdec vertical decimation 1, 2 or 4\n" |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
762 " -zrhdec horizontal decimation 1, 2 or 4\n" |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
763 " -zrfd decimation is only done if the primitive\n" |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
764 " hardware upscaler can correct for the decimation,\n" |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
765 " this switch allows you to see the effects\n" |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
766 " of too much decimation\n" |
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
767 " -zrbw display in black&white (speed increase)\n" |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
768 " -zrxdoff x offset from upper-left of TV screen (default is 'centered')\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
769 " -zrydoff y offset from upper-left of TV screen (default is 'centered')\n" |
5865
f4b470b66a99
update: we use the new quantizer in libavcodec, -zrquality 1 is allowed
rik
parents:
5666
diff
changeset
|
770 " -zrquality jpeg compression quality [BEST] 1 - 20 [VERY BAD]\n" |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
771 " -zrdev playback device (example -zrdev /dev/video1)\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
772 " -zrnorm specify norm PAL/NTSC (default: leave at current setting)\n" |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
773 "\n" |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
774 "Cinerama support: additional occurances of -zrcrop activate cinerama mode,\n" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
775 "suppose you have a 704x272 movie, two DC10+ cards and two beamers (or tv's),\n" |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
776 "then you would issue the following command:\n\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
777 "mplayer -vo zr -zrcrop 352x272+0+0 -zrdev /dev/video0 -zrcrop 352x272+352+0 \\\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
778 " -zrdev /dev/video1 movie.avi\n\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
779 "Options appearing after the second -zrcrop apply to the second card, it is\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
780 "possible to dispay at a different jpeg quality or at different decimations.\n\n" |
7903 | 781 "The parameters -zrxdoff and -zrydoff can be used to align the two images.\n" |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
782 "The maximum number of zoran cards participating in cinerama is 4, so you can\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
783 "build a 2x2 vidiwall. (untested for obvious reasons, the setup wit a buz and\n" |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
784 "a DC10+ (and no beamers) is tested, however)\n" |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
785 ); |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
786 exit(0); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
787 |
4214
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
788 } |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
789 return ERR_NOT_AN_OPTION; |
664984198aef
zr driver (tv-out for DC10/DC10+, iomega buz, LML33...) added - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
diff
changeset
|
790 } |
4259 | 791 |
25232
893db6cc97b2
Add appropriate const specifiers to some custom parse functions.
reimar
parents:
25220
diff
changeset
|
792 void vo_zr_revertoption(const m_option_t* opt,const char* param) { |
4259 | 793 |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
794 zr_info_t *zr = &zr_info[1]; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
795 zr_count = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
796 zr_parsing = 0; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
797 |
4259 | 798 if (!strcasecmp(param, "zrdev")) { |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
799 if(zr->device) |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
800 free(zr->device); |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
801 zr->device=NULL; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
802 } else if (!strcasecmp(param, "zrbw")) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
803 zr->bw=0; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
804 else if (!strcasecmp(param, "zrfd")) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
805 zr->fd=0; |
4259 | 806 else if (!strcasecmp(param, "zrcrop")) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
807 zr->g.set = zr->g.xoff = zr->g.yoff = 0; |
4348
d4acef803c94
use the new jpeg encoder - patch by Rik Snel <rsnel@cube.dyndns.org>
arpi
parents:
4259
diff
changeset
|
808 else if (!strcasecmp(param, "zrhdec")) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
809 zr->hdec = 1; |
4259 | 810 else if (!strcasecmp(param, "zrvdec")) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
811 zr->vdec = 1; |
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
812 else if (!strcasecmp(param, "zrxdoff")) |
6933 | 813 zr->xdoff = -1; |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
814 else if (!strcasecmp(param, "zrydoff")) |
6933 | 815 zr->ydoff = -1; |
4259 | 816 else if (!strcasecmp(param, "zrquality")) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
817 zr->quality = 2; |
4259 | 818 else if (!strcasecmp(param, "zrnorm")) |
6932
56cb4837384b
cinerama support in -vo zr for people with more than one zoran card, documentation contained in -zrhelp
rik
parents:
6235
diff
changeset
|
819 zr->norm = VIDEO_MODE_AUTO; |
4259 | 820 |
821 } | |
4352 | 822 |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
823 static int preinit(const char *arg) |
4352 | 824 { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
825 if(arg) |
4737
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4668
diff
changeset
|
826 { |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4668
diff
changeset
|
827 printf("vo_zr: Unknown subdevice: %s\n",arg); |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4668
diff
changeset
|
828 return ENOSYS; |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4668
diff
changeset
|
829 } |
32e1f5042f65
I don't like such reports: '-vo dga:vidix or -vo x11:vidix works fine for me'
nick
parents:
4668
diff
changeset
|
830 return 0; |
4352 | 831 } |
832 | |
16171
fd51fd1ff231
Fix the return types of all (six) libvo API functions. Used to be uint32_t, but
ivo
parents:
15212
diff
changeset
|
833 static int control(uint32_t request, void *data, ...) |
4352 | 834 { |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
835 switch (request) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
836 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
837 return query_format(*((uint32_t*)data)); |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
838 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4433
diff
changeset
|
839 return VO_NOTIMPL; |
4352 | 840 } |