From Riccardo Corsi, "this should be the final version of the qt-plugin ported to windows and cleaned up to avoid crashes on exit.

Stephan and I tested it on Mac and Win.
Just a couple of notes:

    * the plugin is able to load both regular 2D images and movie stream. There is a #define QT_HANDLE_IMAGES_ALSO mechanism to indicate whether to use it for images or not. This is defined by default on Mac only, to avoid conflicts with the standard windows plugins. See comments on QTUtils.h

    * de-initialization of quicktime before exit is now left to an observer, which calls exitQuicktime() when last media loaded with the plugin is released. This prevent a crash on exit without need of any extra call external to the plugin."
This commit is contained in:
Robert Osfield
2007-01-12 22:07:33 +00:00
parent b992451586
commit 35ec6cee40
5 changed files with 105 additions and 61 deletions

View File

@@ -27,7 +27,7 @@ using namespace std;
#endif
OSErr err = EnterMovies();
if (err!=0)
osg::notify(osg::FATAL) << "Error while initializing quicktime: " << err << endl;
osg::notify(osg::FATAL) << "Error while initializing quicktime: " << err << endl;
else
osg::notify(osg::DEBUG_INFO) << "Quicktime initialized successfully" << endl;
registerQTReader();
@@ -45,6 +45,9 @@ using namespace std;
protected:
void registerQTReader() {
osgDB::Registry* r = osgDB::Registry::instance();
r->addFileExtensionAlias("mov", "qt");
#ifdef QT_HANDLE_IMAGES_ALSO
r->addFileExtensionAlias("jpg", "qt");
r->addFileExtensionAlias("jpe", "qt");
r->addFileExtensionAlias("jpeg", "qt");
@@ -59,8 +62,9 @@ using namespace std;
r->addFileExtensionAlias("mpg", "qt");
r->addFileExtensionAlias("mpv", "qt");
r->addFileExtensionAlias("dv", "qt");
r->addFileExtensionAlias("mp4", "qt");
r->addFileExtensionAlias("m4v", "qt");
r->addFileExtensionAlias("mp4", "qt");
r->addFileExtensionAlias("m4v", "qt");
#endif
}
};