diff options
Diffstat (limited to 'linden/indra/llmedia/llmediaimplquicktime.h')
-rw-r--r-- | linden/indra/llmedia/llmediaimplquicktime.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/linden/indra/llmedia/llmediaimplquicktime.h b/linden/indra/llmedia/llmediaimplquicktime.h new file mode 100644 index 0000000..9eb3a04 --- /dev/null +++ b/linden/indra/llmedia/llmediaimplquicktime.h | |||
@@ -0,0 +1,131 @@ | |||
1 | /** | ||
2 | * @file llmediaimplquicktime.h | ||
3 | * @brief implementation that supports Apple QuickTime media. | ||
4 | * | ||
5 | * Copyright (c) 2005-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #if LL_QUICKTIME_ENABLED | ||
29 | |||
30 | // header guard | ||
31 | #ifndef llmediaimplquicktime_h | ||
32 | #define llmediaimplquicktime_h | ||
33 | |||
34 | #include "stdtypes.h" | ||
35 | |||
36 | #include "llmediamoviebase.h" | ||
37 | |||
38 | #if LL_QUICKTIME_ENABLED | ||
39 | #if LL_DARWIN | ||
40 | #include <QuickTime/QuickTime.h> | ||
41 | #else | ||
42 | #include "MacTypes.h" | ||
43 | #include "QTML.h" | ||
44 | #include "Movies.h" | ||
45 | #include "FixMath.h" | ||
46 | #include "QuickTimeStreaming.h" | ||
47 | #endif | ||
48 | #endif | ||
49 | |||
50 | |||
51 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
52 | // | ||
53 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
54 | class LLMediaImplQuickTime: | ||
55 | public LLMediaMovieBase | ||
56 | { | ||
57 | public: | ||
58 | LLMediaImplQuickTime (); | ||
59 | virtual ~LLMediaImplQuickTime (); | ||
60 | |||
61 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
62 | // implementation of the media public interface | ||
63 | |||
64 | // housekeeping | ||
65 | virtual BOOL setBuffer ( U8* bufferIn ); | ||
66 | virtual BOOL init (); | ||
67 | virtual BOOL load ( const LLString& urlIn ); | ||
68 | virtual BOOL unload (); | ||
69 | |||
70 | // transport controls | ||
71 | virtual BOOL stop (); | ||
72 | virtual BOOL play (); | ||
73 | virtual BOOL loop ( S32 howMany ); | ||
74 | virtual BOOL pause (); | ||
75 | virtual BOOL seek ( F64 time ); | ||
76 | |||
77 | // audio levels | ||
78 | virtual BOOL setVolume ( F32 volumeIn ); | ||
79 | virtual F32 getVolume (); | ||
80 | |||
81 | // status | ||
82 | virtual BOOL isIdle () const; | ||
83 | virtual BOOL isBuffering () const; | ||
84 | virtual BOOL isError () const; | ||
85 | virtual BOOL isLoaded () const; | ||
86 | virtual BOOL isStopped () const; | ||
87 | virtual BOOL isPaused () const; | ||
88 | virtual BOOL isPlaying () const; | ||
89 | virtual BOOL isLooping () const; | ||
90 | virtual F64 getTime () const; | ||
91 | |||
92 | // media data | ||
93 | virtual S32 updateMedia (); | ||
94 | virtual void setAutoScaled ( BOOL autoScaledIn ); | ||
95 | virtual U8* getMediaData (); | ||
96 | virtual F64 getMediaDuration () const; | ||
97 | |||
98 | private: | ||
99 | // quicktime specific | ||
100 | Movie theMovie; | ||
101 | ComponentInstance theController; | ||
102 | PixMapHandle pixmapHandle; | ||
103 | GWorldPtr theGWorld; | ||
104 | Rect movieRect; | ||
105 | U8* mediaData; | ||
106 | BOOL movieLoaded; | ||
107 | BOOL ownBuffer; | ||
108 | short curVolume; | ||
109 | S32 loopsLeft; | ||
110 | |||
111 | BOOL autoScaled; | ||
112 | BOOL sizeChangeInProgress; | ||
113 | BOOL initialStartDone; | ||
114 | BOOL isQTLoaded (); | ||
115 | BOOL isQTPlaythroughOK (); | ||
116 | void setupDummyBuffer (); | ||
117 | |||
118 | static OSErr myFrameDrawnCallback ( Movie callbackMovie, long refCon ); | ||
119 | static Boolean myMCActionFilterProc (MovieController theMC, short theAction, void *theParams, long theRefCon); | ||
120 | |||
121 | void rewind(); | ||
122 | void sizeChanged(); | ||
123 | void updateMediaSize(); | ||
124 | |||
125 | enum { ModeNone, ModeIdle, ModeError, ModeBuffering, ModeLoaded, ModeStopped, ModePaused, ModePlaying, ModeLooping } currentMode; | ||
126 | }; | ||
127 | |||
128 | |||
129 | #endif // llmediaimplquicktime_h | ||
130 | |||
131 | #endif | ||