-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/nullvideo.c | 21 |
2 files changed, 26 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 8896cfe..d04af08 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -21,166 +21,171 @@ | |||
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <stdio.h> | 34 | #include <stdio.h> |
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | #include <qimage.h> | 36 | #include <qimage.h> |
37 | #include <qtextstream.h> | 37 | #include <qtextstream.h> |
38 | #include <qpe/resource.h> | 38 | #include <qpe/resource.h> |
39 | 39 | ||
40 | #include <qfile.h> | 40 | #include <qfile.h> |
41 | #include <qdir.h> | 41 | #include <qdir.h> |
42 | 42 | ||
43 | #include <qgfx_qws.h> | 43 | #include <qgfx_qws.h> |
44 | #include <qdirectpainter_qws.h> | 44 | #include <qdirectpainter_qws.h> |
45 | 45 | ||
46 | #include <assert.h> | 46 | #include <assert.h> |
47 | 47 | ||
48 | #include "xinevideowidget.h" | 48 | #include "xinevideowidget.h" |
49 | #include "frame.h" | 49 | #include "frame.h" |
50 | #include "lib.h" | 50 | #include "lib.h" |
51 | 51 | ||
52 | 52 | ||
53 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | 53 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, |
54 | int width, int height,int bytes ); | 54 | int width, int height,int bytes ); |
55 | 55 | ||
56 | extern "C" { | 56 | extern "C" { |
57 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); | 57 | xine_vo_driver_t* init_video_out_plugin( xine_t *xine, void* video, display_xine_frame_t, void * ); |
58 | int null_is_showing_video( const xine_vo_driver_t* self ); | 58 | int null_is_showing_video( const xine_vo_driver_t* self ); |
59 | void null_set_show_video( const xine_vo_driver_t* self, int show ); | 59 | void null_set_show_video( const xine_vo_driver_t* self, int show ); |
60 | int null_is_fullscreen( const xine_vo_driver_t* self ); | 60 | int null_is_fullscreen( const xine_vo_driver_t* self ); |
61 | void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); | 61 | void null_set_fullscreen( const xine_vo_driver_t* self, int screen ); |
62 | int null_is_scaling( const xine_vo_driver_t* self ); | 62 | int null_is_scaling( const xine_vo_driver_t* self ); |
63 | void null_set_scaling( const xine_vo_driver_t* self, int scale ); | 63 | void null_set_scaling( const xine_vo_driver_t* self, int scale ); |
64 | void null_set_gui_width( const xine_vo_driver_t* self, int width ); | 64 | void null_set_gui_width( const xine_vo_driver_t* self, int width ); |
65 | void null_set_gui_height( const xine_vo_driver_t* self, int height ); | 65 | void null_set_gui_height( const xine_vo_driver_t* self, int height ); |
66 | void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); | 66 | void null_set_mode( const xine_vo_driver_t* self, int depth, int rgb ); |
67 | void null_set_videoGamma( const xine_vo_driver_t* self , int value ); | 67 | void null_set_videoGamma( const xine_vo_driver_t* self , int value ); |
68 | void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); | 68 | void null_display_handler( const xine_vo_driver_t* self, display_xine_frame_t t, void* user_data ); |
69 | |||
70 | void null_preload_decoders( xine_stream_t *stream ); | ||
69 | } | 71 | } |
70 | 72 | ||
71 | using namespace XINE; | 73 | using namespace XINE; |
72 | 74 | ||
73 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) | 75 | Lib::Lib( InitializationMode initMode, XineVideoWidget* widget ) |
74 | { | 76 | { |
75 | m_initialized = false; | 77 | m_initialized = false; |
76 | m_duringInitialization = false; | 78 | m_duringInitialization = false; |
77 | m_video = false; | 79 | m_video = false; |
78 | m_wid = widget; | 80 | m_wid = widget; |
79 | printf("Lib"); | 81 | printf("Lib"); |
80 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; | 82 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; |
81 | // get the configuration | 83 | // get the configuration |
82 | 84 | ||
83 | // not really OO, should be an extra class, later | 85 | // not really OO, should be an extra class, later |
84 | if ( !QFile::exists(configPath) ) { | 86 | if ( !QFile::exists(configPath) ) { |
85 | QFile f(configPath); | 87 | QFile f(configPath); |
86 | f.open(IO_WriteOnly); | 88 | f.open(IO_WriteOnly); |
87 | QTextStream ts( &f ); | 89 | QTextStream ts( &f ); |
88 | ts << "misc.memcpy_method:glibc\n"; | 90 | ts << "misc.memcpy_method:glibc\n"; |
89 | f.close(); | 91 | f.close(); |
90 | } | 92 | } |
91 | 93 | ||
92 | if ( initMode == InitializeImmediately ) { | 94 | if ( initMode == InitializeImmediately ) { |
93 | initialize(); | 95 | initialize(); |
94 | m_initialized = true; | 96 | m_initialized = true; |
95 | } | 97 | } |
96 | else | 98 | else |
97 | start(); | 99 | start(); |
98 | } | 100 | } |
99 | 101 | ||
100 | void Lib::run() | 102 | void Lib::run() |
101 | { | 103 | { |
102 | qDebug( "Lib::run() started" ); | 104 | qDebug( "Lib::run() started" ); |
103 | initialize(); | 105 | initialize(); |
104 | m_initialized = true; | 106 | m_initialized = true; |
105 | qDebug( "Lib::run() finished" ); | 107 | qDebug( "Lib::run() finished" ); |
106 | } | 108 | } |
107 | 109 | ||
108 | void Lib::initialize() | 110 | void Lib::initialize() |
109 | { | 111 | { |
110 | m_duringInitialization = true; | 112 | m_duringInitialization = true; |
111 | m_xine = xine_new( ); | 113 | m_xine = xine_new( ); |
112 | 114 | ||
113 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; | 115 | QString configPath = QDir::homeDirPath() + "/Settings/opiexine.cf"; |
114 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); | 116 | xine_config_load( m_xine, QFile::encodeName( configPath ) ); |
115 | 117 | ||
116 | xine_init( m_xine ); | 118 | xine_init( m_xine ); |
117 | 119 | ||
118 | // allocate oss for sound | 120 | // allocate oss for sound |
119 | // and fb for framebuffer | 121 | // and fb for framebuffer |
120 | m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); | 122 | m_audioOutput = xine_open_audio_driver( m_xine, "oss", NULL ); |
121 | m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this ); | 123 | m_videoOutput = ::init_video_out_plugin( m_xine, NULL, xine_display_frame, this ); |
122 | 124 | ||
123 | 125 | ||
124 | //xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL); | 126 | //xine_open_video_driver( m_xine, NULL, XINE_VISUAL_TYPE_FB, NULL); |
125 | 127 | ||
126 | 128 | ||
127 | // null_display_handler( m_videoOutput, xine_display_frame, this ); | 129 | // null_display_handler( m_videoOutput, xine_display_frame, this ); |
128 | 130 | ||
129 | m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); | 131 | m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); |
130 | 132 | ||
131 | if (m_wid != 0 ) { | 133 | if (m_wid != 0 ) { |
132 | printf( "!0\n" ); | 134 | printf( "!0\n" ); |
133 | setWidget( m_wid ); | 135 | setWidget( m_wid ); |
134 | } | 136 | } |
135 | 137 | ||
136 | m_queue = xine_event_new_queue (m_stream); | 138 | m_queue = xine_event_new_queue (m_stream); |
137 | 139 | ||
138 | xine_event_create_listener_thread (m_queue, xine_event_handler, this); | 140 | xine_event_create_listener_thread (m_queue, xine_event_handler, this); |
141 | |||
142 | ::null_preload_decoders( m_stream ); | ||
143 | |||
139 | m_duringInitialization = false; | 144 | m_duringInitialization = false; |
140 | } | 145 | } |
141 | 146 | ||
142 | Lib::~Lib() { | 147 | Lib::~Lib() { |
143 | assert( isRunning() == false ); | 148 | assert( isRunning() == false ); |
144 | assert( m_initialized ); | 149 | assert( m_initialized ); |
145 | 150 | ||
146 | // free( m_config ); | 151 | // free( m_config ); |
147 | 152 | ||
148 | xine_close( m_stream ); | 153 | xine_close( m_stream ); |
149 | 154 | ||
150 | xine_event_dispose_queue( m_queue ); | 155 | xine_event_dispose_queue( m_queue ); |
151 | 156 | ||
152 | xine_dispose( m_stream ); | 157 | xine_dispose( m_stream ); |
153 | 158 | ||
154 | xine_exit( m_xine ); | 159 | xine_exit( m_xine ); |
155 | /* FIXME either free or delete but valgrind bitches against both */ | 160 | /* FIXME either free or delete but valgrind bitches against both */ |
156 | //free( m_videoOutput ); | 161 | //free( m_videoOutput ); |
157 | //delete m_audioOutput; | 162 | //delete m_audioOutput; |
158 | } | 163 | } |
159 | 164 | ||
160 | void Lib::resize ( const QSize &s ) { | 165 | void Lib::resize ( const QSize &s ) { |
161 | assert( m_initialized || m_duringInitialization ); | 166 | assert( m_initialized || m_duringInitialization ); |
162 | 167 | ||
163 | if ( s. width ( ) && s. height ( ) ) { | 168 | if ( s. width ( ) && s. height ( ) ) { |
164 | ::null_set_gui_width( m_videoOutput, s. width() ); | 169 | ::null_set_gui_width( m_videoOutput, s. width() ); |
165 | ::null_set_gui_height( m_videoOutput, s. height() ); | 170 | ::null_set_gui_height( m_videoOutput, s. height() ); |
166 | } | 171 | } |
167 | } | 172 | } |
168 | 173 | ||
169 | int Lib::majorVersion() { | 174 | int Lib::majorVersion() { |
170 | int major, minor, sub; | 175 | int major, minor, sub; |
171 | xine_get_version ( &major, &minor, &sub ); | 176 | xine_get_version ( &major, &minor, &sub ); |
172 | return major; | 177 | return major; |
173 | } | 178 | } |
174 | 179 | ||
175 | int Lib::minorVersion() { | 180 | int Lib::minorVersion() { |
176 | int major, minor, sub; | 181 | int major, minor, sub; |
177 | xine_get_version ( &major, &minor, &sub ); | 182 | xine_get_version ( &major, &minor, &sub ); |
178 | return minor; | 183 | return minor; |
179 | } | 184 | } |
180 | 185 | ||
181 | int Lib::subVersion() { | 186 | int Lib::subVersion() { |
182 | int major, minor, sub; | 187 | int major, minor, sub; |
183 | xine_get_version ( &major, &minor, &sub ); | 188 | xine_get_version ( &major, &minor, &sub ); |
184 | return sub; | 189 | return sub; |
185 | } | 190 | } |
186 | 191 | ||
diff --git a/noncore/multimedia/opieplayer2/nullvideo.c b/noncore/multimedia/opieplayer2/nullvideo.c index c988854..e2eb663 100644 --- a/noncore/multimedia/opieplayer2/nullvideo.c +++ b/noncore/multimedia/opieplayer2/nullvideo.c | |||
@@ -1,91 +1,92 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> | 4 | Copyright (c) 2002 Max Reiss <harlekin@handhelds.org> |
5 | Copyright (c) 2002 LJP <> | 5 | Copyright (c) 2002 LJP <> |
6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 6 | Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
7 | =. | 7 | =. |
8 | .=l. | 8 | .=l. |
9 | .>+-= | 9 | .>+-= |
10 | _;:, .> :=|. This program is free software; you can | 10 | _;:, .> :=|. This program is free software; you can |
11 | .> <`_, > . <= redistribute it and/or modify it under | 11 | .> <`_, > . <= redistribute it and/or modify it under |
12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 12 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
13 | .="- .-=="i, .._ License as published by the Free Software | 13 | .="- .-=="i, .._ License as published by the Free Software |
14 | - . .-<_> .<> Foundation; either version 2 of the License, | 14 | - . .-<_> .<> Foundation; either version 2 of the License, |
15 | ._= =} : or (at your option) any later version. | 15 | ._= =} : or (at your option) any later version. |
16 | .%`+i> _;_. | 16 | .%`+i> _;_. |
17 | .i_,=:_. -<s. This program is distributed in the hope that | 17 | .i_,=:_. -<s. This program is distributed in the hope that |
18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 18 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
19 | : .. .:, . . . without even the implied warranty of | 19 | : .. .:, . . . without even the implied warranty of |
20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 20 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 21 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
22 | ..}^=.= = ; Library General Public License for more | 22 | ..}^=.= = ; Library General Public License for more |
23 | ++= -. .` .: details. | 23 | ++= -. .` .: details. |
24 | : = ...= . :.=- | 24 | : = ...= . :.=- |
25 | -. .:....=;==+<; You should have received a copy of the GNU | 25 | -. .:....=;==+<; You should have received a copy of the GNU |
26 | -_. . . )=. = Library General Public License along with | 26 | -_. . . )=. = Library General Public License along with |
27 | -- :-=` this library; see the file COPYING.LIB. | 27 | -- :-=` this library; see the file COPYING.LIB. |
28 | If not, write to the Free Software Foundation, | 28 | If not, write to the Free Software Foundation, |
29 | Inc., 59 Temple Place - Suite 330, | 29 | Inc., 59 Temple Place - Suite 330, |
30 | Boston, MA 02111-1307, USA. | 30 | Boston, MA 02111-1307, USA. |
31 | 31 | ||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
35 | #include <stdio.h> | 35 | #include <stdio.h> |
36 | 36 | ||
37 | #include <math.h> | 37 | #include <math.h> |
38 | 38 | ||
39 | #include <xine.h> | 39 | #include <xine.h> |
40 | #include <xine/video_out.h> | 40 | #include <xine/video_out.h> |
41 | #include <xine/xine_internal.h> | 41 | #include <xine/xine_internal.h> |
42 | #include <xine/xineutils.h> | 42 | #include <xine/xineutils.h> |
43 | #include <xine/vo_scale.h> | 43 | #include <xine/vo_scale.h> |
44 | #include <xine/buffer.h> | ||
44 | 45 | ||
45 | #include <pthread.h> | 46 | #include <pthread.h> |
46 | #include "alphablend.h" | 47 | #include "alphablend.h" |
47 | #include "yuv2rgb.h" | 48 | #include "yuv2rgb.h" |
48 | 49 | ||
49 | #define printf(x,...) | 50 | #define printf(x,...) |
50 | 51 | ||
51 | /* | 52 | /* |
52 | #define LOG | 53 | #define LOG |
53 | */ | 54 | */ |
54 | 55 | ||
55 | /* the caller for our event draw handler */ | 56 | /* the caller for our event draw handler */ |
56 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, | 57 | typedef void (*display_xine_frame_t) (void *user_data, uint8_t* frame, |
57 | int width, int height,int bytes ); | 58 | int width, int height,int bytes ); |
58 | 59 | ||
59 | typedef struct null_driver_s null_driver_t; | 60 | typedef struct null_driver_s null_driver_t; |
60 | 61 | ||
61 | struct null_driver_s { | 62 | struct null_driver_s { |
62 | vo_driver_t vo_driver; | 63 | vo_driver_t vo_driver; |
63 | 64 | ||
64 | uint32_t m_capabilities; | 65 | uint32_t m_capabilities; |
65 | int m_show_video; | 66 | int m_show_video; |
66 | int m_video_fullscreen; | 67 | int m_video_fullscreen; |
67 | int m_is_scaling; | 68 | int m_is_scaling; |
68 | 69 | ||
69 | int depth, bpp, bytes_per_pixel; | 70 | int depth, bpp, bytes_per_pixel; |
70 | int yuv2rgb_mode; | 71 | int yuv2rgb_mode; |
71 | int yuv2rgb_swap; | 72 | int yuv2rgb_swap; |
72 | int yuv2rgb_gamma; | 73 | int yuv2rgb_gamma; |
73 | uint8_t *yuv2rgb_cmap; | 74 | uint8_t *yuv2rgb_cmap; |
74 | yuv2rgb_factory_t *yuv2rgb_factory; | 75 | yuv2rgb_factory_t *yuv2rgb_factory; |
75 | 76 | ||
76 | vo_overlay_t *overlay; | 77 | vo_overlay_t *overlay; |
77 | vo_scale_t sc; | 78 | vo_scale_t sc; |
78 | 79 | ||
79 | int gui_width; | 80 | int gui_width; |
80 | int gui_height; | 81 | int gui_height; |
81 | int gui_changed; | 82 | int gui_changed; |
82 | 83 | ||
83 | double display_ratio; | 84 | double display_ratio; |
84 | void* caller; | 85 | void* caller; |
85 | display_xine_frame_t frameDis; | 86 | display_xine_frame_t frameDis; |
86 | }; | 87 | }; |
87 | 88 | ||
88 | typedef struct opie_frame_s opie_frame_t; | 89 | typedef struct opie_frame_s opie_frame_t; |
89 | struct opie_frame_s { | 90 | struct opie_frame_s { |
90 | vo_frame_t frame; | 91 | vo_frame_t frame; |
91 | 92 | ||
@@ -567,48 +568,68 @@ void null_set_mode( xine_vo_driver_t* self, int depth, int rgb ) { | |||
567 | case 24: | 568 | case 24: |
568 | if( this->bpp == 32 ) { | 569 | if( this->bpp == 32 ) { |
569 | if( rgb == 0 ) { | 570 | if( rgb == 0 ) { |
570 | this->yuv2rgb_mode = MODE_32_RGB; | 571 | this->yuv2rgb_mode = MODE_32_RGB; |
571 | } else { | 572 | } else { |
572 | this->yuv2rgb_mode = MODE_32_BGR; | 573 | this->yuv2rgb_mode = MODE_32_BGR; |
573 | } | 574 | } |
574 | }else{ | 575 | }else{ |
575 | if( rgb == 0 ) | 576 | if( rgb == 0 ) |
576 | this->yuv2rgb_mode = MODE_24_RGB; | 577 | this->yuv2rgb_mode = MODE_24_RGB; |
577 | else | 578 | else |
578 | this->yuv2rgb_mode = MODE_24_BGR; | 579 | this->yuv2rgb_mode = MODE_24_BGR; |
579 | }; | 580 | }; |
580 | break; | 581 | break; |
581 | case 16: | 582 | case 16: |
582 | if( rgb == 0 ) { | 583 | if( rgb == 0 ) { |
583 | this->yuv2rgb_mode = MODE_16_RGB; | 584 | this->yuv2rgb_mode = MODE_16_RGB; |
584 | } else { | 585 | } else { |
585 | this->yuv2rgb_mode = MODE_16_BGR; | 586 | this->yuv2rgb_mode = MODE_16_BGR; |
586 | } | 587 | } |
587 | break; | 588 | break; |
588 | case 15: | 589 | case 15: |
589 | if( rgb == 0 ) { | 590 | if( rgb == 0 ) { |
590 | this->yuv2rgb_mode = MODE_15_RGB; | 591 | this->yuv2rgb_mode = MODE_15_RGB; |
591 | } else { | 592 | } else { |
592 | this->yuv2rgb_mode = MODE_15_BGR; | 593 | this->yuv2rgb_mode = MODE_15_BGR; |
593 | } | 594 | } |
594 | break; | 595 | break; |
595 | case 8: | 596 | case 8: |
596 | if( rgb == 0 ) { | 597 | if( rgb == 0 ) { |
597 | this->yuv2rgb_mode = MODE_8_RGB; | 598 | this->yuv2rgb_mode = MODE_8_RGB; |
598 | } else { | 599 | } else { |
599 | this->yuv2rgb_mode = MODE_8_BGR; | 600 | this->yuv2rgb_mode = MODE_8_BGR; |
600 | } | 601 | } |
601 | break; | 602 | break; |
602 | }; | 603 | }; |
603 | //free(this->yuv2rgb_factory ); | 604 | //free(this->yuv2rgb_factory ); |
604 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, | 605 | // this->yuv2rgb_factory = yuv2rgb_factory_init (this->yuv2rgb_mode, this->yuv2rgb_swap, |
605 | // this->yuv2rgb_cmap); | 606 | // this->yuv2rgb_cmap); |
606 | }; | 607 | }; |
607 | 608 | ||
608 | void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, | 609 | void null_display_handler( xine_vo_driver_t* self, display_xine_frame_t t, |
609 | void* user_data ) { | 610 | void* user_data ) { |
610 | null_driver_t* this = (null_driver_t*) self->driver; | 611 | null_driver_t* this = (null_driver_t*) self->driver; |
611 | this->caller = user_data; | 612 | this->caller = user_data; |
612 | this->frameDis = t; | 613 | this->frameDis = t; |
613 | } | 614 | } |
614 | 615 | ||
616 | void null_preload_decoders( xine_stream_t *stream ) | ||
617 | { | ||
618 | static const uint32_t preloadedAudioDecoders[] = { BUF_AUDIO_MPEG, BUF_AUDIO_VORBIS }; | ||
619 | static const uint8_t preloadedAudioDecoderCount = sizeof( preloadedAudioDecoders ) / sizeof( preloadedAudioDecoders[ 0 ] ); | ||
620 | static const uint32_t preloadedVideoDecoders[] = { BUF_VIDEO_MPEG, BUF_VIDEO_MPEG4, BUF_VIDEO_DIVX5 }; | ||
621 | static const uint8_t preloadedVideoDecoderCount = sizeof( preloadedVideoDecoders ) / sizeof( preloadedVideoDecoders[ 0 ] ); | ||
622 | |||
623 | uint8_t i; | ||
624 | |||
625 | for ( i = 0; i < preloadedAudioDecoderCount; ++i ) { | ||
626 | audio_decoder_t *decoder = get_audio_decoder( stream, ( preloadedAudioDecoders[ i ] >> 16 ) & 0xff ); | ||
627 | free_audio_decoder( stream, decoder ); | ||
628 | } | ||
629 | |||
630 | for ( i = 0; i < preloadedVideoDecoderCount; ++i ) { | ||
631 | video_decoder_t *decoder = get_video_decoder( stream, ( preloadedVideoDecoders[ i ] >> 16 ) & 0xff ); | ||
632 | free_video_decoder( stream, decoder ); | ||
633 | } | ||
634 | } | ||
635 | |||