summaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2013-04-16 10:51:35 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-04-22 08:35:29 +0200
commit5586da3302015e50372cd2e444bf247f988661d7 (patch)
tree5ab65cb8ad921cb7482b34a1f53ef14c8326fc36 /recipes
parent7a0b20f74adb69693f9f2812516061d1a3a7dff3 (diff)
gstreamer-1.0: Add Android specific 1.0 changes
Diffstat (limited to 'recipes')
-rw-r--r--recipes/custom.py30
-rw-r--r--recipes/gst-android-1.0.recipe37
-rw-r--r--recipes/gst-libav-1.0-static.recipe9
-rw-r--r--recipes/gst-plugins-bad-1.0-static.recipe1
-rw-r--r--recipes/gst-plugins-bad-1.0.recipe1
5 files changed, 74 insertions, 4 deletions
diff --git a/recipes/custom.py b/recipes/custom.py
index 514c8765..1d056ff4 100644
--- a/recipes/custom.py
+++ b/recipes/custom.py
@@ -79,7 +79,7 @@ class GStreamerStatic(recipe.Recipe):
os.path.join(self.config.prefix, f))
-def list_gstreamer_plugins_by_category(config):
+def list_gstreamer_plugins_by_category(config):
cookbook = CookBook(config)
# For plugins named differently
replacements = {'decodebin2': 'uridecodebin', 'playbin': 'playback',
@@ -106,3 +106,31 @@ def list_gstreamer_plugins_by_category(config):
continue
plugins[cat_name].append(e[25:-8])
return plugins, replacements
+
+def list_gstreamer_1_0_plugins_by_category(config):
+ cookbook = CookBook(config)
+ # For plugins named differently
+ replacements = {'decodebin': 'playback', 'playbin': 'playback',
+ 'uridecodebin': 'playback', 'sdpelem': 'sdp',
+ 'encodebin': 'encoding', 'souphttpsrc': 'soup',
+ 'siren': 'gstsiren', 'scaletempoplugin' : 'scaletempo',
+ 'rmdemux': 'realmedia', 'camerabin2': 'camerabin'}
+ plugins = defaultdict(list)
+ for r in ['gstreamer-1.0', 'gst-plugins-base-1.0', 'gst-plugins-good-1.0',
+ 'gst-plugins-bad-1.0', 'gst-plugins-ugly-1.0', 'gst-libav-1.0']:
+ r = cookbook.get_recipe(r)
+ for attr_name in dir(r):
+ if attr_name.startswith('files_plugins_'):
+ cat_name = attr_name[len('files_plugins_'):]
+ plugins_list = getattr(r, attr_name)
+ elif attr_name.startswith('platform_files_plugins_'):
+ cat_name = attr_name[len('platform_files_plugins_'):]
+ plugins_dict = getattr(r, attr_name)
+ plugins_list = plugins_dict.get(config.target_platform, [])
+ else:
+ continue
+ for e in plugins_list:
+ if not e.startswith('lib/gstreamer-'):
+ continue
+ plugins[cat_name].append(e[24:-8])
+ return plugins, replacements
diff --git a/recipes/gst-android-1.0.recipe b/recipes/gst-android-1.0.recipe
new file mode 100644
index 00000000..779849a9
--- /dev/null
+++ b/recipes/gst-android-1.0.recipe
@@ -0,0 +1,37 @@
+# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
+from cerbero.utils import shell
+from custom import list_gstreamer_1_0_plugins_by_category
+
+class Recipe(recipe.Recipe):
+ name = 'gst-android-1.0'
+ version = '0.1'
+ licenses = [License.LGPLv2_1]
+ stype = SourceType.CUSTOM
+ btype = BuildType.CUSTOM
+
+ files_devel = [
+ 'share/gst-android/ndk-build-1.0/gstreamer_android.c.in',
+ 'share/gst-android/ndk-build-1.0/gstreamer.mk',
+ 'share/gst-android/ndk-build-1.0/gstreamer_prebuilt.mk',
+ 'share/gst-android/ndk-build-1.0/tools.mk',
+ 'share/gst-android/ndk-build-1.0/plugins.mk',
+ 'share/gst-android/ndk-build-1.0/GStreamer.java',
+ 'share/gst-android/ndk-build-1.0/tools/windows',
+ 'share/gst-android/ndk-build-1.0/fontconfig',
+ ]
+
+ def install(self):
+ ndk_build_dir = os.path.join(self.config.prefix, 'share', 'gst-android', 'ndk-build-1.0')
+ shell.copy_dir(os.path.join(self.config.data_dir, 'ndk-build-1.0'),
+ ndk_build_dir)
+
+ plugins, replacements = list_gstreamer_1_0_plugins_by_category(self.config)
+ f = open(os.path.join(ndk_build_dir, 'plugins.mk'), 'w')
+ for c, p in plugins.iteritems():
+ p = ' '.join(p)
+ for k,v in replacements.iteritems():
+ p = p.replace(k, v)
+ f.write('GSTREAMER_PLUGINS_%s := %s\n' % (c.upper(), p))
+ f.close()
+
+
diff --git a/recipes/gst-libav-1.0-static.recipe b/recipes/gst-libav-1.0-static.recipe
index f5dd22e7..011828d7 100644
--- a/recipes/gst-libav-1.0-static.recipe
+++ b/recipes/gst-libav-1.0-static.recipe
@@ -31,7 +31,7 @@ class Recipe(custom.GStreamerStatic):
self.configure_options += ' ASFLAGS="%s"' % asflags
super(Recipe, self).prepare()
- for f in ['libavcodec', 'libavformat', 'libavutil']:
+ for f in ['libavcodec', 'libavformat', 'libavutil', 'libswscale']:
for ext in ['.a', '.la']:
path = os.path.join('lib', f + ext)
self.files_plugins_codecs_restricted_devel.append(path)
@@ -56,7 +56,7 @@ class Recipe(custom.GStreamerStatic):
shell.replace(os.path.join(libav_path, 'config.h'), replacements)
def post_install(self):
- for n in ['avutil', 'avcodec', 'avformat']:
+ for n in ['avutil', 'avcodec', 'avformat', 'swscale']:
name = 'lib%s' % n
lib = '%s.a' % name
path = os.path.join(self.build_dir, 'gst-libs', 'ext', 'libav',
@@ -67,6 +67,8 @@ class Recipe(custom.GStreamerStatic):
deps += ['avutil']
if n == 'avformat':
deps += ['avutil', 'avcodec']
+ if n == 'swscale':
+ deps += ['avutil']
libtool_la = LibtoolLibrary(n, None, None, None, self.config.libdir,
self.config.target_platform, deps)
libtool_la.change_value ('dlname', '')
@@ -78,5 +80,6 @@ class Recipe(custom.GStreamerStatic):
shell.replace (gstlibavlib,
{'-lavformat': os.path.join(self.config.libdir, 'libavformat.la'),
'-lavcodec': os.path.join(self.config.libdir, 'libavcodec.la'),
- '-lavutil': os.path.join(self.config.libdir, 'libavutil.la')})
+ '-lavutil': os.path.join(self.config.libdir, 'libavutil.la'),
+ '-lswscale': os.path.join(self.config.libdir, 'libswscale.la')})
diff --git a/recipes/gst-plugins-bad-1.0-static.recipe b/recipes/gst-plugins-bad-1.0-static.recipe
index c0e885a2..f63c64d6 100644
--- a/recipes/gst-plugins-bad-1.0-static.recipe
+++ b/recipes/gst-plugins-bad-1.0-static.recipe
@@ -136,6 +136,7 @@ class Recipe(custom.GStreamerStatic):
if self.config.target_platform == Platform.ANDROID:
for d in ['libdvdnav']:
self.deps.remove(d)
+ self.files_plugins_dvd_devel.remove('libgstresindvd')
if self.config.variants.nodebug:
self.configure_options += ' --disable-gst-debug'
diff --git a/recipes/gst-plugins-bad-1.0.recipe b/recipes/gst-plugins-bad-1.0.recipe
index 8651a96a..0e3cc836 100644
--- a/recipes/gst-plugins-bad-1.0.recipe
+++ b/recipes/gst-plugins-bad-1.0.recipe
@@ -142,6 +142,7 @@ class Recipe(recipe.Recipe):
if self.config.target_platform == Platform.ANDROID:
for d in ['libdvdnav']:
self.deps.remove(d)
+ self.files_plugins_dvd.remove('lib/gstreamer-1.0/libgstresindvd%(mext)s')
if self.config.variants.nodebug:
self.configure_options += ' --disable-gst-debug'