MCPcopy Create free account
hub / github.com/cinder/Cinder / initFromDataSource

Method initFromDataSource

src/cinder/qtime/QuickTimeImplLegacy.cpp:157–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void MovieBase::initFromDataSource( DataSourceRef dataSourceRef, const std::string &mimeTypeHint )
158{
159 startQuickTime();
160 if( dataSourceRef->isFilePath() ) { // try to use quicktime's native file handling if possible
161 getObj()->mMovie = openMovieFromPath( dataSourceRef->getFilePath() );
162 // no need to retain the data source
163 }
164 else if( dataSourceRef->isUrl() ) { // try to use quicktime's native Url handling if possible
165 // Create a loader for this Url and then wait on it
166 MovieLoader loader( dataSourceRef->getUrl() );
167 loader.waitForLoaded();
168 getObj()->mMovie = loader.transferMovieHandle();
169 // no need to retain the data source
170 }
171 else { // we'll need to load from memory; and we'll rer to the data source to make sure it doesn't go away before the movie does
172 BufferRef buffer( dataSourceRef->getBuffer() );
173 getObj()->mMovie = openMovieFromMemory( buffer->getData(), buffer->getSize(), dataSourceRef->getFilePathHint().string(), mimeTypeHint );
174 getObj()->mDataSource = dataSourceRef; // retain a reference to the dataSource so that it doesn't go away before we do
175 }
176 init();
177}
178
179void MovieBase::init()
180{

Callers

nothing calls this directly

Calls 11

startQuickTimeFunction · 0.85
openMovieFromPathFunction · 0.85
openMovieFromMemoryFunction · 0.85
isFilePathMethod · 0.80
isUrlMethod · 0.80
waitForLoadedMethod · 0.80
getBufferMethod · 0.80
transferMovieHandleMethod · 0.45
getDataMethod · 0.45
getSizeMethod · 0.45
stringMethod · 0.45

Tested by

no test coverage detected