bilboed gst-python: gst-python/ gst-python/gst/

[email protected] Wed, 31 Dec 2008 04:01:16 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-python
Changes by:     bilboed
Date:           Wed Dec 31 2008  12:01:16 UTC

Log message:
* 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

Modified files:
    .               : ChangeLog configure.ac
    gst             : Makefile.am
Added files:
    gst             : audio.defs audio.override audiomodule.c

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/ChangeLog.diff?r1=1.703&r2=1.704
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/configure.ac.diff?r1=1.177&r2=1.178
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/Makefile.am.diff?r1=1.82&r2=1.83
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/audio.defs?rev=1.1&content-type=text/vnd.viewcvs-markup
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/audio.override?rev=1.1&content-type=text/vnd.viewcvs-markup
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-python/gst/audiomodule.c?rev=1.1&content-type=text/vnd.viewcvs-markup

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-python/ChangeLog,v
retrieving revision 1.703
retrieving revision 1.704
diff -u -d -r1.703 -r1.704
--- ChangeLog	30 Dec 2008 19:20:30 -0000	1.703
+++ ChangeLog	31 Dec 2008 12:01:01 -0000	1.704
@@ -1,3 +1,13 @@
+2008-12-31  Edward Hervey  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* configure.ac:
Index: configure.ac
RCS file: /cvs/gstreamer/gst-python/configure.ac,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- configure.ac	30 Dec 2008 19:20:30 -0000	1.177
+++ configure.ac	31 Dec 2008 12:01:01 -0000	1.178
@@ -182,6 +182,11 @@
     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 @@
   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_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,
Index: Makefile.am
RCS file: /cvs/gstreamer/gst-python/gst/Makefile.am,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- Makefile.am	30 Dec 2008 19:20:30 -0000	1.82
+++ Makefile.am	31 Dec 2008 12:01:02 -0000	1.83
@@ -105,6 +105,28 @@
 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 \
--- NEW FILE: audio.defs ---
;; -*- scheme -*-
; object definitions ...
(define-object AudioClock
  (in-module "Gst")
  (parent "GstSystemClock")
  (c-name "GstAudioClock")
  (gtype-id "GST_TYPE_AUDIO_CLOCK")
)

(define-object AudioFilter
  (parent "GstBaseTransform")
  (c-name "GstAudioFilter")
  (gtype-id "GST_TYPE_AUDIO_FILTER")
(define-object BaseAudioSink
  (parent "GstBaseSink")
  (c-name "GstBaseAudioSink")
  (gtype-id "GST_TYPE_BASE_AUDIO_SINK")
(define-object AudioSink
  (parent "GstBaseAudioSink")
  (c-name "GstAudioSink")
  (gtype-id "GST_TYPE_AUDIO_SINK")
;; (define-object BaseAudioSrc
;;   (in-module "Gst")
;;   (parent "GstPushSrc")
;;   (c-name "GstBaseAudioSrc")
;;   (gtype-id "GST_TYPE_BASE_AUDIO_SRC")
;; )
;; (define-object AudioSrc
;;   (parent "GstBaseAudioSrc")
;;   (c-name "GstAudioSrc")
;;   (gtype-id "GST_TYPE_AUDIO_SRC")
(define-object RingBuffer
  (parent "GstObject")
  (c-name "GstRingBuffer")
  (gtype-id "GST_TYPE_RING_BUFFER")
;; Enumerations and flags ...
(define-enum BaseAudioSinkSlaveMethod
  (c-name "GstBaseAudioSinkSlaveMethod")
  (gtype-id "GST_TYPE_BASE_AUDIO_SINK_SLAVE_METHOD")
  (values
    '("resample" "GST_BASE_AUDIO_SINK_SLAVE_RESAMPLE")
    '("skew" "GST_BASE_AUDIO_SINK_SLAVE_SKEW")
    '("none" "GST_BASE_AUDIO_SINK_SLAVE_NONE")
  )
(define-enum BaseAudioSrcSlaveMethod
  (c-name "GstBaseAudioSrcSlaveMethod")
  (gtype-id "GST_TYPE_BASE_AUDIO_SRC_SLAVE_METHOD")
    '("resample" "GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE")
    '("retimestamp" "GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP")
    '("skew" "GST_BASE_AUDIO_SRC_SLAVE_SKEW")
    '("none" "GST_BASE_AUDIO_SRC_SLAVE_NONE")
(define-enum RingBufferState
  (c-name "GstRingBufferState")
  (gtype-id "GST_TYPE_RING_BUFFER_STATE")
    '("stopped" "GST_RING_BUFFER_STATE_STOPPED")
    '("paused" "GST_RING_BUFFER_STATE_PAUSED")
    '("started" "GST_RING_BUFFER_STATE_STARTED")
(define-enum RingBufferSegState
  (c-name "GstRingBufferSegState")
  (gtype-id "GST_TYPE_RING_BUFFER_SEG_STATE")
    '("invalid" "GST_SEGSTATE_INVALID")
    '("empty" "GST_SEGSTATE_EMPTY")
    '("filled" "GST_SEGSTATE_FILLED")
    '("partial" "GST_SEGSTATE_PARTIAL")
(define-enum BufferFormatType
  (c-name "GstBufferFormatType")
  (gtype-id "GST_TYPE_BUFFER_FORMAT_TYPE")
    '("linear" "GST_BUFTYPE_LINEAR")
    '("float" "GST_BUFTYPE_FLOAT")
    '("mu-law" "GST_BUFTYPE_MU_LAW")
    '("a-law" "GST_BUFTYPE_A_LAW")
    '("ima-adpcm" "GST_BUFTYPE_IMA_ADPCM")
    '("mpeg" "GST_BUFTYPE_MPEG")
    '("gsm" "GST_BUFTYPE_GSM")
    '("iec958" "GST_BUFTYPE_IEC958")
    '("ac3" "GST_BUFTYPE_AC3")
    '("eac3" "GST_BUFTYPE_EAC3")
    '("dts" "GST_BUFTYPE_DTS")
(define-enum BufferFormat
  (c-name "GstBufferFormat")
  (gtype-id "GST_TYPE_BUFFER_FORMAT")
    '("unknown" "GST_UNKNOWN")
    '("s8" "GST_S8")
    '("u8" "GST_U8")
    '("s16-le" "GST_S16_LE")
    '("s16-be" "GST_S16_BE")
    '("u16-le" "GST_U16_LE")
    '("u16-be" "GST_U16_BE")
    '("s24-le" "GST_S24_LE")
    '("s24-be" "GST_S24_BE")
    '("u24-le" "GST_U24_LE")
    '("u24-be" "GST_U24_BE")
    '("s32-le" "GST_S32_LE")
    '("s32-be" "GST_S32_BE")
    '("u32-le" "GST_U32_LE")
    '("u32-be" "GST_U32_BE")
    '("s24-3le" "GST_S24_3LE")
    '("s24-3be" "GST_S24_3BE")
    '("u24-3le" "GST_U24_3LE")
    '("u24-3be" "GST_U24_3BE")
    '("s20-3le" "GST_S20_3LE")
    '("s20-3be" "GST_S20_3BE")
    '("u20-3le" "GST_U20_3LE")
    '("u20-3be" "GST_U20_3BE")
    '("s18-3le" "GST_S18_3LE")
    '("s18-3be" "GST_S18_3BE")
    '("u18-3le" "GST_U18_3LE")
    '("u18-3be" "GST_U18_3BE")
    '("float32-le" "GST_FLOAT32_LE")
    '("float32-be" "GST_FLOAT32_BE")
    '("float64-le" "GST_FLOAT64_LE")
    '("float64-be" "GST_FLOAT64_BE")
    '("mu-law" "GST_MU_LAW")
    '("a-law" "GST_A_LAW")
    '("ima-adpcm" "GST_IMA_ADPCM")
    '("mpeg" "GST_MPEG")
    '("gsm" "GST_GSM")
    '("iec958" "GST_IEC958")
    '("ac3" "GST_AC3")
    '("eac3" "GST_EAC3")
    '("dts" "GST_DTS")
(define-enum AudioChannelPosition
  (c-name "GstAudioChannelPosition")
  (gtype-id "GST_TYPE_AUDIO_CHANNEL_POSITION")
    '("invalid" "GST_AUDIO_CHANNEL_POSITION_INVALID")
    '("front-mono" "GST_AUDIO_CHANNEL_POSITION_FRONT_MONO")
    '("front-left" "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT")
    '("front-right" "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT")
    '("rear-center" "GST_AUDIO_CHANNEL_POSITION_REAR_CENTER")
    '("rear-left" "GST_AUDIO_CHANNEL_POSITION_REAR_LEFT")
    '("rear-right" "GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT")
    '("lfe" "GST_AUDIO_CHANNEL_POSITION_LFE")
    '("front-center" "GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER")
    '("front-left-of-center" "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER")
    '("front-right-of-center" "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER")
    '("side-left" "GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT")
    '("side-right" "GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT")
    '("none" "GST_AUDIO_CHANNEL_POSITION_NONE")
    '("num" "GST_AUDIO_CHANNEL_POSITION_NUM")
;; From audio.h
(define-function frame_byte_size
  (c-name "gst_audio_frame_byte_size")
  (return-type "int")
  (parameters
    '("GstPad*" "pad")
(define-function frame_length
  (c-name "gst_audio_frame_length")
  (return-type "long")
    '("GstBuffer*" "buf")
(define-function duration_from_pad_buffer
  (c-name "gst_audio_duration_from_pad_buffer")
  (return-type "GstClockTime")
(define-function is_buffer_framed
  (c-name "gst_audio_is_buffer_framed")
  (return-type "gboolean")
(define-function buffer_clip
  (c-name "gst_audio_buffer_clip")
  (return-type "GstBuffer*")
    '("GstBuffer*" "buffer")
    '("GstSegment*" "segment")
    '("gint" "rate")
    '("gint" "frame_size")
;; From gstaudioclock.h
(define-function gst_audio_clock_get_type
  (c-name "gst_audio_clock_get_type")
  (return-type "GType")
(define-function gst_audio_clock_new
  (c-name "gst_audio_clock_new")
  (is-constructor-of "GstAudioClock")
  (return-type "GstClock*")
    '("gchar*" "name")
    '("GstAudioClockGetTimeFunc" "func")
    '("gpointer" "user_data")
(define-method reset
  (of-object "GstAudioClock")
  (c-name "gst_audio_clock_reset")
  (return-type "none")
    '("GstClockTime" "time")
;; From gstaudiofilter.h
(define-function gst_audio_filter_get_type
  (c-name "gst_audio_filter_get_type")
(define-method add_pad_templates
  (of-object "GstAudioFilterClass")
  (c-name "gst_audio_filter_class_add_pad_templates")
    '("const-GstCaps*" "allowed_caps")
(define-virtual setup
  (of-object "GstAudioFilter")
   '("GstRingBufferSpec*" "format")
   )
;; From gstaudiosink.h
(define-function gst_audio_sink_get_type
  (c-name "gst_audio_sink_get_type")
(define-virtual open
  (of-object "GstAudioSink")
(define-virtual prepare
   '("GstRingBufferSpec*" "spec")
(define-virtual unprepare
(define-virtual close
(define-virtual write
  (return-type "guint")
   '("gpointer" "data")
   '("guint" "length")
(define-virtual delay
(define-virtual reset
;; From gstaudiosrc.h
(define-function gst_audio_src_get_type
  (c-name "gst_audio_src_get_type")
;; From gstbaseaudiosink.h
(define-function gst_base_audio_sink_get_type
  (c-name "gst_base_audio_sink_get_type")
(define-method create_ringbuffer
  (of-object "GstBaseAudioSink")
  (c-name "gst_base_audio_sink_create_ringbuffer")
  (return-type "GstRingBuffer*")
(define-virtual create_ringbuffer
(define-method set_provide_clock
  (c-name "gst_base_audio_sink_set_provide_clock")
    '("gboolean" "provide")
(define-method get_provide_clock
  (c-name "gst_base_audio_sink_get_provide_clock")
(define-method set_slave_method
  (c-name "gst_base_audio_sink_set_slave_method")
    '("GstBaseAudioSinkSlaveMethod" "method")
(define-method get_slave_method
  (c-name "gst_base_audio_sink_get_slave_method")
  (return-type "GstBaseAudioSinkSlaveMethod")
;; From gstbaseaudiosrc.h
(define-function gst_base_audio_src_get_type
  (c-name "gst_base_audio_src_get_type")
  (of-object "GstBaseAudioSrc")
  (c-name "gst_base_audio_src_create_ringbuffer")
  (c-name "gst_base_audio_src_set_provide_clock")
  (c-name "gst_base_audio_src_get_provide_clock")
  (c-name "gst_base_audio_src_set_slave_method")
    '("GstBaseAudioSrcSlaveMethod" "method")
  (c-name "gst_base_audio_src_get_slave_method")
  (return-type "GstBaseAudioSrcSlaveMethod")
;; From gstringbuffer.h
(define-function gst_ring_buffer_get_type
  (c-name "gst_ring_buffer_get_type")
(define-method set_callback
  (of-object "GstRingBuffer")
  (c-name "gst_ring_buffer_set_callback")
    '("GstRingBufferCallback" "cb")
(define-function ring_buffer_parse_caps
  (c-name "gst_ring_buffer_parse_caps")
    '("GstRingBufferSpec*" "spec")
    '("GstCaps*" "caps")
(define-function ring_buffer_debug_spec_caps
  (c-name "gst_ring_buffer_debug_spec_caps")
(define-function ring_buffer_debug_spec_buff
  (c-name "gst_ring_buffer_debug_spec_buff")
(define-method convert
  (c-name "gst_ring_buffer_convert")
    '("GstFormat" "src_fmt")
    '("gint64" "src_val")
    '("GstFormat" "dest_fmt")
    '("gint64*" "dest_val")
(define-method open_device
  (c-name "gst_ring_buffer_open_device")
(define-method close_device
  (c-name "gst_ring_buffer_close_device")
(define-method device_is_open
  (c-name "gst_ring_buffer_device_is_open")
(define-method acquire
  (c-name "gst_ring_buffer_acquire")
(define-method release
  (c-name "gst_ring_buffer_release")
(define-method is_acquired
  (c-name "gst_ring_buffer_is_acquired")
(define-method activate
  (c-name "gst_ring_buffer_activate")
    '("gboolean" "active")
(define-method is_active
  (c-name "gst_ring_buffer_is_active")
(define-method set_flushing
  (c-name "gst_ring_buffer_set_flushing")
    '("gboolean" "flushing")
(define-method start
  (c-name "gst_ring_buffer_start")
(define-method pause
  (c-name "gst_ring_buffer_pause")
(define-method stop
  (c-name "gst_ring_buffer_stop")
(define-method delay
  (c-name "gst_ring_buffer_delay")
(define-method samples_done
  (c-name "gst_ring_buffer_samples_done")
  (return-type "guint64")
(define-method set_sample
  (c-name "gst_ring_buffer_set_sample")
    '("guint64" "sample")
(define-method clear_all
  (c-name "gst_ring_buffer_clear_all")
(define-method commit
  (c-name "gst_ring_buffer_commit")
    '("guchar*" "data")
    '("guint" "len")
(define-method commit_full
  (c-name "gst_ring_buffer_commit_full")
    '("guint64*" "sample")
    '("gint" "in_samples")
    '("gint" "out_samples")
    '("gint*" "accum")
(define-method read
  (c-name "gst_ring_buffer_read")
(define-method prepare_read
  (c-name "gst_ring_buffer_prepare_read")
    '("gint*" "segment")
    '("guint8**" "readptr")
    '("gint*" "len")
(define-method clear
  (c-name "gst_ring_buffer_clear")
    '("gint" "segment")
(define-method advance
  (c-name "gst_ring_buffer_advance")
    '("guint" "advance")
(define-method may_start
  (c-name "gst_ring_buffer_may_start")
    '("gboolean" "allowed")
(define-virtual open_device
(define-virtual acquire
(define-virtual release
(define-virtual close_device
(define-virtual start
(define-virtual pause
(define-virtual resume
(define-virtual stop
(define-virtual activate
   '("gboolean" "active")
;; From mixerutils.h
(define-function default_registry_mixer_filter
  (c-name "gst_audio_default_registry_mixer_filter")
  (return-type "GList*")
    '("GstAudioMixerFilterFunc" "filter_func")
    '("gboolean" "first")
;; From multichannel-enumtypes.h
(define-function gst_audio_channel_position_get_type
  (c-name "gst_audio_channel_position_get_type")
;; From multichannel.h
(define-function get_channel_positions
  (c-name "gst_audio_get_channel_positions")
  (return-type "GstAudioChannelPosition*")
    '("GstStructure*" "str")
(define-function set_channel_positions
  (c-name "gst_audio_set_channel_positions")
    '("const-GstAudioChannelPosition*" "pos")
(define-function set_structure_channel_positions_list
  (c-name "gst_audio_set_structure_channel_positions_list")
    '("gint" "num_positions")
(define-function set_caps_channel_positions_list
  (c-name "gst_audio_set_caps_channel_positions_list")
(define-function fixate_channel_positions
  (c-name "gst_audio_fixate_channel_positions")
(define-function check_channel_positions
  (c-name "gst_audio_check_channel_positions")
    '("guint" "channels")
--- NEW FILE: audio.override ---
/* -*- Mode: C; c-basic-offset: 4 -*- */
/* gst-python
 * Copyright (C) 2008 <[email protected]>
 *
 * 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
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
--- NEW FILE: audiomodule.c ---
 * Copyright (C) 2008 Edward Hervey <[email protected]>
#include "config.h"
/* include this first, before NO_IMPORT_PYGOBJECT is defined */
#include <pygobject.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");
	}
}

------------------------------------------------------------------------------