| | 40 | bool isUrl( osgDB::containsServerAddress(afilename) ); |
| | 41 | |
| | 42 | std::string filename = afilename; |
| | 43 | if (!isUrl) { |
| | 44 | if (!osgDB::isFileNameNativeStyle(filename)) |
| | 45 | filename = osgDB::convertFileNameToNativeStyle(filename); |
| | 46 | } |
| | 47 | |
| | 48 | image->setFileName(filename); |
| | 49 | |
| | 50 | |
| | 51 | QTNewMoviePropertyElement newMovieProperties[2]; |
| | 52 | CFStringRef movieLocation = CFStringCreateWithCString(NULL, filename.c_str(), kCFStringEncodingUTF8); |
| | 53 | CFURLRef movieURL(NULL); |
| | 54 | Boolean trueValue = true; |
| | 55 | |
| | 56 | newMovieProperties[0].propClass = kQTPropertyClass_DataLocation; |
| | 57 | if (!isUrl) |
| | 58 | { |
| | 59 | #ifdef __APPLE__ |
| | 60 | newMovieProperties[0].propID = kQTDataLocationPropertyID_CFStringPosixPath; |
| | 61 | #else |
| | 62 | newMovieProperties[0].propID = kQTDataLocationPropertyID_CFStringWindowsPath; |
| | 63 | #endif |
| | 64 | |
| | 65 | newMovieProperties[0].propValueSize = sizeof(CFStringRef); |
| | 66 | newMovieProperties[0].propValueAddress = &movieLocation; |
| | 67 | } |
| | 68 | else |
| | 69 | { |
| | 70 | movieURL = CFURLCreateWithString(kCFAllocatorDefault, movieLocation, NULL); |
| | 71 | |
| | 72 | newMovieProperties[0].propID = kQTDataLocationPropertyID_CFURL; |
| | 73 | newMovieProperties[0].propValueSize = sizeof(movieURL); |
| | 74 | newMovieProperties[0].propValueAddress = (void*)&movieURL; |
| | 75 | } |
| | 76 | |
| | 77 | // make movie active |
| | 78 | newMovieProperties[1].propClass = kQTPropertyClass_NewMovieProperty; |
| | 79 | newMovieProperties[1].propID = kQTNewMoviePropertyID_Active; |
| | 80 | newMovieProperties[1].propValueSize = sizeof(trueValue); |
| | 81 | newMovieProperties[1].propValueAddress = &trueValue; |
| | 82 | |
| | 83 | // Instantiate the Movie |
| | 84 | OSStatus status = NewMovieFromProperties(2, newMovieProperties, 0, NULL, &_movie); |
| | 85 | CFRelease(movieLocation); |
| | 86 | if (movieURL) CFRelease(movieURL); |
| | 87 | |
| | 88 | if (status !=0) { |
| | 89 | _fError = true; |
| | 90 | osg::notify(osg::FATAL) << " MovieData :: NewMovieFromProperties failed with err " << status<< std::endl; |
| | 91 | return; |
| | 92 | } |
| | 93 | |
| | 94 | |