summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/mediaplayerstate.cpp
Unidiff
Diffstat (limited to 'core/multimedia/opieplayer/mediaplayerstate.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/mediaplayerstate.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/mediaplayerstate.cpp b/core/multimedia/opieplayer/mediaplayerstate.cpp
index b700cd1..8b0fbbc 100644
--- a/core/multimedia/opieplayer/mediaplayerstate.cpp
+++ b/core/multimedia/opieplayer/mediaplayerstate.cpp
@@ -94,97 +94,97 @@ struct MediaPlayerPlugin {
94 94
95static QValueList<MediaPlayerPlugin> pluginList; 95static QValueList<MediaPlayerPlugin> pluginList;
96 96
97 97
98// Find the first decoder which supports this type of file 98// Find the first decoder which supports this type of file
99MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) { 99MediaPlayerDecoder *MediaPlayerState::newDecoder( const QString& file ) {
100 MediaPlayerDecoder *tmpDecoder = NULL; 100 MediaPlayerDecoder *tmpDecoder = NULL;
101 QValueList<MediaPlayerPlugin>::Iterator it; 101 QValueList<MediaPlayerPlugin>::Iterator it;
102 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) { 102 for ( it = pluginList.begin(); it != pluginList.end(); ++it ) {
103 if ( (*it).decoder->isFileSupported( file ) ) { 103 if ( (*it).decoder->isFileSupported( file ) ) {
104 tmpDecoder = (*it).decoder; 104 tmpDecoder = (*it).decoder;
105 break; 105 break;
106 } 106 }
107 } 107 }
108 if(file.left(4)=="http") 108 if(file.left(4)=="http")
109 isStreaming = TRUE; 109 isStreaming = TRUE;
110 else 110 else
111 isStreaming = FALSE; 111 isStreaming = FALSE;
112 return decoder = tmpDecoder; 112 return decoder = tmpDecoder;
113} 113}
114 114
115 115
116MediaPlayerDecoder *MediaPlayerState::curDecoder() { 116MediaPlayerDecoder *MediaPlayerState::curDecoder() {
117 return decoder; 117 return decoder;
118} 118}
119 119
120 120
121// ### hack to get true sample count 121// ### hack to get true sample count
122MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() { 122MediaPlayerDecoder *MediaPlayerState::libMpeg3Decoder() {
123 return libmpeg3decoder; 123 return libmpeg3decoder;
124} 124}
125 125
126// ### hack to get true sample count 126// ### hack to get true sample count
127// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() { 127// MediaPlayerDecoder *MediaPlayerState::libWavDecoder() {
128// return libwavdecoder; 128// return libwavdecoder;
129// } 129// }
130 130
131void MediaPlayerState::loadPlugins() { 131void MediaPlayerState::loadPlugins() {
132 // odebug << "load plugins" << oendl; 132 // odebug << "load plugins" << oendl;
133#ifndef QT_NO_COMPONENT 133#ifndef QT_NO_COMPONENT
134 QValueList<MediaPlayerPlugin>::Iterator mit; 134 QValueList<MediaPlayerPlugin>::Iterator mit;
135 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) { 135 for ( mit = pluginList.begin(); mit != pluginList.end(); ++mit ) {
136 (*mit).iface->release(); 136 (*mit).iface->release();
137 (*mit).library->unload(); 137 (*mit).library->unload();
138 delete (*mit).library; 138 delete (*mit).library;
139 } 139 }
140 pluginList.clear(); 140 pluginList.clear();
141 141
142 QString path = QPEApplication::qpeDir() + "/plugins/codecs"; 142 QString path = QPEApplication::qpeDir() + "plugins/codecs";
143 QDir dir( path, "lib*.so" ); 143 QDir dir( path, "lib*.so" );
144 QStringList list = dir.entryList(); 144 QStringList list = dir.entryList();
145 QStringList::Iterator it; 145 QStringList::Iterator it;
146 for ( it = list.begin(); it != list.end(); ++it ) { 146 for ( it = list.begin(); it != list.end(); ++it ) {
147 MediaPlayerPluginInterface *iface = 0; 147 MediaPlayerPluginInterface *iface = 0;
148 QLibrary *lib = new QLibrary( path + "/" + *it ); 148 QLibrary *lib = new QLibrary( path + "/" + *it );
149// odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl; 149// odebug << "querying: " << QString( path + "/" + *it ) << "" << oendl;
150 150
151 if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) { 151 if ( lib->queryInterface( IID_MediaPlayerPlugin, (QUnknownInterface**)&iface ) == QS_OK ) {
152 152
153// odebug << "loading: " << QString( path + "/" + *it ) << "" << oendl; 153// odebug << "loading: " << QString( path + "/" + *it ) << "" << oendl;
154 154
155 MediaPlayerPlugin plugin; 155 MediaPlayerPlugin plugin;
156 plugin.library = lib; 156 plugin.library = lib;
157 plugin.iface = iface; 157 plugin.iface = iface;
158 plugin.decoder = plugin.iface->decoder(); 158 plugin.decoder = plugin.iface->decoder();
159 plugin.encoder = plugin.iface->encoder(); 159 plugin.encoder = plugin.iface->encoder();
160 pluginList.append( plugin ); 160 pluginList.append( plugin );
161 161
162 // ### hack to get true sample count 162 // ### hack to get true sample count
163 if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") ) 163 if ( plugin.decoder->pluginName() == QString("LibMpeg3Plugin") )
164 libmpeg3decoder = plugin.decoder; 164 libmpeg3decoder = plugin.decoder;
165 165
166 } else { 166 } else {
167 delete lib; 167 delete lib;
168 } 168 }
169 } 169 }
170#else 170#else
171 pluginList.clear(); 171 pluginList.clear();
172 172
173 MediaPlayerPlugin plugin0; 173 MediaPlayerPlugin plugin0;
174 plugin0.iface = new LibMpeg3PluginImpl; 174 plugin0.iface = new LibMpeg3PluginImpl;
175 plugin0.decoder = plugin0.iface->decoder(); 175 plugin0.decoder = plugin0.iface->decoder();
176 plugin0.encoder = plugin0.iface->encoder(); 176 plugin0.encoder = plugin0.iface->encoder();
177 pluginList.append( plugin0 ); 177 pluginList.append( plugin0 );
178 178
179 MediaPlayerPlugin plugin1; 179 MediaPlayerPlugin plugin1;
180 plugin1.iface = new LibMadPluginImpl; 180 plugin1.iface = new LibMadPluginImpl;
181 plugin1.decoder = plugin1.iface->decoder(); 181 plugin1.decoder = plugin1.iface->decoder();
182 plugin1.encoder = plugin1.iface->encoder(); 182 plugin1.encoder = plugin1.iface->encoder();
183 pluginList.append( plugin1 ); 183 pluginList.append( plugin1 );
184 184
185 MediaPlayerPlugin plugin2; 185 MediaPlayerPlugin plugin2;
186 plugin2.iface = new WavPluginImpl; 186 plugin2.iface = new WavPluginImpl;
187 plugin2.decoder = plugin2.iface->decoder(); 187 plugin2.decoder = plugin2.iface->decoder();
188 plugin2.encoder = plugin2.iface->encoder(); 188 plugin2.encoder = plugin2.iface->encoder();
189 pluginList.append( plugin2 ); 189 pluginList.append( plugin2 );
190#endif 190#endif