Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QuickTime.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, The Barbarian Group
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
6  the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and
9  the following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
11  the following disclaimer in the documentation and/or other materials provided with the distribution.
12 
13  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
14  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
15  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
16  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
17  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20  POSSIBILITY OF SUCH DAMAGE.
21 */
22 
23 #pragma once
24 
25 // None of this works in 64 bit on the mac or Windows. We'll need to move to QTKit on the mac.
26 #if ! defined( __LP64__ )
27 
28 #include "cinder/Cinder.h"
29 #include "cinder/gl/gl.h"
30 #include "cinder/Surface.h"
31 #include "cinder/gl/Texture.h"
32 #include "cinder/Display.h"
33 #include "cinder/Url.h"
34 #include "cinder/DataSource.h"
35 #include "cinder/Thread.h"
36 
37 #include <string>
38 
39 #if defined( CINDER_MAC )
40  #include <QuickTime/QuickTime.h>
41  #if defined( __OBJC__ )
42  @class QTMovie;
43  #else
44  class QTMovie;
45  #endif
46 #endif
47 
48 
49 // these are forward-declared to avoid bringing all of QuickTime into the global namespace on Windows
50 #if defined( CINDER_MSW )
51  typedef struct MovieType** Movie;
52  typedef struct OpaqueQTVisualContext* QTVisualContextRef;
53  typedef long TimeValue;
54  typedef struct QTAudioFrequencyLevels QTAudioFrequencyLevels;
55  typedef unsigned long FourCharCode;
56  typedef struct __CVBuffer* CVBufferRef;
57  typedef CVBufferRef CVImageBufferRef;
58 #endif
59 
60 namespace cinder { namespace qtime {
61 
63 typedef std::shared_ptr<MovieLoader> MovieLoaderRef;
64 
65 class MovieBase {
66  public:
67  virtual ~MovieBase() {}
68 
70  bool checkPlayable();
71 
73  int32_t getWidth() const { return getObj()->mWidth; }
75  int32_t getHeight() const { return getObj()->mHeight; }
77  Vec2i getSize() const { return Vec2i( getWidth(), getHeight() ); }
79  float getAspectRatio() const { return getObj()->mWidth / (float)getObj()->mHeight; }
81  Area getBounds() const { return Area( 0, 0, getWidth(), getHeight() ); }
83  float getPixelAspectRatio() const;
85  float getDuration() const { return getObj()->mDuration; }
87  float getFramerate() const;
89  int32_t getNumFrames() const;
91  bool hasAlpha() const;
92 
94  bool hasVisuals() const;
96  bool hasAudio() const;
97 
99  bool checkNewFrame();
100 
102  float getCurrentTime() const;
104  void seekToTime( float seconds );
106  void seekToFrame( int frame );
108  void seekToStart();
110  void seekToEnd();
112  void setActiveSegment( float startTime, float duration );
114  void resetActiveSegment();
115 
117  void setLoop( bool loop = true, bool palindrome = false );
119  void stepForward();
121  void stepBackward();
123  void setRate( float rate );
124 
126  void setVolume( float volume );
128  float getVolume() const;
129 
131  void setupMonoFft( uint32_t numBands );
133  void setupStereoFft( uint32_t numBands );
135  void setupMultiChannelFft( uint32_t numBands );
136 
137  float* getFftData() const;
138  uint32_t getNumFftBands() const;
139  uint32_t getNumFftChannels() const;
140 
142  bool isPlaying() const;
144  bool isDone() const;
146  void play();
148  void stop();
149 
151  void setNewFrameCallback( void(*aNewFrameCallback)( long, void * ), void *aNewFrameCallbackRefcon );
152 
154  ::Movie getMovieHandle() const { return getObj()->mMovie; }
155 
156  protected:
158  void init();
159  void updateFrame();
160  void updateLoadState();
161 
162  void setupFft( FourCharCode code, uint32_t bandNum, uint8_t channelNum );
163 
164  static int32_t countFrames( ::Movie theMovie );
165  TimeValue getStartTimeOfFirstSample() const;
166 
167  protected:
168  void initFromPath( const fs::path &filePath );
169  void initFromLoader( const class MovieLoader &loader );
170  void initFromMemory( const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint );
171  void initFromDataSource( DataSourceRef dataSource, const std::string &mimeTypeHint );
172 
173  struct Obj {
174  Obj();
175  virtual ~Obj();
176 
177  void prepareForDestruction();
178 
179  void lock() { mMutex.lock(); }
180  void unlock() { mMutex.unlock(); }
181 
182  // because the MovieBase* might change over time, but the MovieBase::Obj* will not, we need our callbacks to take an Obj* as a refcon
183  // which in turn means this functionality must be in the Obj, not the MovieBase
184  virtual void releaseFrame() = 0;
185  virtual void newFrame( CVImageBufferRef cvImage ) = 0;
186 
187  int32_t mWidth, mHeight;
188  int32_t mFrameCount;
189  float mDuration;
192 
193  QTAudioFrequencyLevels *mFFTData;
194  FourCharCode mFFTFourCharCode;
196  uint32_t mFFTNumChannels;
197  QTVisualContextRef mVisualContext;
198  ::Movie mMovie;
199 
200  void (*mNewFrameCallback)(long timeValue, void *refcon);
202 
203  std::mutex mMutex;
204  DataSourceRef mDataSource; // sometimes used to retain a reference to a data source so that it doesn't go away before we do
205  };
206 
207  virtual Obj* getObj() const = 0;
208 };
209 
211 typedef std::shared_ptr<MovieSurface> MovieSurfaceRef;
212 
213 class MovieSurface : public MovieBase {
214  public:
216  MovieSurface( const fs::path &path );
217  MovieSurface( const class MovieLoader &loader );
219 
220  MovieSurface( const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint = "" );
221  MovieSurface( DataSourceRef dataSource, const std::string mimeTypeHint = "" );
222 
223  static MovieSurfaceRef create( const fs::path &path ) { return std::shared_ptr<MovieSurface>( new MovieSurface( path ) ); }
224  static MovieSurfaceRef create( const MovieLoaderRef &loader );
225  static MovieSurfaceRef create( const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint = "" )
226  { return std::shared_ptr<MovieSurface>( new MovieSurface( data, dataSize, fileNameHint, mimeTypeHint ) ); }
227  static MovieSurfaceRef create( DataSourceRef dataSource, const std::string mimeTypeHint = "" )
228  { return std::shared_ptr<MovieSurface>( new MovieSurface( dataSource, mimeTypeHint ) ); }
229 
232 
233  protected:
234  void allocateVisualContext();
235 
236  struct Obj : public MovieBase::Obj {
237  virtual ~Obj();
238 
239  virtual void releaseFrame();
240  virtual void newFrame( CVImageBufferRef cvImage );
241 
243  };
244 
245  std::shared_ptr<Obj> mObj;
246  virtual MovieBase::Obj* getObj() const { return mObj.get(); }
247 
248  public:
250  typedef std::shared_ptr<Obj> MovieSurface::*unspecified_bool_type;
252  operator unspecified_bool_type() const { return ( mObj.get() == 0 ) ? 0 : &MovieSurface::mObj; }
253  void reset() { mObj.reset(); }
255 };
256 
257 class MovieGl;
258 typedef std::shared_ptr<MovieGl> MovieGlRef;
263 class MovieGl : public MovieBase {
264  public:
266  MovieGl( const fs::path &path );
267  MovieGl( const class MovieLoader &loader );
269 
270  MovieGl( const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint = "" );
271  MovieGl( DataSourceRef dataSource, const std::string mimeTypeHint = "" );
272 
273  static MovieGlRef create( const fs::path &path ) { return std::shared_ptr<MovieGl>( new MovieGl( path ) ); }
274  static MovieGlRef create( const MovieLoaderRef &loader );
275  static MovieGlRef create( const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint = "" )
276  { return std::shared_ptr<MovieGl>( new MovieGl( data, dataSize, fileNameHint, mimeTypeHint ) ); }
277  static MovieGlRef create( DataSourceRef dataSource, const std::string mimeTypeHint = "" )
278  { return std::shared_ptr<MovieGl>( new MovieGl( dataSource, mimeTypeHint ) ); }
279 
281  const gl::Texture getTexture();
282 
283  protected:
284  void allocateVisualContext();
285 
286  struct Obj : public MovieBase::Obj {
287  Obj();
288  ~Obj();
289 
290  virtual void releaseFrame();
291  virtual void newFrame( CVImageBufferRef cvImage );
292 
294 #if defined( CINDER_MSW )
295  gl::TextureCache mTextureCache;
296 #endif
297  };
298 
299  std::shared_ptr<Obj> mObj;
300  virtual MovieBase::Obj* getObj() const { return mObj.get(); }
301 
302  public:
304  typedef std::shared_ptr<Obj> MovieGl::*unspecified_bool_type;
306  operator unspecified_bool_type() const { return ( mObj.get() == 0 ) ? 0 : &MovieGl::mObj; }
307  void reset() { mObj.reset(); }
309 };
310 
311 class MovieLoader {
312  public:
314  MovieLoader( const Url &url );
315 
316  static MovieLoaderRef create( const Url &url ) { return std::shared_ptr<MovieLoader>( new MovieLoader( url ) ); }
317 
319  bool checkLoaded() const;
321  bool checkPlayable() const;
323  bool checkPlaythroughOk() const;
324 
326  void waitForLoaded() const;
328  void waitForPlayable() const;
330  void waitForPlaythroughOk() const;
331 
333  const Url& getUrl() const { return mObj->mUrl; }
334 
336  ::Movie getMovieHandle() const { return mObj->mMovie; }
337 
339  ::Movie transferMovieHandle() const { mObj->mOwnsMovie = false; return mObj->mMovie; }
340 
341  protected:
342  void updateLoadState() const;
343 
344  struct Obj {
345  Obj( const Url &url );
346  ~Obj();
347 
348  mutable bool mOwnsMovie;
349  ::Movie mMovie;
352  };
353 
354  std::shared_ptr<Obj> mObj;
355 
356  public:
358  typedef std::shared_ptr<Obj> MovieLoader::*unspecified_bool_type;
360  operator unspecified_bool_type() const { return ( mObj.get() == 0 ) ? 0 : &MovieLoader::mObj; }
361  void reset() { mObj.reset(); }
363 };
364 
365 inline int32_t floatToFixed( float fl ) { return ((int32_t)((float)(fl) * ((int32_t) 0x00010000L))); }
366 
368 void startQuickTime();
370 extern int32_t getQuickTimeVersion();
373 
375 extern void quickTimeTask();
376 
377 class QuickTimeExc : public std::exception {
378 };
379 
381 };
382 
384 };
385 
387 };
388 
390 };
391 
393 };
394 
395 } /* namespace qtime */ } /* namespace cinder */
396 #endif // ! defined( __LP64__ )
bool mLoaded
Definition: QuickTime.h:351
virtual void newFrame(CVImageBufferRef cvImage)
Definition: QuickTime.cpp:702
virtual ~Obj()
Definition: QuickTime.cpp:203
void prepareForDestruction()
Definition: QuickTime.cpp:216
virtual ~MovieBase()
Definition: QuickTime.h:67
int32_t getQuickTimeVersion()
Returns 0 if QuickTime is not available, otherwise an integer encoding of the QuickTime version...
Definition: QuickTime.cpp:939
bool hasAudio() const
Returns whether a movie contains at least one audio track, defined as Sound, Music, or MPEG tracks.
Definition: QuickTime.cpp:296
float getFramerate() const
Returns the movie's framerate measured as frames per second.
Definition: QuickTime.cpp:245
float getDuration() const
Returns the movie's length measured in seconds.
Definition: QuickTime.h:85
static MovieGlRef create(DataSourceRef dataSource, const std::string mimeTypeHint="")
Definition: QuickTime.h:277
void updateLoadState()
Definition: QuickTime.cpp:221
void * mNewFrameCallbackRefcon
Definition: QuickTime.h:201
const gl::Texture getTexture()
Returns the gl::Texture representing the Movie's current frame, bound to the GL_TEXTURE_RECTANGLE_ARB...
Definition: QuickTime.cpp:848
bool mPlayingForward
Definition: QuickTime.h:191
bool mPlayable
Definition: QuickTime.h:190
Definition: Area.h:37
void setupStereoFft(uint32_t numBands)
Sets up Fourier analysis on the movie using numBands distinct bands in a two (stereo) channels...
Definition: QuickTime.cpp:560
GLsizei const GLchar ** string
Definition: GLee.h:2427
static MovieGlRef create(const fs::path &path)
Definition: QuickTime.h:273
static MovieSurfaceRef create(const fs::path &path)
Definition: QuickTime.h:223
void reset()
Emulates shared_ptr-like behavior.
Definition: QuickTime.h:253
void startQuickTime()
Initializes QuickTime system-wide. Safe to call multiple times.
Definition: QuickTime.cpp:74
int32_t mWidth
Definition: QuickTime.h:187
Vec2i getSize() const
Returns the size of the movie in pixels.
Definition: QuickTime.h:77
QuickTime movie playback as OpenGL textures Textures are always bound to the GL_TEXTURE_RECTANGLE_ARB...
Definition: QuickTime.h:263
std::shared_ptr< MovieGl > MovieGlRef
Definition: QuickTime.h:257
void resetActiveSegment()
Resets the active segment to be the entire movie.
Definition: QuickTime.cpp:358
Obj()
Definition: QuickTime.cpp:195
Definition: QuickTime.h:286
void setVolume(float volume)
Sets the audio playback volume ranging from [0 - 1.0].
Definition: QuickTime.cpp:510
virtual Obj * getObj() const =0
~Obj()
Definition: QuickTime.cpp:740
Definition: QuickTime.h:311
void initFromPath(const fs::path &filePath)
Definition: QuickTime.cpp:136
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: GLee.h:1011
Surface mSurface
Definition: QuickTime.h:242
static MovieSurfaceRef create(DataSourceRef dataSource, const std::string mimeTypeHint="")
Definition: QuickTime.h:227
void stepForward()
Advances the movie by one frame (a single video sample). Ignores looping settings.
Definition: QuickTime.cpp:423
void reset()
Emulates shared_ptr-like behavior.
Definition: QuickTime.h:361
void seekToFrame(int frame)
Sets the movie time to the start time of frame frame.
Definition: QuickTime.cpp:312
void lock()
Definition: QuickTime.h:179
Definition: QuickTime.h:173
typedef void(APIENTRYP GLEEPFNGLBLENDCOLORPROC)(GLclampf red
float getVolume() const
Gets the audio playback volume ranging from [0 - 1.0].
Definition: QuickTime.cpp:517
bool checkPlaythroughOk() const
Returns whether the movie is ready for playthrough, implying media data is still downloading, but all data is expected to arrive before it is needed.
Definition: QuickTime.cpp:880
Definition: QuickTime.h:377
Url mUrl
Definition: QuickTime.h:350
static MovieSurfaceRef create(const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint="")
Definition: QuickTime.h:225
void stepBackward()
Steps backward by one frame (a single video sample). Ignores looping settings.
Definition: QuickTime.cpp:437
void initFromDataSource(DataSourceRef dataSource, const std::string &mimeTypeHint)
Definition: QuickTime.cpp:150
void reset()
Emulates shared_ptr-like behavior.
Definition: QuickTime.h:307
void setupMonoFft(uint32_t numBands)
Sets up Fourier analysis on the movie using numBands distinct bands in a single (mono) channel...
Definition: QuickTime.cpp:555
void seekToStart()
Sets the movie time to its beginning.
Definition: QuickTime.cpp:328
void waitForPlaythroughOk() const
Waits until the movie is ready for playthrough, implying media data is still downloading, but all data is expected to arrive before it is needed.
Definition: QuickTime.cpp:903
void setLoop(bool loop=true, bool palindrome=false)
Sets whether the movie is set to loop during playback. If palindrome is true, the movie will "ping-po...
Definition: QuickTime.cpp:380
static int32_t countFrames(::Movie theMovie)
Definition: QuickTime.cpp:365
void(* mNewFrameCallback)(long timeValue, void *refcon)
Definition: QuickTime.h:200
int32_t mHeight
Definition: QuickTime.h:187
virtual void releaseFrame()
Definition: QuickTime.cpp:712
QTVisualContextRef mVisualContext
Definition: QuickTime.h:197
void seekToEnd()
Sets the movie time to its end.
Definition: QuickTime.cpp:333
std::shared_ptr< MovieLoader > MovieLoaderRef
Definition: QuickTime.h:62
void setupFft(FourCharCode code, uint32_t bandNum, uint8_t channelNum)
Definition: QuickTime.cpp:522
Represents an OpenGL Texture. Implicitly shared object.
Definition: Texture.h:41
float getAspectRatio() const
Returns the movie's aspect ratio, the ratio of its width to its height.
Definition: QuickTime.h:79
bool isDone() const
Returns whether the movie has completely finished playing.
Definition: QuickTime.cpp:628
void init()
Definition: QuickTime.cpp:172
Obj(const Url &url)
Definition: QuickTime.cpp:922
MovieSurface()
Definition: QuickTime.h:215
const Url & getUrl() const
Returns the original Url that the MovieLoader is loading.
Definition: QuickTime.h:333
::Movie mMovie
Definition: QuickTime.h:349
void setActiveSegment(float startTime, float duration)
Limits the active portion of a movie to a subset beginning at startTime seconds and lasting for durat...
Definition: QuickTime.cpp:338
bool checkNewFrame()
Returns whether a movie has a new frame available.
Definition: QuickTime.cpp:456
int32_t getNumFrames() const
Returns the total number of frames (video samples) in the movie.
Definition: QuickTime.cpp:254
bool mPlayable
Definition: QuickTime.h:351
::Movie mMovie
Definition: QuickTime.h:198
bool mPlaythroughOK
Definition: QuickTime.h:351
void quickTimeTask()
Gives QuickTime an opportunity to update all playing movies by calling ::MoviesTask. Generally only necessary when playing audio-only movies on Windows.
Definition: QuickTime.cpp:977
::Movie getMovieHandle() const
Returns the native QuickTime Movie data structure but still maintains ownership of it...
Definition: QuickTime.h:336
MovieBase()
Definition: QuickTime.h:157
Definition: QuickTime.h:65
std::shared_ptr< Obj > mObj
Definition: QuickTime.h:354
void seekToTime(float seconds)
Sets the movie to the time seconds.
Definition: QuickTime.cpp:307
~Obj()
Definition: QuickTime.cpp:933
Definition: QuickTime.h:386
int32_t getWidth() const
Returns the width of the movie in pixels.
Definition: QuickTime.h:73
std::shared_ptr< Obj > MovieLoader::* unspecified_bool_type
Emulates shared_ptr-like behavior.
Definition: QuickTime.h:359
uint32_t mFFTNumBandLevels
Definition: QuickTime.h:195
Definition: QuickTime.h:344
virtual void releaseFrame()=0
virtual void newFrame(CVImageBufferRef cvImage)=0
void initFromLoader(const class MovieLoader &loader)
Definition: QuickTime.cpp:125
std::shared_ptr< Obj > mObj
Definition: QuickTime.h:299
void waitForPlayable() const
Waits until the movie is in a playable state, implying the movie is fully formed and can be played bu...
Definition: QuickTime.cpp:895
MovieLoader()
Definition: QuickTime.h:313
uint32_t getNumFftChannels() const
Definition: QuickTime.cpp:603
void setNewFrameCallback(void(*aNewFrameCallback)(long, void *), void *aNewFrameCallbackRefcon)
Sets a function which is called whenever the movie has rendered a new frame during playback...
Definition: QuickTime.cpp:643
::Movie transferMovieHandle() const
Returns the native QuickTime Movie and marks itself as no longer the owner. In general you should not...
Definition: QuickTime.h:339
void updateFrame()
Definition: QuickTime.cpp:474
int32_t mFrameCount
Definition: QuickTime.h:188
float getCurrentTime() const
Returns the current time of a movie in seconds.
Definition: QuickTime.cpp:302
bool hasVisuals() const
Returns whether a movie contains at least one visual track, defined as Video, MPEG, Sprite, QuickDraw3D, Text, or TimeCode tracks.
Definition: QuickTime.cpp:290
std::shared_ptr< MovieSurface > MovieSurfaceRef
Definition: QuickTime.h:210
Obj()
Definition: QuickTime.cpp:735
void allocateVisualContext()
Definition: QuickTime.cpp:686
std::shared_ptr< Obj > MovieSurface::* unspecified_bool_type
Emulates shared_ptr-like behavior.
Definition: QuickTime.h:251
bool checkPlayable() const
Returns whether the movie is playable, implying the movie is fully formed and can be played but media...
Definition: QuickTime.cpp:873
bool checkPlayable()
Returns whether the movie has loaded and buffered enough to playback without interruption.
Definition: QuickTime.cpp:237
void allocateVisualContext()
Definition: QuickTime.cpp:774
void setupMultiChannelFft(uint32_t numBands)
Sets up Fourier analysis on the movie using numBands distinct bands in as many channels as the audo t...
Definition: QuickTime.cpp:565
bool mOwnsMovie
Definition: QuickTime.h:348
Definition: QuickTime.h:236
void unlock()
Definition: QuickTime.h:180
Definition: QuickTime.h:392
virtual MovieBase::Obj * getObj() const
Definition: QuickTime.h:246
void play()
Begins movie playback.
Definition: QuickTime.cpp:633
virtual void releaseFrame()
Definition: QuickTime.cpp:800
virtual ~Obj()
Definition: QuickTime.cpp:652
DataSourceRef mDataSource
Definition: QuickTime.h:204
uint32_t mFFTNumChannels
Definition: QuickTime.h:196
FourCharCode mFFTFourCharCode
Definition: QuickTime.h:194
uint32_t getNumFftBands() const
Definition: QuickTime.cpp:598
std::string getQuickTimeVersionString()
Returns an empty string if QuickTime is not available, otherwise a human readable string of the Quick...
Definition: QuickTime.cpp:960
std::shared_ptr< Obj > mObj
Definition: QuickTime.h:245
int32_t getHeight() const
Returns the height of the movie in pixels.
Definition: QuickTime.h:75
std::mutex mMutex
Definition: QuickTime.h:203
float * getFftData() const
Definition: QuickTime.cpp:608
bool mPalindrome
Definition: QuickTime.h:191
bool checkLoaded() const
Returns whether the movie is in a loaded state, implying its structures are ready for reading but it ...
Definition: QuickTime.cpp:866
Area getBounds() const
the Area defining the Movie's bounds in pixels: [0,0]-[width,height]
Definition: QuickTime.h:81
MovieGl()
Definition: QuickTime.h:265
static MovieGlRef create(const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint="")
Definition: QuickTime.h:275
void stop()
Stops movie playback.
Definition: QuickTime.cpp:638
Definition: Texture.h:279
void initFromMemory(const void *data, size_t dataSize, const std::string &fileNameHint, const std::string &mimeTypeHint)
Definition: QuickTime.cpp:143
bool isPlaying() const
Returns whether the movie is currently playing or is paused/stopped.
Definition: QuickTime.cpp:623
gl::Texture mTexture
Definition: QuickTime.h:293
Definition: QuickTime.h:383
virtual MovieBase::Obj * getObj() const
Definition: QuickTime.h:300
Definition: QuickTime.h:213
bool mLoaded
Definition: QuickTime.h:190
void setRate(float rate)
Sets the playback rate, which begins playback immediately for nonzero values. 1.0 represents normal s...
Definition: QuickTime.cpp:451
std::shared_ptr< Obj > MovieGl::* unspecified_bool_type
Emulates shared_ptr-like behavior.
Definition: QuickTime.h:305
std::shared_ptr< class DataSource > DataSourceRef
Definition: DataSource.h:35
Surface getSurface()
Returns the Surface8u representing the Movie's current frame.
Definition: QuickTime.cpp:717
void waitForLoaded() const
Waits until the movie is in a loaded state, which implies its structures are ready for reading but it...
Definition: QuickTime.cpp:887
float getPixelAspectRatio() const
Returns the movie's pixel aspect ratio. Returns 1.0 if the movie does not contain an explicit pixel a...
Definition: QuickTime.cpp:94
::Movie getMovieHandle() const
Returns the native QuickTime Movie data structure.
Definition: QuickTime.h:154
TimeValue getStartTimeOfFirstSample() const
Definition: QuickTime.cpp:414
int32_t floatToFixed(float fl)
Definition: QuickTime.h:365
float mDuration
Definition: QuickTime.h:189
QTAudioFrequencyLevels * mFFTData
Definition: QuickTime.h:193
bool hasAlpha() const
Returns whether the first video track in the movie contains an alpha channel. Returns false in the ab...
Definition: QuickTime.cpp:264
Definition: QuickTime.h:380
static MovieLoaderRef create(const Url &url)
Definition: QuickTime.h:316
Vec2< int > Vec2i
Definition: Vector.h:1313
bool mLoop
Definition: QuickTime.h:191
virtual void newFrame(CVImageBufferRef cvImage)
Definition: QuickTime.cpp:805
void updateLoadState() const
Definition: QuickTime.cpp:911
Definition: QuickTime.h:389
Definition: Url.h:31