Mercurial > mplayer.hg
annotate libvo/vo_dxr3.c @ 5373:b476f5d1c91e
10l to nick - ACCEPT_WIDTH fixed
author | arpi |
---|---|
date | Wed, 27 Mar 2002 21:49:19 +0000 |
parents | 3e81a50e33ff |
children | f7402401318c |
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 |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
9 * 2002-03-26: |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
10 * 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
|
11 * codec. We thank him again. |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
12 * |
5330 | 13 * 2002-03-25: |
14 * A couple of bugfixes by XorA | |
15 * | |
5273
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
16 * 2002-03-23: |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
17 * 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
|
18 * 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
|
19 * |
5134
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
20 * 2002-03-16: |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
21 * 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
|
22 * 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
|
23 * with fame. |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
24 * |
5064 | 25 * 2002-03-13: |
26 * Preliminary fame support added (it breaks after seeking, why?) | |
27 * | |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
28 * 2002-02-18: |
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
29 * 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
|
30 * |
4723
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
31 * 2002-02-16: |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
32 * 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
|
33 * 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
|
34 * |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
35 * 2002-02-13: |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
36 * 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
|
37 * 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
|
38 * 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
|
39 * 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
|
40 * 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
|
41 * |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
42 * 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
|
43 * 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
|
44 * 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
|
45 * 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
|
46 * 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
|
47 * |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
48 * 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
|
49 * 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
|
50 * |
4480 | 51 * 2002-02-02: |
52 * Cleaned out some old code which might have slowed down writes | |
53 * | |
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
|
54 * 2002-01-17: |
4219 | 55 * 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
|
56 * |
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-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
|
58 * 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
|
59 * 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
|
60 * |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
61 * 2002-01-10: |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
62 * 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
|
63 * 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
|
64 * find any inconcistencies. |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
65 */ |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
66 |
2921 | 67 #include <linux/em8300.h> |
68 #include <sys/ioctl.h> | |
69 #include <sys/stat.h> | |
70 #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
|
71 #include <sys/select.h> |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
72 #include <unistd.h> |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
73 #include <stdio.h> |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
74 #include <stdlib.h> |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
75 #include <string.h> |
2921 | 76 #include <fcntl.h> |
2645 | 77 #include <stdio.h> |
78 #include <time.h> | |
79 | |
80 #include "config.h" | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
81 #include "fastmemcpy.h" |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
82 |
2645 | 83 #include "video_out.h" |
84 #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
|
85 #include "aspect.h" |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
86 #include "../postproc/rgb2rgb.h" |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
87 #include "../postproc/swscale.h" |
5275
38f45e170f3b
Disable prebuffering on athlons (3DNowEx) as the ones running at 266MHz
mswitch
parents:
5274
diff
changeset
|
88 #include "../cpudetect.h" |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
89 |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
90 #define USE_LIBFAME |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
91 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
92 /* Libfame codec initialisation */ |
5064 | 93 #ifdef USE_LIBFAME |
94 #include "../libfame/fame.h" | |
95 static unsigned char *outbuf = NULL; | |
96 static fame_parameters_t fame_params; | |
97 static fame_yuv_t fame_yuv; | |
5225 | 98 static fame_context_t *fame_ctx = NULL; |
99 static fame_object_t *fame_obj; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
100 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
101 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
102 /* libavcodec codec initialisation */ |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
103 #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
|
104 #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
|
105 #include <libffmpeg/avcodec.h> |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
106 #else |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
107 #include "libavcodec/avcodec.h" |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
108 #endif |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
109 /* 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
|
110 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
|
111 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
|
112 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
|
113 int avc_outbuf_size = 100000; |
3432 | 114 #endif |
5064 | 115 |
116 char *picture_data[] = { NULL, NULL, NULL }; | |
117 int picture_linesize[] = { 0, 0, 0 }; | |
2645 | 118 |
119 #ifdef HAVE_MMX | |
120 #include "mmx.h" | |
121 #endif | |
122 | |
123 LIBVO_EXTERN (dxr3) | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
124 /* codec control */ |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
125 enum MpegCodec |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
126 { |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
127 MPG_CODEC_NON, |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
128 MPG_CODEC_AVCODEC, |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
129 MPG_CODEC_FAME |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
130 }; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
131 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
132 #if defined(USE_LIBFAME) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
133 static int mpeg_codec = MPG_CODEC_FAME; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
134 #elif defined(USE_LIBAVCODEC) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
135 static int mpeg_codec = MPG_CODEC_AVCODEC; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
136 #else |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
137 statuc int mpeg_codec = MPG_CODEC_NONE; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
138 #endif |
2645 | 139 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
140 /* Resolutions and positions */ |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
141 static int v_width, v_height; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
142 static int s_width, s_height; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
143 static int osd_w, osd_h; |
4605 | 144 static int noprebuf = 0; |
2770 | 145 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
|
146 static SwsContext * sws = NULL; |
3329
529a001496c2
Switched from rte which caused alot of problems for some users to libmp1e.
mswitch
parents:
3232
diff
changeset
|
147 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
148 /* File descriptors */ |
2921 | 149 static int fd_control = -1; |
150 static int fd_video = -1; | |
151 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
|
152 static char fdv_name[80]; |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
153 |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
154 /* Static variable used in ioctl's */ |
2921 | 155 static int ioval = 0; |
2645 | 156 |
157 static vo_info_t vo_info = | |
158 { | |
159 "DXR3/H+ video out", | |
160 "dxr3", | |
161 "David Holm <dholm@iname.com>", | |
162 "" | |
163 }; | |
164 | |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
165 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
|
166 { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
167 uint32_t flag = 0; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
168 switch (request) { |
4754 | 169 case VOCTRL_RESUME: |
170 if (!noprebuf) { | |
171 ioval = EM8300_PLAYMODE_PLAY; | |
172 if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { | |
173 printf("VO: [dxr3] Unable to set playmode!\n"); | |
174 } | |
175 } | |
176 return VO_TRUE; | |
177 case VOCTRL_PAUSE: | |
178 if (!noprebuf) { | |
179 ioval = EM8300_PLAYMODE_PAUSED; | |
180 if (ioctl(fd_control, EM8300_IOCTL_SET_PLAYMODE, &ioval) < 0) { | |
181 printf("VO: [dxr3] Unable to set playmode!\n"); | |
182 } | |
183 } | |
184 return VO_TRUE; | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
185 case VOCTRL_RESET: |
4605 | 186 if (!noprebuf) { |
187 close(fd_video); | |
188 fd_video = open(fdv_name, O_WRONLY); | |
4609 | 189 fsync(fd_video); |
4605 | 190 } |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
191 return VO_TRUE; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
192 case VOCTRL_QUERY_FORMAT: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
193 switch (*((uint32_t*)data)) { |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
194 case IMGFMT_MPEGPES: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
195 /* Hardware accelerated | Hardware supports subpics */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
196 flag = 0x2 | 0x8; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
197 break; |
5064 | 198 #if defined(USE_LIBFAME) || defined(USE_LIBAVCODEC) |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
199 case IMGFMT_YV12: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
200 case IMGFMT_YUY2: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
201 case IMGFMT_RGB24: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
202 case IMGFMT_BGR24: |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
203 /* Conversion needed | OSD Supported */ |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
204 flag = 0x1 | 0x4; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
205 break; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
206 #else |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
207 default: |
5134
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
208 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
|
209 #endif |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
210 } |
4605 | 211 if (noprebuf) { |
212 return flag; | |
213 } else { | |
214 return (flag | 0x100); | |
215 } | |
4592
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
216 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
217 return VO_NOTIMPL; |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
218 } |
5fbfd8545c3b
query_ stuff replaced by new control() - patch by David Holm
arpi
parents:
4523
diff
changeset
|
219 |
5225 | 220 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 | 221 { |
4754 | 222 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
|
223 em8300_register_t reg; |
5273
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
224 extern float monitor_aspect; |
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
225 |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
226 /* 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
|
227 /* 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
|
228 /* 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
|
229 /* up in a lockup */ |
4160 | 230 ioval = EM8300_SPUMODE_ON; |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
231 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
|
232 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
|
233 uninit(); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
234 return -1; |
3201 | 235 } |
236 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
237 /* 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
|
238 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
|
239 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
|
240 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
|
241 } |
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 |
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 /* 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
|
244 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
|
245 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
|
246 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
|
247 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
|
248 |
4607
da09673aea00
Removed some stuff from the em8300 driver, had to compensate
mswitch
parents:
4605
diff
changeset
|
249 /* Clean buffer by syncing it */ |
4609 | 250 ioval = EM8300_SUBDEVICE_VIDEO; |
251 ioctl(fd_control, EM8300_IOCTL_FLUSH, &ioval); | |
252 ioval = EM8300_SUBDEVICE_AUDIO; | |
253 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
|
254 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
|
255 if (!noprebuf) { |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
256 ioval = 0x900; |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
257 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
|
258 ioval = 0; |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
259 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
|
260 } |
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
|
261 |
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
|
262 /* 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
|
263 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
|
264 v_width = width; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
265 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
|
266 |
5273
8af542acc1b6
Jitter-bug fixed by Marcel Hild <hild@b4mad.net>, many many thanks goes
mswitch
parents:
5225
diff
changeset
|
267 /* 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
|
268 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
|
269 |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
270 /* 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
|
271 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
|
272 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
|
273 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
|
274 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
|
275 printf("VO: [dxr3] Setting up for NTSC.\n"); |
5065 | 276 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
|
277 } else { |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
278 printf("VO: [dxr3] Setting up for PAL/SECAM.\n"); |
5065 | 279 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
|
280 } |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
281 aspect(&s_width, &s_height, A_ZOOM); |
5064 | 282 s_width -= s_width % 16; |
5281
88df6d5f6ce7
Aspect code reenabled, apparently users didn't like running movies
mswitch
parents:
5275
diff
changeset
|
283 s_height -= s_height % 16; |
5064 | 284 |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
285 /* 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
|
286 /* 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
|
287 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
|
288 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
|
289 if (tmp1 < tmp2) { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
290 ioval = EM8300_ASPECTRATIO_4_3; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
291 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
|
292 } else { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
293 ioval = EM8300_ASPECTRATIO_16_9; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
294 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
|
295 } |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
296 ioctl(fd_control, EM8300_IOCTL_SET_ASPECTRATIO, &ioval); |
4754 | 297 |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
298 if (format != IMGFMT_MPEGPES) { |
5064 | 299 size = s_width * s_height; |
300 picture_data[0] = malloc((size * 3) / 2); | |
301 picture_data[1] = picture_data[0] + size; | |
302 picture_data[2] = picture_data[1] + size / 4; | |
303 | |
304 picture_linesize[0] = s_width; | |
305 picture_linesize[1] = s_width / 2; | |
306 picture_linesize[2] = s_width / 2; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
307 switch(mpeg_codec) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
308 { |
5064 | 309 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
310 case MPG_CODEC_FAME: |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
311 printf("VO: [dxr3] Using FAME\n"); |
5064 | 312 fame_ctx = fame_open(); |
313 if (!fame_ctx) { | |
314 printf("VO: [dxr3] Cannot open libFAME!\n"); | |
315 return -1; | |
316 } | |
317 | |
5308
69e55c9c1a1a
Default to avcodec if installed, otherwise use fame. Apparently fame output is very very blocky
mswitch
parents:
5281
diff
changeset
|
318 fame_obj = fame_get_object(fame_ctx, "motion/pmvfast"); |
5225 | 319 fame_register(fame_ctx, "motion", fame_obj); |
320 | |
5064 | 321 fame_params.width = s_width; |
322 fame_params.height = s_height; | |
5225 | 323 fame_params.coding = "IPPPPPPP"; |
5199
72817be5265f
Automatically use avcodec if it exists, otherwise fall back to fame (due
mswitch
parents:
5134
diff
changeset
|
324 fame_params.quality = 90; |
5225 | 325 fame_params.bitrate = 0; |
5064 | 326 fame_params.slices_per_frame = 1; |
5199
72817be5265f
Automatically use avcodec if it exists, otherwise fall back to fame (due
mswitch
parents:
5134
diff
changeset
|
327 fame_params.frames_per_sequence = (int) (vo_fps + 0.5); |
5064 | 328 fame_params.shape_quality = 100; |
5225 | 329 fame_params.search_range = (int) (vo_fps + 0.5); |
5064 | 330 fame_params.verbose = 0; |
331 fame_params.profile = NULL; | |
332 | |
5134
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
333 if (vo_fps < 24.0) { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
334 fame_params.frame_rate_num = 24000; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
335 fame_params.frame_rate_den = 1001; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
336 } else if (vo_fps < 25.0) { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
337 fame_params.frame_rate_num = 24; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
338 fame_params.frame_rate_den = 1; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
339 } else if (vo_fps < 29.0) { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
340 fame_params.frame_rate_num = 25; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
341 fame_params.frame_rate_den = 1; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
342 } else if (vo_fps < 30.0) { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
343 fame_params.frame_rate_num = 30000; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
344 fame_params.frame_rate_den = 1001; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
345 } else if (vo_fps < 50.0) { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
346 fame_params.frame_rate_num = 30; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
347 fame_params.frame_rate_den = 1; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
348 } else if (vo_fps < 55.0) { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
349 fame_params.frame_rate_num = 50; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
350 fame_params.frame_rate_den = 1; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
351 } else if (vo_fps < 60.0) { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
352 fame_params.frame_rate_num = 60000; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
353 fame_params.frame_rate_den = 1001; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
354 } else { |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
355 fame_params.frame_rate_num = 60; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
356 fame_params.frame_rate_den = 1; |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
357 } |
83b3dc5132a5
Fixed some bugs with fame, had to disable prebuffering with fame though
mswitch
parents:
5132
diff
changeset
|
358 |
5064 | 359 outbuf = malloc(100000); |
360 fame_init(fame_ctx, &fame_params, outbuf, 100000); | |
361 | |
362 fame_yuv.w = s_width; | |
363 fame_yuv.h = s_height; | |
364 fame_yuv.y = picture_data[0]; | |
365 fame_yuv.u = picture_data[1]; | |
366 fame_yuv.v = picture_data[2]; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
367 break; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
368 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
369 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
370 case MPG_CODEC_AVCODEC: |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
371 printf("VO: [dxr3] Using AVCODEC\n"); |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
372 avc_codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
373 if (!avc_codec) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
374 printf("VO: [dxr3] Unable to find mpeg1video codec\n"); |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
375 uninit(); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
376 return -1; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
377 } |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
378 avc_context = malloc(sizeof(AVCodecContext)); |
5330 | 379 memset(avc_context, 0, sizeof(AVCodecContext)); |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
380 avc_context->width = s_width; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
381 avc_context->height = s_height; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
382 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
|
383 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
|
384 avc_context->gop_size = 18; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
385 } else { |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
386 avc_context->gop_size = 15; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
387 } |
5309 | 388 avc_context->frame_rate = (int) (vo_fps * FRAME_RATE_BASE); |
5199
72817be5265f
Automatically use avcodec if it exists, otherwise fall back to fame (due
mswitch
parents:
5134
diff
changeset
|
389 avc_context->bit_rate = 6e6; |
4523 | 390 avc_context->flags = CODEC_FLAG_HQ | CODEC_FLAG_QSCALE; |
391 avc_context->quality = 2; | |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
392 avc_context->pix_fmt = PIX_FMT_YUV420P; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
393 if (avcodec_open(avc_context, avc_codec) < 0) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
394 printf("VO: [dxr3] Unable to open codec\n"); |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
395 uninit(); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
396 return -1; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
397 } |
5064 | 398 /* Create a pixel buffer and set up pointers for color components */ |
399 memset(&avc_picture, 0, sizeof(avc_picture)); | |
400 avc_picture.linesize[0] = picture_linesize[0]; | |
401 avc_picture.linesize[1] = picture_linesize[1]; | |
402 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
|
403 |
5064 | 404 avc_picture.data[0] = picture_data[0]; |
405 avc_picture.data[1] = picture_data[1]; | |
406 avc_picture.data[2] = picture_data[2]; | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
407 break; |
5064 | 408 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
409 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
410 |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
411 sws = getSwsContextFromCmdLine(v_width, v_height, img_format, s_width, s_height, IMGFMT_YV12); |
5064 | 412 if (!sws) { |
4685
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
413 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
|
414 return -1; |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
415 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
416 |
5064 | 417 /* 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
|
418 osd_w = s_width; |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
419 osd_h = s_height; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
420 |
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
|
421 if (format == IMGFMT_BGR24) { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
422 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
|
423 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
424 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
|
425 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
426 return 0; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
427 } else if (format == IMGFMT_MPEGPES) { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
428 printf("VO: [dxr3] Format: MPEG-PES (no conversion needed)\n"); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
429 return 0; |
3201 | 430 } |
431 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
432 printf("VO: [dxr3] Format: Unsupported\n"); |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
433 uninit(); |
3432 | 434 return -1; |
2645 | 435 } |
436 | |
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
|
437 static const vo_info_t* get_info(void) |
2645 | 438 { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
439 return &vo_info; |
2645 | 440 } |
441 | |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
442 static void draw_alpha(int x, int y, int w, int h, unsigned char* src, unsigned char *srca, int srcstride) |
2645 | 443 { |
5064 | 444 #if defined(USE_LIBFAME) || defined(USE_LIBAVCODEC) |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
445 vo_draw_alpha_yv12(w, h, src, srca, srcstride, |
5064 | 446 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
|
447 #endif |
2645 | 448 } |
449 | |
450 static void draw_osd(void) | |
451 { | |
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
|
452 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
|
453 vo_draw_text(osd_w, osd_h, draw_alpha); |
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
|
454 } |
2645 | 455 } |
456 | |
457 static uint32_t draw_frame(uint8_t * src[]) | |
458 { | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
459 if (img_format == IMGFMT_MPEGPES) { |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
460 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
|
461 |
4160 | 462 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
|
463 if (!noprebuf) { |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
464 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
|
465 } |
4480 | 466 write(fd_spu, p->data, p->size); |
4160 | 467 } else { |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
468 write(fd_video, p->data, p->size); |
4160 | 469 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
470 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
|
471 } else { |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
472 int size, srcStride = (img_format == IMGFMT_YUY2) ? (v_width * 2) : (v_width * 3); |
5064 | 473 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
|
474 draw_osd(); |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
475 switch(mpeg_codec) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
476 { |
5064 | 477 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
478 case MPG_CODEC_FAME: |
5064 | 479 size = fame_encode_frame(fame_ctx, &fame_yuv, NULL); |
480 write(fd_video, outbuf, size); | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
481 break; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
482 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
483 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
484 case MPG_CODEC_AVCODEC: |
5064 | 485 size = avcodec_encode_video(avc_context, picture_data[0], avc_outbuf_size, &avc_picture); |
486 write(fd_video, picture_data[0], size); | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
487 break; |
5064 | 488 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
489 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
490 return 0; |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
491 } |
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
492 return -1; |
2645 | 493 } |
494 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
495 static void flip_page(void) |
2645 | 496 { |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
497 int size; |
4755
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
498 if (!noprebuf) { |
67c33b0fb847
Accidentally mixed experimental code with stable one during last commit,
mswitch
parents:
4754
diff
changeset
|
499 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
|
500 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
501 if (img_format == IMGFMT_YV12) { |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
502 switch(mpeg_codec) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
503 { |
5064 | 504 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
505 case MPG_CODEC_FAME: |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
506 size = fame_encode_frame(fame_ctx, &fame_yuv, NULL); |
5064 | 507 write(fd_video, outbuf, size); |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
508 break; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
509 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
510 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
511 case MPG_CODEC_AVCODEC: |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
512 size = avcodec_encode_video(avc_context, picture_data[0], avc_outbuf_size, &avc_picture); |
4613
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
513 if (!noprebuf) { |
8497da33a0d2
updated :noprebuf to emulate the playback used in mplayer 0.60 (with dxr3 patch), this solves
mswitch
parents:
4609
diff
changeset
|
514 ioctl(fd_video, EM8300_IOCTL_VIDEO_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
|
515 } |
5064 | 516 write(fd_video, picture_data[0], size); |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
517 break; |
5064 | 518 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
519 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
520 } |
2645 | 521 } |
522 | |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
523 static uint32_t draw_slice(uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0) |
2645 | 524 { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
525 if (img_format == IMGFMT_YV12) { |
5064 | 526 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
|
527 return 0; |
3232
d037e1201721
Added support for codecs that supports BGR24 (some opensource codecs and vivo)
mswitch
parents:
3218
diff
changeset
|
528 } |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
529 return -1; |
2645 | 530 } |
531 | |
3208 | 532 static void uninit(void) |
2645 | 533 { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
534 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
|
535 if (sws) { |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
536 freeSwsContext(sws); |
e8a749c866cf
Using the mplayer SwScaler instead of doing scaling manually (sometimes this dies with sig FPE
mswitch
parents:
4613
diff
changeset
|
537 } |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
538 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
539 switch(mpeg_codec) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
540 { |
5064 | 541 #ifdef USE_LIBFAME |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
542 case MPG_CODEC_FAME: |
5064 | 543 if (fame_ctx) { |
544 fame_close(fame_ctx); | |
545 } | |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
546 break; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
547 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
548 #ifdef USE_LIBAVCODEC |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
549 case MPG_CODEC_AVCODEC: |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
550 if (avc_context) { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
551 avcodec_close(avc_context); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
552 } |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
553 break; |
5064 | 554 #endif |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
555 } |
5064 | 556 if (picture_data[0]) { |
557 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
|
558 } |
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
|
559 if (fd_video) { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
560 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
|
561 } |
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
|
562 if (fd_spu) { |
4095
a3f3858b8c15
useless cosmetics changes... a.k.a. cvslog killer - patch by David Holm
arpi
parents:
4063
diff
changeset
|
563 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
|
564 } |
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
|
565 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
|
566 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
|
567 } |
2645 | 568 } |
569 | |
570 static void check_events(void) | |
571 { | |
572 } | |
4352 | 573 |
574 static uint32_t preinit(const char *arg) | |
575 { | |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
576 char devname[80]; |
4605 | 577 int fdflags = O_WRONLY; |
5310 | 578 CpuCaps cpucaps; |
5097 | 579 |
5310 | 580 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
|
581 /* Open the control interface */ |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
582 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
|
583 printf("VO: [dxr3] Disabling prebuffering.\n"); |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
584 noprebuf = 1; |
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
585 fdflags |= O_NONBLOCK; |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
586 arg=strchr(arg,':'); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
587 if(arg) arg++; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
588 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
589 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
590 if(cpucaps.has3DNowExt) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
591 { |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
592 printf("VO: [dxr3] fast AMD special disabling prebuffering.\n"); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
593 noprebuf = 1; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
594 fdflags |= O_NONBLOCK; |
4723
93e959f0a6e4
Fixed bug which would cause gibberish to be printed when using :noprebuf
mswitch
parents:
4685
diff
changeset
|
595 } |
5225 | 596 |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
597 #if defined(USE_LIBFAME) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
598 printf("VO: [dxr3] FAME supported\n"); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
599 if (arg && !strncmp("fame",arg,4)) { |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
600 mpeg_codec=MPG_CODEC_FAME; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
601 arg=strchr(arg,':'); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
602 if(arg) arg++; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
603 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
604 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
605 #if defined(USE_LIBAVCODEC) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
606 printf("VO: [dxr3] AVCODEC supported\n"); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
607 if (arg && !strncmp("avcodec",arg,7)) { |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
608 mpeg_codec=MPG_CODEC_AVCODEC; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
609 arg=strchr(arg,':'); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
610 if(arg) arg++; |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
611 } |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
612 #endif |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
613 |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
614 if (arg && arg[0]) { |
4724
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
615 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
|
616 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
|
617 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
618 /* 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
|
619 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
|
620 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
621 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
|
622 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
|
623 /* 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
|
624 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
|
625 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
|
626 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
|
627 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
|
628 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
|
629 return -1; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
630 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
631 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
632 |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
633 /* Open the video interface */ |
4724
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
634 if (arg && !noprebuf) { |
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
635 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
|
636 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
637 /* 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
|
638 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
|
639 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
640 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
|
641 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
|
642 /* 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
|
643 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
|
644 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
|
645 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
|
646 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
|
647 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
|
648 uninit(); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
649 return -1; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
650 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
651 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
652 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
|
653 } |
4602
e4a96fe4f3d2
Thanks to the new control() method I've finally been able to add prebuffering support. This
mswitch
parents:
4596
diff
changeset
|
654 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
|
655 |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
656 /* Open the subpicture interface */ |
4724
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
657 if (arg && !noprebuf) { |
798fdbcef121
Fixed a strange bug that sneaked in at the last minute (vobsub would
mswitch
parents:
4723
diff
changeset
|
658 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
|
659 } else { |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
660 /* 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
|
661 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
|
662 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
663 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
|
664 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
|
665 /* 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
|
666 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
|
667 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
|
668 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
|
669 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
|
670 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
|
671 uninit(); |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
672 return -1; |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
673 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
674 } |
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
675 |
5361
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
676 if(mpeg_codec==MPG_CODEC_AVCODEC) |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
677 { |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
678 avcodec_init(); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
679 avcodec_register_all(); |
3e81a50e33ff
XorA added the option of switching between fame/avcodec without
mswitch
parents:
5330
diff
changeset
|
680 } |
4513
2e3800da1ceb
Switched from libmp1e to libavcodec, at least for me it runs helluva lot faster than libmp1e
mswitch
parents:
4480
diff
changeset
|
681 |
4480 | 682 return 0; |
4352 | 683 } |