Mercurial > mplayer.hg
annotate libvo/vo_dxr3.c @ 5491:846285e8e0b4
Removed blinking effect from spuenc
author | mswitch |
---|---|
date | Thu, 04 Apr 2002 16:35:03 +0000 |
parents | 78bd1fa449c3 |
children | 14323f846fc8 |
rev | line source |
---|---|
2645 | 1 /* |
2 * vo_dxr3.c - DXR3/H+ video out | |
3 * | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
4 * Copyright (C) 2002 David Holm <dholm@iname.com> |
2645 | 5 * |
6 */ | |
7 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
8 /* ChangeLog added 2002-01-10 |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
9 * 2002-04-03: |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
10 * Carl George added spuenc support |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
11 * |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
12 * 2002-03-26: |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
13 * XorA added an option parser and support for selecting encoder |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
14 * codec. We thank him again. |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
15 * |
5330 | 16 * 2002-03-25: |
17 * A couple of bugfixes by XorA | |
18 * | |
5273
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
19 * 2002-03-23: |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
20 * Thanks to Marcel Hild <hild@b4mad.net> the jitter-bug experienced |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
21 * with some videos have been fixed, many thanks goes to him. |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
22 * |
5134
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
23 * 2002-03-16: |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
24 * Fixed problems with fame, it gives a better picture than avcodec, |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
25 * but is slightly slower. Most notably the wobbling effect is gone |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
26 * with fame. |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
27 * |
5064 | 28 * 2002-03-13: |
29 * Preliminary fame support added (it breaks after seeking, why?) | |
30 * | |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
31 * 2002-02-18: |
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
32 * Fixed sync problems when pausing video (while using prebuffering) |
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
33 * |
4723
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
34 * 2002-02-16: |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
35 * Fixed bug which would case invalid output when using :noprebuf |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
36 * Removed equalization code, it caused problems on slow systems |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
37 * |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
38 * 2002-02-13: |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
39 * Using the swscaler instead of the old hand coded shit. (Checkout man mplayer and search for sws ;). |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
40 * Using aspect function to setup a proper mpeg1, no more hassling with odd resolutions or GOP-sizes, |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
41 * this would only create jitter on some vids! |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
42 * The swscaler sometimes exits with sig8 on mpegs, I don't know why yet (just use -vc mpegpes in this |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
43 * case, and report to me if you have any avi's etc which does this...) |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
44 * |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
45 * 2002-02-09: |
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
46 * Thanks to the new control() method I have finally been able to enable the em8300 prebuffering. |
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
47 * This should speed up playback on all systems, the vout cpu usage should rocket since I will be hogging |
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
48 * the pci bus. Not to worry though, since frames are prebuffered it should be able to take a few blows |
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
49 * if you start doing other stuff simultaneously. |
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
50 * |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
51 * 2002-02-03: |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
52 * Removal of libmp1e, libavcodec has finally become faster (and it's code is helluva lot cleaner) |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
53 * |
4480 | 54 * 2002-02-02: |
55 * Cleaned out some old code which might have slowed down writes | |
56 * | |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
57 * 2002-01-17: |
4219 | 58 * Testrelease of new sync engine (using previously undocumented feature of em8300). |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
59 * |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
60 * 2002-01-15: |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
61 * Preliminary subpic support with -vc mpegpes and dvd's |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
62 * Device interfaces tries the new naming scheme by default (even though most users probably still use the old one) |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
63 * |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
64 * 2002-01-10: |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
65 * I rehauled the entire codebase. I have now changed to |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
66 * Kernighan & Ritchie codingstyle, please mail me if you |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
67 * find any inconcistencies. |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
68 */ |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
69 |
2921 | 70 #include <linux/em8300.h> |
71 #include <sys/ioctl.h> | |
72 #include <sys/stat.h> | |
73 #include <sys/types.h> | |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
74 #include <sys/select.h> |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
75 #include <unistd.h> |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
76 #include <stdio.h> |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
77 #include <stdlib.h> |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
78 #include <string.h> |
2921 | 79 #include <fcntl.h> |
2645 | 80 #include <stdio.h> |
81 #include <time.h> | |
82 | |
83 #include "config.h" | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
84 #include "fastmemcpy.h" |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
85 |
2645 | 86 #include "video_out.h" |
87 #include "video_out_internal.h" | |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
88 #include "aspect.h" |
5397 | 89 #include "postproc/rgb2rgb.h" |
90 #include "postproc/swscale.h" | |
91 #include "cpudetect.h" | |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
92 #include "spuenc.h" |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
93 |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
94 #define USE_LIBFAME |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
95 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
96 /* Libfame codec initialisation */ |
5064 | 97 #ifdef USE_LIBFAME |
98 #include "../libfame/fame.h" | |
99 static unsigned char *outbuf = NULL; | |
100 static fame_parameters_t fame_params; | |
101 static fame_yuv_t fame_yuv; | |
5225 | 102 static fame_context_t *fame_ctx = NULL; |
103 static fame_object_t *fame_obj; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
104 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
105 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
106 /* libavcodec codec initialisation */ |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
107 #ifdef USE_LIBAVCODEC |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
108 #ifdef USE_LIBAVCODEC_SO |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
109 #include <libffmpeg/avcodec.h> |
5397 | 110 #include <libffmpeg/dsputil.h> |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
111 #else |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
112 #include "libavcodec/avcodec.h" |
5397 | 113 #include "libavcodec/dsputil.h" |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
114 #endif |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
115 /* for video encoder */ |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
116 static AVCodec *avc_codec = NULL; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
117 static AVCodecContext *avc_context = NULL; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
118 static AVPicture avc_picture; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
119 int avc_outbuf_size = 100000; |
5397 | 120 extern int avcodec_inited; |
3432 | 121 #endif |
5064 | 122 |
123 char *picture_data[] = { NULL, NULL, NULL }; | |
124 int picture_linesize[] = { 0, 0, 0 }; | |
2645 | 125 |
126 #ifdef HAVE_MMX | |
127 #include "mmx.h" | |
128 #endif | |
129 | |
130 LIBVO_EXTERN (dxr3) | |
5377 | 131 |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
132 /* codec control */ |
5377 | 133 enum MpegCodec { |
134 MPG_CODEC_NON, | |
135 MPG_CODEC_AVCODEC, | |
136 MPG_CODEC_FAME | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
137 }; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
138 |
5377 | 139 #if defined(USE_LIBAVCODEC) |
140 static int mpeg_codec = MPG_CODEC_AVCODEC; | |
141 #elif defined(USE_LIBFAME) | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
142 static int mpeg_codec = MPG_CODEC_FAME; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
143 #else |
5377 | 144 static int mpeg_codec = MPG_CODEC_NONE; |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
145 #endif |
2645 | 146 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
147 /* Resolutions and positions */ |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
148 static int v_width, v_height; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
149 static int s_width, s_height; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
150 static int osd_w, osd_h; |
4605 | 151 static int noprebuf = 0; |
2770 | 152 static int img_format = 0; |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
153 static SwsContext * sws = NULL; |
3329
529a001496c2
Switched from rte which caused alot of problems for some users to libmp1e.
mswitch
parents:
3232
diff
changeset
|
154 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
155 /* File descriptors */ |
2921 | 156 static int fd_control = -1; |
157 static int fd_video = -1; | |
158 static int fd_spu = -1; | |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
159 static char fdv_name[80]; |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
160 |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
161 /* on screen display/subpics */ |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
162 static char *osdpicbuf = NULL; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
163 static int osdpicbuf_w; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
164 static int osdpicbuf_h; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
165 static int disposd = 0; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
166 static encodedata *spued; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
167 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
168 /* Static variable used in ioctl's */ |
2921 | 169 static int ioval = 0; |
2645 | 170 |
171 static vo_info_t vo_info = | |
172 { | |
173 "DXR3/H+ video out", | |
174 "dxr3", | |
175 "David Holm <dholm@iname.com>", | |
176 "" | |
177 }; | |
178 | |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
179 uint32_t control(uint32_t request, void *data, ...) |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
180 { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
181 uint32_t flag = 0; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
182 switch (request) { |
4754 | 183 case VOCTRL_RESUME: |
184 if (!noprebuf) { | |
185 ioval = EM8300_PLAYMODE_PLAY; | |
186 if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { | |
187 printf("VO: [dxr3] Unable to set playmode!\n"); | |
188 } | |
189 } | |
190 return VO_TRUE; | |
191 case VOCTRL_PAUSE: | |
192 if (!noprebuf) { | |
193 ioval = EM8300_PLAYMODE_PAUSED; | |
194 if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { | |
195 printf("VO: [dxr3] Unable to set playmode!\n"); | |
196 } | |
197 } | |
198 return VO_TRUE; | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
199 case VOCTRL_RESET: |
4605 | 200 if (!noprebuf) { |
201 close(fd_video); | |
202 fd_video = open(fdv_name, O_WRONLY); | |
4609 | 203 fsync(fd_video); |
4605 | 204 } |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
205 return VO_TRUE; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
206 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
207 switch (*((uint32_t*)data)) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
208 case IMGFMT_MPEGPES: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
209 /* Hardware accelerated | Hardware supports subpics */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
210 flag = 0x2 | 0x8; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
211 break; |
5064 | 212 #if defined(USE_LIBFAME) || defined(USE_LIBAVCODEC) |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
213 case IMGFMT_YV12: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
214 case IMGFMT_YUY2: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
215 case IMGFMT_RGB24: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
216 case IMGFMT_BGR24: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
217 /* Conversion needed | OSD Supported */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
218 flag = 0x1 | 0x4; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
219 break; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
220 #else |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
221 default: |
5134
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
222 printf("VO: [dxr3] You have disabled libavcodec/libfame support (Read DOCS/codecs.html)!\n"); |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
223 #endif |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
224 } |
4605 | 225 if (noprebuf) { |
226 return flag; | |
227 } else { | |
228 return (flag | 0x100); | |
229 } | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
230 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
231 return VO_NOTIMPL; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
232 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
233 |
5225 | 234 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format, const vo_tune_info_t *info) |
2645 | 235 { |
4754 | 236 int tmp1, tmp2, size; |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
237 em8300_register_t reg; |
5273
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
238 extern float monitor_aspect; |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
239 |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
240 /* Softzoom turned on, downscale */ |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
241 /* This activates the subpicture processor, you can safely disable this and still send */ |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
242 /* broken subpics to the em8300, if it's enabled and you send broken subpics you will end */ |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
243 /* up in a lockup */ |
4160 | 244 ioval = EM8300_SPUMODE_ON; |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
245 if (ioctl(fd_control, EM8300_IOCTL_SET_SPUMODE, &ioval) < 0) { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
246 printf("VO: [dxr3] Unable to set subpicture mode!\n"); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
247 uninit(); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
248 return -1; |
3201 | 249 } |
250 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
251 /* Set the playmode to play (just in case another app has set it to something else) */ |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
252 ioval = EM8300_PLAYMODE_PLAY; |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
253 if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
254 printf("VO: [dxr3] Unable to set playmode!\n"); |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
255 } |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
256 |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
257 /* Start em8300 prebuffering and sync engine */ |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
258 reg.microcode_register = 1; |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
259 reg.reg = 0; |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
260 reg.val = MVCOMMAND_SYNC; |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
261 ioctl(fd_control, EM8300_IOCTL_WRITEREG, ®); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
262 |
4607
da09673aea00
Removed some stuff from the em8300 driver, had to compensate
mswitch
parents:
4605
diff
changeset
|
263 /* Clean buffer by syncing it */ |
4609 | 264 ioval = EM8300_SUBDEVICE_VIDEO; |
265 ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval); | |
266 ioval = EM8300_SUBDEVICE_AUDIO; | |
267 ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval); | |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
268 fsync(fd_video); |
4613
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
269 if (!noprebuf) { |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
270 ioval = 0x900; |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
271 ioctl(fd_control, EM8300_IOCTL_SCR_SETSPEED, &ioval); |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
272 ioval = 0; |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
273 ioctl(fd_control, EM8300_IOCTL_SCR_SET, &ioval); |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
274 } |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
275 |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
276 /* Store some variables statically that we need later in another scope */ |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
277 img_format = format; |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
278 v_width = width; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
279 v_height = height; |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
280 |
5273
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
281 /* Set monitor_aspect to avoid jitter */ |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
282 monitor_aspect = (float) width / (float) height; |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
283 |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
284 /* libavcodec requires a width and height that is x|16 */ |
5281
88df6d5f6ce7
Aspect code reenabled, apparently users didn't like running movies
mswitch
parents:
5275
diff
changeset
|
285 aspect_save_orig(width, height); |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
286 aspect_save_prescale(d_width, d_height); |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
287 ioctl(fd_control, EM8300_IOCTL_GET_VIDEOMODE, &ioval); |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
288 if (ioval == EM8300_VIDEOMODE_NTSC) { |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
289 printf("VO: [dxr3] Setting up for NTSC.\n"); |
5065 | 290 aspect_save_screenres(352, 240); |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
291 } else { |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
292 printf("VO: [dxr3] Setting up for PAL/SECAM.\n"); |
5065 | 293 aspect_save_screenres(352, 288); |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
294 } |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
295 aspect(&s_width, &s_height, A_ZOOM); |
5064 | 296 s_width -= s_width % 16; |
5281
88df6d5f6ce7
Aspect code reenabled, apparently users didn't like running movies
mswitch
parents:
5275
diff
changeset
|
297 s_height -= s_height % 16; |
5064 | 298 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
299 /* Try to figure out whether to use widescreen output or not */ |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
300 /* Anamorphic widescreen modes makes this a pain in the ass */ |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
301 tmp1 = abs(d_height - ((d_width / 4) * 3)); |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
302 tmp2 = abs(d_height - (int) (d_width / 2.35)); |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
303 if (tmp1 < tmp2) { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
304 ioval = EM8300_ASPECTRATIO_4_3; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
305 printf("VO: [dxr3] Setting aspect ratio to 4:3\n"); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
306 } else { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
307 ioval = EM8300_ASPECTRATIO_16_9; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
308 printf("VO: [dxr3] Setting aspect ratio to 16:9\n"); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
309 } |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
310 ioctl(fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &ioval); |
4754 | 311 |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
312 if (format != IMGFMT_MPEGPES) { |
5064 | 313 size = s_width * s_height; |
314 picture_data[0] = malloc((size * 3) / 2); | |
315 picture_data[1] = picture_data[0] + size; | |
316 picture_data[2] = picture_data[1] + size / 4; | |
317 | |
318 picture_linesize[0] = s_width; | |
319 picture_linesize[1] = s_width / 2; | |
320 picture_linesize[2] = s_width / 2; | |
5377 | 321 switch (mpeg_codec) { |
5064 | 322 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
323 case MPG_CODEC_FAME: |
5377 | 324 printf("VO: [dxr3] Using FAME\n"); |
325 fame_ctx = fame_open(); | |
326 if (!fame_ctx) { | |
327 printf("VO: [dxr3] Cannot open libFAME!\n"); | |
328 return -1; | |
329 } | |
5064 | 330 |
5377 | 331 fame_obj = fame_get_object(fame_ctx, "motion/pmvfast"); |
332 fame_register(fame_ctx, "motion", fame_obj); | |
333 | |
334 memset(&fame_params, 0, sizeof(fame_parameters_t)); | |
335 fame_params.width = s_width; | |
336 fame_params.height = s_height; | |
337 fame_params.coding = "IPPPPPPP"; | |
338 fame_params.quality = 90; | |
339 fame_params.bitrate = 0; | |
340 fame_params.slices_per_frame = 1; | |
341 fame_params.frames_per_sequence = (int) (vo_fps + 0.5); | |
342 fame_params.shape_quality = 100; | |
343 fame_params.search_range = (int) (vo_fps + 0.5); | |
344 fame_params.verbose = 0; | |
345 fame_params.profile = NULL; | |
5064 | 346 |
5377 | 347 if (vo_fps < 24.0) { |
348 fame_params.frame_rate_num = 24000; | |
349 fame_params.frame_rate_den = 1001; | |
350 } else if (vo_fps < 25.0) { | |
351 fame_params.frame_rate_num = 24; | |
352 fame_params.frame_rate_den = 1; | |
353 } else if (vo_fps < 29.0) { | |
354 fame_params.frame_rate_num = 25; | |
355 fame_params.frame_rate_den = 1; | |
356 } else if (vo_fps < 30.0) { | |
357 fame_params.frame_rate_num = 30000; | |
358 fame_params.frame_rate_den = 1001; | |
359 } else if (vo_fps < 50.0) { | |
360 fame_params.frame_rate_num = 30; | |
361 fame_params.frame_rate_den = 1; | |
362 } else if (vo_fps < 55.0) { | |
363 fame_params.frame_rate_num = 50; | |
364 fame_params.frame_rate_den = 1; | |
365 } else if (vo_fps < 60.0) { | |
366 fame_params.frame_rate_num = 60000; | |
367 fame_params.frame_rate_den = 1001; | |
368 } else { | |
369 fame_params.frame_rate_num = 60; | |
370 fame_params.frame_rate_den = 1; | |
371 } | |
372 | |
373 outbuf = malloc(100000); | |
374 fame_init(fame_ctx, &fame_params, outbuf, 100000); | |
5064 | 375 |
5377 | 376 fame_yuv.w = s_width; |
377 fame_yuv.h = s_height; | |
378 fame_yuv.y = picture_data[0]; | |
379 fame_yuv.u = picture_data[1]; | |
380 fame_yuv.v = picture_data[2]; | |
381 break; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
382 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
383 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
384 case MPG_CODEC_AVCODEC: |
5377 | 385 printf("VO: [dxr3] Using AVCODEC\n"); |
386 avc_codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO); | |
387 if (!avc_codec) { | |
388 printf("VO: [dxr3] Unable to find mpeg1video codec\n"); | |
389 uninit(); | |
390 return -1; | |
391 } | |
392 if (avc_context) { | |
393 free(avc_context); | |
394 } | |
395 avc_context = malloc(sizeof(AVCodecContext)); | |
396 memset(avc_context, 0, sizeof(AVCodecContext)); | |
397 avc_context->width = s_width; | |
398 avc_context->height = s_height; | |
399 ioctl(fd_control, EM8300_IOCTL_GET_VIDEOMODE, &ioval); | |
400 if (ioval == EM8300_VIDEOMODE_NTSC) { | |
401 avc_context->gop_size = 18; | |
402 } else { | |
403 avc_context->gop_size = 15; | |
404 } | |
405 avc_context->frame_rate = (int) (vo_fps * FRAME_RATE_BASE); | |
406 avc_context->bit_rate = 6e6; | |
407 avc_context->flags = CODEC_FLAG_HQ | CODEC_FLAG_QSCALE; | |
408 avc_context->quality = 2; | |
409 avc_context->pix_fmt = PIX_FMT_YUV420P; | |
410 if (avcodec_open(avc_context, avc_codec) < 0) { | |
411 printf("VO: [dxr3] Unable to open codec\n"); | |
412 uninit(); | |
413 return -1; | |
414 } | |
415 /* Create a pixel buffer and set up pointers for color components */ | |
416 memset(&avc_picture, 0, sizeof(avc_picture)); | |
417 avc_picture.linesize[0] = picture_linesize[0]; | |
418 avc_picture.linesize[1] = picture_linesize[1]; | |
419 avc_picture.linesize[2] = picture_linesize[2]; | |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
420 |
5377 | 421 avc_picture.data[0] = picture_data[0]; |
422 avc_picture.data[1] = picture_data[1]; | |
423 avc_picture.data[2] = picture_data[2]; | |
424 break; | |
5064 | 425 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
426 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
427 |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
428 sws = getSwsContextFromCmdLine(v_width, v_height, img_format, s_width, s_height, IMGFMT_YV12); |
5064 | 429 if (!sws) { |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
430 printf("vo_vesa: Can't initialize SwScaler\n"); |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
431 return -1; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
432 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
433 |
5064 | 434 /* This stuff calculations the relative position of the osd */ |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
435 osd_w = s_width; |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
436 osd_h = s_height; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
437 |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
438 if (format == IMGFMT_BGR24) { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
439 yuv2rgb_init(24, MODE_BGR); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
440 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
441 yuv2rgb_init(24, MODE_RGB); |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
442 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
443 return 0; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
444 } else if (format == IMGFMT_MPEGPES) { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
445 printf("VO: [dxr3] Format: MPEG-PES (no conversion needed)\n"); |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
446 osdpicbuf = malloc(s_width * s_height); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
447 if (osdpicbuf == NULL) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
448 printf("vo_dxr3: out of mem\n"); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
449 return -1; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
450 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
451 spued = (encodedata *) malloc(sizeof(encodedata)); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
452 if (spued == NULL) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
453 printf("vo_dxr3:out of mem\n"); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
454 return -1; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
455 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
456 osd_w = s_width; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
457 osd_h = s_height; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
458 osdpicbuf_w = s_width; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
459 osdpicbuf_h = s_height; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
460 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
461 return 0; |
3201 | 462 } |
463 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
464 printf("VO: [dxr3] Format: Unsupported\n"); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
465 uninit(); |
3432 | 466 return -1; |
2645 | 467 } |
468 | |
2866
4f6190ab52e7
Added a temporary fix to the DXR3 win32 codec playback, win32 codecs might prove to play back an unscaled image!
mswitch
parents:
2770
diff
changeset
|
469 static const vo_info_t* get_info(void) |
2645 | 470 { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
471 return &vo_info; |
2645 | 472 } |
473 | |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
474 static void draw_alpha(int x, int y, int w, int h, unsigned char* src, unsigned char *srca, int srcstride) |
2645 | 475 { |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
476 int lx, ly, bx; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
477 unsigned char *buf; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
478 buf = &osdpicbuf[(y * osdpicbuf_w) + x]; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
479 if (img_format == IMGFMT_MPEGPES) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
480 for (ly = 0; ly < h - 1; ly++) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
481 for(lx = 0; lx < w; lx++) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
482 if ((srca[(ly * srcstride) + lx] != 0) && (src[(ly * srcstride) + lx] != 0)) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
483 if(src[(ly * srcstride) + lx] >= 128) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
484 buf[ly * osdpicbuf_w + lx] = 3; |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
485 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
486 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
487 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
488 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
489 pixbuf_encode_rle(x, y, osdpicbuf_w, osdpicbuf_h - 1, osdpicbuf, osdpicbuf_w, spued); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
490 } else { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
491 #if defined(USE_LIBAVCODEC) || defined(USE_LIBFAME) |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
492 vo_draw_alpha_yv12(w, h, src, srca, srcstride, |
5064 | 493 picture_data[0] + x + y * picture_linesize[0], picture_linesize[0]); |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
494 #endif |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
495 } |
2645 | 496 } |
497 | |
498 static void draw_osd(void) | |
499 { | |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
500 if (img_format != IMGFMT_MPEGPES) { |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
501 vo_draw_text(osd_w, osd_h, draw_alpha); |
5491 | 502 } else if ((disposd % 15) == 0) { |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
503 vo_draw_text(osd_w, osd_h, draw_alpha); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
504 memset(osdpicbuf, 0, s_width * s_height); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
505 |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
506 /* could stand some check here to see if the subpic hasn't changed |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
507 * as if it hasn't and we re-send it it will "blink" as the last one |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
508 * is turned off, and the new one (same one) is turned on |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
509 */ |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
510 if (!noprebuf) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
511 ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
512 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
513 write(fd_spu, spued->data, spued->count); |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
514 } |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
515 disposd++; |
2645 | 516 } |
517 | |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
518 |
2645 | 519 static uint32_t draw_frame(uint8_t * src[]) |
520 { | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
521 if (img_format == IMGFMT_MPEGPES) { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
522 vo_mpegpes_t *p = (vo_mpegpes_t *) src[0]; |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
523 |
4160 | 524 if (p->id == 0x20) { |
4613
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
525 if (!noprebuf) { |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
526 ioctl(fd_spu, EM8300_IOCTL_SPU_SETPTS, &vo_pts); |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
527 } |
4480 | 528 write(fd_spu, p->data, p->size); |
4160 | 529 } else { |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
530 write(fd_video, p->data, p->size); |
4160 | 531 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
532 return 0; |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
533 } else { |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
534 int size, srcStride = (img_format == IMGFMT_YUY2) ? (v_width * 2) : (v_width * 3); |
5064 | 535 sws->swScale(sws, src, &srcStride, 0, v_height, picture_data, picture_linesize); |
4514
4e21ffb56104
Forgot the osd fix in the other patch, well, here it is ;)
mswitch
parents:
4513
diff
changeset
|
536 draw_osd(); |
5377 | 537 switch (mpeg_codec) { |
5064 | 538 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
539 case MPG_CODEC_FAME: |
5377 | 540 size = fame_encode_frame(fame_ctx, &fame_yuv, NULL); |
541 write(fd_video, outbuf, size); | |
542 break; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
543 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
544 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
545 case MPG_CODEC_AVCODEC: |
5377 | 546 size = avcodec_encode_video(avc_context, picture_data[0], avc_outbuf_size, &avc_picture); |
547 write(fd_video, picture_data[0], size); | |
548 break; | |
5064 | 549 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
550 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
551 return 0; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
552 } |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
553 return -1; |
2645 | 554 } |
555 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
556 static void flip_page(void) |
2645 | 557 { |
5377 | 558 int size; |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
559 if (!noprebuf) { |
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
560 ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts); |
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
561 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
562 if (img_format == IMGFMT_YV12) { |
5377 | 563 switch (mpeg_codec) { |
5064 | 564 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
565 case MPG_CODEC_FAME: |
5377 | 566 size = fame_encode_frame(fame_ctx, &fame_yuv, NULL); |
567 write(fd_video, outbuf, size); | |
568 break; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
569 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
570 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
571 case MPG_CODEC_AVCODEC: |
5377 | 572 size = avcodec_encode_video(avc_context, picture_data[0], avc_outbuf_size, &avc_picture); |
573 if (!noprebuf) { | |
574 ioctl(fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vo_pts); | |
575 } | |
576 write(fd_video, picture_data[0], size); | |
577 break; | |
5064 | 578 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
579 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
580 } |
2645 | 581 } |
582 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
583 static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0) |
2645 | 584 { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
585 if (img_format == IMGFMT_YV12) { |
5064 | 586 sws->swScale(sws, srcimg, stride, y0, h, picture_data, picture_linesize); |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
587 return 0; |
3232
d037e1201721
Added support for codecs that supports BGR24 (some opensource codecs and vivo)
mswitch
parents:
3218
diff
changeset
|
588 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
589 return -1; |
2645 | 590 } |
591 | |
3208 | 592 static void uninit(void) |
2645 | 593 { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
594 printf("VO: [dxr3] Uninitializing\n"); |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
595 if (sws) { |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
596 freeSwsContext(sws); |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
597 } |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
598 |
5377 | 599 switch (mpeg_codec) { |
5064 | 600 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
601 case MPG_CODEC_FAME: |
5377 | 602 if (fame_ctx) { |
603 fame_close(fame_ctx); | |
604 } | |
605 break; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
606 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
607 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
608 case MPG_CODEC_AVCODEC: |
5377 | 609 if (avc_context) { |
610 avcodec_close(avc_context); | |
611 } | |
612 break; | |
5064 | 613 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
614 } |
5064 | 615 if (picture_data[0]) { |
616 free(picture_data[0]); | |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
617 } |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
618 if (fd_video) { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
619 close(fd_video); |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
620 } |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
621 if (fd_spu) { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
622 close(fd_spu); |
4218
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
623 } |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
624 if (fd_control) { |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
625 close(fd_control); |
3931c41f740a
Added new syncengine thanks to a new previously undocumented feature of the em8300, this might fix playback on both slow and fast machines (more testing needed). This also requires users to get the em8300 driver from cvs until the next version is released (will probably happen this weekend)
mswitch
parents:
4166
diff
changeset
|
626 } |
5490
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
627 if(osdpicbuf) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
628 free(osdpicbuf); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
629 } |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
630 if(spued) { |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
631 free(spued); |
78bd1fa449c3
Added spuenc... should write a draw_alpha_spu perhaps =D
mswitch
parents:
5397
diff
changeset
|
632 } |
2645 | 633 } |
634 | |
635 static void check_events(void) | |
636 { | |
637 } | |
4352 | 638 |
639 static uint32_t preinit(const char *arg) | |
640 { | |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
641 char devname[80]; |
4605 | 642 int fdflags = O_WRONLY; |
5310 | 643 CpuCaps cpucaps; |
5097 | 644 |
5310 | 645 GetCpuCaps(&cpucaps); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
646 /* Open the control interface */ |
5377 | 647 if (arg && !strncmp("noprebuf", arg, 8)) { |
4723
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
648 printf("VO: [dxr3] Disabling prebuffering.\n"); |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
649 noprebuf = 1; |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
650 fdflags |= O_NONBLOCK; |
5377 | 651 arg = strchr(arg, ':'); |
652 if (arg) { | |
653 arg++; | |
654 } | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
655 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
656 |
5377 | 657 if (cpucaps.has3DNowExt) { |
658 printf("VO: [dxr3] Fast AMD special disabling prebuffering.\n"); | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
659 noprebuf = 1; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
660 fdflags |= O_NONBLOCK; |
4723
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
661 } |
5225 | 662 |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
663 #if defined(USE_LIBFAME) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
664 printf("VO: [dxr3] FAME supported\n"); |
5377 | 665 if (arg && !strncmp("fame", arg, 4)) { |
666 mpeg_codec = MPG_CODEC_FAME; | |
667 arg = strchr(arg, ':'); | |
668 if (arg) { | |
669 arg++; | |
670 } | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
671 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
672 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
673 #if defined(USE_LIBAVCODEC) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
674 printf("VO: [dxr3] AVCODEC supported\n"); |
5377 | 675 if (arg && !strncmp("avcodec", arg, 7)) { |
676 mpeg_codec = MPG_CODEC_AVCODEC; | |
677 arg = strchr(arg, ':'); | |
678 if (arg) { | |
679 arg++; | |
680 } | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
681 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
682 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
683 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
684 if (arg && arg[0]) { |
4724
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
685 printf("VO: [dxr3] Forcing use of device %s\n", arg); |
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
686 sprintf(devname, "/dev/em8300-%s", arg); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
687 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
688 /* Try new naming scheme by default */ |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
689 sprintf(devname, "/dev/em8300-0"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
690 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
691 fd_control = open(devname, fdflags); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
692 if (fd_control < 1) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
693 /* Fall back to old naming scheme */ |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
694 printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300 instead\n", devname); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
695 sprintf(devname, "/dev/em8300"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
696 fd_control = open(devname, fdflags); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
697 if (fd_control < 1) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
698 printf("VO: [dxr3] Error opening /dev/em8300 for writing as well!\nBailing\n"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
699 return -1; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
700 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
701 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
702 |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
703 /* Open the video interface */ |
4724
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
704 if (arg && !noprebuf) { |
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
705 sprintf(devname, "/dev/em8300_mv-%s", arg); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
706 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
707 /* Try new naming scheme by default */ |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
708 sprintf(devname, "/dev/em8300_mv-0"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
709 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
710 fd_video = open(devname, fdflags); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
711 if (fd_video < 0) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
712 /* Fall back to old naming scheme */ |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
713 printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300_mv instead\n", devname); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
714 sprintf(devname, "/dev/em8300_mv"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
715 fd_video = open(devname, fdflags); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
716 if (fd_video < 0) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
717 printf("VO: [dxr3] Error opening /dev/em8300_mv for writing as well!\nBailing\n"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
718 uninit(); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
719 return -1; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
720 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
721 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
722 printf("VO: [dxr3] Opened %s\n", devname); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
723 } |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
724 strcpy(fdv_name, devname); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
725 |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
726 /* Open the subpicture interface */ |
4724
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
727 if (arg && !noprebuf) { |
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
728 sprintf(devname, "/dev/em8300_sp-%s", arg); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
729 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
730 /* Try new naming scheme by default */ |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
731 sprintf(devname, "/dev/em8300_sp-0"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
732 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
733 fd_spu = open(devname, fdflags); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
734 if (fd_spu < 0) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
735 /* Fall back to old naming scheme */ |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
736 printf("VO: [dxr3] Error opening %s for writing, trying /dev/em8300_sp instead\n", devname); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
737 sprintf(devname, "/dev/em8300_sp"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
738 fd_spu = open(devname, fdflags); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
739 if (fd_spu < 0) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
740 printf("VO: [dxr3] Error opening /dev/em8300_sp for writing as well!\nBailing\n"); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
741 uninit(); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
742 return -1; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
743 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
744 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
745 |
5377 | 746 #if defined(USE_LIBAVCODEC) |
5397 | 747 if (mpeg_codec == MPG_CODEC_AVCODEC && !avcodec_inited) { |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
748 avcodec_init(); |
5397 | 749 avcodec_register_all(); |
750 avcodec_inited = 1; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
751 } |
5397 | 752 |
5377 | 753 #endif |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
754 |
4480 | 755 return 0; |
4352 | 756 } |