<SECTION>
<FILE>gstcolorbalance</FILE>
-<INCLUDE>gst/interfaces/color.h</INCLUDE>
+<INCLUDE>gst/video/colorbalance.h</INCLUDE>
GstColorBalance
GstColorBalanceInterface
GstColorBalanceType
<SECTION>
<FILE>gstcolorbalancechannel</FILE>
-<INCLUDE>gst/interfaces/colorbalancechannel.h</INCLUDE>
+<INCLUDE>gst/video/colorbalancechannel.h</INCLUDE>
GstColorBalanceChannel
GstColorBalanceChannelClass
<SUBSECTION Standard>
<SECTION>
<FILE>gstvideoorientation</FILE>
-<INCLUDE>gst/interfaces/videoorientation.h</INCLUDE>
+<INCLUDE>gst/video/videoorientation.h</INCLUDE>
GstVideoOrientation
GstVideoOrientationInterface
gst_video_orientation_get_hcenter
<SECTION>
<FILE>gstvideooverlay</FILE>
-<INCLUDE>gst/interfaces/videooverlay.h</INCLUDE>
+<INCLUDE>gst/video/videooverlay.h</INCLUDE>
GstXOverlay
GstXOverlayIface
gst_video_overlay_got_window_handle
#include <gst/audio/gstaudioringbuffer.h>
gst_audio_ring_buffer_get_type
-#include <gst/interfaces/colorbalance.h>
-gst_color_balance_get_type
-gst_color_balance_channel_get_type
#include <gst/interfaces/mixer.h>
gst_mixer_get_type
gst_mixer_options_get_type
gst_tuner_norm_get_type
#include <gst/interfaces/streamvolume.h>
gst_stream_volume_get_type
-#include <gst/interfaces/videoorientation.h>
-gst_video_orientation_get_type
-#include <gst/interfaces/videooverlay.h>
-gst_video_overlay_get_type
#include <gst/rtp/gstrtpbasedepayload.h>
gst_video_filter_get_type
#include <gst/video/gstvideosink.h>
gst_video_sink_get_type
+#include <gst/video/colorbalance.h>
+gst_color_balance_get_type
+gst_color_balance_channel_get_type
+#include <gst/video/videoorientation.h>
+gst_video_orientation_get_type
+#include <gst/video/videooverlay.h>
+gst_video_overlay_get_type
#include <gst/pbutils/pbutils.h>
gst_discoverer_get_type
$(includedir)/gstreamer-@GST_MAJORMINOR@/gst/interfaces
headers_interfaces = \
- colorbalance.h \
- colorbalancechannel.h \
mixer.h \
mixeroptions.h \
mixertrack.h \
streamvolume.h \
tuner.h \
tunernorm.h \
- tunerchannel.h \
- videoorientation.h \
- videooverlay.h
+ tunerchannel.h
# variables used for enum/marshal generation
glib_enum_headers = $(headers_interfaces)
interfaces-enumtypes.h
libgstinterfaces_@GST_MAJORMINOR@_la_SOURCES = \
- colorbalance.c \
- colorbalancechannel.c \
mixer.c \
mixeroptions.c \
mixertrack.c \
streamvolume.c \
tuner.c \
tunernorm.c \
- tunerchannel.c \
- videoorientation.c \
- videooverlay.c
+ tunerchannel.c
nodist_libgstinterfaces_@GST_MAJORMINOR@_la_SOURCES = \
$(built_sources) \
+++ /dev/null
-/* GStreamer Color Balance
- * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
- *
- * colorbalance.c: image color balance interface design
- * virtual class function wrappers
- *
- * 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 "colorbalance.h"
-#include "interfaces-marshal.h"
-
-/**
- * SECTION:gstcolorbalance
- * @short_description: Interface for adjusting color balance settings
- *
- * <refsect2><para>
- * This interface is implemented by elements which can perform some color
- * balance operation on video frames they process. For example, modifying
- * the brightness, contrast, hue or saturation.
- * </para><para>
- * Example elements are 'xvimagesink' and 'colorbalance'
- * </para>
- * </refsect2>
- */
-
-/* FIXME 0.11: check if we need to add API for sometimes-supportedness
- * (aka making up for GstImplementsInterface removal) */
-
-/* FIXME 0.11: replace signals with messages (+ make API thread-safe) */
-
-enum
-{
- VALUE_CHANGED,
- LAST_SIGNAL
-};
-
-static void gst_color_balance_class_init (GstColorBalanceInterface * iface);
-
-static guint gst_color_balance_signals[LAST_SIGNAL] = { 0 };
-
-GType
-gst_color_balance_get_type (void)
-{
- static GType gst_color_balance_type = 0;
-
- if (!gst_color_balance_type) {
- static const GTypeInfo gst_color_balance_info = {
- sizeof (GstColorBalanceInterface),
- (GBaseInitFunc) gst_color_balance_class_init,
- NULL,
- NULL,
- NULL,
- NULL,
- 0,
- 0,
- NULL,
- };
-
- gst_color_balance_type = g_type_register_static (G_TYPE_INTERFACE,
- "GstColorBalance", &gst_color_balance_info, 0);
- }
-
- return gst_color_balance_type;
-}
-
-static void
-gst_color_balance_class_init (GstColorBalanceInterface * iface)
-{
- static gboolean initialized = FALSE;
-
- if (!initialized) {
- /**
- * GstColorBalance::value-changed:
- * @colorbalance: The GstColorBalance instance
- * @channel: The #GstColorBalanceChannel
- * @value: The new value
- *
- * Fired when the value of the indicated channel has changed.
- */
- gst_color_balance_signals[VALUE_CHANGED] =
- g_signal_new ("value-changed",
- GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GstColorBalanceInterface, value_changed),
- NULL, NULL,
- gst_interfaces_marshal_VOID__OBJECT_INT,
- G_TYPE_NONE, 2, GST_TYPE_COLOR_BALANCE_CHANNEL, G_TYPE_INT);
-
- initialized = TRUE;
- }
-
- iface->balance_type = GST_COLOR_BALANCE_SOFTWARE;
-
- /* default virtual functions */
- iface->list_channels = NULL;
- iface->set_value = NULL;
- iface->get_value = NULL;
-}
-
-/**
- * gst_color_balance_list_channels:
- * @balance: A #GstColorBalance instance
- *
- * Retrieve a list of the available channels.
- *
- * Returns: A GList containing pointers to #GstColorBalanceChannel objects.
- * The list is owned by the #GstColorBalance instance and must not
- * be freed.
- */
-const GList *
-gst_color_balance_list_channels (GstColorBalance * balance)
-{
- GstColorBalanceInterface *iface;
-
- g_return_val_if_fail (GST_IS_COLOR_BALANCE (balance), NULL);
-
- iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
-
- if (iface->list_channels) {
- return iface->list_channels (balance);
- }
-
- return NULL;
-}
-
-/**
- * gst_color_balance_set_value:
- * @balance: A #GstColorBalance instance
- * @channel: A #GstColorBalanceChannel instance
- * @value: The new value for the channel.
- *
- * Sets the current value of the channel to the passed value, which must
- * be between min_value and max_value.
- *
- * See Also: The #GstColorBalanceChannel.min_value and
- * #GstColorBalanceChannel.max_value members of the
- * #GstColorBalanceChannel object.
- */
-void
-gst_color_balance_set_value (GstColorBalance * balance,
- GstColorBalanceChannel * channel, gint value)
-{
- GstColorBalanceInterface *iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
-
- if (iface->set_value) {
- iface->set_value (balance, channel, value);
- }
-}
-
-/**
- * gst_color_balance_get_value:
- * @balance: A #GstColorBalance instance
- * @channel: A #GstColorBalanceChannel instance
- *
- * Retrieve the current value of the indicated channel, between min_value
- * and max_value.
- *
- * See Also: The #GstColorBalanceChannel.min_value and
- * #GstColorBalanceChannel.max_value members of the
- * #GstColorBalanceChannel object.
- *
- * Returns: The current value of the channel.
- */
-gint
-gst_color_balance_get_value (GstColorBalance * balance,
- GstColorBalanceChannel * channel)
-{
- GstColorBalanceInterface *iface;
-
- g_return_val_if_fail (GST_IS_COLOR_BALANCE (balance), 0);
-
- iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
-
- if (iface->get_value) {
- return iface->get_value (balance, channel);
- }
-
- return channel->min_value;
-}
-
-/**
- * gst_color_balance_get_balance_type:
- * @balance: The #GstColorBalance implementation
- *
- * Get the #GstColorBalanceType of this implementation.
- *
- * Returns: A the #GstColorBalanceType.
- *
- * Since: 0.10.24
- */
-GstColorBalanceType
-gst_color_balance_get_balance_type (GstColorBalance * balance)
-{
- GstColorBalanceInterface *iface;
-
- g_return_val_if_fail (GST_IS_COLOR_BALANCE (balance),
- GST_COLOR_BALANCE_SOFTWARE);
-
- iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
-
- return iface->balance_type;
-}
-
-/**
- * gst_color_balance_value_changed:
- * @balance: A #GstColorBalance instance
- * @channel: A #GstColorBalanceChannel whose value has changed
- * @value: The new value of the channel
- *
- * A helper function called by implementations of the GstColorBalance
- * interface. It fires the #GstColorBalance::value-changed signal on the
- * instance, and the #GstColorBalanceChannel::value-changed signal on the
- * channel object.
- */
-void
-gst_color_balance_value_changed (GstColorBalance * balance,
- GstColorBalanceChannel * channel, gint value)
-{
-
- g_return_if_fail (GST_IS_COLOR_BALANCE (balance));
-
- g_signal_emit (G_OBJECT (balance),
- gst_color_balance_signals[VALUE_CHANGED], 0, channel, value);
-
- g_signal_emit_by_name (G_OBJECT (channel), "value_changed", value);
-}
+++ /dev/null
-/* GStreamer Color Balance
- * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
- *
- * color-balance.h: image color balance interface design
- *
- * 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.
- */
-
-#ifndef __GST_COLOR_BALANCE_H__
-#define __GST_COLOR_BALANCE_H__
-
-#include <gst/gst.h>
-#include <gst/interfaces/colorbalancechannel.h>
-#include <gst/interfaces/interfaces-enumtypes.h>
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_COLOR_BALANCE \
- (gst_color_balance_get_type ())
-#define GST_COLOR_BALANCE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_COLOR_BALANCE, GstColorBalance))
-#define GST_IS_COLOR_BALANCE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE))
-#define GST_COLOR_BALANCE_GET_INTERFACE(inst) \
- (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceInterface))
-
-#define GST_COLOR_BALANCE_TYPE(iface) (iface->balance_type)
-
-typedef struct _GstColorBalance GstColorBalance;
-typedef struct _GstColorBalanceInterface GstColorBalanceInterface;
-
-/**
- * GstColorBalanceType:
- * @GST_COLOR_BALANCE_HARDWARE: Color balance is implemented with dedicated
- * hardware.
- * @GST_COLOR_BALANCE_SOFTWARE: Color balance is implemented via software
- * processing.
- *
- * An enumeration indicating whether an element implements color balancing
- * operations in software or in dedicated hardware. In general, dedicated
- * hardware implementations (such as those provided by xvimagesink) are
- * preferred.
- */
-typedef enum
-{
- GST_COLOR_BALANCE_HARDWARE,
- GST_COLOR_BALANCE_SOFTWARE
-} GstColorBalanceType;
-
-/**
- * GstColorBalanceInterface:
- * @iface: the parent interface
- * @balance_type: implementation type
- * @list_channels: list handled channels
- * @set_value: set a channel value
- * @get_value: get a channel value
- * @value_changed: default handler for value changed notification
- *
- * Color-balance interface.
- */
-struct _GstColorBalanceInterface {
- GTypeInterface iface;
-
- GstColorBalanceType balance_type;
-
- /* virtual functions */
- const GList * (* list_channels) (GstColorBalance *balance);
-
- void (* set_value) (GstColorBalance *balance,
- GstColorBalanceChannel *channel,
- gint value);
- gint (* get_value) (GstColorBalance *balance,
- GstColorBalanceChannel *channel);
-
- /* signals */
- void (* value_changed) (GstColorBalance *balance,
- GstColorBalanceChannel *channel,
- gint value);
-};
-
-GType gst_color_balance_get_type (void);
-
-/* virtual class function wrappers */
-const GList *
- gst_color_balance_list_channels (GstColorBalance *balance);
-void gst_color_balance_set_value (GstColorBalance *balance,
- GstColorBalanceChannel *channel,
- gint value);
-gint gst_color_balance_get_value (GstColorBalance *balance,
- GstColorBalanceChannel *channel);
-
-GstColorBalanceType
- gst_color_balance_get_balance_type (GstColorBalance *balance);
-
-/* trigger signal */
-void gst_color_balance_value_changed (GstColorBalance *balance,
- GstColorBalanceChannel *channel,
- gint value);
-
-G_END_DECLS
-
-#endif /* __GST_COLOR_BALANCE_H__ */
+++ /dev/null
-/* GStreamer Color Balance
- * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
- *
- * colorbalancechannel.c: colorbalance channel object design
- *
- * 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 "colorbalancechannel.h"
-
-/**
- * SECTION:gstcolorbalancechannel
- * @short_description: Object representing a channel from the #GstColorBalance
- * interface.
- *
- * <refsect2><para>The #GstColorBalanceChannel object represents a parameter
- * for modifying the color balance implemented by an element providing the
- * #GstColorBalance interface. For example, Hue or Saturation.
- * </para></refsect2>
- */
-
-enum
-{
- /* FILL ME */
- SIGNAL_VALUE_CHANGED,
- LAST_SIGNAL
-};
-
-static void gst_color_balance_channel_class_init (GstColorBalanceChannelClass *
- klass);
-static void gst_color_balance_channel_init (GstColorBalanceChannel * balance);
-static void gst_color_balance_channel_dispose (GObject * object);
-
-static GObjectClass *parent_class = NULL;
-static guint signals[LAST_SIGNAL] = { 0 };
-
-GType
-gst_color_balance_channel_get_type (void)
-{
- static GType gst_color_balance_channel_type = 0;
-
- if (!gst_color_balance_channel_type) {
- static const GTypeInfo color_balance_channel_info = {
- sizeof (GstColorBalanceChannelClass),
- NULL,
- NULL,
- (GClassInitFunc) gst_color_balance_channel_class_init,
- NULL,
- NULL,
- sizeof (GstColorBalanceChannel),
- 0,
- (GInstanceInitFunc) gst_color_balance_channel_init,
- NULL
- };
-
- gst_color_balance_channel_type =
- g_type_register_static (G_TYPE_OBJECT,
- "GstColorBalanceChannel", &color_balance_channel_info, 0);
- }
-
- return gst_color_balance_channel_type;
-}
-
-static void
-gst_color_balance_channel_class_init (GstColorBalanceChannelClass * klass)
-{
- GObjectClass *object_klass = (GObjectClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
-
- /**
- * GstColorBalanceChannel::value-changed:
- * @channel: The #GstColorBalanceChannel
- * @value: The new value
- *
- * Fired when the value of the indicated channel has changed.
- */
- signals[SIGNAL_VALUE_CHANGED] =
- g_signal_new ("value-changed", G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GstColorBalanceChannelClass,
- value_changed),
- NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
-
- object_klass->dispose = gst_color_balance_channel_dispose;
-}
-
-static void
-gst_color_balance_channel_init (GstColorBalanceChannel * channel)
-{
- channel->label = NULL;
- channel->min_value = channel->max_value = 0;
-}
-
-static void
-gst_color_balance_channel_dispose (GObject * object)
-{
- GstColorBalanceChannel *channel = GST_COLOR_BALANCE_CHANNEL (object);
-
- if (channel->label)
- g_free (channel->label);
-
- channel->label = NULL;
-
- if (parent_class->dispose)
- parent_class->dispose (object);
-}
+++ /dev/null
-/* GStreamer Color Balance
- * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
- *
- * colorbalancechannel.h: individual channel object
- *
- * 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.
- */
-
-#ifndef __GST_COLOR_BALANCE_CHANNEL_H__
-#define __GST_COLOR_BALANCE_CHANNEL_H__
-
-#include <gst/gst.h>
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_COLOR_BALANCE_CHANNEL \
- (gst_color_balance_channel_get_type ())
-#define GST_COLOR_BALANCE_CHANNEL(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_COLOR_BALANCE_CHANNEL, \
- GstColorBalanceChannel))
-#define GST_COLOR_BALANCE_CHANNEL_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL, \
- GstColorBalanceChannelClass))
-#define GST_IS_COLOR_BALANCE_CHANNEL(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE_CHANNEL))
-#define GST_IS_COLOR_BALANCE_CHANNEL_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL))
-
-typedef struct _GstColorBalanceChannel GstColorBalanceChannel;
-typedef struct _GstColorBalanceChannelClass GstColorBalanceChannelClass;
-
-/**
- * GstColorBalanceChannel:
- * @label: A string containing a descriptive name for this channel
- * @min_value: The minimum valid value for this channel.
- * @max_value: The maximum valid value for this channel.
- */
-struct _GstColorBalanceChannel {
- GObject parent;
-
- /*< public >*/
- gchar *label;
- gint min_value;
- gint max_value;
-
- /*< private >*/
- gpointer _gst_reserved[GST_PADDING];
-};
-
-/**
- * GstColorBalanceChannelClass:
- * @parent: the parent class
- * @value_changed: default handler for value changed notification
- *
- * Color-balance channel class.
- */
-struct _GstColorBalanceChannelClass {
- GObjectClass parent;
-
- /* signals */
- void (* value_changed) (GstColorBalanceChannel *channel,
- gint value);
-
- /*< private >*/
- gpointer _gst_reserved[GST_PADDING];
-};
-
-GType gst_color_balance_channel_get_type (void);
-
-G_END_DECLS
-
-#endif /* __GST_COLOR_BALANCE_CHANNEL_H__ */
+++ /dev/null
-/* GStreamer
- * Copyright (C) 2006 Nokia <stefan.kost@nokia.com>
- *
- * videoorientation.c: video flipping and centering interface
- *
- * 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 "videoorientation.h"
-#include "interfaces-marshal.h"
-
-#include <string.h>
-
-/**
- * SECTION:gstvideoorientation
- * @short_description: Interface for elements providing video orientation
- * controls
- *
- * The interface allows unified access to control flipping and autocenter
- * operation of video-sources or operators.
- *
- * Since: 0.10.11
- */
-
-/* FIXME 0.11: check if we need to add API for sometimes-supportedness
- * (aka making up for GstImplementsInterface removal) (probably yes) */
-
-static void gst_video_orientation_iface_init (GstVideoOrientationInterface *
- iface);
-
-GType
-gst_video_orientation_get_type (void)
-{
- static GType gst_video_orientation_type = 0;
-
- if (!gst_video_orientation_type) {
- static const GTypeInfo gst_video_orientation_info = {
- sizeof (GstVideoOrientationInterface),
- (GBaseInitFunc) gst_video_orientation_iface_init,
- NULL,
- NULL,
- NULL,
- NULL,
- 0,
- 0,
- NULL,
- };
-
- gst_video_orientation_type = g_type_register_static (G_TYPE_INTERFACE,
- "GstVideoOrientation", &gst_video_orientation_info, 0);
- }
-
- return gst_video_orientation_type;
-}
-
-static void
-gst_video_orientation_iface_init (GstVideoOrientationInterface * iface)
-{
- /* default virtual functions */
-
- iface->get_hflip = NULL;
- iface->get_vflip = NULL;
- iface->get_hcenter = NULL;
- iface->get_vcenter = NULL;
-
- iface->set_hflip = NULL;
- iface->set_vflip = NULL;
- iface->set_hcenter = NULL;
- iface->set_vcenter = NULL;
-}
-
-/**
- * gst_video_orientation_get_hflip:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @flip: return location for the result
- *
- * Get the horizontal flipping state (%TRUE for flipped) from the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports flipping
- */
-gboolean
-gst_video_orientation_get_hflip (GstVideoOrientation * video_orientation,
- gboolean * flip)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->get_hflip) {
- return iface->get_hflip (video_orientation, flip);
- }
- return FALSE;
-}
-
-/**
- * gst_video_orientation_get_vflip:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @flip: return location for the result
- *
- * Get the vertical flipping state (%TRUE for flipped) from the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports flipping
- */
-gboolean
-gst_video_orientation_get_vflip (GstVideoOrientation * video_orientation,
- gboolean * flip)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->get_vflip) {
- return iface->get_vflip (video_orientation, flip);
- }
- return FALSE;
-}
-
-/**
- * gst_video_orientation_get_hcenter:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @center: return location for the result
- *
- * Get the horizontal centering offset from the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports centering
- */
-gboolean
-gst_video_orientation_get_hcenter (GstVideoOrientation * video_orientation,
- gint * center)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->get_hcenter) {
- return iface->get_hcenter (video_orientation, center);
- }
- return FALSE;
-}
-
-/**
- * gst_video_orientation_get_vcenter:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @center: return location for the result
- *
- * Get the vertical centering offset from the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports centering
- */
-gboolean
-gst_video_orientation_get_vcenter (GstVideoOrientation * video_orientation,
- gint * center)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->get_vcenter) {
- return iface->get_vcenter (video_orientation, center);
- }
- return FALSE;
-}
-
-/**
- * gst_video_orientation_set_hflip:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @flip: use flipping
- *
- * Set the horizontal flipping state (%TRUE for flipped) for the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports flipping
- */
-gboolean
-gst_video_orientation_set_hflip (GstVideoOrientation * video_orientation,
- gboolean flip)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->set_hflip) {
- return iface->set_hflip (video_orientation, flip);
- }
- return FALSE;
-}
-
-/**
- * gst_video_orientation_set_vflip:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @flip: use flipping
- *
- * Set the vertical flipping state (%TRUE for flipped) for the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports flipping
- */
-gboolean
-gst_video_orientation_set_vflip (GstVideoOrientation * video_orientation,
- gboolean flip)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->set_vflip) {
- return iface->set_vflip (video_orientation, flip);
- }
- return FALSE;
-}
-
-/**
- * gst_video_orientation_set_hcenter:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @center: centering offset
- *
- * Set the horizontal centering offset for the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports centering
- */
-gboolean
-gst_video_orientation_set_hcenter (GstVideoOrientation * video_orientation,
- gint center)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->set_hcenter) {
- return iface->set_hcenter (video_orientation, center);
- }
- return FALSE;
-}
-
-/**
- * gst_video_orientation_set_vcenter:
- * @video_orientation: #GstVideoOrientation interface of a #GstElement
- * @center: centering offset
- *
- * Set the vertical centering offset for the given object.
- *
- * Since: 0.10.11
- * Returns: %TRUE in case the element supports centering
- */
-gboolean
-gst_video_orientation_set_vcenter (GstVideoOrientation * video_orientation,
- gint center)
-{
- GstVideoOrientationInterface *iface =
- GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
-
- if (iface->set_vcenter) {
- return iface->set_vcenter (video_orientation, center);
- }
- return FALSE;
-}
+++ /dev/null
-/* GStreamer
- * Copyright (C) 2006 Nokia <stefan.kost@nokia.com
- *
- * videoorientation.h: video flipping and centering interface
- *
- * 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.
- */
-
-#ifndef __GST_VIDEO_ORIENTATION_H__
-#define __GST_VIDEO_ORIENTATION_H__
-
-#include <gst/gst.h>
-#include <gst/interfaces/interfaces-enumtypes.h>
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_VIDEO_ORIENTATION \
- (gst_video_orientation_get_type ())
-#define GST_VIDEO_ORIENTATION(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientation))
-#define GST_IS_VIDEO_ORIENTATION(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_ORIENTATION))
-#define GST_VIDEO_ORIENTATION_GET_INTERFACE(inst) \
- (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientationInterface))
-
-/**
- * GstVideoOrientation:
- *
- * Opaque #GstVideoOrientation data structure.
- */
-typedef struct _GstVideoOrientation GstVideoOrientation;
-typedef struct _GstVideoOrientationInterface GstVideoOrientationInterface;
-
-/**
- * GstVideoOrientationInterface:
- * @iface: parent interface type.
- * @get_hflip: virtual method to get horizontal flipping state
- * @get_vflip: virtual method to get vertical flipping state
- * @get_hcenter: virtual method to get horizontal centering state
- * @get_vcenter: virtual method to get vertical centering state
- * @set_hflip: virtual method to set horizontal flipping state
- * @set_vflip: virtual method to set vertical flipping state
- * @set_hcenter: virtual method to set horizontal centering state
- * @set_vcenter: virtual method to set vertical centering state
- *
- * #GstVideoOrientationInterface interface.
- */
-struct _GstVideoOrientationInterface {
- GTypeInterface iface;
-
- /* FIXME 0.11: fix awkward API? add some kind of get_supported flags thing
- * and then just return booleans/int from all vfuncs requiring the caller
- * to check the flags first */
-
- /* virtual functions */
- gboolean (* get_hflip) (GstVideoOrientation *video_orientation, gboolean *flip);
- gboolean (* get_vflip) (GstVideoOrientation *video_orientation, gboolean *flip);
- gboolean (* get_hcenter) (GstVideoOrientation *video_orientation, gint *center);
- gboolean (* get_vcenter) (GstVideoOrientation *video_orientation, gint *center);
-
- gboolean (* set_hflip) (GstVideoOrientation *video_orientation, gboolean flip);
- gboolean (* set_vflip) (GstVideoOrientation *video_orientation, gboolean flip);
- gboolean (* set_hcenter) (GstVideoOrientation *video_orientation, gint center);
- gboolean (* set_vcenter) (GstVideoOrientation *video_orientation, gint center);
-};
-
-GType gst_video_orientation_get_type (void);
-
-/* virtual class function wrappers */
-gboolean gst_video_orientation_get_hflip (GstVideoOrientation *video_orientation, gboolean *flip);
-gboolean gst_video_orientation_get_vflip (GstVideoOrientation *video_orientation, gboolean *flip);
-gboolean gst_video_orientation_get_hcenter (GstVideoOrientation *video_orientation, gint *center);
-gboolean gst_video_orientation_get_vcenter (GstVideoOrientation *video_orientation, gint *center);
-
-gboolean gst_video_orientation_set_hflip (GstVideoOrientation *video_orientation, gboolean flip);
-gboolean gst_video_orientation_set_vflip (GstVideoOrientation *video_orientation, gboolean flip);
-gboolean gst_video_orientation_set_hcenter (GstVideoOrientation *video_orientation, gint center);
-gboolean gst_video_orientation_set_vcenter (GstVideoOrientation *video_orientation, gint center);
-
-G_END_DECLS
-
-#endif /* __GST_VIDEO_ORIENTATION_H__ */
+++ /dev/null
-/* GStreamer Video Overlay interface
- * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
- * Copyright (C) 2011 Tim-Philipp Müller <tim@centricular.net>
- *
- * 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.
- */
-/**
- * SECTION:gstvideooverlay
- * @short_description: Interface for setting/getting a window system resource
- * on elements supporting it to configure a window into which to render a
- * video.
- *
- * <refsect2>
- * <para>
- * The #GstVideoOverlay interface is used for 2 main purposes :
- * <itemizedlist>
- * <listitem>
- * <para>
- * To get a grab on the Window where the video sink element is going to render.
- * This is achieved by either being informed about the Window identifier that
- * the video sink element generated, or by forcing the video sink element to use
- * a specific Window identifier for rendering.
- * </para>
- * </listitem>
- * <listitem>
- * <para>
- * To force a redrawing of the latest video frame the video sink element
- * displayed on the Window. Indeed if the #GstPipeline is in #GST_STATE_PAUSED
- * state, moving the Window around will damage its content. Application
- * developers will want to handle the Expose events themselves and force the
- * video sink element to refresh the Window's content.
- * </para>
- * </listitem>
- * </itemizedlist>
- * </para>
- * <para>
- * Using the Window created by the video sink is probably the simplest scenario,
- * in some cases, though, it might not be flexible enough for application
- * developers if they need to catch events such as mouse moves and button
- * clicks.
- * </para>
- * <para>
- * Setting a specific Window identifier on the video sink element is the most
- * flexible solution but it has some issues. Indeed the application needs to set
- * its Window identifier at the right time to avoid internal Window creation
- * from the video sink element. To solve this issue a #GstMessage is posted on
- * the bus to inform the application that it should set the Window identifier
- * immediately. Here is an example on how to do that correctly:
- * |[
- * static GstBusSyncReply
- * create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)
- * {
- * // ignore anything but 'prepare-window-handle' element messages
- * if (!gst_is_video_overlay_prepare_window_handle_message (message))
- * return GST_BUS_PASS;
- *
- * win = XCreateSimpleWindow (disp, root, 0, 0, 320, 240, 0, 0, 0);
- *
- * XSetWindowBackgroundPixmap (disp, win, None);
- *
- * XMapRaised (disp, win);
- *
- * XSync (disp, FALSE);
- *
- * gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)),
- * win);
- *
- * gst_message_unref (message);
- *
- * return GST_BUS_DROP;
- * }
- * ...
- * int
- * main (int argc, char **argv)
- * {
- * ...
- * bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
- * gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, pipeline);
- * ...
- * }
- * ]|
- * </para>
- * </refsect2>
- * <refsect2>
- * <title>Two basic usage scenarios</title>
- * <para>
- * There are two basic usage scenarios: in the simplest case, the application
- * knows exactly what particular element is used for video output, which is
- * usually the case when the application creates the videosink to use
- * (e.g. #xvimagesink, #ximagesink, etc.) itself; in this case, the application
- * can just create the videosink element, create and realize the window to
- * render the video on and then call gst_video_overlay_set_window_handle() directly
- * with the XID or native window handle, before starting up the pipeline.
- * </para>
- * <para>
- * In the other and more common case, the application does not know in advance
- * what GStreamer video sink element will be used for video output. This is
- * usually the case when an element such as #autovideosink or #gconfvideosink
- * is used. In this case, the video sink element itself is created
- * asynchronously from a GStreamer streaming thread some time after the
- * pipeline has been started up. When that happens, however, the video sink
- * will need to know right then whether to render onto an already existing
- * application window or whether to create its own window. This is when it
- * posts a prepare-window-handle message, and that is also why this message needs
- * to be handled in a sync bus handler which will be called from the streaming
- * thread directly (because the video sink will need an answer right then).
- * </para>
- * <para>
- * As response to the prepare-window-handle element message in the bus sync
- * handler, the application may use gst_video_overlay_set_window_handle() to tell
- * the video sink to render onto an existing window surface. At this point the
- * application should already have obtained the window handle / XID, so it
- * just needs to set it. It is generally not advisable to call any GUI toolkit
- * functions or window system functions from the streaming thread in which the
- * prepare-window-handle message is handled, because most GUI toolkits and
- * windowing systems are not thread-safe at all and a lot of care would be
- * required to co-ordinate the toolkit and window system calls of the
- * different threads (Gtk+ users please note: prior to Gtk+ 2.18
- * GDK_WINDOW_XID() was just a simple structure access, so generally fine to do
- * within the bus sync handler; this macro was changed to a function call in
- * Gtk+ 2.18 and later, which is likely to cause problems when called from a
- * sync handler; see below for a better approach without GDK_WINDOW_XID()
- * used in the callback).
- * </para>
- * </refsect2>
- * <refsect2>
- * <title>GstVideoOverlay and Gtk+</title>
- * <para>
- * |[
- * #include <gtk/gtk.h>
- * #ifdef GDK_WINDOWING_X11
- * #include <gdk/gdkx.h> // for GDK_WINDOW_XID
- * #endif
- * ...
- * static gulong video_window_xid = 0;
- * ...
- * static GstBusSyncReply
- * bus_sync_handler (GstBus * bus, GstMessage * message, gpointer user_data)
- * {
- * // ignore anything but 'prepare-window-handle' element messages
- * if (!gst_is_video_overlay_prepare_window_handle_message (message))
- * return GST_BUS_PASS;
- *
- * if (video_window_xid != 0) {
- * GstVideoOverlay *xoverlay;
- *
- * // GST_MESSAGE_SRC (message) will be the video sink element
- * xoverlay = GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message));
- * gst_video_overlay_set_window_handle (xoverlay, video_window_xid);
- * } else {
- * g_warning ("Should have obtained video_window_xid by now!");
- * }
- *
- * gst_message_unref (message);
- * return GST_BUS_DROP;
- * }
- * ...
- * static void
- * video_widget_realize_cb (GtkWidget * widget, gpointer data)
- * {
- * #if GTK_CHECK_VERSION(2,18,0)
- * // This is here just for pedagogical purposes, GDK_WINDOW_XID will call
- * // it as well in newer Gtk versions
- * if (!gdk_window_ensure_native (widget->window))
- * g_error ("Couldn't create native window needed for GstVideoOverlay!");
- * #endif
- *
- * #ifdef GDK_WINDOWING_X11
- * video_window_xid = GDK_WINDOW_XID (video_window->window);
- * #endif
- * }
- * ...
- * int
- * main (int argc, char **argv)
- * {
- * GtkWidget *video_window;
- * GtkWidget *app_window;
- * ...
- * app_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- * ...
- * video_window = gtk_drawing_area_new ();
- * g_signal_connect (video_window, "realize",
- * G_CALLBACK (video_widget_realize_cb), NULL);
- * gtk_widget_set_double_buffered (video_window, FALSE);
- * ...
- * // usually the video_window will not be directly embedded into the
- * // application window like this, but there will be many other widgets
- * // and the video window will be embedded in one of them instead
- * gtk_container_add (GTK_CONTAINER (ap_window), video_window);
- * ...
- * // show the GUI
- * gtk_widget_show_all (app_window);
- *
- * // realize window now so that the video window gets created and we can
- * // obtain its XID before the pipeline is started up and the videosink
- * // asks for the XID of the window to render onto
- * gtk_widget_realize (window);
- *
- * // we should have the XID now
- * g_assert (video_window_xid != 0);
- * ...
- * // set up sync handler for setting the xid once the pipeline is started
- * bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
- * gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, NULL);
- * gst_object_unref (bus);
- * ...
- * gst_element_set_state (pipeline, GST_STATE_PLAYING);
- * ...
- * }
- * ]|
- * </para>
- * </refsect2>
- * <refsect2>
- * <title>GstVideoOverlay and Qt</title>
- * <para>
- * |[
- * #include <glib.h>
- * #include <gst/gst.h>
- * #include <gst/interfaces/videooverlay.h>
- *
- * #include <QApplication>
- * #include <QTimer>
- * #include <QWidget>
- *
- * int main(int argc, char *argv[])
- * {
- * if (!g_thread_supported ())
- * g_thread_init (NULL);
- *
- * gst_init (&argc, &argv);
- * QApplication app(argc, argv);
- * app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ()));
- *
- * // prepare the pipeline
- *
- * GstElement *pipeline = gst_pipeline_new ("xvoverlay");
- * GstElement *src = gst_element_factory_make ("videotestsrc", NULL);
- * GstElement *sink = gst_element_factory_make ("xvimagesink", NULL);
- * gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
- * gst_element_link (src, sink);
- *
- * // prepare the ui
- *
- * QWidget window;
- * window.resize(320, 240);
- * window.show();
- *
- * WId xwinid = window.winId();
- * gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (sink), xwinid);
- *
- * // run the pipeline
- *
- * GstStateChangeReturn sret = gst_element_set_state (pipeline,
- * GST_STATE_PLAYING);
- * if (sret == GST_STATE_CHANGE_FAILURE) {
- * gst_element_set_state (pipeline, GST_STATE_NULL);
- * gst_object_unref (pipeline);
- * // Exit application
- * QTimer::singleShot(0, QApplication::activeWindow(), SLOT(quit()));
- * }
- *
- * int ret = app.exec();
- *
- * window.hide();
- * gst_element_set_state (pipeline, GST_STATE_NULL);
- * gst_object_unref (pipeline);
- *
- * return ret;
- * }
- * ]|
- * </para>
- * </refsect2>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "videooverlay.h"
-
-GType
-gst_video_overlay_get_type (void)
-{
- static GType gst_video_overlay_type = 0;
-
- if (!gst_video_overlay_type) {
- static const GTypeInfo gst_video_overlay_info = {
- sizeof (GstVideoOverlayInterface),
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- 0,
- 0,
- NULL,
- };
-
- gst_video_overlay_type = g_type_register_static (G_TYPE_INTERFACE,
- "GstVideoOverlay", &gst_video_overlay_info, 0);
- }
-
- return gst_video_overlay_type;
-}
-
-/**
- * gst_video_overlay_set_window_handle:
- * @overlay: a #GstVideoOverlay to set the window on.
- * @handle: a handle referencing the window.
- *
- * This will call the video overlay's set_window_handle method. You
- * should use this method to tell to a XOverlay to display video output to a
- * specific window (e.g. an XWindow on X11). Passing 0 as the @handle will
- * tell the overlay to stop using that window and create an internal one.
- *
- * Since: 0.10.31
- */
-void
-gst_video_overlay_set_window_handle (GstVideoOverlay * overlay, guintptr handle)
-{
- GstVideoOverlayInterface *iface;
-
- g_return_if_fail (overlay != NULL);
- g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
-
- iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
-
- if (iface->set_window_handle) {
- iface->set_window_handle (overlay, handle);
- }
-}
-
-/**
- * gst_video_overlay_got_window_handle:
- * @overlay: a #GstVideoOverlay which got a window
- * @handle: a platform-specific handle referencing the window
- *
- * This will post a "have-window-handle" element message on the bus.
- *
- * This function should only be used by video overlay plugin developers.
- */
-void
-gst_video_overlay_got_window_handle (GstVideoOverlay * overlay, guintptr handle)
-{
- GstStructure *s;
- GstMessage *msg;
-
- g_return_if_fail (overlay != NULL);
- g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
-
- GST_LOG_OBJECT (GST_OBJECT (overlay), "window_handle = %p", (gpointer)
- handle);
- s = gst_structure_new ("have-window-handle",
- "window-handle", G_TYPE_UINT64, (guint64) handle, NULL);
- msg = gst_message_new_element (GST_OBJECT (overlay), s);
- gst_element_post_message (GST_ELEMENT (overlay), msg);
-}
-
-/**
- * gst_video_overlay_prepare_window_handle:
- * @overlay: a #GstVideoOverlay which does not yet have an Window handle set
- *
- * This will post a "prepare-window-handle" element message on the bus
- * to give applications an opportunity to call
- * gst_video_overlay_set_window_handle() before a plugin creates its own
- * window.
- *
- * This function should only be used by video overlay plugin developers.
- */
-void
-gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay)
-{
- GstStructure *s;
- GstMessage *msg;
-
- g_return_if_fail (overlay != NULL);
- g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
-
- GST_LOG_OBJECT (GST_OBJECT (overlay), "prepare window handle");
- s = gst_structure_new_empty ("prepare-window-handle");
- msg = gst_message_new_element (GST_OBJECT (overlay), s);
- gst_element_post_message (GST_ELEMENT (overlay), msg);
-}
-
-/**
- * gst_video_overlay_expose:
- * @overlay: a #GstVideoOverlay to expose.
- *
- * Tell an overlay that it has been exposed. This will redraw the current frame
- * in the drawable even if the pipeline is PAUSED.
- */
-void
-gst_video_overlay_expose (GstVideoOverlay * overlay)
-{
- GstVideoOverlayInterface *iface;
-
- g_return_if_fail (overlay != NULL);
- g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
-
- iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
-
- if (iface->expose) {
- iface->expose (overlay);
- }
-}
-
-/**
- * gst_video_overlay_handle_events:
- * @overlay: a #GstVideoOverlay to expose.
- * @handle_events: a #gboolean indicating if events should be handled or not.
- *
- * Tell an overlay that it should handle events from the window system. These
- * events are forwared upstream as navigation events. In some window system,
- * events are not propagated in the window hierarchy if a client is listening
- * for them. This method allows you to disable events handling completely
- * from the XOverlay.
- *
- * Since: 0.10.12
- */
-void
-gst_video_overlay_handle_events (GstVideoOverlay * overlay,
- gboolean handle_events)
-{
- GstVideoOverlayInterface *iface;
-
- g_return_if_fail (overlay != NULL);
- g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
-
- iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
-
- if (iface->handle_events) {
- iface->handle_events (overlay, handle_events);
- }
-}
-
-/**
- * gst_video_overlay_set_render_rectangle:
- * @overlay: a #GstVideoOverlay
- * @x: the horizontal offset of the render area inside the window
- * @y: the vertical offset of the render area inside the window
- * @width: the width of the render area inside the window
- * @height: the height of the render area inside the window
- *
- * Configure a subregion as a video target within the window set by
- * gst_video_overlay_set_window_handle(). If this is not used or not supported
- * the video will fill the area of the window set as the overlay to 100%.
- * By specifying the rectangle, the video can be overlayed to a specific region
- * of that window only. After setting the new rectangle one should call
- * gst_video_overlay_expose() to force a redraw. To unset the region pass -1 for
- * the @width and @height parameters.
- *
- * This method is needed for non fullscreen video overlay in UI toolkits that
- * do not support subwindows.
- *
- * Returns: %FALSE if not supported by the sink.
- *
- * Since: 0.10.29
- */
-gboolean
-gst_video_overlay_set_render_rectangle (GstVideoOverlay * overlay,
- gint x, gint y, gint width, gint height)
-{
- GstVideoOverlayInterface *iface;
-
- g_return_val_if_fail (overlay != NULL, FALSE);
- g_return_val_if_fail (GST_IS_VIDEO_OVERLAY (overlay), FALSE);
- g_return_val_if_fail ((width == -1 && height == -1) ||
- (width > 0 && height > 0), FALSE);
-
- iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
-
- if (iface->set_render_rectangle) {
- iface->set_render_rectangle (overlay, x, y, width, height);
- return TRUE;
- }
- return FALSE;
-}
-
-/**
- * gst_is_video_overlay_prepare_window_handle_message:
- * @msg: a #GstMessage
- *
- * Convenience function to check if the given message is a
- * "prepare-window-handle" message from a #GstVideoOverlay.
- *
- * Since: 0.11.2
- *
- * Returns: whether @msg is a "prepare-window-handle" message
- */
-gboolean
-gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg)
-{
- g_return_val_if_fail (msg != NULL, FALSE);
-
- if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_ELEMENT)
- return FALSE;
-
- return gst_message_has_name (msg, "prepare-window-handle");
-}
+++ /dev/null
-/* GStreamer Video Overlay Interface
- * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
- * Copyright (C) 2003 Julien Moutte <julien@moutte.net>
- * Copyright (C) 2011 Tim-Philipp Müller <tim@centricular.net>
- *
- * 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.
- */
-
-#ifndef __GST_VIDEO_OVERLAY_H__
-#define __GST_VIDEO_OVERLAY_H__
-
-#include <gst/gst.h>
-
-G_BEGIN_DECLS
-
-#define GST_TYPE_VIDEO_OVERLAY \
- (gst_video_overlay_get_type ())
-#define GST_VIDEO_OVERLAY(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_OVERLAY, GstVideoOverlay))
-#define GST_IS_VIDEO_OVERLAY(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_OVERLAY))
-#define GST_VIDEO_OVERLAY_GET_INTERFACE(inst) \
- (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_OVERLAY, GstVideoOverlayInterface))
-
-/**
- * GstVideoOverlay:
- *
- * Opaque #GstVideoOverlay interface structure
- */
-typedef struct _GstVideoOverlay GstVideoOverlay;
-typedef struct _GstVideoOverlayInterface GstVideoOverlayInterface;
-
-/**
- * GstVideoOverlayInterface:
- * @iface: parent interface type.
- * @expose: virtual method to handle expose events
- * @handle_events: virtual method to handle events
- * @set_render_rectangle: virtual method to set the render rectangle
- * @set_window_handle: virtual method to configure the window handle
- *
- * #GstVideoOverlay interface
- */
-struct _GstVideoOverlayInterface {
- GTypeInterface iface;
-
- /* virtual functions */
- void (*expose) (GstVideoOverlay *overlay);
-
- void (*handle_events) (GstVideoOverlay *overlay, gboolean handle_events);
-
- void (*set_render_rectangle) (GstVideoOverlay *overlay,
- gint x, gint y,
- gint width, gint height);
-
- void (*set_window_handle) (GstVideoOverlay *overlay, guintptr handle);
-};
-
-GType gst_video_overlay_get_type (void);
-
-/* virtual function wrappers */
-
-gboolean gst_video_overlay_set_render_rectangle (GstVideoOverlay * overlay,
- gint x,
- gint y,
- gint width,
- gint height);
-
-void gst_video_overlay_expose (GstVideoOverlay * overlay);
-
-void gst_video_overlay_handle_events (GstVideoOverlay * overlay,
- gboolean handle_events);
-
-void gst_video_overlay_set_window_handle (GstVideoOverlay * overlay,
- guintptr handle);
-
-/* public methods to dispatch bus messages */
-void gst_video_overlay_got_window_handle (GstVideoOverlay * overlay,
- guintptr handle);
-
-void gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay);
-
-gboolean gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg);
-
-G_END_DECLS
-
-#endif /* __GST_VIDEO_OVERLAY_H__ */
# variables used for enum/marshal generation
-glib_enum_headers = video.h
+glib_enum_headers = video.h colorbalance.h
glib_enum_define = GST_VIDEO
glib_gen_prefix = gst_video
glib_gen_basename = video
-built_sources = video-enumtypes.c
-built_headers = video-enumtypes.h
+built_sources = video-enumtypes.c video-marshal.c
+built_headers = video-enumtypes.h video-marshal.h
BUILT_SOURCES = $(built_sources) $(built_headers)
lib_LTLIBRARIES = libgstvideo-@GST_MAJORMINOR@.la
CLEANFILES = $(BUILT_SOURCES)
+EXTRA_DIST = video-marshal.list
+
libgstvideo_@GST_MAJORMINOR@_la_SOURCES = \
- video.c gstvideosink.c gstvideofilter.c convertframe.c gstvideometa.c gstvideopool.c
+ colorbalance.c \
+ colorbalancechannel.c \
+ video.c \
+ gstvideosink.c \
+ gstvideofilter.c \
+ convertframe.c \
+ gstvideometa.c \
+ gstvideopool.c \
+ videoorientation.c \
+ videooverlay.c
+
nodist_libgstvideo_@GST_MAJORMINOR@_la_SOURCES = $(BUILT_SOURCES)
libgstvideo_@GST_MAJORMINOR@includedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/video
--- /dev/null
+/* GStreamer Color Balance
+ * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
+ *
+ * colorbalance.c: image color balance interface design
+ * virtual class function wrappers
+ *
+ * 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 "colorbalance.h"
+#include "video-marshal.h"
+
+/**
+ * SECTION:gstcolorbalance
+ * @short_description: Interface for adjusting color balance settings
+ *
+ * <refsect2><para>
+ * This interface is implemented by elements which can perform some color
+ * balance operation on video frames they process. For example, modifying
+ * the brightness, contrast, hue or saturation.
+ * </para><para>
+ * Example elements are 'xvimagesink' and 'colorbalance'
+ * </para>
+ * </refsect2>
+ */
+
+/* FIXME 0.11: check if we need to add API for sometimes-supportedness
+ * (aka making up for GstImplementsInterface removal) */
+
+/* FIXME 0.11: replace signals with messages (+ make API thread-safe) */
+
+enum
+{
+ VALUE_CHANGED,
+ LAST_SIGNAL
+};
+
+static void gst_color_balance_class_init (GstColorBalanceInterface * iface);
+
+static guint gst_color_balance_signals[LAST_SIGNAL] = { 0 };
+
+GType
+gst_color_balance_get_type (void)
+{
+ static GType gst_color_balance_type = 0;
+
+ if (!gst_color_balance_type) {
+ static const GTypeInfo gst_color_balance_info = {
+ sizeof (GstColorBalanceInterface),
+ (GBaseInitFunc) gst_color_balance_class_init,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ };
+
+ gst_color_balance_type = g_type_register_static (G_TYPE_INTERFACE,
+ "GstColorBalance", &gst_color_balance_info, 0);
+ }
+
+ return gst_color_balance_type;
+}
+
+static void
+gst_color_balance_class_init (GstColorBalanceInterface * iface)
+{
+ static gboolean initialized = FALSE;
+
+ if (!initialized) {
+ /**
+ * GstColorBalance::value-changed:
+ * @colorbalance: The GstColorBalance instance
+ * @channel: The #GstColorBalanceChannel
+ * @value: The new value
+ *
+ * Fired when the value of the indicated channel has changed.
+ */
+ gst_color_balance_signals[VALUE_CHANGED] =
+ g_signal_new ("value-changed",
+ GST_TYPE_COLOR_BALANCE, G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GstColorBalanceInterface, value_changed),
+ NULL, NULL,
+ gst_video_marshal_VOID__OBJECT_INT,
+ G_TYPE_NONE, 2, GST_TYPE_COLOR_BALANCE_CHANNEL, G_TYPE_INT);
+
+ initialized = TRUE;
+ }
+
+ iface->balance_type = GST_COLOR_BALANCE_SOFTWARE;
+
+ /* default virtual functions */
+ iface->list_channels = NULL;
+ iface->set_value = NULL;
+ iface->get_value = NULL;
+}
+
+/**
+ * gst_color_balance_list_channels:
+ * @balance: A #GstColorBalance instance
+ *
+ * Retrieve a list of the available channels.
+ *
+ * Returns: A GList containing pointers to #GstColorBalanceChannel objects.
+ * The list is owned by the #GstColorBalance instance and must not
+ * be freed.
+ */
+const GList *
+gst_color_balance_list_channels (GstColorBalance * balance)
+{
+ GstColorBalanceInterface *iface;
+
+ g_return_val_if_fail (GST_IS_COLOR_BALANCE (balance), NULL);
+
+ iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
+
+ if (iface->list_channels) {
+ return iface->list_channels (balance);
+ }
+
+ return NULL;
+}
+
+/**
+ * gst_color_balance_set_value:
+ * @balance: A #GstColorBalance instance
+ * @channel: A #GstColorBalanceChannel instance
+ * @value: The new value for the channel.
+ *
+ * Sets the current value of the channel to the passed value, which must
+ * be between min_value and max_value.
+ *
+ * See Also: The #GstColorBalanceChannel.min_value and
+ * #GstColorBalanceChannel.max_value members of the
+ * #GstColorBalanceChannel object.
+ */
+void
+gst_color_balance_set_value (GstColorBalance * balance,
+ GstColorBalanceChannel * channel, gint value)
+{
+ GstColorBalanceInterface *iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
+
+ if (iface->set_value) {
+ iface->set_value (balance, channel, value);
+ }
+}
+
+/**
+ * gst_color_balance_get_value:
+ * @balance: A #GstColorBalance instance
+ * @channel: A #GstColorBalanceChannel instance
+ *
+ * Retrieve the current value of the indicated channel, between min_value
+ * and max_value.
+ *
+ * See Also: The #GstColorBalanceChannel.min_value and
+ * #GstColorBalanceChannel.max_value members of the
+ * #GstColorBalanceChannel object.
+ *
+ * Returns: The current value of the channel.
+ */
+gint
+gst_color_balance_get_value (GstColorBalance * balance,
+ GstColorBalanceChannel * channel)
+{
+ GstColorBalanceInterface *iface;
+
+ g_return_val_if_fail (GST_IS_COLOR_BALANCE (balance), 0);
+
+ iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
+
+ if (iface->get_value) {
+ return iface->get_value (balance, channel);
+ }
+
+ return channel->min_value;
+}
+
+/**
+ * gst_color_balance_get_balance_type:
+ * @balance: The #GstColorBalance implementation
+ *
+ * Get the #GstColorBalanceType of this implementation.
+ *
+ * Returns: A the #GstColorBalanceType.
+ *
+ * Since: 0.10.24
+ */
+GstColorBalanceType
+gst_color_balance_get_balance_type (GstColorBalance * balance)
+{
+ GstColorBalanceInterface *iface;
+
+ g_return_val_if_fail (GST_IS_COLOR_BALANCE (balance),
+ GST_COLOR_BALANCE_SOFTWARE);
+
+ iface = GST_COLOR_BALANCE_GET_INTERFACE (balance);
+
+ return iface->balance_type;
+}
+
+/**
+ * gst_color_balance_value_changed:
+ * @balance: A #GstColorBalance instance
+ * @channel: A #GstColorBalanceChannel whose value has changed
+ * @value: The new value of the channel
+ *
+ * A helper function called by implementations of the GstColorBalance
+ * interface. It fires the #GstColorBalance::value-changed signal on the
+ * instance, and the #GstColorBalanceChannel::value-changed signal on the
+ * channel object.
+ */
+void
+gst_color_balance_value_changed (GstColorBalance * balance,
+ GstColorBalanceChannel * channel, gint value)
+{
+
+ g_return_if_fail (GST_IS_COLOR_BALANCE (balance));
+
+ g_signal_emit (G_OBJECT (balance),
+ gst_color_balance_signals[VALUE_CHANGED], 0, channel, value);
+
+ g_signal_emit_by_name (G_OBJECT (channel), "value_changed", value);
+}
--- /dev/null
+/* GStreamer Color Balance
+ * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
+ *
+ * color-balance.h: image color balance interface design
+ *
+ * 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.
+ */
+
+#ifndef __GST_COLOR_BALANCE_H__
+#define __GST_COLOR_BALANCE_H__
+
+#include <gst/gst.h>
+#include <gst/video/colorbalancechannel.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_COLOR_BALANCE \
+ (gst_color_balance_get_type ())
+#define GST_COLOR_BALANCE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_COLOR_BALANCE, GstColorBalance))
+#define GST_IS_COLOR_BALANCE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE))
+#define GST_COLOR_BALANCE_GET_INTERFACE(inst) \
+ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_COLOR_BALANCE, GstColorBalanceInterface))
+
+#define GST_COLOR_BALANCE_TYPE(iface) (iface->balance_type)
+
+typedef struct _GstColorBalance GstColorBalance;
+typedef struct _GstColorBalanceInterface GstColorBalanceInterface;
+
+/**
+ * GstColorBalanceType:
+ * @GST_COLOR_BALANCE_HARDWARE: Color balance is implemented with dedicated
+ * hardware.
+ * @GST_COLOR_BALANCE_SOFTWARE: Color balance is implemented via software
+ * processing.
+ *
+ * An enumeration indicating whether an element implements color balancing
+ * operations in software or in dedicated hardware. In general, dedicated
+ * hardware implementations (such as those provided by xvimagesink) are
+ * preferred.
+ */
+typedef enum
+{
+ GST_COLOR_BALANCE_HARDWARE,
+ GST_COLOR_BALANCE_SOFTWARE
+} GstColorBalanceType;
+
+/**
+ * GstColorBalanceInterface:
+ * @iface: the parent interface
+ * @balance_type: implementation type
+ * @list_channels: list handled channels
+ * @set_value: set a channel value
+ * @get_value: get a channel value
+ * @value_changed: default handler for value changed notification
+ *
+ * Color-balance interface.
+ */
+struct _GstColorBalanceInterface {
+ GTypeInterface iface;
+
+ GstColorBalanceType balance_type;
+
+ /* virtual functions */
+ const GList * (* list_channels) (GstColorBalance *balance);
+
+ void (* set_value) (GstColorBalance *balance,
+ GstColorBalanceChannel *channel,
+ gint value);
+ gint (* get_value) (GstColorBalance *balance,
+ GstColorBalanceChannel *channel);
+
+ /* signals */
+ void (* value_changed) (GstColorBalance *balance,
+ GstColorBalanceChannel *channel,
+ gint value);
+};
+
+GType gst_color_balance_get_type (void);
+
+/* virtual class function wrappers */
+const GList *
+ gst_color_balance_list_channels (GstColorBalance *balance);
+void gst_color_balance_set_value (GstColorBalance *balance,
+ GstColorBalanceChannel *channel,
+ gint value);
+gint gst_color_balance_get_value (GstColorBalance *balance,
+ GstColorBalanceChannel *channel);
+
+GstColorBalanceType
+ gst_color_balance_get_balance_type (GstColorBalance *balance);
+
+/* trigger signal */
+void gst_color_balance_value_changed (GstColorBalance *balance,
+ GstColorBalanceChannel *channel,
+ gint value);
+
+G_END_DECLS
+
+#endif /* __GST_COLOR_BALANCE_H__ */
--- /dev/null
+/* GStreamer Color Balance
+ * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
+ *
+ * colorbalancechannel.c: colorbalance channel object design
+ *
+ * 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 "colorbalancechannel.h"
+
+/**
+ * SECTION:gstcolorbalancechannel
+ * @short_description: Object representing a channel from the #GstColorBalance
+ * interface.
+ *
+ * <refsect2><para>The #GstColorBalanceChannel object represents a parameter
+ * for modifying the color balance implemented by an element providing the
+ * #GstColorBalance interface. For example, Hue or Saturation.
+ * </para></refsect2>
+ */
+
+enum
+{
+ /* FILL ME */
+ SIGNAL_VALUE_CHANGED,
+ LAST_SIGNAL
+};
+
+static void gst_color_balance_channel_class_init (GstColorBalanceChannelClass *
+ klass);
+static void gst_color_balance_channel_init (GstColorBalanceChannel * balance);
+static void gst_color_balance_channel_dispose (GObject * object);
+
+static GObjectClass *parent_class = NULL;
+static guint signals[LAST_SIGNAL] = { 0 };
+
+GType
+gst_color_balance_channel_get_type (void)
+{
+ static GType gst_color_balance_channel_type = 0;
+
+ if (!gst_color_balance_channel_type) {
+ static const GTypeInfo color_balance_channel_info = {
+ sizeof (GstColorBalanceChannelClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) gst_color_balance_channel_class_init,
+ NULL,
+ NULL,
+ sizeof (GstColorBalanceChannel),
+ 0,
+ (GInstanceInitFunc) gst_color_balance_channel_init,
+ NULL
+ };
+
+ gst_color_balance_channel_type =
+ g_type_register_static (G_TYPE_OBJECT,
+ "GstColorBalanceChannel", &color_balance_channel_info, 0);
+ }
+
+ return gst_color_balance_channel_type;
+}
+
+static void
+gst_color_balance_channel_class_init (GstColorBalanceChannelClass * klass)
+{
+ GObjectClass *object_klass = (GObjectClass *) klass;
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ /**
+ * GstColorBalanceChannel::value-changed:
+ * @channel: The #GstColorBalanceChannel
+ * @value: The new value
+ *
+ * Fired when the value of the indicated channel has changed.
+ */
+ signals[SIGNAL_VALUE_CHANGED] =
+ g_signal_new ("value-changed", G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GstColorBalanceChannelClass,
+ value_changed),
+ NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT);
+
+ object_klass->dispose = gst_color_balance_channel_dispose;
+}
+
+static void
+gst_color_balance_channel_init (GstColorBalanceChannel * channel)
+{
+ channel->label = NULL;
+ channel->min_value = channel->max_value = 0;
+}
+
+static void
+gst_color_balance_channel_dispose (GObject * object)
+{
+ GstColorBalanceChannel *channel = GST_COLOR_BALANCE_CHANNEL (object);
+
+ if (channel->label)
+ g_free (channel->label);
+
+ channel->label = NULL;
+
+ if (parent_class->dispose)
+ parent_class->dispose (object);
+}
--- /dev/null
+/* GStreamer Color Balance
+ * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
+ *
+ * colorbalancechannel.h: individual channel object
+ *
+ * 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.
+ */
+
+#ifndef __GST_COLOR_BALANCE_CHANNEL_H__
+#define __GST_COLOR_BALANCE_CHANNEL_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_COLOR_BALANCE_CHANNEL \
+ (gst_color_balance_channel_get_type ())
+#define GST_COLOR_BALANCE_CHANNEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_COLOR_BALANCE_CHANNEL, \
+ GstColorBalanceChannel))
+#define GST_COLOR_BALANCE_CHANNEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL, \
+ GstColorBalanceChannelClass))
+#define GST_IS_COLOR_BALANCE_CHANNEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_COLOR_BALANCE_CHANNEL))
+#define GST_IS_COLOR_BALANCE_CHANNEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_COLOR_BALANCE_CHANNEL))
+
+typedef struct _GstColorBalanceChannel GstColorBalanceChannel;
+typedef struct _GstColorBalanceChannelClass GstColorBalanceChannelClass;
+
+/**
+ * GstColorBalanceChannel:
+ * @label: A string containing a descriptive name for this channel
+ * @min_value: The minimum valid value for this channel.
+ * @max_value: The maximum valid value for this channel.
+ */
+struct _GstColorBalanceChannel {
+ GObject parent;
+
+ /*< public >*/
+ gchar *label;
+ gint min_value;
+ gint max_value;
+
+ /*< private >*/
+ gpointer _gst_reserved[GST_PADDING];
+};
+
+/**
+ * GstColorBalanceChannelClass:
+ * @parent: the parent class
+ * @value_changed: default handler for value changed notification
+ *
+ * Color-balance channel class.
+ */
+struct _GstColorBalanceChannelClass {
+ GObjectClass parent;
+
+ /* signals */
+ void (* value_changed) (GstColorBalanceChannel *channel,
+ gint value);
+
+ /*< private >*/
+ gpointer _gst_reserved[GST_PADDING];
+};
+
+GType gst_color_balance_channel_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_COLOR_BALANCE_CHANNEL_H__ */
--- /dev/null
+VOID:OBJECT,INT
--- /dev/null
+/* GStreamer
+ * Copyright (C) 2006 Nokia <stefan.kost@nokia.com>
+ *
+ * videoorientation.c: video flipping and centering interface
+ *
+ * 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 "videoorientation.h"
+#include "video-marshal.h"
+
+#include <string.h>
+
+/**
+ * SECTION:gstvideoorientation
+ * @short_description: Interface for elements providing video orientation
+ * controls
+ *
+ * The interface allows unified access to control flipping and autocenter
+ * operation of video-sources or operators.
+ *
+ * Since: 0.10.11
+ */
+
+/* FIXME 0.11: check if we need to add API for sometimes-supportedness
+ * (aka making up for GstImplementsInterface removal) (probably yes) */
+
+static void gst_video_orientation_iface_init (GstVideoOrientationInterface *
+ iface);
+
+GType
+gst_video_orientation_get_type (void)
+{
+ static GType gst_video_orientation_type = 0;
+
+ if (!gst_video_orientation_type) {
+ static const GTypeInfo gst_video_orientation_info = {
+ sizeof (GstVideoOrientationInterface),
+ (GBaseInitFunc) gst_video_orientation_iface_init,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ };
+
+ gst_video_orientation_type = g_type_register_static (G_TYPE_INTERFACE,
+ "GstVideoOrientation", &gst_video_orientation_info, 0);
+ }
+
+ return gst_video_orientation_type;
+}
+
+static void
+gst_video_orientation_iface_init (GstVideoOrientationInterface * iface)
+{
+ /* default virtual functions */
+
+ iface->get_hflip = NULL;
+ iface->get_vflip = NULL;
+ iface->get_hcenter = NULL;
+ iface->get_vcenter = NULL;
+
+ iface->set_hflip = NULL;
+ iface->set_vflip = NULL;
+ iface->set_hcenter = NULL;
+ iface->set_vcenter = NULL;
+}
+
+/**
+ * gst_video_orientation_get_hflip:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @flip: return location for the result
+ *
+ * Get the horizontal flipping state (%TRUE for flipped) from the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports flipping
+ */
+gboolean
+gst_video_orientation_get_hflip (GstVideoOrientation * video_orientation,
+ gboolean * flip)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->get_hflip) {
+ return iface->get_hflip (video_orientation, flip);
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_orientation_get_vflip:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @flip: return location for the result
+ *
+ * Get the vertical flipping state (%TRUE for flipped) from the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports flipping
+ */
+gboolean
+gst_video_orientation_get_vflip (GstVideoOrientation * video_orientation,
+ gboolean * flip)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->get_vflip) {
+ return iface->get_vflip (video_orientation, flip);
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_orientation_get_hcenter:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @center: return location for the result
+ *
+ * Get the horizontal centering offset from the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports centering
+ */
+gboolean
+gst_video_orientation_get_hcenter (GstVideoOrientation * video_orientation,
+ gint * center)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->get_hcenter) {
+ return iface->get_hcenter (video_orientation, center);
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_orientation_get_vcenter:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @center: return location for the result
+ *
+ * Get the vertical centering offset from the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports centering
+ */
+gboolean
+gst_video_orientation_get_vcenter (GstVideoOrientation * video_orientation,
+ gint * center)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->get_vcenter) {
+ return iface->get_vcenter (video_orientation, center);
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_orientation_set_hflip:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @flip: use flipping
+ *
+ * Set the horizontal flipping state (%TRUE for flipped) for the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports flipping
+ */
+gboolean
+gst_video_orientation_set_hflip (GstVideoOrientation * video_orientation,
+ gboolean flip)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->set_hflip) {
+ return iface->set_hflip (video_orientation, flip);
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_orientation_set_vflip:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @flip: use flipping
+ *
+ * Set the vertical flipping state (%TRUE for flipped) for the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports flipping
+ */
+gboolean
+gst_video_orientation_set_vflip (GstVideoOrientation * video_orientation,
+ gboolean flip)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->set_vflip) {
+ return iface->set_vflip (video_orientation, flip);
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_orientation_set_hcenter:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @center: centering offset
+ *
+ * Set the horizontal centering offset for the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports centering
+ */
+gboolean
+gst_video_orientation_set_hcenter (GstVideoOrientation * video_orientation,
+ gint center)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->set_hcenter) {
+ return iface->set_hcenter (video_orientation, center);
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_orientation_set_vcenter:
+ * @video_orientation: #GstVideoOrientation interface of a #GstElement
+ * @center: centering offset
+ *
+ * Set the vertical centering offset for the given object.
+ *
+ * Since: 0.10.11
+ * Returns: %TRUE in case the element supports centering
+ */
+gboolean
+gst_video_orientation_set_vcenter (GstVideoOrientation * video_orientation,
+ gint center)
+{
+ GstVideoOrientationInterface *iface =
+ GST_VIDEO_ORIENTATION_GET_INTERFACE (video_orientation);
+
+ if (iface->set_vcenter) {
+ return iface->set_vcenter (video_orientation, center);
+ }
+ return FALSE;
+}
--- /dev/null
+/* GStreamer
+ * Copyright (C) 2006 Nokia <stefan.kost@nokia.com
+ *
+ * videoorientation.h: video flipping and centering interface
+ *
+ * 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.
+ */
+
+#ifndef __GST_VIDEO_ORIENTATION_H__
+#define __GST_VIDEO_ORIENTATION_H__
+
+#include <gst/gst.h>
+#include <gst/interfaces/interfaces-enumtypes.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_VIDEO_ORIENTATION \
+ (gst_video_orientation_get_type ())
+#define GST_VIDEO_ORIENTATION(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientation))
+#define GST_IS_VIDEO_ORIENTATION(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_ORIENTATION))
+#define GST_VIDEO_ORIENTATION_GET_INTERFACE(inst) \
+ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_ORIENTATION, GstVideoOrientationInterface))
+
+/**
+ * GstVideoOrientation:
+ *
+ * Opaque #GstVideoOrientation data structure.
+ */
+typedef struct _GstVideoOrientation GstVideoOrientation;
+typedef struct _GstVideoOrientationInterface GstVideoOrientationInterface;
+
+/**
+ * GstVideoOrientationInterface:
+ * @iface: parent interface type.
+ * @get_hflip: virtual method to get horizontal flipping state
+ * @get_vflip: virtual method to get vertical flipping state
+ * @get_hcenter: virtual method to get horizontal centering state
+ * @get_vcenter: virtual method to get vertical centering state
+ * @set_hflip: virtual method to set horizontal flipping state
+ * @set_vflip: virtual method to set vertical flipping state
+ * @set_hcenter: virtual method to set horizontal centering state
+ * @set_vcenter: virtual method to set vertical centering state
+ *
+ * #GstVideoOrientationInterface interface.
+ */
+struct _GstVideoOrientationInterface {
+ GTypeInterface iface;
+
+ /* FIXME 0.11: fix awkward API? add some kind of get_supported flags thing
+ * and then just return booleans/int from all vfuncs requiring the caller
+ * to check the flags first */
+
+ /* virtual functions */
+ gboolean (* get_hflip) (GstVideoOrientation *video_orientation, gboolean *flip);
+ gboolean (* get_vflip) (GstVideoOrientation *video_orientation, gboolean *flip);
+ gboolean (* get_hcenter) (GstVideoOrientation *video_orientation, gint *center);
+ gboolean (* get_vcenter) (GstVideoOrientation *video_orientation, gint *center);
+
+ gboolean (* set_hflip) (GstVideoOrientation *video_orientation, gboolean flip);
+ gboolean (* set_vflip) (GstVideoOrientation *video_orientation, gboolean flip);
+ gboolean (* set_hcenter) (GstVideoOrientation *video_orientation, gint center);
+ gboolean (* set_vcenter) (GstVideoOrientation *video_orientation, gint center);
+};
+
+GType gst_video_orientation_get_type (void);
+
+/* virtual class function wrappers */
+gboolean gst_video_orientation_get_hflip (GstVideoOrientation *video_orientation, gboolean *flip);
+gboolean gst_video_orientation_get_vflip (GstVideoOrientation *video_orientation, gboolean *flip);
+gboolean gst_video_orientation_get_hcenter (GstVideoOrientation *video_orientation, gint *center);
+gboolean gst_video_orientation_get_vcenter (GstVideoOrientation *video_orientation, gint *center);
+
+gboolean gst_video_orientation_set_hflip (GstVideoOrientation *video_orientation, gboolean flip);
+gboolean gst_video_orientation_set_vflip (GstVideoOrientation *video_orientation, gboolean flip);
+gboolean gst_video_orientation_set_hcenter (GstVideoOrientation *video_orientation, gint center);
+gboolean gst_video_orientation_set_vcenter (GstVideoOrientation *video_orientation, gint center);
+
+G_END_DECLS
+
+#endif /* __GST_VIDEO_ORIENTATION_H__ */
--- /dev/null
+/* GStreamer Video Overlay interface
+ * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
+ * Copyright (C) 2011 Tim-Philipp Müller <tim@centricular.net>
+ *
+ * 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.
+ */
+/**
+ * SECTION:gstvideooverlay
+ * @short_description: Interface for setting/getting a window system resource
+ * on elements supporting it to configure a window into which to render a
+ * video.
+ *
+ * <refsect2>
+ * <para>
+ * The #GstVideoOverlay interface is used for 2 main purposes :
+ * <itemizedlist>
+ * <listitem>
+ * <para>
+ * To get a grab on the Window where the video sink element is going to render.
+ * This is achieved by either being informed about the Window identifier that
+ * the video sink element generated, or by forcing the video sink element to use
+ * a specific Window identifier for rendering.
+ * </para>
+ * </listitem>
+ * <listitem>
+ * <para>
+ * To force a redrawing of the latest video frame the video sink element
+ * displayed on the Window. Indeed if the #GstPipeline is in #GST_STATE_PAUSED
+ * state, moving the Window around will damage its content. Application
+ * developers will want to handle the Expose events themselves and force the
+ * video sink element to refresh the Window's content.
+ * </para>
+ * </listitem>
+ * </itemizedlist>
+ * </para>
+ * <para>
+ * Using the Window created by the video sink is probably the simplest scenario,
+ * in some cases, though, it might not be flexible enough for application
+ * developers if they need to catch events such as mouse moves and button
+ * clicks.
+ * </para>
+ * <para>
+ * Setting a specific Window identifier on the video sink element is the most
+ * flexible solution but it has some issues. Indeed the application needs to set
+ * its Window identifier at the right time to avoid internal Window creation
+ * from the video sink element. To solve this issue a #GstMessage is posted on
+ * the bus to inform the application that it should set the Window identifier
+ * immediately. Here is an example on how to do that correctly:
+ * |[
+ * static GstBusSyncReply
+ * create_window (GstBus * bus, GstMessage * message, GstPipeline * pipeline)
+ * {
+ * // ignore anything but 'prepare-window-handle' element messages
+ * if (!gst_is_video_overlay_prepare_window_handle_message (message))
+ * return GST_BUS_PASS;
+ *
+ * win = XCreateSimpleWindow (disp, root, 0, 0, 320, 240, 0, 0, 0);
+ *
+ * XSetWindowBackgroundPixmap (disp, win, None);
+ *
+ * XMapRaised (disp, win);
+ *
+ * XSync (disp, FALSE);
+ *
+ * gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message)),
+ * win);
+ *
+ * gst_message_unref (message);
+ *
+ * return GST_BUS_DROP;
+ * }
+ * ...
+ * int
+ * main (int argc, char **argv)
+ * {
+ * ...
+ * bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
+ * gst_bus_set_sync_handler (bus, (GstBusSyncHandler) create_window, pipeline);
+ * ...
+ * }
+ * ]|
+ * </para>
+ * </refsect2>
+ * <refsect2>
+ * <title>Two basic usage scenarios</title>
+ * <para>
+ * There are two basic usage scenarios: in the simplest case, the application
+ * knows exactly what particular element is used for video output, which is
+ * usually the case when the application creates the videosink to use
+ * (e.g. #xvimagesink, #ximagesink, etc.) itself; in this case, the application
+ * can just create the videosink element, create and realize the window to
+ * render the video on and then call gst_video_overlay_set_window_handle() directly
+ * with the XID or native window handle, before starting up the pipeline.
+ * </para>
+ * <para>
+ * In the other and more common case, the application does not know in advance
+ * what GStreamer video sink element will be used for video output. This is
+ * usually the case when an element such as #autovideosink or #gconfvideosink
+ * is used. In this case, the video sink element itself is created
+ * asynchronously from a GStreamer streaming thread some time after the
+ * pipeline has been started up. When that happens, however, the video sink
+ * will need to know right then whether to render onto an already existing
+ * application window or whether to create its own window. This is when it
+ * posts a prepare-window-handle message, and that is also why this message needs
+ * to be handled in a sync bus handler which will be called from the streaming
+ * thread directly (because the video sink will need an answer right then).
+ * </para>
+ * <para>
+ * As response to the prepare-window-handle element message in the bus sync
+ * handler, the application may use gst_video_overlay_set_window_handle() to tell
+ * the video sink to render onto an existing window surface. At this point the
+ * application should already have obtained the window handle / XID, so it
+ * just needs to set it. It is generally not advisable to call any GUI toolkit
+ * functions or window system functions from the streaming thread in which the
+ * prepare-window-handle message is handled, because most GUI toolkits and
+ * windowing systems are not thread-safe at all and a lot of care would be
+ * required to co-ordinate the toolkit and window system calls of the
+ * different threads (Gtk+ users please note: prior to Gtk+ 2.18
+ * GDK_WINDOW_XID() was just a simple structure access, so generally fine to do
+ * within the bus sync handler; this macro was changed to a function call in
+ * Gtk+ 2.18 and later, which is likely to cause problems when called from a
+ * sync handler; see below for a better approach without GDK_WINDOW_XID()
+ * used in the callback).
+ * </para>
+ * </refsect2>
+ * <refsect2>
+ * <title>GstVideoOverlay and Gtk+</title>
+ * <para>
+ * |[
+ * #include <gtk/gtk.h>
+ * #ifdef GDK_WINDOWING_X11
+ * #include <gdk/gdkx.h> // for GDK_WINDOW_XID
+ * #endif
+ * ...
+ * static gulong video_window_xid = 0;
+ * ...
+ * static GstBusSyncReply
+ * bus_sync_handler (GstBus * bus, GstMessage * message, gpointer user_data)
+ * {
+ * // ignore anything but 'prepare-window-handle' element messages
+ * if (!gst_is_video_overlay_prepare_window_handle_message (message))
+ * return GST_BUS_PASS;
+ *
+ * if (video_window_xid != 0) {
+ * GstVideoOverlay *xoverlay;
+ *
+ * // GST_MESSAGE_SRC (message) will be the video sink element
+ * xoverlay = GST_VIDEO_OVERLAY (GST_MESSAGE_SRC (message));
+ * gst_video_overlay_set_window_handle (xoverlay, video_window_xid);
+ * } else {
+ * g_warning ("Should have obtained video_window_xid by now!");
+ * }
+ *
+ * gst_message_unref (message);
+ * return GST_BUS_DROP;
+ * }
+ * ...
+ * static void
+ * video_widget_realize_cb (GtkWidget * widget, gpointer data)
+ * {
+ * #if GTK_CHECK_VERSION(2,18,0)
+ * // This is here just for pedagogical purposes, GDK_WINDOW_XID will call
+ * // it as well in newer Gtk versions
+ * if (!gdk_window_ensure_native (widget->window))
+ * g_error ("Couldn't create native window needed for GstVideoOverlay!");
+ * #endif
+ *
+ * #ifdef GDK_WINDOWING_X11
+ * video_window_xid = GDK_WINDOW_XID (video_window->window);
+ * #endif
+ * }
+ * ...
+ * int
+ * main (int argc, char **argv)
+ * {
+ * GtkWidget *video_window;
+ * GtkWidget *app_window;
+ * ...
+ * app_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ * ...
+ * video_window = gtk_drawing_area_new ();
+ * g_signal_connect (video_window, "realize",
+ * G_CALLBACK (video_widget_realize_cb), NULL);
+ * gtk_widget_set_double_buffered (video_window, FALSE);
+ * ...
+ * // usually the video_window will not be directly embedded into the
+ * // application window like this, but there will be many other widgets
+ * // and the video window will be embedded in one of them instead
+ * gtk_container_add (GTK_CONTAINER (ap_window), video_window);
+ * ...
+ * // show the GUI
+ * gtk_widget_show_all (app_window);
+ *
+ * // realize window now so that the video window gets created and we can
+ * // obtain its XID before the pipeline is started up and the videosink
+ * // asks for the XID of the window to render onto
+ * gtk_widget_realize (window);
+ *
+ * // we should have the XID now
+ * g_assert (video_window_xid != 0);
+ * ...
+ * // set up sync handler for setting the xid once the pipeline is started
+ * bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));
+ * gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, NULL);
+ * gst_object_unref (bus);
+ * ...
+ * gst_element_set_state (pipeline, GST_STATE_PLAYING);
+ * ...
+ * }
+ * ]|
+ * </para>
+ * </refsect2>
+ * <refsect2>
+ * <title>GstVideoOverlay and Qt</title>
+ * <para>
+ * |[
+ * #include <glib.h>
+ * #include <gst/gst.h>
+ * #include <gst/interfaces/videooverlay.h>
+ *
+ * #include <QApplication>
+ * #include <QTimer>
+ * #include <QWidget>
+ *
+ * int main(int argc, char *argv[])
+ * {
+ * if (!g_thread_supported ())
+ * g_thread_init (NULL);
+ *
+ * gst_init (&argc, &argv);
+ * QApplication app(argc, argv);
+ * app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit ()));
+ *
+ * // prepare the pipeline
+ *
+ * GstElement *pipeline = gst_pipeline_new ("xvoverlay");
+ * GstElement *src = gst_element_factory_make ("videotestsrc", NULL);
+ * GstElement *sink = gst_element_factory_make ("xvimagesink", NULL);
+ * gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
+ * gst_element_link (src, sink);
+ *
+ * // prepare the ui
+ *
+ * QWidget window;
+ * window.resize(320, 240);
+ * window.show();
+ *
+ * WId xwinid = window.winId();
+ * gst_video_overlay_set_window_handle (GST_VIDEO_OVERLAY (sink), xwinid);
+ *
+ * // run the pipeline
+ *
+ * GstStateChangeReturn sret = gst_element_set_state (pipeline,
+ * GST_STATE_PLAYING);
+ * if (sret == GST_STATE_CHANGE_FAILURE) {
+ * gst_element_set_state (pipeline, GST_STATE_NULL);
+ * gst_object_unref (pipeline);
+ * // Exit application
+ * QTimer::singleShot(0, QApplication::activeWindow(), SLOT(quit()));
+ * }
+ *
+ * int ret = app.exec();
+ *
+ * window.hide();
+ * gst_element_set_state (pipeline, GST_STATE_NULL);
+ * gst_object_unref (pipeline);
+ *
+ * return ret;
+ * }
+ * ]|
+ * </para>
+ * </refsect2>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "videooverlay.h"
+
+GType
+gst_video_overlay_get_type (void)
+{
+ static GType gst_video_overlay_type = 0;
+
+ if (!gst_video_overlay_type) {
+ static const GTypeInfo gst_video_overlay_info = {
+ sizeof (GstVideoOverlayInterface),
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ };
+
+ gst_video_overlay_type = g_type_register_static (G_TYPE_INTERFACE,
+ "GstVideoOverlay", &gst_video_overlay_info, 0);
+ }
+
+ return gst_video_overlay_type;
+}
+
+/**
+ * gst_video_overlay_set_window_handle:
+ * @overlay: a #GstVideoOverlay to set the window on.
+ * @handle: a handle referencing the window.
+ *
+ * This will call the video overlay's set_window_handle method. You
+ * should use this method to tell to a XOverlay to display video output to a
+ * specific window (e.g. an XWindow on X11). Passing 0 as the @handle will
+ * tell the overlay to stop using that window and create an internal one.
+ *
+ * Since: 0.10.31
+ */
+void
+gst_video_overlay_set_window_handle (GstVideoOverlay * overlay, guintptr handle)
+{
+ GstVideoOverlayInterface *iface;
+
+ g_return_if_fail (overlay != NULL);
+ g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
+
+ iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
+
+ if (iface->set_window_handle) {
+ iface->set_window_handle (overlay, handle);
+ }
+}
+
+/**
+ * gst_video_overlay_got_window_handle:
+ * @overlay: a #GstVideoOverlay which got a window
+ * @handle: a platform-specific handle referencing the window
+ *
+ * This will post a "have-window-handle" element message on the bus.
+ *
+ * This function should only be used by video overlay plugin developers.
+ */
+void
+gst_video_overlay_got_window_handle (GstVideoOverlay * overlay, guintptr handle)
+{
+ GstStructure *s;
+ GstMessage *msg;
+
+ g_return_if_fail (overlay != NULL);
+ g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
+
+ GST_LOG_OBJECT (GST_OBJECT (overlay), "window_handle = %p", (gpointer)
+ handle);
+ s = gst_structure_new ("have-window-handle",
+ "window-handle", G_TYPE_UINT64, (guint64) handle, NULL);
+ msg = gst_message_new_element (GST_OBJECT (overlay), s);
+ gst_element_post_message (GST_ELEMENT (overlay), msg);
+}
+
+/**
+ * gst_video_overlay_prepare_window_handle:
+ * @overlay: a #GstVideoOverlay which does not yet have an Window handle set
+ *
+ * This will post a "prepare-window-handle" element message on the bus
+ * to give applications an opportunity to call
+ * gst_video_overlay_set_window_handle() before a plugin creates its own
+ * window.
+ *
+ * This function should only be used by video overlay plugin developers.
+ */
+void
+gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay)
+{
+ GstStructure *s;
+ GstMessage *msg;
+
+ g_return_if_fail (overlay != NULL);
+ g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
+
+ GST_LOG_OBJECT (GST_OBJECT (overlay), "prepare window handle");
+ s = gst_structure_new_empty ("prepare-window-handle");
+ msg = gst_message_new_element (GST_OBJECT (overlay), s);
+ gst_element_post_message (GST_ELEMENT (overlay), msg);
+}
+
+/**
+ * gst_video_overlay_expose:
+ * @overlay: a #GstVideoOverlay to expose.
+ *
+ * Tell an overlay that it has been exposed. This will redraw the current frame
+ * in the drawable even if the pipeline is PAUSED.
+ */
+void
+gst_video_overlay_expose (GstVideoOverlay * overlay)
+{
+ GstVideoOverlayInterface *iface;
+
+ g_return_if_fail (overlay != NULL);
+ g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
+
+ iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
+
+ if (iface->expose) {
+ iface->expose (overlay);
+ }
+}
+
+/**
+ * gst_video_overlay_handle_events:
+ * @overlay: a #GstVideoOverlay to expose.
+ * @handle_events: a #gboolean indicating if events should be handled or not.
+ *
+ * Tell an overlay that it should handle events from the window system. These
+ * events are forwared upstream as navigation events. In some window system,
+ * events are not propagated in the window hierarchy if a client is listening
+ * for them. This method allows you to disable events handling completely
+ * from the XOverlay.
+ *
+ * Since: 0.10.12
+ */
+void
+gst_video_overlay_handle_events (GstVideoOverlay * overlay,
+ gboolean handle_events)
+{
+ GstVideoOverlayInterface *iface;
+
+ g_return_if_fail (overlay != NULL);
+ g_return_if_fail (GST_IS_VIDEO_OVERLAY (overlay));
+
+ iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
+
+ if (iface->handle_events) {
+ iface->handle_events (overlay, handle_events);
+ }
+}
+
+/**
+ * gst_video_overlay_set_render_rectangle:
+ * @overlay: a #GstVideoOverlay
+ * @x: the horizontal offset of the render area inside the window
+ * @y: the vertical offset of the render area inside the window
+ * @width: the width of the render area inside the window
+ * @height: the height of the render area inside the window
+ *
+ * Configure a subregion as a video target within the window set by
+ * gst_video_overlay_set_window_handle(). If this is not used or not supported
+ * the video will fill the area of the window set as the overlay to 100%.
+ * By specifying the rectangle, the video can be overlayed to a specific region
+ * of that window only. After setting the new rectangle one should call
+ * gst_video_overlay_expose() to force a redraw. To unset the region pass -1 for
+ * the @width and @height parameters.
+ *
+ * This method is needed for non fullscreen video overlay in UI toolkits that
+ * do not support subwindows.
+ *
+ * Returns: %FALSE if not supported by the sink.
+ *
+ * Since: 0.10.29
+ */
+gboolean
+gst_video_overlay_set_render_rectangle (GstVideoOverlay * overlay,
+ gint x, gint y, gint width, gint height)
+{
+ GstVideoOverlayInterface *iface;
+
+ g_return_val_if_fail (overlay != NULL, FALSE);
+ g_return_val_if_fail (GST_IS_VIDEO_OVERLAY (overlay), FALSE);
+ g_return_val_if_fail ((width == -1 && height == -1) ||
+ (width > 0 && height > 0), FALSE);
+
+ iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
+
+ if (iface->set_render_rectangle) {
+ iface->set_render_rectangle (overlay, x, y, width, height);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * gst_is_video_overlay_prepare_window_handle_message:
+ * @msg: a #GstMessage
+ *
+ * Convenience function to check if the given message is a
+ * "prepare-window-handle" message from a #GstVideoOverlay.
+ *
+ * Since: 0.11.2
+ *
+ * Returns: whether @msg is a "prepare-window-handle" message
+ */
+gboolean
+gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg)
+{
+ g_return_val_if_fail (msg != NULL, FALSE);
+
+ if (GST_MESSAGE_TYPE (msg) != GST_MESSAGE_ELEMENT)
+ return FALSE;
+
+ return gst_message_has_name (msg, "prepare-window-handle");
+}
--- /dev/null
+/* GStreamer Video Overlay Interface
+ * Copyright (C) 2003 Ronald Bultje <rbultje@ronald.bitfreak.net>
+ * Copyright (C) 2003 Julien Moutte <julien@moutte.net>
+ * Copyright (C) 2011 Tim-Philipp Müller <tim@centricular.net>
+ *
+ * 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.
+ */
+
+#ifndef __GST_VIDEO_OVERLAY_H__
+#define __GST_VIDEO_OVERLAY_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_VIDEO_OVERLAY \
+ (gst_video_overlay_get_type ())
+#define GST_VIDEO_OVERLAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_OVERLAY, GstVideoOverlay))
+#define GST_IS_VIDEO_OVERLAY(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_OVERLAY))
+#define GST_VIDEO_OVERLAY_GET_INTERFACE(inst) \
+ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_OVERLAY, GstVideoOverlayInterface))
+
+/**
+ * GstVideoOverlay:
+ *
+ * Opaque #GstVideoOverlay interface structure
+ */
+typedef struct _GstVideoOverlay GstVideoOverlay;
+typedef struct _GstVideoOverlayInterface GstVideoOverlayInterface;
+
+/**
+ * GstVideoOverlayInterface:
+ * @iface: parent interface type.
+ * @expose: virtual method to handle expose events
+ * @handle_events: virtual method to handle events
+ * @set_render_rectangle: virtual method to set the render rectangle
+ * @set_window_handle: virtual method to configure the window handle
+ *
+ * #GstVideoOverlay interface
+ */
+struct _GstVideoOverlayInterface {
+ GTypeInterface iface;
+
+ /* virtual functions */
+ void (*expose) (GstVideoOverlay *overlay);
+
+ void (*handle_events) (GstVideoOverlay *overlay, gboolean handle_events);
+
+ void (*set_render_rectangle) (GstVideoOverlay *overlay,
+ gint x, gint y,
+ gint width, gint height);
+
+ void (*set_window_handle) (GstVideoOverlay *overlay, guintptr handle);
+};
+
+GType gst_video_overlay_get_type (void);
+
+/* virtual function wrappers */
+
+gboolean gst_video_overlay_set_render_rectangle (GstVideoOverlay * overlay,
+ gint x,
+ gint y,
+ gint width,
+ gint height);
+
+void gst_video_overlay_expose (GstVideoOverlay * overlay);
+
+void gst_video_overlay_handle_events (GstVideoOverlay * overlay,
+ gboolean handle_events);
+
+void gst_video_overlay_set_window_handle (GstVideoOverlay * overlay,
+ guintptr handle);
+
+/* public methods to dispatch bus messages */
+void gst_video_overlay_got_window_handle (GstVideoOverlay * overlay,
+ guintptr handle);
+
+void gst_video_overlay_prepare_window_handle (GstVideoOverlay * overlay);
+
+gboolean gst_is_video_overlay_prepare_window_handle_message (GstMessage * msg);
+
+G_END_DECLS
+
+#endif /* __GST_VIDEO_OVERLAY_H__ */
/* Our interfaces */
#include <gst/interfaces/navigation.h>
-#include <gst/interfaces/videooverlay.h>
+#include <gst/video/videooverlay.h>
#include <gst/video/gstvideometa.h>
/* Our interfaces */
#include <gst/interfaces/navigation.h>
-#include <gst/interfaces/videooverlay.h>
-#include <gst/interfaces/colorbalance.h>
#include <gst/interfaces/propertyprobe.h>
+#include <gst/video/videooverlay.h>
+#include <gst/video/colorbalance.h>
/* Helper functions */
#include <gst/video/gstvideometa.h>
#include <gst/fft/gstffts16.h>
#include <gst/fft/gstffts32.h>
-#include <gst/interfaces/colorbalancechannel.h>
-#include <gst/interfaces/colorbalance.h>
#include <gst/interfaces/interfaces-enumtypes.h>
#include <gst/interfaces/interfaces-marshal.h>
#include <gst/interfaces/mixer.h>
#include <gst/interfaces/tunerchannel.h>
#include <gst/interfaces/tuner.h>
#include <gst/interfaces/tunernorm.h>
-#include <gst/interfaces/videoorientation.h>
-#include <gst/interfaces/videooverlay.h>
#include <gst/pbutils/codec-utils.h>
#include <gst/pbutils/descriptions.h>
#include <gst/video/gstvideofilter.h>
#include <gst/video/gstvideosink.h>
#include <gst/video/video-enumtypes.h>
+#include <gst/video/video-marshal.h>
#include <gst/video/video.h>
+#include <gst/video/colorbalancechannel.h>
+#include <gst/video/colorbalance.h>
+#include <gst/video/videoorientation.h>
+#include <gst/video/videooverlay.h>
/* we mostly just want to make sure that our library headers don't
* contain anything a C++ compiler might not like */
#include <gst/fft/gstffts32.h>
#include <gst/fft/gstfftf32.h>
#include <gst/fft/gstfftf64.h>
-#include <gst/interfaces/colorbalance.h>
#include <gst/interfaces/mixer.h>
#include <gst/interfaces/navigation.h>
#include <gst/interfaces/propertyprobe.h>
#include <gst/interfaces/streamvolume.h>
#include <gst/interfaces/tuner.h>
-#include <gst/interfaces/videoorientation.h>
-#include <gst/interfaces/videooverlay.h>
#include <gst/pbutils/pbutils.h>
#include <gst/riff/riff-media.h>
#include <gst/riff/riff-read.h>
#include <gst/video/video.h>
#include <gst/video/gstvideofilter.h>
#include <gst/video/gstvideosink.h>
+#include <gst/video/colorbalance.h>
+#include <gst/video/videoorientation.h>
+#include <gst/video/videooverlay.h>
/* initial version of the file was generated using:
* grep -A1 "<STRUCT>" ../../docs/libs/gst-plugins-base-libs-decl.txt | \
gtk_videooverlay_SOURCES = gtk-videooverlay.c
gtk_videooverlay_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(X_CFLAGS) $(GTK_CFLAGS)
gtk_videooverlay_LDADD = \
- $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
+ $(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la \
$(GST_LIBS) $(X_LIBS) $(LIBM) $(GTK_LIBS)
endif
qt_videooverlay_SOURCES = qt-videooverlay.cpp
qt_videooverlay_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) $(X_CFLAGS) $(QT_CFLAGS)
qt_videooverlay_LDADD = \
- $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
+ $(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la \
$(GST_LIBS) $(X_LIBS) $(LIBM) $(QT_LIBS)
endif
qtgv_videooverlay_SOURCES = qtgv-videooverlay.cpp qtgv-videooverlay.h
qtgv_videooverlay_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) $(X_CFLAGS) $(QT_CFLAGS)
qtgv_videooverlay_LDADD = \
- $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
+ $(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la \
$(GST_LIBS) $(X_LIBS) $(LIBM) $(QT_LIBS)
# qt moc support, according to http://qtnode.net/wiki/Qt_with_autotools
#include <glib.h>
#include <gst/gst.h>
-#include <gst/interfaces/videooverlay.h>
+#include <gst/video/videooverlay.h>
#include <QApplication>
#include <QTimer>
#include <QApplication>
#include <QTimer>
-#include <gst/interfaces/videooverlay.h>
+#include <gst/video/videooverlay.h>
SinkPipeline::SinkPipeline(QGraphicsView *parent) : QObject(parent)
{
stress_videooverlay_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) $(GST_CFLAGS) $(X_CFLAGS)
stress_videooverlay_LDADD = \
- $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
+ $(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la \
$(GST_LIBS) $(X_LIBS) $(LIBM)
if HAVE_GTK_X11
test_colorkey_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) $(GST_CFLAGS) $(X_CFLAGS) $(GTK_CFLAGS)
test_colorkey_LDADD = \
- $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
+ $(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la \
$(GST_LIBS) $(X_LIBS) $(LIBM) $(GTK_LIBS)
test_videooverlay_SOURCES = test-videooverlay.c
test_videooverlay_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) $(GST_CFLAGS) $(X_CFLAGS) $(GTK_CFLAGS)
test_videooverlay_LDADD = \
- $(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces-$(GST_MAJORMINOR).la \
+ $(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_MAJORMINOR).la \
$(GST_LIBS) $(X_LIBS) $(LIBM) $(GTK_LIBS)
endif
#endif
#include <gst/gst.h>
-#include <gst/interfaces/videooverlay.h>
+#include <gst/video/videooverlay.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>