From Stephan Huber, "attached you'll find a zip containing some bug-fixes and some refactored + new code.
* ZeroConfDevice does now return FILE_NOT_HANDLED instead of FILE_NOT_FOUND * present3D supports multiple devices per env-var P3D_DEVICE, separate multiple device with a space I refactored parts the p3d-plugin, the curl-plugin and parts of Registry and ReaderWriter. Currently the p3d-plugin tries to open all remote files with the help of the curl-plugin. I added a new method to Registry called getReaderWriterForProtocolAndExtension. which will return a ReaderWriter which is capable in handling the remote file for the given protocol and extension. If no readerwriter is found for the given extension, a list is built of all readerwriters supporting the given protocol and this list is checked for support of wildcards (extension = "*"). If anything matches it get returned. I added this principle also to the Registry, so now it's possible to register a generic ReaderWriter which can handle all filetypes for a given protocol, similar what curl is doing. All you have to do is to load the plugin at startup. The curl-fallback is still in place. With these changes it is now possible to reference a movie inside a presentation without a server-address, read the presentation (with curl) and stream the movie with the correct plugin (e.g. QTKit) "
This commit is contained in:
@@ -2142,7 +2142,12 @@ class MyReadFileCallback : public virtual osgDB::ReadFileCallback
|
||||
OSG_INFO<<"Trying server file "<<filename<<std::endl;
|
||||
|
||||
osgDB::ReaderWriter::ReadResult result;
|
||||
osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension("curl");
|
||||
|
||||
// get a specific readerwriter capable of handling the protocol and extension, will return a registered fallback readerwriter for extension '*'
|
||||
osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForProtocolAndExtension(
|
||||
osgDB::getServerProtocol(filename),
|
||||
osgDB::getFileExtension(filename));
|
||||
|
||||
if (!rw) return osgDB::ReaderWriter::ReadResult::FILE_NOT_HANDLED;
|
||||
|
||||
switch(type)
|
||||
|
||||
Reference in New Issue
Block a user