aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaimplgstreamer.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:34 -0500
committerJacek Antonelli2008-08-15 23:45:34 -0500
commitcd17687f01420952712a500107e0f93e7ab8d5f8 (patch)
treece48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/llmedia/llmediaimplgstreamer.h
parentSecond Life viewer sources 1.19.0.5 (diff)
downloadmeta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2
meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz
Second Life viewer sources 1.19.1.0
Diffstat (limited to '')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.h105
1 files changed, 53 insertions, 52 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h
index f1a7956..944db59 100644
--- a/linden/indra/llmedia/llmediaimplgstreamer.h
+++ b/linden/indra/llmedia/llmediaimplgstreamer.h
@@ -1,5 +1,6 @@
1/** 1/**
2 * @file llmediaimplgstreamer.h 2 * @file llmediaimplgstreamer.h
3 * @author Tofu Linden
3 * @brief implementation that supports media playback via GStreamer. 4 * @brief implementation that supports media playback via GStreamer.
4 * 5 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$ 6 * $LicenseInfo:firstyear=2007&license=viewergpl$
@@ -33,27 +34,30 @@
33#ifndef llmediaimplgstreamer_h 34#ifndef llmediaimplgstreamer_h
34#define llmediaimplgstreamer_h 35#define llmediaimplgstreamer_h
35 36
37#include "llmediaimplcommon.h"
38#include "llmediaimplfactory.h"
39
36#if LL_GSTREAMER_ENABLED 40#if LL_GSTREAMER_ENABLED
37 41
38extern "C" { 42extern "C" {
43#include <stdio.h>
39#include <gst/gst.h> 44#include <gst/gst.h>
40 45
41#include <apr-1/apr_pools.h> 46#include <apr-1/apr_pools.h>
42#include <apr-1/apr_dso.h> 47#include <apr-1/apr_dso.h>
43} 48}
44 49
45#include "stdtypes.h"
46
47#include "llmediamoviebase.h"
48
49#include "llmediaimplgstreamervidplug.h" 50#include "llmediaimplgstreamervidplug.h"
50#ifdef LL_GST_SOUNDSINK 51#ifdef LL_GST_SOUNDSINK
51#include "llmediaimplgstreamersndplug.h" 52#include "llmediaimplgstreamersndplug.h"
52#endif // LL_GST_SOUNDSINK 53#endif // LL_GST_SOUNDSINK
53 54
55class LLMediaManagerData;
56class LLMediaImplMaker;
57
54/////////////////////////////////////////////////////////////////////////// 58///////////////////////////////////////////////////////////////////////////
55class LLMediaImplGStreamer: 59class LLMediaImplGStreamer:
56 public LLMediaMovieBase 60 public LLMediaImplCommon
57{ 61{
58 public: 62 public:
59 LLMediaImplGStreamer (); 63 LLMediaImplGStreamer ();
@@ -62,54 +66,31 @@ class LLMediaImplGStreamer:
62 //////////////////////////////////////////////////////// 66 ////////////////////////////////////////////////////////
63 // implementation of the media public interface 67 // implementation of the media public interface
64 68
65 // housekeeping 69 static bool startup( LLMediaManagerData* init_data );
66 virtual BOOL setBuffer ( U8* bufferIn ); 70 static bool closedown();
67 virtual BOOL init (); 71
68 virtual BOOL load ( const LLString& urlIn ); 72 /* virtual */ std::string getVersion();
69 virtual BOOL unload (); 73 /* virtual */ bool navigateTo( const std::string url );
70 74 /* virtual */ bool updateMedia();
71 // transport controls 75 /* virtual */ unsigned char* getMediaData();
72 virtual BOOL stop (); 76 /* virtual */ int getTextureFormatPrimary() const;
73 virtual BOOL play (); 77 /* virtual */ int getTextureFormatType() const;
74 virtual BOOL loop ( S32 howMany ); 78 /* virtual */ int getTextureFormatInternal() const;
75 virtual BOOL pause (); 79 /* virtual */ bool setVolume( float volume );
76 virtual BOOL seek ( F64 time ); 80
77 81 bool stop();
78 // audio levels 82 bool play();
79 virtual BOOL setVolume ( F32 volumeIn ); 83 LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;};
80 virtual F32 getVolume ();
81
82 // status
83 virtual BOOL isIdle () const;
84 virtual BOOL isBuffering () const;
85 virtual BOOL isError () const;
86 virtual BOOL isLoaded () const;
87 virtual BOOL isStopped () const;
88 virtual BOOL isPaused () const;
89 virtual BOOL isPlaying () const;
90 virtual BOOL isLooping () const;
91 virtual F64 getTime () const;
92
93 // media data
94 virtual S32 updateMedia ();
95 virtual void setAutoScaled ( BOOL autoScaledIn );
96 virtual U8* getMediaData ();
97 virtual F64 getMediaDuration () const;
98
99 // class-specific
100 GMainLoop *getPump() {return mPump;};
101 typedef enum { ModeNone, ModeIdle, ModeError, ModeBuffering, ModeStopped, ModePaused, ModePlaying, ModeLooping } llGstMode;
102 llGstMode getCurrentMode() {return currentMode;};
103 void setCurrentMode(llGstMode mode) {currentMode = mode;};
104 84
105 private: 85 private:
106 // misc 86 // misc
107 U8* mediaData; 87 bool unload();
108 BOOL ownBuffer; 88 bool pause();
109 BOOL autoScaled; 89 unsigned char* mediaData;
110 F32 mVolume; 90 int mMediaRowbytes;
111 91
112 llGstMode currentMode; 92 int mTextureFormatPrimary;
93 int mTextureFormatType;
113 94
114 // GStreamer-specific 95 // GStreamer-specific
115 GMainLoop *mPump; // event pump for this media 96 GMainLoop *mPump; // event pump for this media
@@ -120,9 +101,29 @@ class LLMediaImplGStreamer:
120#endif // LL_GST_SOUNDSINK 101#endif // LL_GST_SOUNDSINK
121}; 102};
122 103
123// called during shutdown when no instances may exist 104class LLMediaImplGStreamerMaker : public LLMediaImplMaker
124void UnloadGStreamer(); 105{
106public:
107 LLMediaImplGStreamerMaker();
108 LLMediaImplGStreamer* create()
109 {
110 return new LLMediaImplGStreamer();
111 }
112};
125 113
114/////////////////////////////////////////////////////////////////////////
115// Debug/Info/Warning macros.
116#define STDERRMSG(...) do{\
117 fprintf(stderr, "%s:%d: ", __FUNCTION__, __LINE__);\
118 fprintf(stderr, __VA_ARGS__);\
119 fputc('\n',stderr);\
120 }while(0)
121#define NULLMSG(...) do{}while(0)
122
123#define DEBUGMSG NULLMSG
124#define INFOMSG STDERRMSG
125#define WARNMSG STDERRMSG
126/////////////////////////////////////////////////////////////////////////
126 127
127#endif // LL_GSTREAMER_ENABLED 128#endif // LL_GSTREAMER_ENABLED
128 129