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:
@@ -64,6 +64,8 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
||||
|
||||
/** Return true if ReaderWriter accepts specified file extension.*/
|
||||
virtual bool acceptsExtension(const std::string& /*extension*/) const;
|
||||
|
||||
virtual bool acceptsProtocol(const std::string& protocol) const;
|
||||
|
||||
/// Bit mask for setting up which feature types are available for read and/or write
|
||||
enum Features
|
||||
|
||||
@@ -128,6 +128,11 @@ class OSGDB_EXPORT Registry : public osg::Referenced
|
||||
|
||||
/** get const list of all registered ReaderWriters.*/
|
||||
const ReaderWriterList& getReaderWriterList() const { return _rwList; }
|
||||
|
||||
/** get a list of registered ReaderWriters which can handle given protocol */
|
||||
void getReaderWriterListForProtocol(const std::string& protocol, ReaderWriterList& results) const;
|
||||
|
||||
ReaderWriter* getReaderWriterForProtocolAndExtension(const std::string& protocol, const std::string& extension);
|
||||
|
||||
|
||||
typedef std::vector< osg::ref_ptr<ImageProcessor> > ImageProcessorList;
|
||||
|
||||
Reference in New Issue
Block a user