aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaimplgstreamer.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer.h164
1 files changed, 0 insertions, 164 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer.h b/linden/indra/llmedia/llmediaimplgstreamer.h
deleted file mode 100644
index 8d2e756..0000000
--- a/linden/indra/llmedia/llmediaimplgstreamer.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/**
2 * @file llmediaimplgstreamer.h
3 * @author Tofu Linden
4 * @brief implementation that supports media playback via GStreamer.
5 *
6 * $LicenseInfo:firstyear=2007&license=viewergpl$
7 *
8 * Copyright (c) 2007-2009, Linden Research, Inc.
9 *
10 * Second Life Viewer Source Code
11 * The source code in this file ("Source Code") is provided by Linden Lab
12 * to you under the terms of the GNU General Public License, version 2.0
13 * ("GPL"), unless you have obtained a separate licensing agreement
14 * ("Other License"), formally executed by you and Linden Lab. Terms of
15 * the GPL can be found in doc/GPL-license.txt in this distribution, or
16 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
17 *
18 * There are special exceptions to the terms and conditions of the GPL as
19 * it is applied to this Source Code. View the full text of the exception
20 * in the file doc/FLOSS-exception.txt in this software distribution, or
21 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33// header guard
34#ifndef llmediaimplgstreamer_h
35#define llmediaimplgstreamer_h
36
37#include "llmediaimplcommon.h"
38#include "llmediaimplfactory.h"
39
40///#if LL_GSTREAMER_ENABLED
41
42extern "C" {
43#include <gst/gst.h>
44}
45
46#include <stdio.h>
47#include "apr_pools.h"
48#include "apr_dso.h"
49
50
51#include "llmediaimplgstreamervidplug.h"
52#include "llgstplaythread.h"
53
54class LLMediaManagerData;
55class LLMediaImplMaker;
56
57///////////////////////////////////////////////////////////////////////////
58class LLMediaImplGStreamer:
59 public LLMediaImplCommon
60{
61 friend class LLGstPlayThread;
62
63 public:
64 LLMediaImplGStreamer ();
65 virtual ~LLMediaImplGStreamer ();
66
67 ////////////////////////////////////////////////////////
68 // implementation of the media public interface
69
70 static bool startup( LLMediaManagerData* init_data );
71 static bool closedown();
72
73 // Sets GST_PLUGIN_PATH env var for GStreamer.
74 static void set_gst_plugin_path();
75
76 /* virtual */ bool setDebugLevel( LLMediaBase::EDebugLevel level );
77
78 // Function given to GStreamer for handling debug messages
79 static void gstreamer_log(GstDebugCategory *category,
80 GstDebugLevel level,
81 const gchar *file,
82 const gchar *function,
83 gint line,
84 GObject *object,
85 GstDebugMessage *message,
86 gpointer data)
87#if __GNUC__
88 // recommended by the gstreamer docs
89 G_GNUC_NO_INSTRUMENT
90#endif
91 ;
92
93 /* virtual */ std::string getVersion();
94 /* virtual */ bool navigateTo( const std::string url );
95 /* virtual */ bool updateMedia();
96 /* virtual */ unsigned char* getMediaData();
97 /* virtual */ int getTextureFormatPrimary() const;
98 /* virtual */ int getTextureFormatType() const;
99 /* virtual */ int getTextureFormatInternal() const;
100 /* virtual */ bool seek( double time );
101 /* virtual */ bool setVolume( float volume );
102
103 LLMediaEmitter< LLMediaObserver > getEventEmitter() const {return mEventEmitter;};
104
105 protected:
106
107 void startPlay();
108
109
110 private:
111
112 // misc
113 bool unload();
114 bool pause();
115 bool stop();
116 bool play();
117
118 static gboolean bus_callback (GstBus *bus,
119 GstMessage *message,
120 gpointer data);
121
122 unsigned char* mediaData;
123 int mMediaRowbytes;
124 int mTextureFormatPrimary;
125 int mTextureFormatType;
126
127 // GStreamer-specific
128 GMainLoop *mPump; // event pump for this media
129 GstElement *mPlaybin;
130 GstSLVideo *mVideoSink;
131 std::string mLastTitle;
132 GstState mState;
133 GstState getState() const { return mState; }
134
135 LLGstPlayThread *mPlayThread;
136};
137
138class LLMediaImplGStreamerMaker : public LLMediaImplMaker
139{
140 public:
141 LLMediaImplGStreamerMaker();
142 LLMediaImplGStreamer* create()
143 {
144 return new LLMediaImplGStreamer();
145 }
146};
147
148/////////////////////////////////////////////////////////////////////////
149// Debug/Info/Warning macros.
150#define STDERRMSG(...) do{\
151 fprintf(stderr, "%s:%d: ", __FUNCTION__, __LINE__);\
152 fprintf(stderr, __VA_ARGS__);\
153 fputc('\n',stderr);\
154 }while(0)
155#define NULLMSG(...) do{}while(0)
156
157#define DEBUGMSG NULLMSG
158#define INFOMSG STDERRMSG
159#define WARNMSG STDERRMSG
160/////////////////////////////////////////////////////////////////////////
161
162///#endif // LL_GSTREAMER_ENABLED
163
164#endif // llmediaimplgstreamer_h