diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/llmedia/llmediabase.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmedia/llmediabase.h | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/linden/indra/llmedia/llmediabase.h b/linden/indra/llmedia/llmediabase.h new file mode 100644 index 0000000..cf16947 --- /dev/null +++ b/linden/indra/llmedia/llmediabase.h | |||
@@ -0,0 +1,136 @@ | |||
1 | /** | ||
2 | * @file llmediabase.h | ||
3 | * @brief LLMedia support - base class | ||
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 | // header guard | ||
29 | #ifndef llmediabase_h | ||
30 | #define llmediabase_h | ||
31 | |||
32 | #include "llstring.h" | ||
33 | #include "llmediaemitter.h" | ||
34 | #include "llmediaobservers.h" | ||
35 | #include "llmediaemitterevents.h" | ||
36 | |||
37 | class LLMediaBase | ||
38 | { | ||
39 | public: | ||
40 | LLMediaBase (); | ||
41 | |||
42 | // do the right thing with dtor | ||
43 | virtual ~LLMediaBase () | ||
44 | { | ||
45 | }; | ||
46 | |||
47 | /////////////////////////////////////////////////////////////////////////////// | ||
48 | // public interface: | ||
49 | |||
50 | /////////////////////////////////////////////////////////////////////////////// | ||
51 | // different types of supported media | ||
52 | enum MediaType { Unknown, QuickTime }; | ||
53 | |||
54 | /////////////////////////////////////////////////////////////////////////////// | ||
55 | // factory method based on explicit media type | ||
56 | static LLMediaBase* make ( const MediaType mediaTypeIn, S32 width_pixels, S32 height_pixels ); | ||
57 | |||
58 | // Result codes for updateMedia | ||
59 | enum | ||
60 | { | ||
61 | updateMediaNoChanges, | ||
62 | updateMediaNeedsUpdate, | ||
63 | updateMediaNeedsSizeChange | ||
64 | |||
65 | } updateMediaResult; | ||
66 | |||
67 | // housekeeping | ||
68 | virtual BOOL setBuffer ( U8* bufferIn ) = 0; | ||
69 | virtual bool setBufferSize(S32 width_pixels, S32 height_pixels) { return false; } | ||
70 | virtual BOOL init (); | ||
71 | virtual BOOL load ( const LLString& urlIn ); | ||
72 | virtual BOOL unload (); | ||
73 | |||
74 | // media data | ||
75 | virtual S32 updateMedia () = 0; | ||
76 | virtual U8* getMediaData () = 0; | ||
77 | virtual S32 getTextureWidth () const; | ||
78 | virtual S32 getTextureHeight () const; | ||
79 | virtual S32 getTextureDepth () const; | ||
80 | virtual S32 getTextureFormatInternal () const; | ||
81 | virtual S32 getTextureFormatPrimary () const; | ||
82 | virtual S32 getTextureFormatType () const; | ||
83 | virtual S32 getTextureFormatSwapBytes () const; | ||
84 | virtual S32 getMediaWidth () const; | ||
85 | virtual S32 getMediaHeight () const; | ||
86 | virtual S32 getMediaDepthBytes () const; | ||
87 | virtual S32 getMediaBufferSize () const; | ||
88 | |||
89 | // allow consumers to observe media events | ||
90 | virtual BOOL addMediaObserver( LLMediaObserver* observerIn ); | ||
91 | virtual BOOL remMediaObserver( LLMediaObserver* observerIn ); | ||
92 | |||
93 | // MBW -- XXX -- These don't belong here! | ||
94 | // LLMediaEngine should really only deal with LLMediaMovieBase subclasses | ||
95 | virtual BOOL stop () { return TRUE; } | ||
96 | virtual BOOL play () { return TRUE; } | ||
97 | virtual BOOL loop ( S32 howMany ) { return TRUE; } | ||
98 | virtual BOOL pause () { return TRUE; } | ||
99 | virtual BOOL seek ( F64 time ) { return TRUE; } | ||
100 | virtual BOOL setVolume ( F32 volumeIn ) { return TRUE; } | ||
101 | virtual BOOL isLoaded () const { return TRUE; } | ||
102 | virtual BOOL isPaused () const { return FALSE; } | ||
103 | virtual BOOL isPlaying () const { return TRUE; } | ||
104 | virtual BOOL isLooping () const { return FALSE; } | ||
105 | virtual void setAutoScaled ( BOOL autoScaledIn ) {} | ||
106 | |||
107 | protected: | ||
108 | // event emitter | ||
109 | LLMediaEmitter<LLMediaObserver> mMediaEventEmitter; | ||
110 | |||
111 | U32 mBufferChangeCount; // Incremented when the buffer changes | ||
112 | U32 mLastBufferChangeCount; // Set to mBufferChangeCount when the buffer is reported as changed | ||
113 | |||
114 | S32 mMediaWidth; | ||
115 | S32 mMediaHeight; | ||
116 | S32 mMediaDepthBytes; | ||
117 | S32 mMediaRowbytes; | ||
118 | S32 mTextureWidth; | ||
119 | S32 mTextureHeight; | ||
120 | S32 mTextureDepth; | ||
121 | S32 mTextureFormatInternal; | ||
122 | S32 mTextureFormatPrimary; | ||
123 | S32 mTextureFormatType; | ||
124 | S32 mTextureFormatSwapBytes; | ||
125 | |||
126 | public: | ||
127 | |||
128 | // Has memory buffer been updated? (page content change, scroll, movie frame drawn, etc) | ||
129 | void bufferChanged() { mBufferChangeCount++; } | ||
130 | bool getBufferChanged() const { return mBufferChangeCount != mLastBufferChangeCount; } | ||
131 | void resetBufferChanged() { mLastBufferChangeCount = mBufferChangeCount; } | ||
132 | |||
133 | }; | ||
134 | |||
135 | |||
136 | #endif // llmediabase_h | ||