diff options
author | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:04 -0500 |
commit | 117e22047c5752352342d64e3fb7ce00a4eb8113 (patch) | |
tree | e32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/llmedia/llmediaimplgstreamer.h | |
parent | Second Life viewer sources 1.18.0.6 (diff) | |
download | meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2 meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz |
Second Life viewer sources 1.18.1.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmedia/llmediaimplgstreamer.h | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h new file mode 100644 index 0000000..52a5c84 --- /dev/null +++ b/linden/indra/llmedia/llmediaimplgstreamer.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /** | ||
2 | * @file llmediaimplgstreamer.h | ||
3 | * @brief implementation that supports media playback via GStreamer. | ||
4 | * | ||
5 | * Copyright (c) 2007-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
9 | * to you under the terms of the GNU General Public License, version 2.0 | ||
10 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
11 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
12 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
13 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
14 | * | ||
15 | * There are special exceptions to the terms and conditions of the GPL as | ||
16 | * it is applied to this Source Code. View the full text of the exception | ||
17 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
18 | * online at http://secondlife.com/developers/opensource/flossexception | ||
19 | * | ||
20 | * By copying, modifying or distributing this software, you acknowledge | ||
21 | * that you have read and understood your obligations described above, | ||
22 | * and agree to abide by those obligations. | ||
23 | * | ||
24 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
25 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
26 | * COMPLETENESS OR PERFORMANCE. | ||
27 | */ | ||
28 | |||
29 | // header guard | ||
30 | #ifndef llmediaimplgstreamer_h | ||
31 | #define llmediaimplgstreamer_h | ||
32 | |||
33 | #if LL_GSTREAMER_ENABLED | ||
34 | |||
35 | extern "C" { | ||
36 | #include <gst/gst.h> | ||
37 | |||
38 | #include <apr-1/apr_pools.h> | ||
39 | #include <apr-1/apr_dso.h> | ||
40 | } | ||
41 | |||
42 | #include "stdtypes.h" | ||
43 | |||
44 | #include "llmediamoviebase.h" | ||
45 | |||
46 | #include "llmediaimplgstreamervidplug.h" | ||
47 | #ifdef LL_GST_SOUNDSINK | ||
48 | #include "llmediaimplgstreamersndplug.h" | ||
49 | #endif // LL_GST_SOUNDSINK | ||
50 | |||
51 | /////////////////////////////////////////////////////////////////////////// | ||
52 | class LLMediaImplGStreamer: | ||
53 | public LLMediaMovieBase | ||
54 | { | ||
55 | public: | ||
56 | LLMediaImplGStreamer (); | ||
57 | virtual ~LLMediaImplGStreamer (); | ||
58 | |||
59 | //////////////////////////////////////////////////////// | ||
60 | // implementation of the media public interface | ||
61 | |||
62 | // housekeeping | ||
63 | virtual BOOL setBuffer ( U8* bufferIn ); | ||
64 | virtual BOOL init (); | ||
65 | virtual BOOL load ( const LLString& urlIn ); | ||
66 | virtual BOOL unload (); | ||
67 | |||
68 | // transport controls | ||
69 | virtual BOOL stop (); | ||
70 | virtual BOOL play (); | ||
71 | virtual BOOL loop ( S32 howMany ); | ||
72 | virtual BOOL pause (); | ||
73 | virtual BOOL seek ( F64 time ); | ||
74 | |||
75 | // audio levels | ||
76 | virtual BOOL setVolume ( F32 volumeIn ); | ||
77 | virtual F32 getVolume (); | ||
78 | |||
79 | // status | ||
80 | virtual BOOL isIdle () const; | ||
81 | virtual BOOL isBuffering () const; | ||
82 | virtual BOOL isError () const; | ||
83 | virtual BOOL isLoaded () const; | ||
84 | virtual BOOL isStopped () const; | ||
85 | virtual BOOL isPaused () const; | ||
86 | virtual BOOL isPlaying () const; | ||
87 | virtual BOOL isLooping () const; | ||
88 | virtual F64 getTime () const; | ||
89 | |||
90 | // media data | ||
91 | virtual S32 updateMedia (); | ||
92 | virtual void setAutoScaled ( BOOL autoScaledIn ); | ||
93 | virtual U8* getMediaData (); | ||
94 | virtual F64 getMediaDuration () const; | ||
95 | |||
96 | // class-specific | ||
97 | GMainLoop *getPump() {return mPump;}; | ||
98 | typedef enum { ModeNone, ModeIdle, ModeError, ModeBuffering, ModeStopped, ModePaused, ModePlaying, ModeLooping } llGstMode; | ||
99 | llGstMode getCurrentMode() {return currentMode;}; | ||
100 | void setCurrentMode(llGstMode mode) {currentMode = mode;}; | ||
101 | |||
102 | private: | ||
103 | // misc | ||
104 | U8* mediaData; | ||
105 | BOOL ownBuffer; | ||
106 | BOOL autoScaled; | ||
107 | F32 mVolume; | ||
108 | |||
109 | llGstMode currentMode; | ||
110 | |||
111 | // GStreamer-specific | ||
112 | GMainLoop *mPump; // event pump for this media | ||
113 | GstElement *mPlaybin; | ||
114 | GstSLVideo *mVideoSink; | ||
115 | #ifdef LL_GST_SOUNDSINK | ||
116 | GstSLSound *mAudioSink; | ||
117 | #endif // LL_GST_SOUNDSINK | ||
118 | }; | ||
119 | |||
120 | // called during shutdown when no instances may exist | ||
121 | void UnloadGStreamer(); | ||
122 | |||
123 | |||
124 | #endif // LL_GSTREAMER_ENABLED | ||
125 | |||
126 | #endif // llmediaimplgstreamer_h | ||