aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llmedia/llmediaimplgstreamer_syms.cpp')
-rw-r--r--linden/indra/llmedia/llmediaimplgstreamer_syms.cpp198
1 files changed, 0 insertions, 198 deletions
diff --git a/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp b/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp
deleted file mode 100644
index 2f6d09c..0000000
--- a/linden/indra/llmedia/llmediaimplgstreamer_syms.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
1/**
2 * @file llmediaimplgstreamer_syms.cpp
3 * @brief dynamic GStreamer symbol-grabbing code
4 *
5 * $LicenseInfo:firstyear=2007&license=viewergpl$
6 *
7 * Copyright (c) 2007-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32///#if LL_GSTREAMER_ENABLED
33
34#if LL_WINDOWS
35 // GStreamer 0.10.22 - gstutils.h - conversion from 'guint64' to 'guint8'.
36 // This was an intentional change to make GStreamer more threadsafe, and
37 // is okay. Delete this bit if GStreamer ever gets more VS-friendly -- McCabe
38 #pragma warning(disable : 4244)
39#endif
40
41extern "C" {
42#include <gst/gst.h>
43
44#include "apr_pools.h"
45#include "apr_dso.h"
46}
47
48#include "llmediaimplgstreamer.h"
49
50#if LL_WINDOWS
51 #pragma warning(default : 4244)
52#endif
53
54#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) RTN (*ll##GSTSYM)(__VA_ARGS__) = NULL
55#include "llmediaimplgstreamer_syms_raw.inc"
56#include "llmediaimplgstreamer_syms_rawa.inc"
57#include "llmediaimplgstreamer_syms_rawv.inc"
58#undef LL_GST_SYM
59
60
61static bool sSymsGrabbed = false;
62static apr_pool_t *sSymGSTDSOMemoryPool = NULL;
63static apr_dso_handle_t *sSymGSTDSOHandleG = NULL;
64static apr_dso_handle_t *sSymGSTDSOHandleV = NULL;
65static apr_dso_handle_t *sSymGSTDSOHandleA = NULL;
66
67
68bool grab_gst_syms(std::string gst_dso_name,
69 std::string gst_dso_name_vid,
70 std::string gst_dso_name_aud)
71{
72 if (sSymsGrabbed)
73 {
74 // already have grabbed good syms
75 return TRUE;
76 }
77
78 bool sym_error = false;
79 bool rtn = false;
80 apr_status_t rv;
81 apr_dso_handle_t *sSymGSTDSOHandle = NULL;
82
83#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll##GSTSYM, sSymGSTDSOHandle, #GSTSYM); if (rv != APR_SUCCESS) {INFOMSG("Failed to grab symbol: %s", #GSTSYM); if (REQ) sym_error = true;} else DEBUGMSG("grabbed symbol: %s from %p", #GSTSYM, (void*)ll##GSTSYM);}while(0)
84
85 //attempt to load the shared libraries
86 apr_pool_create(&sSymGSTDSOMemoryPool, NULL);
87
88 if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle,
89 gst_dso_name.c_str(),
90 sSymGSTDSOMemoryPool) ))
91 {
92 INFOMSG("Found DSO: %s", gst_dso_name.c_str());
93#include "llmediaimplgstreamer_syms_raw.inc"
94
95 if ( sSymGSTDSOHandle )
96 {
97 sSymGSTDSOHandleG = sSymGSTDSOHandle;
98 sSymGSTDSOHandle = NULL;
99 }
100
101 if ( APR_SUCCESS == (rv = apr_dso_load(&sSymGSTDSOHandle,
102 gst_dso_name_aud.c_str(),
103 sSymGSTDSOMemoryPool) ))
104 {
105 INFOMSG("Found DSO: %s", gst_dso_name_aud.c_str());
106#include "llmediaimplgstreamer_syms_rawa.inc"
107
108 if ( sSymGSTDSOHandle )
109 {
110 sSymGSTDSOHandleA = sSymGSTDSOHandle;
111 sSymGSTDSOHandle = NULL;
112 }
113
114 if ( APR_SUCCESS ==
115 (rv = apr_dso_load(&sSymGSTDSOHandle,
116 gst_dso_name_vid.c_str(),
117 sSymGSTDSOMemoryPool) ))
118 {
119 INFOMSG("Found DSO: %s", gst_dso_name_vid.c_str());
120#include "llmediaimplgstreamer_syms_rawv.inc"
121 }
122 else
123 {
124 INFOMSG("Couldn't load DSO: %s", gst_dso_name_vid.c_str());
125 rtn = false; // failure
126 }
127 }
128 else
129 {
130 INFOMSG("Couldn't load DSO: %s", gst_dso_name_aud.c_str());
131 rtn = false; // failure
132 }
133
134 rtn = !sym_error;
135 }
136 else
137 {
138 INFOMSG("Couldn't load DSO: %s", gst_dso_name.c_str());
139 rtn = false; // failure
140 }
141
142 if (sym_error)
143 {
144 WARNMSG("Failed to find necessary symbols in GStreamer libraries.");
145 }
146
147 if ( sSymGSTDSOHandle )
148 {
149 sSymGSTDSOHandleV = sSymGSTDSOHandle;
150 sSymGSTDSOHandle = NULL;
151 }
152#undef LL_GST_SYM
153
154 sSymsGrabbed = !!rtn;
155 return rtn;
156}
157
158
159void ungrab_gst_syms()
160{
161 // should be safe to call regardless of whether we've
162 // actually grabbed syms.
163
164 if ( sSymGSTDSOHandleG )
165 {
166 apr_dso_unload(sSymGSTDSOHandleG);
167 sSymGSTDSOHandleG = NULL;
168 }
169
170 if ( sSymGSTDSOHandleA )
171 {
172 apr_dso_unload(sSymGSTDSOHandleA);
173 sSymGSTDSOHandleA = NULL;
174 }
175
176 if ( sSymGSTDSOHandleV )
177 {
178 apr_dso_unload(sSymGSTDSOHandleV);
179 sSymGSTDSOHandleV = NULL;
180 }
181
182 if ( sSymGSTDSOMemoryPool )
183 {
184 apr_pool_destroy(sSymGSTDSOMemoryPool);
185 sSymGSTDSOMemoryPool = NULL;
186 }
187
188 // NULL-out all of the symbols we'd grabbed
189#define LL_GST_SYM(REQ, GSTSYM, RTN, ...) do{ll##GSTSYM = NULL;}while(0)
190#include "llmediaimplgstreamer_syms_raw.inc"
191#include "llmediaimplgstreamer_syms_rawa.inc"
192#include "llmediaimplgstreamer_syms_rawv.inc"
193#undef LL_GST_SYM
194
195 sSymsGrabbed = false;
196}
197
198///#endif // LL_GSTREAMER_ENABLED