gst/: Adding new API additions

Original commit message from CVS:
* gst/base.defs:
* gst/gst.defs:
* gst/interfaces.defs:
* gst/libs.defs:
* gst/gst.override:
* gst/gstmodule.c: (init_gst):
Adding new API additions
* gst/gstmessage.override:
wrap GstMessage.parse_buffering.
* gst/interfaces.override:
wrap gst_mixer_message_parse_*() functions.
wrap GstVideoOrientation::get_*() methods.
This commit is contained in:
Edward Hervey 2007-07-28 14:26:54 +00:00
parent a73bf408b1
commit 7ef06cab13
9 changed files with 550 additions and 0 deletions

View file

@ -1,3 +1,18 @@
2007-07-28 Edward Hervey <bilboed@bilboed.com>
* gst/base.defs:
* gst/gst.defs:
* gst/interfaces.defs:
* gst/libs.defs:
* gst/gst.override:
* gst/gstmodule.c: (init_gst):
Adding new API additions
* gst/gstmessage.override:
wrap GstMessage.parse_buffering.
* gst/interfaces.override:
wrap gst_mixer_message_parse_*() functions.
wrap GstVideoOrientation::get_*() methods.
2007-07-28 Edward Hervey <bilboed@bilboed.com>
* configure.ac:

View file

@ -35,6 +35,13 @@
(gtype-id "GST_TYPE_COLLECT_PADS")
)
(define-object DataQueue
(in-module "Gst")
(parent "GObject")
(c-name "GstDataQueue")
(gtype-id "GST_TYPE_DATA_QUEUE")
)
; PushSrc doesn't work due to limitations in the code generator, so disable
;(define-object PushSrc
; (in-module "Gst")
@ -846,3 +853,91 @@
'("GstTypeFindProbability*" "prob")
)
)
;; From gstdataqueue.h
(define-function gst_data_queue_get_type
(c-name "gst_data_queue_get_type")
(return-type "GType")
)
(define-function gst_data_queue_new
(c-name "gst_data_queue_new")
(is-constructor-of "GstDataQueue")
(return-type "GstDataQueue*")
(parameters
'("GstDataQueueCheckFullFunction" "checkfull")
'("gpointer" "checkdata")
)
)
(define-method push
(of-object "GstDataQueue")
(c-name "gst_data_queue_push")
(return-type "gboolean")
(parameters
'("GstDataQueueItem*" "item")
)
)
(define-method pop
(of-object "GstDataQueue")
(c-name "gst_data_queue_pop")
(return-type "gboolean")
(parameters
'("GstDataQueueItem**" "item")
)
)
(define-method flush
(of-object "GstDataQueue")
(c-name "gst_data_queue_flush")
(return-type "none")
)
(define-method set_flushing
(of-object "GstDataQueue")
(c-name "gst_data_queue_set_flushing")
(return-type "none")
(parameters
'("gboolean" "flushing")
)
)
(define-method drop_head
(of-object "GstDataQueue")
(c-name "gst_data_queue_drop_head")
(return-type "gboolean")
(parameters
'("GType" "type")
)
)
(define-method is_full
(of-object "GstDataQueue")
(c-name "gst_data_queue_is_full")
(return-type "gboolean")
)
(define-method is_empty
(of-object "GstDataQueue")
(c-name "gst_data_queue_is_empty")
(return-type "gboolean")
)
(define-method get_level
(of-object "GstDataQueue")
(c-name "gst_data_queue_get_level")
(return-type "none")
(parameters
'("GstDataQueueSize*" "level")
)
)
(define-method limits_changed
(of-object "GstDataQueue")
(c-name "gst_data_queue_limits_changed")
(return-type "none")
)

View file

@ -1064,6 +1064,18 @@
)
)
(define-method set_details_simple
(of-object "GstElementClass")
(c-name "gst_element_class_set_details_simple")
(return-type "none")
(parameters
'("gchar*" "longname")
'("gchar*" "classification")
'("gchar*" "description")
'("gchar*" "author")
)
)
(define-function element_get_type
(c-name "gst_element_get_type")
(return-type "GType")
@ -1538,6 +1550,15 @@
(return-type "GStrv")
)
(define-method has_interface
(of-object "GstElementFactory")
(c-name "gst_element_factory_has_interface")
(return-type "gboolean")
(parameters
'("const-gchar*" "interfacename")
)
)
(define-method create
(of-object "GstElementFactory")
(c-name "gst_element_factory_create")

View file

@ -46,6 +46,7 @@ headers
#include <gst/base/gstbasetransform.h>
#include <gst/base/gstcollectpads.h>
#include <gst/base/gsttypefindhelper.h>
#include <gst/base/gstdataqueue.h>
#include <gst/net/gstnet.h>

View file

@ -301,3 +301,19 @@ _wrap_gst_message_parse_async_start (PyGstMiniObject *self)
return PyBool_FromLong (res);
}
%%
override gst_message_parse_buffering noargs
static PyObject *
_wrap_gst_message_parse_buffering (PyGstMiniObject *self)
{
gint percent;
if (GST_MESSAGE(self->obj)->type != GST_MESSAGE_BUFFERING) {
PyErr_SetString(PyExc_TypeError, "Message is not a 'buffering' message");
return NULL;
}
gst_message_parse_buffering (GST_MESSAGE(self->obj), &percent);
return Py_BuildValue("i", percent);
}

View file

@ -251,6 +251,10 @@ init_gst (void)
PyModule_AddStringConstant (m, "TAG_PREVIEW_IMAGE", GST_TAG_PREVIEW_IMAGE);
#if ((GST_VERSION_MICRO >= 10) || (GST_VERSION_MICRO == 9 && GST_VERSION_NANO > 0 ))
PyModule_AddStringConstant (m, "TAG_EXTENDED_COMMENT", GST_TAG_EXTENDED_COMMENT);
#if ((GST_VERSION_MICRO >= 14) || (GST_VERSION_MICRO == 13 && GST_VERSION_NANO > 0))
PyModule_AddStringConstant (m, "TAG_LICENSE_URI", GST_TAG_LICENSE_URI);
PyModule_AddStringConstant (m, "TAG_COPYRIGHT_URI", GST_TAG_COPYRIGHT_URI);
#endif
#endif
#endif
#endif

View file

@ -126,6 +126,29 @@
)
)
(define-enum MixerMessageType
(in-module "Gst")
(c-name "GstMixerMessageType")
(gtype-id "GST_TYPE_MIXER_MESSAGE_TYPE")
(values
'("invalid" "GST_MIXER_MESSAGE_INVALID")
'("mute-toggled" "GST_MIXER_MESSAGE_MUTE_TOGGLED")
'("record-toggled" "GST_MIXER_MESSAGE_RECORD_TOGGLED")
'("volume-changed" "GST_MIXER_MESSAGE_VOLUME_CHANGED")
'("option-changed" "GST_MIXER_MESSAGE_OPTION_CHANGED")
)
)
(define-flags MixerFlags
(in-module "Gst")
(c-name "GstMixerFlags")
(gtype-id "GST_TYPE_MIXER_FLAGS")
(values
'("none" "GST_MIXER_FLAG_NONE")
'("auto-notifications" "GST_MIXER_FLAG_AUTO_NOTIFICATIONS")
)
)
(define-flags MixerTrackFlags
(in-module "Gst")
(c-name "GstMixerTrackFlags")
@ -329,6 +352,61 @@
)
)
(define-method get_mixer_flags
(of-object "GstMixer")
(c-name "gst_mixer_get_mixer_flags")
(return-type "GstMixerFlags")
)
(define-function mixer_message_get_type
(c-name "gst_mixer_message_get_type")
(return-type "GstMixerMessageType")
(parameters
'("GstMessage*" "message")
)
)
(define-function mixer_message_parse_mute_toggled
(c-name "gst_mixer_message_parse_mute_toggled")
(return-type "none")
(parameters
'("GstMessage*" "message")
'("GstMixerTrack**" "track")
'("gboolean*" "mute")
)
)
(define-function mixer_message_parse_record_toggled
(c-name "gst_mixer_message_parse_record_toggled")
(return-type "none")
(parameters
'("GstMessage*" "message")
'("GstMixerTrack**" "track")
'("gboolean*" "record")
)
)
(define-function mixer_message_parse_volume_changed
(c-name "gst_mixer_message_parse_volume_changed")
(return-type "none")
(parameters
'("GstMessage*" "message")
'("GstMixerTrack**" "track")
'("gint**" "volumes")
'("gint*" "num_channels")
)
)
(define-function mixer_message_parse_option_changed
(c-name "gst_mixer_message_parse_option_changed")
(return-type "none")
(parameters
'("GstMessage*" "message")
'("GstMixerOptions**" "options")
'("const-gchar**" "value")
)
)
(define-virtual list_tracks
(of-object "GstMixer")
(return-type "const-GList*")

View file

@ -344,3 +344,139 @@ _wrap_gst_property_probe_get_values_name (PyGObject *self, PyObject *args)
return py_list;
}
%%
override gst_mixer_message_parse_mute_toggled noargs
static PyObject *
_wrap_gst_mixer_message_parse_mute_toggled (PyGstMiniObject * self)
{
GstMixerTrack *track;
gboolean mute;
if (GST_MESSAGE(self->obj)->type != GST_MIXER_MESSAGE_MUTE_TOGGLED) {
PyErr_SetString(PyExc_TypeError, "Message is not a mute-toggled message");
return NULL;
}
gst_mixer_message_parse_mute_toggled (GST_MESSAGE(self->obj), &track, &mute);
return Py_BuildValue("(OO)",
pygobject_new(G_OBJECT (track)),
PyBool_FromLong(mute));
}
%%
override gst_mixer_message_parse_record_toggled noargs
static PyObject *
_wrap_gst_mixer_message_parse_record_toggled (PyGstMiniObject * self)
{
GstMixerTrack *track;
gboolean record;
if (GST_MESSAGE(self->obj)->type != GST_MIXER_MESSAGE_RECORD_TOGGLED) {
PyErr_SetString(PyExc_TypeError, "Message is not a record-toggled message");
return NULL;
}
gst_mixer_message_parse_record_toggled (GST_MESSAGE(self->obj), &track, &record);
return Py_BuildValue("(OO)",
pygobject_new(G_OBJECT (track)),
PyBool_FromLong(record));
}
%%
override gst_mixer_message_parse_volume_changed noargs
static PyObject *
_wrap_gst_mixer_message_parse_volume_changed (PyGstMiniObject * self)
{
GstMixerTrack *track;
gint *volumes;
gint num_channels;
PyObject *pvolumes;
int i;
if (GST_MESSAGE(self->obj)->type != GST_MIXER_MESSAGE_VOLUME_CHANGED) {
PyErr_SetString(PyExc_TypeError, "Message is not a volume-changed message");
return NULL;
}
gst_mixer_message_parse_volume_changed (GST_MESSAGE(self->obj), &track, &volumes, &num_channels);
pvolumes = PyList_New (num_channels);
for (i = 0; i < num_channels; ++i) {
PyList_SET_ITEM (pvolumes, i, PyInt_FromLong (volumes[i]));
}
g_free (volumes);
return Py_BuildValue("(OOi)",
pygobject_new(G_OBJECT (track)),
pvolumes, num_channels);
}
%%
override gst_mixer_message_parse_option_changed noargs
static PyObject *
_wrap_gst_mixer_message_parse_option_changed (PyGstMiniObject * self)
{
GstMixerOptions *options;
const gchar *value = NULL;
if (GST_MESSAGE(self->obj)->type != GST_MIXER_MESSAGE_OPTION_CHANGED) {
PyErr_SetString(PyExc_TypeError, "Message is not a option-changed message");
return NULL;
}
gst_mixer_message_parse_option_changed (GST_MESSAGE(self->obj), &options, &value);
return Py_BuildValue("(Os)",
pygobject_new(G_OBJECT (options)),
value);
}
%%
override gst_video_orientation_get_hflip noargs
static PyObject *
_wrap_gst_video_orientation_get_hflip (PyGObject * self)
{
gboolean flip, res;
res = gst_video_orientation_get_hflip (GST_VIDEO_ORIENTATION (self->obj), &flip);
return Py_BuildValue("(OO)",
PyBool_FromLong(res),
PyBool_FromLong(flip));
}
%%
override gst_video_orientation_get_vflip noargs
static PyObject *
_wrap_gst_video_orientation_get_vflip (PyGObject * self)
{
gboolean flip, res;
res = gst_video_orientation_get_vflip (GST_VIDEO_ORIENTATION (self->obj), &flip);
return Py_BuildValue("(OO)",
PyBool_FromLong(res),
PyBool_FromLong(flip));
}
%%
override gst_video_orientation_get_hcenter noargs
static PyObject *
_wrap_gst_video_orientation_get_hcenter (PyGObject * self)
{
gboolean res;
gint center;
res = gst_video_orientation_get_hcenter (GST_VIDEO_ORIENTATION (self->obj), &center);
return Py_BuildValue("(Oi)",
PyBool_FromLong(res),
center);
}
%%
override gst_video_orientation_get_vcenter noargs
static PyObject *
_wrap_gst_video_orientation_get_vcenter (PyGObject * self)
{
gboolean res;
gint center;
res = gst_video_orientation_get_vcenter (GST_VIDEO_ORIENTATION (self->obj), &center);
return Py_BuildValue("(Oi)",
PyBool_FromLong(res),
center);
}

View file

@ -1,6 +1,13 @@
;; -*- scheme -*-
; object definitions ...
(define-object ControlSource
(in-module "Gst")
(parent "GObject")
(c-name "GstControlSource")
(gtype-id "GST_TYPE_CONTROL_SOURCE")
)
(define-object Controller
(in-module "Gst")
(parent "GObject")
@ -8,6 +15,13 @@
(gtype-id "GST_TYPE_CONTROLLER")
)
(define-object InterpolationControlSource
(in-module "Gst")
(parent "GstControlSource")
(c-name "GstInterpolationControlSource")
(gtype-id "GST_TYPE_INTERPOLATION_CONTROL_SOURCE")
)
;; Enumerations and flags ...
(define-flags ParamFlags
@ -125,6 +139,43 @@
)
)
(define-method set_disabled
(of-object "GstController")
(c-name "gst_controller_set_disabled")
(return-type "none")
(parameters
'("gboolean" "disabled")
)
)
(define-method set_property_disabled
(of-object "GstController")
(c-name "gst_controller_set_property_disabled")
(return-type "none")
(parameters
'("gchar*" "property_name")
'("gboolean" "disabled")
)
)
(define-method set_control_source
(of-object "GstController")
(c-name "gst_controller_set_control_source")
(return-type "gboolean")
(parameters
'("gchar*" "property_name")
'("GstControlSource*" "csource")
)
)
(define-method get_control_source
(of-object "GstController")
(c-name "gst_controller_get_control_source")
(return-type "GstControlSource*")
(parameters
'("gchar*" "property_name")
)
)
(define-method set
(of-object "GstController")
(c-name "gst_controller_set")
@ -280,6 +331,25 @@
)
)
(define-function gst_object_set_control_source
(c-name "gst_object_set_control_source")
(return-type "gboolean")
(parameters
'("GObject*" "object")
'("gchar*" "property_name")
'("GstControlSource*" "csource")
)
)
(define-function gst_object_get_control_source
(c-name "gst_object_get_control_source")
(return-type "GstControlSource*")
(parameters
'("GObject*" "object")
'("gchar*" "property_name")
)
)
(define-function object_get_value_arrays
(c-name "gst_object_get_value_arrays")
(return-type "gboolean")
@ -328,6 +398,120 @@
;; From gstcontrolsource.h
(define-function gst_control_source_get_type
(c-name "gst_control_source_get_type")
(return-type "GType")
(parameters
)
)
(define-method get_value
(of-object "GstControlSource")
(c-name "gst_control_source_get_value")
(return-type "gboolean")
(parameters
'("GstClockTime" "timestamp")
'("GValue*" "value")
)
)
(define-method get_value_array
(of-object "GstControlSource")
(c-name "gst_control_source_get_value_array")
(return-type "gboolean")
(parameters
'("GstClockTime" "timestamp")
'("GstValueArray*" "value_array")
)
)
(define-method bind
(of-object "GstControlSource")
(c-name "gst_control_source_bind")
(return-type "gboolean")
(parameters
'("GParamSpec*" "pspec")
)
)
;; From gstinterpolationcontrolsource.h
(define-function gst_interpolation_control_source_get_type
(c-name "gst_interpolation_control_source_get_type")
(return-type "GType")
(parameters
)
)
(define-function gst_interpolation_control_source_new
(c-name "gst_interpolation_control_source_new")
(is-constructor-of "GstInterpolationControlSource")
(return-type "GstInterpolationControlSource*")
(parameters
)
)
(define-method set_interpolation_mode
(of-object "GstInterpolationControlSource")
(c-name "gst_interpolation_control_source_set_interpolation_mode")
(return-type "gboolean")
(parameters
'("GstInterpolateMode" "mode")
)
)
(define-method set
(of-object "GstInterpolationControlSource")
(c-name "gst_interpolation_control_source_set")
(return-type "gboolean")
(parameters
'("GstClockTime" "timestamp")
'("GValue*" "value")
)
)
(define-method set_from_list
(of-object "GstInterpolationControlSource")
(c-name "gst_interpolation_control_source_set_from_list")
(return-type "gboolean")
(parameters
'("GSList*" "timedvalues")
)
)
(define-method unset
(of-object "GstInterpolationControlSource")
(c-name "gst_interpolation_control_source_unset")
(return-type "gboolean")
(parameters
'("GstClockTime" "timestamp")
)
)
(define-method unset_all
(of-object "GstInterpolationControlSource")
(c-name "gst_interpolation_control_source_unset_all")
(return-type "none")
)
(define-method get_all
(of-object "GstInterpolationControlSource")
(c-name "gst_interpolation_control_source_get_all")
(return-type "GList*")
)
(define-method get_count
(of-object "GstInterpolationControlSource")
(c-name "gst_interpolation_control_source_get_count")
(return-type "gint")
)
;; From ../gstreamer/libs/gst/dataprotocol/dataprotocol.h
(define-function dp_init