/usr/share/pyshared/insanity/gstutils.py is in python-insanity 0.0+git20110920.4750a8e8-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | # GStreamer QA system
#
# gstutils.py
#
# Copyright (c) 2008, Edward Hervey <bilboed@bilboed.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
"""
Miscellaneous utility functions and classes related to testing GStreamer
"""
import os.path
import string
def get_gstreamer_env_variables(mainpath=None, gstcorepath=None, gstbasepath=None,
gstgoodpath=None, gstbadpath=None, gstuglypath=None,
gstffmpegpath=None, gstpythonpath=None,
gnonlinpath=None):
"""
Returns a dictionnary of environment variables that will allow using the
specified *uninstalled* gstreamer modules.
If mainpath is specified, then all gstreamer modules are expected to be located
within that path (ex : $mainpath/gstreamer/, $mainpath/gst-python/, ...).
If not-specified, only the specified paths will be filled. This can be useful
when mixing releases and development modules.
All the resulting environment variables *should* be pre-pended to the existing
ones.
"""
res = {}
ldlibs = []
ppath = []
if mainpath:
gstcorepath = os.path.join(mainpath, "gstreamer")
gstbasepath = os.path.join(mainpath, "gst-plugins-base")
gstgoodpath = os.path.join(mainpath, "gst-plugins-good")
gstbadpath = os.path.join(mainpath, "gst-plugins-bad")
gstuglypath = os.path.join(mainpath, "gst-plugins-ugly")
gstffmpegpath = os.path.join(mainpath, "gst-ffmpeg")
gstpythonpath = os.path.join(mainpath, "gst-python")
gnonlinpath = os.path.join(mainpath, "gnonlin")
# libraries
if gstbadpath:
ldlibs.append(os.path.join(gstbadpath, "gst-libs/gst/app/.libs"))
if gstbasepath:
for i in ["audio", "cdda", "fft", "interfaces", "pbutils", "netbuffer",
"riff", "rtp", "rtsp", "sdp", "tag", "utils", "video"]:
ldlibs.append(os.path.join(gstbasepath, "gst-libs/gst/%s/.libs" % i))
if gstcorepath:
for i in ["base", "net", "check", "controller", "dataprotocol"]:
ldlibs.append(os.path.join(gstcorepath, "libs/gst/%s/.libs" % i ))
ldlibs.append(os.path.join(gstcorepath, "gst/.libs"))
# python stuff
if gstpythonpath:
res["PYTHONPATH"] = gstpythonpath
# and finally the plugin paths
if gstcorepath:
ppath.append(gstcorepath)
if gstbasepath:
ppath.append(gstbasepath)
if gstgoodpath:
ppath.append(gstgoodpath)
if gstbadpath:
ppath.append(gstbadpath)
if gstuglypath:
ppath.append(gstuglypath)
if gstffmpegpath:
ppath.append(gstffmpegpath)
if gnonlinpath:
ppath.append(gnonlinpath)
# convert everything to strings
res["LD_LIBRARY_PATH"] = string.join(ldlibs, ":")
res["DYLD_LIBRARY_PATH"] = string.join(ldlibs, ":")
res["GST_PLUGIN_PATH"] = string.join(ppath, ":")
return res
|