| | 138 | // if the file is a ".live" video encoded string then load as an ImageStream |
| | 139 | if (acceptsLiveExtension(ext)) |
| | 140 | { |
| | 141 | long num_video_components; |
| | 142 | { |
| | 143 | // Begin QuickTime |
| | 144 | QTScopedQTMLInitialiser qt_init; |
| | 145 | QTScopedMovieInitialiser qt_movie_init; |
| | 146 | // |
| | 147 | ComponentDescription video_component_description; |
| | 148 | video_component_description.componentType = 'vdig'; /* A unique 4-byte code indentifying the command set */ |
| | 149 | video_component_description.componentSubType = 0L; /* Particular flavor of this instance */ |
| | 150 | video_component_description.componentManufacturer = 0L; /* Vendor indentification */ |
| | 151 | video_component_description.componentFlags = 0L; /* 8 each for Component,Type,SubType,Manuf/revision */ |
| | 152 | video_component_description.componentFlagsMask = 0L; /* Mask for specifying which flags to consider in search, zero during registration */ |
| | 153 | num_video_components = CountComponents (&video_component_description); |
| | 154 | } |
| | 155 | if (osgDB::getNameLessExtension(file) == "devices") |
| | 156 | { |
| | 157 | osg::notify(osg::ALWAYS) << " available Video DigitizerComponents : " << num_video_components << std::endl; |
| | 158 | if (num_video_components) |
| | 159 | { |
| | 160 | // Probe Video Dig |
| | 161 | probe_video_digitizer_components(); |
| | 162 | // Probe SG |
| | 163 | std::vector<OSG_SGDeviceList> devices_list = probe_sequence_grabber_components(); |
| | 164 | if (devices_list.size()) |
| | 165 | { |
| | 166 | // Video |
| | 167 | OSG_SGDeviceList& video_device_list = devices_list[0]; |
| | 168 | // Print |
| | 169 | osg::notify(osg::ALWAYS) << std::endl; |
| | 170 | osg::notify(osg::ALWAYS) << "Video Component/Input IDs follow: " << std::endl; |
| | 171 | osg::notify(osg::ALWAYS) << std::endl; |
| | 172 | for (int device_input = 0; device_input < video_device_list.size(); ++device_input) |
| | 173 | { |
| | 174 | OSG_SGDevicePair device_pair = video_device_list[device_input]; |
| | 175 | osg::notify(osg::ALWAYS) << device_pair.first.c_str() << " " << device_pair.second.c_str() << std::endl; |
| | 176 | } |
| | 177 | } |
| | 178 | if (devices_list.size() > 1) |
| | 179 | { |
| | 180 | // Audio |
| | 181 | OSG_SGDeviceList& audio_device_list = devices_list[1]; |
| | 182 | // Print |
| | 183 | osg::notify(osg::ALWAYS) << std::endl; |
| | 184 | osg::notify(osg::ALWAYS) << "Audio Component/Input IDs follow: " << std::endl; |
| | 185 | osg::notify(osg::ALWAYS) << std::endl; |
| | 186 | for (int device_input = 0; device_input < audio_device_list.size(); ++device_input) |
| | 187 | { |
| | 188 | OSG_SGDevicePair device_pair = audio_device_list[device_input]; |
| | 189 | osg::notify(osg::ALWAYS) << device_pair.first.c_str() << " " << device_pair.second.c_str() << std::endl; |
| | 190 | } |
| | 191 | } |
| | 192 | } |
| | 193 | return ReadResult::FILE_NOT_HANDLED; |
| | 194 | } |
| | 195 | else |
| | 196 | { |
| | 197 | osg::notify(osg::DEBUG_INFO) << " available Video DigitizerComponents : " << num_video_components << std::endl; |
| | 198 | if (num_video_components) |
| | 199 | { |
| | 200 | // Note from Riccardo Corsi |
| | 201 | // Quicktime initialization is done here, when a media is found |
| | 202 | // and before any image or movie is loaded. |
| | 203 | // After the first call the function does nothing. |
| | 204 | // The cleaning up is left to the QuicktimeExitObserver (see below) |
| | 205 | initQuicktime(); |
| | 206 | // |
| | 207 | QuicktimeLiveImageStream* p_qt_image_stream = new QuicktimeLiveImageStream(osgDB::getNameLessExtension(file)); |
| | 208 | // add the media to the observer for proper clean up on exit |
| | 209 | _qtExitObserver.addMedia(p_qt_image_stream); |
| | 210 | return p_qt_image_stream; |
| | 211 | } |
| | 212 | else |
| | 213 | { |
| | 214 | osg::notify(osg::DEBUG_INFO) << "No available Video DigitizerComponents : " << std::endl; |
| | 215 | return ReadResult::FILE_NOT_HANDLED; |
| | 216 | } |
| | 217 | } |
| | 218 | } |
| | 219 | |
| | 220 | // Not an encoded "live" psuedo file - so check a real file exists |