llmediaimplgstreamer.h

Go to the documentation of this file.
00001 
00032 // header guard
00033 #ifndef llmediaimplgstreamer_h
00034 #define llmediaimplgstreamer_h
00035 
00036 #if LL_GSTREAMER_ENABLED
00037 
00038 extern "C" {
00039 #include <gst/gst.h>
00040 
00041 #include <apr-1/apr_pools.h>
00042 #include <apr-1/apr_dso.h>
00043 }
00044 
00045 #include "stdtypes.h"
00046 
00047 #include "llmediamoviebase.h"
00048 
00049 #include "llmediaimplgstreamervidplug.h"
00050 #ifdef LL_GST_SOUNDSINK
00051 #include "llmediaimplgstreamersndplug.h"
00052 #endif // LL_GST_SOUNDSINK
00053 
00055 class LLMediaImplGStreamer:
00056         public LLMediaMovieBase
00057 {
00058         public:
00059                 LLMediaImplGStreamer ();
00060                 virtual ~LLMediaImplGStreamer ();
00061 
00063                 // implementation of the media public interface
00064 
00065                 // housekeeping
00066                 virtual BOOL setBuffer ( U8* bufferIn );
00067                 virtual BOOL init ();
00068                 virtual BOOL load ( const LLString& urlIn );
00069                 virtual BOOL unload ();
00070 
00071                 // transport controls
00072                 virtual BOOL stop ();
00073                 virtual BOOL play ();
00074                 virtual BOOL loop ( S32 howMany );
00075                 virtual BOOL pause ();
00076                 virtual BOOL seek ( F64 time );
00077 
00078                 // audio levels
00079                 virtual BOOL setVolume ( F32 volumeIn );
00080                 virtual F32 getVolume ();
00081 
00082                 // status
00083                 virtual BOOL isIdle () const;
00084                 virtual BOOL isBuffering () const;
00085                 virtual BOOL isError () const;
00086                 virtual BOOL isLoaded () const;
00087                 virtual BOOL isStopped () const;
00088                 virtual BOOL isPaused () const;
00089                 virtual BOOL isPlaying () const;
00090                 virtual BOOL isLooping () const;
00091                 virtual F64 getTime () const;
00092 
00093                 // media data
00094                 virtual S32 updateMedia ();
00095                 virtual void setAutoScaled ( BOOL autoScaledIn );
00096                 virtual U8* getMediaData ();
00097                 virtual F64 getMediaDuration () const;
00098 
00099                 // class-specific
00100                 GMainLoop *getPump() {return mPump;};
00101                 typedef enum { ModeNone, ModeIdle, ModeError, ModeBuffering, ModeStopped, ModePaused, ModePlaying, ModeLooping } llGstMode;
00102                 llGstMode getCurrentMode() {return currentMode;};
00103                 void setCurrentMode(llGstMode mode) {currentMode = mode;};
00104 
00105         private:
00106                 // misc
00107                 U8* mediaData;
00108                 BOOL ownBuffer;
00109                 BOOL autoScaled;
00110                 F32 mVolume;
00111 
00112                 llGstMode currentMode;
00113 
00114                 // GStreamer-specific
00115                 GMainLoop *mPump; // event pump for this media
00116                 GstElement *mPlaybin;
00117                 GstSLVideo *mVideoSink;
00118 #ifdef LL_GST_SOUNDSINK
00119                 GstSLSound *mAudioSink;
00120 #endif // LL_GST_SOUNDSINK
00121 };
00122 
00123 // called during shutdown when no instances may exist
00124 void UnloadGStreamer();
00125 
00126 
00127 #endif // LL_GSTREAMER_ENABLED
00128 
00129 #endif // llmediaimplgstreamer_h

Generated on Thu Jul 1 06:08:51 2010 for Second Life Viewer by  doxygen 1.4.7