diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmedia/llmediaimplquicktime.h | 166 |
1 files changed, 69 insertions, 97 deletions
diff --git a/linden/indra/llmedia/llmediaimplquicktime.h b/linden/indra/llmedia/llmediaimplquicktime.h index b170a06..de8e9e2 100644 --- a/linden/indra/llmedia/llmediaimplquicktime.h +++ b/linden/indra/llmedia/llmediaimplquicktime.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /** | 1 | /** |
2 | * @file llmediaimplquicktime.h | 2 | * @file llmediaimplquicktime.h |
3 | * @brief implementation that supports Apple QuickTime media. | 3 | * @brief QuickTime media impl concrete class |
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2005&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2007&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2005-2008, Linden Research, Inc. | 7 | * Copyright (c) 2007-2008, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -29,111 +29,83 @@ | |||
29 | * $/LicenseInfo$ | 29 | * $/LicenseInfo$ |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #if LL_QUICKTIME_ENABLED | 32 | #ifndef LLMEDIAIMPLQUICKTIME_H |
33 | 33 | #define LLMEDIAIMPLQUICKTIME_H | |
34 | // header guard | ||
35 | #ifndef llmediaimplquicktime_h | ||
36 | #define llmediaimplquicktime_h | ||
37 | 34 | ||
38 | #include "stdtypes.h" | 35 | #include "llmediaimplcommon.h" |
39 | 36 | #include "llmediaimplfactory.h" | |
40 | #include "llmediamoviebase.h" | ||
41 | 37 | ||
42 | #if LL_QUICKTIME_ENABLED | 38 | #if LL_QUICKTIME_ENABLED |
43 | #if LL_DARWIN | 39 | |
44 | #include <QuickTime/QuickTime.h> | 40 | #include <string> |
45 | #else | 41 | |
46 | #include "MacTypes.h" | 42 | // QuickTime includes |
47 | #include "QTML.h" | 43 | #if defined(__APPLE__) |
48 | #include "Movies.h" | 44 | #include <QuickTime/QuickTime.h> |
49 | #include "FixMath.h" | 45 | #elif defined(WIN32) |
50 | #include "Gestalt.h" | 46 | #include "MacTypes.h" |
51 | #include "QuickTimeStreaming.h" | 47 | #include "QTML.h" |
52 | #endif | 48 | #include "Movies.h" |
49 | #include "QDoffscreen.h" | ||
50 | #include "FixMath.h" | ||
53 | #endif | 51 | #endif |
54 | 52 | ||
53 | class LLMediaManagerData; | ||
55 | 54 | ||
56 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | 55 | class LLMediaImplQuickTime : |
57 | // | 56 | public LLMediaImplCommon |
58 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
59 | class LLMediaImplQuickTime: | ||
60 | public LLMediaMovieBase | ||
61 | { | 57 | { |
62 | public: | 58 | public: |
63 | LLMediaImplQuickTime (); | 59 | LLMediaImplQuickTime(); |
64 | virtual ~LLMediaImplQuickTime (); | 60 | virtual ~LLMediaImplQuickTime(); |
65 | 61 | ||
66 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | 62 | static bool startup( LLMediaManagerData* init_data ); |
67 | // implementation of the media public interface | 63 | static bool closedown(); |
68 | 64 | ||
69 | // housekeeping | 65 | /* virtual */ std::string getVersion(); |
70 | virtual BOOL setBuffer ( U8* bufferIn ); | 66 | /* virtual */ bool navigateTo( const std::string url ); |
71 | virtual BOOL init (); | 67 | /* virtual */ bool updateMedia(); |
72 | virtual BOOL load ( const LLString& urlIn ); | 68 | /* virtual */ unsigned char* getMediaData(); |
73 | virtual BOOL unload (); | 69 | /* virtual */ int getMediaDataWidth() const; |
74 | 70 | /* virtual */ int getTextureFormatPrimary() const; | |
75 | // transport controls | 71 | /* virtual */ int getTextureFormatType() const; |
76 | virtual BOOL stop (); | 72 | /* virtual */ bool seek( double time ); |
77 | virtual BOOL play (); | 73 | /* virtual */ bool setVolume( float volume ); |
78 | virtual BOOL loop ( S32 howMany ); | 74 | |
79 | virtual BOOL pause (); | 75 | bool sizeChanged(); |
80 | virtual BOOL seek ( F64 time ); | ||
81 | |||
82 | // audio levels | ||
83 | virtual BOOL setVolume ( F32 volumeIn ); | ||
84 | virtual F32 getVolume (); | ||
85 | |||
86 | // status | ||
87 | virtual BOOL isIdle () const; | ||
88 | virtual BOOL isBuffering () const; | ||
89 | virtual BOOL isError () const; | ||
90 | virtual BOOL isLoaded () const; | ||
91 | virtual BOOL isStopped () const; | ||
92 | virtual BOOL isPaused () const; | ||
93 | virtual BOOL isPlaying () const; | ||
94 | virtual BOOL isLooping () const; | ||
95 | virtual F64 getTime () const; | ||
96 | |||
97 | // media data | ||
98 | virtual S32 updateMedia (); | ||
99 | virtual void setAutoScaled ( BOOL autoScaledIn ); | ||
100 | virtual U8* getMediaData (); | ||
101 | virtual F64 getMediaDuration () const; | ||
102 | |||
103 | // static since we need this before an impl is created by media manager | ||
104 | static S32 getVersion(); | ||
105 | 76 | ||
106 | private: | 77 | private: |
107 | // quicktime specific | 78 | static OSErr movieDrawingCompleteCallback( Movie call_back_movie, long ref ); |
108 | Movie theMovie; | 79 | static Boolean mcActionFilterCallBack( MovieController mc, short action, void *params, long ref ); |
109 | ComponentInstance theController; | 80 | static void moviePrePrerollCompleteCallback( Movie movie, OSErr preroll_err, void *refcon ); |
110 | PixMapHandle pixmapHandle; | 81 | |
111 | GWorldPtr theGWorld; | 82 | bool load( const std::string url ); |
112 | Rect movieRect; | 83 | bool unload(); |
113 | U8* mediaData; | ||
114 | BOOL movieLoaded; | ||
115 | BOOL ownBuffer; | ||
116 | short curVolume; | ||
117 | S32 loopsLeft; | ||
118 | |||
119 | BOOL autoScaled; | ||
120 | BOOL sizeChangeInProgress; | ||
121 | BOOL initialStartDone; | ||
122 | BOOL isQTLoaded (); | ||
123 | BOOL isQTPlaythroughOK (); | ||
124 | void setupDummyBuffer (); | ||
125 | |||
126 | static OSErr myFrameDrawnCallback ( Movie callbackMovie, long refCon ); | ||
127 | static Boolean myMCActionFilterProc (MovieController theMC, short theAction, void *theParams, long theRefCon); | ||
128 | |||
129 | void rewind(); | 84 | void rewind(); |
130 | void sizeChanged(); | 85 | bool processState(); |
131 | void updateMediaSize(); | 86 | bool setMovieBoxEnhanced( Rect* rect ); |
132 | 87 | ||
133 | enum { ModeNone, ModeIdle, ModeError, ModeBuffering, ModeLoaded, ModeStopped, ModePaused, ModePlaying, ModeLooping } currentMode; | 88 | Movie mMovieHandle; |
89 | GWorldPtr mGWorldHandle; | ||
90 | ComponentInstance mMovieController; | ||
91 | const int mMinWidth; | ||
92 | const int mMaxWidth; | ||
93 | const int mMinHeight; | ||
94 | const int mMaxHeight; | ||
95 | int mCurVolume; | ||
134 | }; | 96 | }; |
135 | 97 | ||
98 | // The maker class | ||
99 | class LLMediaImplQuickTimeMaker : public LLMediaImplMaker | ||
100 | { | ||
101 | public: | ||
102 | LLMediaImplQuickTimeMaker(); | ||
103 | LLMediaImplQuickTime* create() | ||
104 | { | ||
105 | return new LLMediaImplQuickTime(); | ||
106 | } | ||
107 | }; | ||
136 | 108 | ||
137 | #endif // llmediaimplquicktime_h | 109 | #endif // LL_QUICKTIME_ENABLED |
138 | 110 | ||
139 | #endif | 111 | #endif // LLMEDIAIMPLQUICKTIME_H |