Commit 2b32341a authored by Edward Hervey's avatar Edward Hervey 🤘

Wrap gst-plugins-base's audio helper library.

Original commit message from CVS:
* configure.ac:
* gst/Makefile.am:
* gst/audio.defs:
* gst/audio.override:
* gst/audiomodule.c: (initaudio):
Wrap gst-plugins-base's audio helper library.
Partially fixes #565762
parent e9d605a7
2008-12-31 Edward Hervey <edward.hervey@collabora.co.uk>
* configure.ac:
* gst/Makefile.am:
* gst/audio.defs:
* gst/audio.override:
* gst/audiomodule.c: (initaudio):
Wrap gst-plugins-base's audio helper library.
Partially fixes #565762
2008-12-30 Edward Hervey <edward.hervey@collabora.co.uk>
* configure.ac:
......
......@@ -182,6 +182,11 @@ then
IGNORE_GST_PB_0_10_18=""
fi
if test $GST_PB_MINOR_VERSION -ge "22"
then
AC_DEFINE_UNQUOTED(HAVE_GST_AUDIO, 1, [We can use the gst-audio library])
fi
else
IGNORE_GST_0_10_13=""
IGNORE_GST_0_10_14=""
......@@ -195,6 +200,7 @@ else
IGNORE_GST_PB_0_10_16=""
IGNORE_GST_PB_0_10_18=""
AC_DEFINE_UNQUOTED(HAVE_PLUGINS_INSTALL, 1, [We can use the plugins-install methods])
AC_DEFINE_UNQUOTED(HAVE_GST_AUDIO, 1, [We can use the gst-audio library])
fi
AC_DEFINE_UNQUOTED(HAVE_VIDEO_ORIENTATION_INTERFACE, 1, [We can use the videoorientation interface])
AC_SUBST(IGNORE_GST_0_10_13)
......@@ -210,6 +216,7 @@ AC_SUBST(IGNORE_GST_PB_0_10_16)
AC_SUBST(IGNORE_GST_PB_0_10_18)
AC_SUBST(HAVE_VIDEO_ORIENTATION)
AC_SUBST(HAVE_PLUGINS_INSTALL)
AM_CONDITIONAL(HAVE_GST_AUDIO, $HAVE_GST_AUDIO)
dnl check for gstreamer-base; uninstalled is selected preferentially
PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
......
......@@ -105,6 +105,28 @@ CLEANFILES += pbutils.c
EXTRA_DIST += $(PBUTILS_DEFS) $(PBUTILS_OVERRIDES)
pbutils.c: $(PBUTILS_DEFS) $(PBUTILS_OVERRIDES) $(GEN_FILES)
# GStreamer audio bindings
AUDIO_OVERRIDES = audio.override
AUDIO_DEFS = audio.defs
CLEANFILES += audio.c
EXTRA_DIST += $(AUDIO_DEFS) $(AUDIO_OVERRIDES)
defs_DATA += $(AUDIO_DEFS)
GEN_FILES += $(AUDIO_DEFS)
if HAVE_GST_AUDIO
audio_lib = audio.la
pygstexec_LTLIBRARIES += $(audio_lib)
audio_la_CFLAGS = $(common_cflags) $(GST_PLUGINS_BASE_CFLAGS)
audio_la_LIBADD = $(common_libadd) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-0.10
audio_la_LDFLAGS = $(common_ldflags) \
-export-symbols-regex "^(initaudio|_PyGObject_API).*" $(GST_PLUGINS_BASE_LIBS)
audio_la_SOURCES = audiomodule.c gst-argtypes.c pygstminiobject.c
nodist_audio_la_SOURCES = audio.c
audio.c: $(AUDIO_DEFS) $(AUDIO_OVERRIDES) $(GEN_FILES)
endif
.defs.c:
($(PYTHON) $(top_srcdir)/codegen/codegen.py \
--load-types $(srcdir)/arg-types.py \
......
This diff is collapsed.
/* -*- Mode: C; c-basic-offset: 4 -*- */
/* gst-python
* Copyright (C) 2008 <edward.hervey@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
%%
headers
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#define NO_IMPORT_PYGOBJECT
#include "common.h"
#include <gst/gst.h>
#include <gst/audio/audio.h>
#include <gst/audio/gstaudioclock.h>
#include <gst/audio/gstaudiofilter.h>
#include <gst/audio/gstaudiosink.h>
#include <gst/audio/gstaudiosrc.h>
#include <gst/audio/gstbaseaudiosink.h>
#include <gst/audio/gstbaseaudiosrc.h>
#include <gst/audio/multichannel.h>
#include "pygstminiobject.h"
GST_DEBUG_CATEGORY_EXTERN (pygst_debug);
#define GST_CAT_DEFAULT pygst_debug
/* Boonky define that allows for backwards compatibility with Python 2.4 */
#if PY_VERSION_HEX < 0x02050000
#define Py_ssize_t int
#endif
%%
modulename gst.audio
%%
import gobject.GObject as PyGObject_Type
import gst.Object as PyGstObject_Type
import gst.Structure as PyGstStructure_Type
import gst.Element as PyGstElement_Type
import gst.Pad as PyGstPad_Type
import gst.Buffer as PyGstBuffer_Type
import gst.Message as PyGstMessage_Type
import gst.SystemClock as PyGstSystemClock_Type
import gst.BaseTransform as PyGstBaseTransform_Type
import gst.BaseSink as PyGstBaseSink_Type
%%
include
gstversion.override
%%
ignore-glob
_*
*init
*_free
*_get_type
/* -*- Mode: C; c-basic-offset: 4 -*- */
/* gst-python
* Copyright (C) 2008 Edward Hervey <edward.hervey@collabora.co.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.h>
#include <gst/gst.h>
#include <gst/audio/audio.h>
#include <gst/audio/gstbaseaudiosink.h>
#include <gst/audio/gstbaseaudiosrc.h>
void pyaudio_register_classes (PyObject *d);
void pyaudio_add_constants(PyObject *module, const gchar *strip_prefix);
extern PyMethodDef pyaudio_functions[];
GST_DEBUG_CATEGORY (pygst_debug); /* for python code */
DL_EXPORT(void)
initaudio (void)
{
PyObject *m, *d;
init_pygobject ();
m = Py_InitModule ("audio", pyaudio_functions);
d = PyModule_GetDict (m);
pyaudio_register_classes (d);
pyaudio_add_constants (m, "GST_");
if (PyErr_Occurred ()) {
PyErr_Print ();
Py_FatalError ("can't initialize module gst.audio");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment