LOCAL_SRC_FILES:= $(addprefix ../,$(apetag_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgsttag-0.10 \
- libgstpbutils-0.10
+ libgsttag-0.11 \
+ libgstpbutils-0.11
LOCAL_MODULE:= libgstapetag
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(avi_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgstriff-0.10
+ libgstriff-0.11
LOCAL_MODULE:= libgstavi
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH)/ \
$(LOCAL_PATH)/gst-libs/gst/audio \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(flv_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(icydemux_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgsttag-0.10
+ libgsttag-0.11
LOCAL_MODULE:= libgsticydemux
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(id3demux_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgsttag-0.10 \
- libgstpbutils-0.10
+ libgsttag-0.11 \
+ libgstpbutils-0.11
LOCAL_MODULE:= libgstid3demux
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(qtdemux_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgsttag-0.10 \
- libgstrtp-0.10 \
- libgstriff-0.10 \
- libgstaudio-0.10
+ libgsttag-0.11 \
+ libgstrtp-0.11 \
+ libgstriff-0.11 \
+ libgstaudio-0.11
LOCAL_MODULE:= libgstqtdemux
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(rtp_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgsttag-0.10 \
- libgstrtp-0.10 \
- libgstaudio-0.10
+ libgsttag-0.11 \
+ libgstrtp-0.11 \
+ libgstaudio-0.11
LOCAL_MODULE:= libgstrtp
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
$(addprefix ../android/,$(rtpmanager_LOCAL_SRC_FILES_ANDROID))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgstnetbuffer-0.10 \
- libgstrtp-0.10
+ libgstnetbuffer-0.11 \
+ libgstrtp-0.11
LOCAL_MODULE:= libgstrtpmanager
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
$(LOCAL_PATH)/gst/rtpmanager \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(rtsp_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgstrtp-0.10 \
- libgstinterfaces-0.10 \
- libgstrtsp-0.10 \
- libgstsdp-0.10
+ libgstrtp-0.11 \
+ libgstinterfaces-0.11 \
+ libgstrtsp-0.11 \
+ libgstsdp-0.11
LOCAL_MODULE:= libgstrtsp
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(soup_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgsttag-0.10 \
+ libgsttag-0.11 \
libsoup-2.4
LOCAL_MODULE:= libgstsouphttpsrc
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include \
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
$(addprefix ../android/,$(udp_LOCAL_SRC_FILES_ANDROID))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgsttag-0.10 \
- libgstnetbuffer-0.10
+ libgsttag-0.11 \
+ libgstnetbuffer-0.11
LOCAL_MODULE:= libgstudp
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
$(LOCAL_PATH)/gst/udp \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(wavenc_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgstriff-0.10
+ libgstriff-0.11
LOCAL_MODULE:= libgstwavenc
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
LOCAL_SRC_FILES:= $(addprefix ../,$(wavparse_LOCAL_SRC_FILES))
LOCAL_SHARED_LIBRARIES := \
- libgstreamer-0.10 \
- libgstbase-0.10 \
+ libgstreamer-0.11 \
+ libgstbase-0.11 \
libglib-2.0 \
libgthread-2.0 \
libgmodule-2.0 \
libgobject-2.0 \
- libgstriff-0.10
+ libgstriff-0.11
LOCAL_MODULE:= libgstwavparse
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../gst-libs \
$(LOCAL_PATH) \
- $(TARGET_OUT_HEADERS)/gstreamer-0.10 \
+ $(TARGET_OUT_HEADERS)/gstreamer-0.11 \
$(TARGET_OUT_HEADERS)/glib-2.0 \
$(TARGET_OUT_HEADERS)/glib-2.0/glib \
external/libxml2/include
#
LOCAL_PRELINK_MODULE := false
-#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.10
-LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.10
+#It's a gstreamer plugins, and it must be installed on ..../lib/gstreamer-0.11
+LOCAL_MODULE_PATH := $(TARGET_OUT)/lib/gstreamer-0.11
include $(BUILD_SHARED_LIBRARY)
dnl initialize autoconf
dnl releases only do -Wall, git and prerelease does -Werror too
dnl use a three digit version number for releases, and four for git/pre
-AC_INIT(GStreamer Good Plug-ins, 0.10.27.1,
+AC_INIT(GStreamer Good Plug-ins, 0.11.0.1,
http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
gst-plugins-good)
dnl our libraries and install dirs use major.minor as a version
GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
dnl we override it here if we need to for the release candidate of new series
-GST_MAJORMINOR=0.10
+GST_MAJORMINOR=0.11
AC_SUBST(GST_MAJORMINOR)
AG_GST_LIBTOOL_PREPARE
AM_PROG_LIBTOOL
dnl *** required versions of GStreamer stuff ***
-GST_REQ=0.10.32
-GSTPB_REQ=0.10.32
+GST_REQ=0.11.0
+GSTPB_REQ=0.11.0
dnl *** autotools stuff ****
-e "s/.* PACKAGE_STRING$/#define PACKAGE_STRING \"$PACKAGE_STRING\"/" \
-e 's/.* PACKAGE_TARNAME$/#define PACKAGE_TARNAME "'$PACKAGE_TARNAME'"/' \
-e 's/.* PACKAGE_VERSION$/#define PACKAGE_VERSION "'$PACKAGE_VERSION'"/' \
- -e 's/.* PLUGINDIR$/#ifdef _DEBUG\n# define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-0.10"\n#else\n# define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-0.10"\n#endif/' \
+ -e 's/.* PLUGINDIR$/#ifdef _DEBUG\n# define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-0.11"\n#else\n# define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-0.11"\n#endif/' \
-e 's/.* USE_BINARY_REGISTRY$/#define USE_BINARY_REGISTRY/' \
-e 's/.* VERSION$/#define VERSION "'$VERSION'"/' \
-e "s/.* DEFAULT_AUDIOSINK$/#define DEFAULT_AUDIOSINK \"directsoundsink\"/" \
GST_OBJECT_LOCK (dec);
dec->proportion = proportion;
if (G_LIKELY (ts != GST_CLOCK_TIME_NONE)) {
- if (G_UNLIKELY (diff > 0))
+ if (G_UNLIKELY (diff > dec->qos_duration))
dec->earliest_time = ts + 2 * diff + dec->qos_duration;
else
dec->earliest_time = ts + diff;
GstBuffer *buf;
val = gst_tag_list_get_value_index (list, tag, i);
- buf = (GstBuffer *) gst_value_get_mini_object (val);
+ buf = (GstBuffer *) g_value_get_boxed (val);
if (buf && GST_BUFFER_CAPS (buf)) {
GstStructure *s;
GST_DEBUG ("image %u/%u", n + 1, num_tags);
val = gst_tag_list_get_value_index (list, tag, n);
- image = (GstBuffer *) gst_value_get_mini_object (val);
+ image = (GstBuffer *) g_value_get_boxed (val);
if (GST_IS_BUFFER (image) && GST_BUFFER_SIZE (image) > 0 &&
GST_BUFFER_CAPS (image) != NULL &&
case PROP_PREFER_PASSTHROUGH:{
gboolean prefer_passthrough = g_value_get_boolean (value);
- reconfigure = ((! !prefer_passthrough) != (! !alpha->prefer_passthrough))
+ reconfigure = ((!!prefer_passthrough) != (!!alpha->prefer_passthrough))
&& (alpha->method == ALPHA_METHOD_SET) && (alpha->alpha == 1.0);
alpha->prefer_passthrough = prefer_passthrough;
break;
static GstElementClass *parent_class = NULL;
-typedef struct _GstFencedBuffer GstFencedBuffer;
-struct _GstFencedBuffer
+typedef struct _GstMetaFenced
{
- GstBuffer buffer;
+ GstMeta meta;
+
void *region;
unsigned int length;
-};
+} GstMetaFenced;
+
+static const GstMetaInfo *
+gst_meta_fenced_get_info (void)
+{
+ static const GstMetaInfo *meta_fenced_info = NULL;
+
+ if (meta_fenced_info == NULL) {
+ meta_fenced_info = gst_meta_register ("GstMetaFenced", "GstMetaFenced",
+ sizeof (GstMetaFenced),
+ (GstMetaInitFunction) NULL,
+ (GstMetaFreeFunction) NULL,
+ (GstMetaCopyFunction) NULL,
+ (GstMetaSubFunction) NULL,
+ (GstMetaSerializeFunction) NULL, (GstMetaDeserializeFunction) NULL);
+ }
+ return meta_fenced_info;
+}
-GType gst_fenced_buffer_get_type (void);
-static void gst_fenced_buffer_finalize (GstFencedBuffer * buf);
-static GstFencedBuffer *gst_fenced_buffer_copy (const GstBuffer * buffer);
+#define GST_META_FENCED_GET(buf) ((GstMetaFenced *)gst_buffer_get_meta(buf,gst_meta_fenced_get_info()))
+#define GST_META_FENCED_ADD(buf) ((GstMetaFenced *)gst_buffer_add_meta(buf,gst_meta_fenced_get_info(),NULL))
+
+static void gst_fenced_buffer_dispose (GstBuffer * buf);
+static GstBuffer *gst_fenced_buffer_copy (const GstBuffer * buffer);
static void *gst_fenced_buffer_alloc (GstBuffer * buffer, unsigned int length,
gboolean fence_top);
+#if 0
static GstFlowReturn gst_efence_buffer_alloc (GstPad * pad, guint64 offset,
guint size, GstCaps * caps, GstBuffer ** buf);
-
-#define GST_TYPE_FENCED_BUFFER (gst_fenced_buffer_get_type())
-
-#define GST_IS_FENCED_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_FENCED_BUFFER))
-#define GST_FENCED_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_FENCED_BUFFER, GstFencedBuffer))
+#endif
GType
gst_gst_efence_get_type (void)
GST_DEBUG_FUNCPTR (gst_pad_proxy_setcaps));
gst_pad_set_chain_function (filter->sinkpad,
GST_DEBUG_FUNCPTR (gst_efence_chain));
+#if 0
gst_pad_set_bufferalloc_function (filter->sinkpad,
GST_DEBUG_FUNCPTR (gst_efence_buffer_alloc));
+#endif
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
filter->srcpad =
efence = GST_EFENCE (GST_OBJECT_PARENT (pad));
g_return_val_if_fail (GST_IS_EFENCE (efence), GST_FLOW_ERROR);
+#if 0
if (GST_IS_FENCED_BUFFER (buffer)) {
GST_DEBUG_OBJECT (efence, "Passing on existing fenced buffer with caps %"
GST_PTR_FORMAT, GST_BUFFER_CAPS (buffer));
return gst_pad_push (efence->srcpad, buffer);
}
+#endif
copy = (GstBuffer *) gst_fenced_buffer_copy (buffer);
return gst_pad_activate_pull (efence->sinkpad, active);
}
+#if 0
static GstFlowReturn
gst_efence_buffer_alloc (GstPad * pad, guint64 offset,
guint size, GstCaps * caps, GstBuffer ** buf)
return GST_FLOW_OK;
}
+#endif
static void
gst_efence_set_property (GObject * object, guint prop_id,
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN);
-static GstBufferClass *fenced_buffer_parent_class = NULL;
-
static void
-gst_fenced_buffer_finalize (GstFencedBuffer * buffer)
+gst_fenced_buffer_dispose (GstBuffer * buffer)
{
- GstFencedBuffer *fenced_buffer;
+ GstMetaFenced *meta;
- GST_DEBUG ("free buffer=%p", buffer);
+ meta = GST_META_FENCED_GET (buffer);
- fenced_buffer = GST_FENCED_BUFFER (buffer);
+ GST_DEBUG ("free buffer=%p", buffer);
/* free our data */
if (GST_BUFFER_DATA (buffer)) {
- GST_DEBUG ("free region %p %d", fenced_buffer->region,
- fenced_buffer->length);
- munmap (fenced_buffer->region, fenced_buffer->length);
+ GST_DEBUG ("free region %p %d", meta->region, meta->length);
+ munmap (meta->region, meta->length);
}
-
- GST_MINI_OBJECT_CLASS (fenced_buffer_parent_class)->finalize (GST_MINI_OBJECT
- (buffer));
}
-static GstFencedBuffer *
+static GstBuffer *
gst_fenced_buffer_copy (const GstBuffer * buffer)
{
GstBuffer *copy;
g_return_val_if_fail (buffer != NULL, NULL);
/* create a fresh new buffer */
- copy = (GstBuffer *) gst_mini_object_new (GST_TYPE_FENCED_BUFFER);
+ copy = gst_buffer_new ();
/* we simply copy everything from our parent */
- ptr = gst_fenced_buffer_alloc (GST_BUFFER (copy),
- GST_BUFFER_SIZE (buffer), TRUE);
+ ptr = gst_fenced_buffer_alloc (copy, GST_BUFFER_SIZE (buffer), TRUE);
memcpy (ptr, GST_BUFFER_DATA (buffer), GST_BUFFER_SIZE (buffer));
/* copy relevant flags */
", caps: %" GST_PTR_FORMAT, buffer,
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (copy)), GST_BUFFER_CAPS (copy));
- return GST_FENCED_BUFFER (copy);
+ return copy;
}
void *
{
int alloc_size;
void *region;
- GstFencedBuffer *fenced_buffer = (GstFencedBuffer *) buffer;
+ GstMetaFenced *meta;
int page_size;
GST_DEBUG ("buffer=%p length=%d fence_top=%d", buffer, length, fence_top);
g_warning ("mmap failed");
return NULL;
}
+
+ GST_MINI_OBJECT_CAST (buffer)->dispose =
+ (GstMiniObjectDisposeFunction) gst_fenced_buffer_dispose;
+ GST_MINI_OBJECT_CAST (buffer)->copy =
+ (GstMiniObjectCopyFunction) gst_fenced_buffer_copy;
+
+ meta = GST_META_FENCED_ADD (buffer);
+
#if 0
munmap (region, page_size);
munmap (region + alloc_size - page_size, page_size);
- fenced_buffer->region = region + page_size;
- fenced_buffer->length = alloc_size - page_size;
+ meta->region = region + page_size;
+ meta->length = alloc_size - page_size;
#else
mprotect (region, page_size, PROT_NONE);
mprotect ((char *) region + alloc_size - page_size, page_size, PROT_NONE);
- fenced_buffer->region = region;
- fenced_buffer->length = alloc_size;
+ meta->region = region;
+ meta->length = alloc_size;
#endif
- GST_DEBUG ("new region %p %d", fenced_buffer->region, fenced_buffer->length);
+ GST_DEBUG ("new region %p %d", meta->region, meta->length);
if (fence_top) {
int offset;
return (void *) ((char *) region + page_size);
}
}
-
-static void
-gst_fenced_buffer_class_init (gpointer g_class, gpointer class_data)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
-
- fenced_buffer_parent_class = g_type_class_peek_parent (g_class);
-
- mini_object_class->finalize =
- (GstMiniObjectFinalizeFunction) gst_fenced_buffer_finalize;
- mini_object_class->copy = (GstMiniObjectCopyFunction) gst_fenced_buffer_copy;
-}
-
-GType
-gst_fenced_buffer_get_type (void)
-{
- static GType fenced_buf_type = 0;
-
- if (G_UNLIKELY (!fenced_buf_type)) {
- static const GTypeInfo fenced_buf_info = {
- sizeof (GstBufferClass),
- NULL,
- NULL,
- (GClassInitFunc) gst_fenced_buffer_class_init,
- NULL,
- NULL,
- sizeof (GstFencedBuffer),
- 0,
- NULL,
- };
-
- fenced_buf_type = g_type_register_static (GST_TYPE_BUFFER,
- "GstFencedBuffer", &fenced_buf_info, 0);
- }
- return fenced_buf_type;
-}
libgstreplaygain_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
libgstreplaygain_la_LIBADD = \
- $(GST_PLUGINS_BASE_LIBS) -lgstpbutils-0.10 \
+ $(GST_PLUGINS_BASE_LIBS) -lgstpbutils-$(GST_MAJORMINOR) \
$(GST_BASE_LIBS) $(GST_LIBS) $(LIBM)
libgstreplaygain_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstreplaygain_la_LIBTOOLFLAGS = --tag=disable-static
gboolean rtp, GstBuffer * buffer, GstClockTime current_time,
GstClockTime running_time, guint64 ntpnstime)
{
+ GstMetaNetAddress *meta;
+
/* get time of arrival */
arrival->current_time = current_time;
arrival->running_time = running_time;
}
/* for netbuffer we can store the IP address to check for collisions */
- arrival->have_address = GST_IS_NETBUFFER (buffer);
- if (arrival->have_address) {
- GstNetBuffer *netbuf = (GstNetBuffer *) buffer;
-
- memcpy (&arrival->address, &netbuf->from, sizeof (GstNetAddress));
+ meta = gst_buffer_get_meta_net_address (buffer);
+ if (meta) {
+ arrival->have_address = TRUE;
+ memcpy (&arrival->address, &meta->naddr, sizeof (GstNetAddress));
+ } else {
+ arrival->have_address = FALSE;
}
}
/* we keep these elements, we configure all in configure_transport when the
* server told us to really use the UDP ports. */
- stream->udpsrc[0] = gst_object_ref (udpsrc0);
- stream->udpsrc[1] = gst_object_ref (udpsrc1);
+ stream->udpsrc[0] = gst_object_ref_sink (udpsrc0);
+ stream->udpsrc[1] = gst_object_ref_sink (udpsrc1);
/* keep track of next available port number when we have a range
* configured */
if (src->next_port_num != 0)
src->next_port_num = tmp_rtcp + 1;
- /* they are ours now */
- gst_object_sink (udpsrc0);
- gst_object_sink (udpsrc1);
-
return TRUE;
/* ERRORS */
goto no_element;
/* take ownership */
- gst_object_ref (stream->udpsrc[0]);
- gst_object_sink (stream->udpsrc[0]);
+ gst_object_ref_sink (stream->udpsrc[0]);
/* change state */
gst_element_set_state (stream->udpsrc[0], GST_STATE_PAUSED);
goto no_element;
/* take ownership */
- gst_object_ref (stream->udpsrc[1]);
- gst_object_sink (stream->udpsrc[1]);
+ gst_object_ref_sink (stream->udpsrc[1]);
gst_element_set_state (stream->udpsrc[1], GST_STATE_PAUSED);
}
GstDynUDPSink *sink;
gint ret, size;
guint8 *data;
- GstNetBuffer *netbuf;
+ GstMetaNetAddress *meta;
struct sockaddr_in theiraddr;
guint16 destport;
guint32 destaddr;
memset (&theiraddr, 0, sizeof (theiraddr));
- if (GST_IS_NETBUFFER (buffer)) {
- netbuf = GST_NETBUFFER (buffer);
- } else {
+ meta = gst_buffer_get_meta_net_address (buffer);
+
+ if (meta == NULL) {
GST_DEBUG ("Received buffer is not a GstNetBuffer, skipping");
return GST_FLOW_OK;
}
sink = GST_DYNUDPSINK (bsink);
- size = GST_BUFFER_SIZE (netbuf);
- data = GST_BUFFER_DATA (netbuf);
+ size = GST_BUFFER_SIZE (buffer);
+ data = GST_BUFFER_DATA (buffer);
GST_DEBUG ("about to send %d bytes", size);
- // let's get the address from the netbuffer
- gst_netaddress_get_ip4_address (&netbuf->to, &destaddr, &destport);
+ /* let's get the address from the metaata */
+ gst_netaddress_get_ip4_address (&meta->naddr, &destaddr, &destport);
GST_DEBUG ("sending %d bytes to client %d port %d", size, destaddr, destport);
return FALSE;
#endif
- /* register type of the netbuffer so that we can use it from multiple threads
- * right away. Note that the plugin loading is always serialized */
- gst_netbuffer_get_type ();
+ /* register info of the netaddress metadata so that we can use it from
+ * multiple threads right away. Note that the plugin loading is always
+ * serialized */
+ gst_meta_net_address_get_info ();
if (!gst_element_register (plugin, "udpsink", GST_RANK_NONE,
GST_TYPE_UDPSINK))
gst_udpsrc_create (GstPushSrc * psrc, GstBuffer ** buf)
{
GstUDPSrc *udpsrc;
- GstNetBuffer *outbuf;
+ GstMetaNetAddress *meta;
+ GstBuffer *outbuf;
union gst_sockaddr
{
struct sockaddr sa;
break;
}
- /* special case buffer so receivers can also track the address */
- outbuf = gst_netbuffer_new ();
+ outbuf = gst_buffer_new ();
GST_BUFFER_MALLOCDATA (outbuf) = pktdata;
/* patch pktdata and len when stripping off the headers */
GST_BUFFER_DATA (outbuf) = pktdata;
GST_BUFFER_SIZE (outbuf) = ret;
+ /* use buffer metadata so receivers can also track the address */
+ meta = gst_buffer_add_meta_net_address (outbuf);
+
switch (sa.sa.sa_family) {
case AF_INET:
{
- gst_netaddress_set_ip4_address (&outbuf->from, sa.sa_in.sin_addr.s_addr,
+ gst_netaddress_set_ip4_address (&meta->naddr, sa.sa_in.sin_addr.s_addr,
sa.sa_in.sin_port);
}
break;
guint8 ip6[16];
memcpy (ip6, &sa.sa_in6.sin6_addr, sizeof (ip6));
- gst_netaddress_set_ip6_address (&outbuf->from, ip6, sa.sa_in6.sin6_port);
+ gst_netaddress_set_ip6_address (&meta->naddr, ip6, sa.sa_in6.sin6_port);
}
break;
default:
GST_DEBUG_CATEGORY_EXTERN (v4l2_debug);
#define GST_CAT_DEFAULT v4l2_debug
-
/*
* GstV4l2Buffer:
*/
-
-static GstBufferClass *v4l2buffer_parent_class = NULL;
+const GstMetaInfo *
+gst_meta_v4l2_get_info (void)
+{
+ static const GstMetaInfo *meta_info = NULL;
+
+ if (meta_info == NULL) {
+ meta_info =
+ gst_meta_register ("GstMetaV4l2", "GstMetaV4l2",
+ sizeof (GstMetaV4l2), (GstMetaInitFunction) NULL,
+ (GstMetaFreeFunction) NULL, (GstMetaCopyFunction) NULL,
+ (GstMetaSubFunction) NULL, (GstMetaSerializeFunction) NULL,
+ (GstMetaDeserializeFunction) NULL);
+ }
+ return meta_info;
+}
static void
-gst_v4l2_buffer_finalize (GstV4l2Buffer * buffer)
+gst_v4l2_buffer_dispose (GstBuffer * buffer)
{
GstV4l2BufferPool *pool;
gboolean resuscitated = FALSE;
gint index;
+ GstMetaV4l2 *meta;
- pool = buffer->pool;
+ meta = GST_META_V4L2_GET (buffer);
+ g_assert (meta != NULL);
- index = buffer->vbuffer.index;
+ pool = meta->pool;
+ index = meta->vbuffer.index;
GST_LOG_OBJECT (pool->v4l2elem, "finalizing buffer %p %d", buffer, index);
if (resuscitated) {
/* FIXME: check that the caps didn't change */
GST_LOG_OBJECT (pool->v4l2elem, "reviving buffer %p, %d", buffer, index);
- gst_buffer_ref (GST_BUFFER (buffer));
+ gst_buffer_ref (buffer);
GST_BUFFER_SIZE (buffer) = 0;
pool->buffers[index] = buffer;
}
if (!resuscitated) {
GST_LOG_OBJECT (pool->v4l2elem,
"buffer %p (data %p, len %u) not recovered, unmapping",
- buffer, GST_BUFFER_DATA (buffer), buffer->vbuffer.length);
- gst_mini_object_unref (GST_MINI_OBJECT (pool));
- v4l2_munmap ((void *) GST_BUFFER_DATA (buffer), buffer->vbuffer.length);
+ buffer, GST_BUFFER_DATA (buffer), meta->vbuffer.length);
+ v4l2_munmap ((void *) GST_BUFFER_DATA (buffer), meta->vbuffer.length);
- GST_MINI_OBJECT_CLASS (v4l2buffer_parent_class)->finalize (GST_MINI_OBJECT
- (buffer));
+ g_object_unref (pool);
}
}
-static void
-gst_v4l2_buffer_class_init (gpointer g_class, gpointer class_data)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
-
- v4l2buffer_parent_class = g_type_class_peek_parent (g_class);
-
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- gst_v4l2_buffer_finalize;
-}
-
-GType
-gst_v4l2_buffer_get_type (void)
-{
- static GType _gst_v4l2_buffer_type;
-
- if (G_UNLIKELY (_gst_v4l2_buffer_type == 0)) {
- static const GTypeInfo v4l2_buffer_info = {
- sizeof (GstBufferClass),
- NULL,
- NULL,
- gst_v4l2_buffer_class_init,
- NULL,
- NULL,
- sizeof (GstV4l2Buffer),
- 0,
- NULL,
- NULL
- };
- _gst_v4l2_buffer_type = g_type_register_static (GST_TYPE_BUFFER,
- "GstV4l2Buffer", &v4l2_buffer_info, 0);
- }
- return _gst_v4l2_buffer_type;
-}
-
-static GstV4l2Buffer *
+static GstBuffer *
gst_v4l2_buffer_new (GstV4l2BufferPool * pool, guint index, GstCaps * caps)
{
- GstV4l2Buffer *ret;
- guint8 *data;
+ GstBuffer *ret;
+ guint8 *mem;
+ GstMetaV4l2 *meta;
+
+ ret = gst_buffer_new ();
+ GST_MINI_OBJECT_CAST (ret)->dispose =
+ (GstMiniObjectDisposeFunction) gst_v4l2_buffer_dispose;
- ret = (GstV4l2Buffer *) gst_mini_object_new (GST_TYPE_V4L2_BUFFER);
+ meta = GST_META_V4L2_ADD (ret);
GST_LOG_OBJECT (pool->v4l2elem, "creating buffer %u, %p in pool %p", index,
ret, pool);
- ret->pool =
- (GstV4l2BufferPool *) gst_mini_object_ref (GST_MINI_OBJECT (pool));
+ meta->pool = (GstV4l2BufferPool *) g_object_ref (pool);
- ret->vbuffer.index = index;
- ret->vbuffer.type = pool->type;
- ret->vbuffer.memory = V4L2_MEMORY_MMAP;
+ meta->vbuffer.index = index;
+ meta->vbuffer.type = pool->type;
+ meta->vbuffer.memory = V4L2_MEMORY_MMAP;
- if (v4l2_ioctl (pool->video_fd, VIDIOC_QUERYBUF, &ret->vbuffer) < 0)
+ if (v4l2_ioctl (pool->video_fd, VIDIOC_QUERYBUF, &meta->vbuffer) < 0)
goto querybuf_failed;
- GST_LOG_OBJECT (pool->v4l2elem, " index: %u", ret->vbuffer.index);
- GST_LOG_OBJECT (pool->v4l2elem, " type: %d", ret->vbuffer.type);
- GST_LOG_OBJECT (pool->v4l2elem, " bytesused: %u", ret->vbuffer.bytesused);
- GST_LOG_OBJECT (pool->v4l2elem, " flags: %08x", ret->vbuffer.flags);
- GST_LOG_OBJECT (pool->v4l2elem, " field: %d", ret->vbuffer.field);
- GST_LOG_OBJECT (pool->v4l2elem, " memory: %d", ret->vbuffer.memory);
- if (ret->vbuffer.memory == V4L2_MEMORY_MMAP)
+ GST_LOG_OBJECT (pool->v4l2elem, " index: %u", meta->vbuffer.index);
+ GST_LOG_OBJECT (pool->v4l2elem, " type: %d", meta->vbuffer.type);
+ GST_LOG_OBJECT (pool->v4l2elem, " bytesused: %u", meta->vbuffer.bytesused);
+ GST_LOG_OBJECT (pool->v4l2elem, " flags: %08x", meta->vbuffer.flags);
+ GST_LOG_OBJECT (pool->v4l2elem, " field: %d", meta->vbuffer.field);
+ GST_LOG_OBJECT (pool->v4l2elem, " memory: %d", meta->vbuffer.memory);
+ if (meta->vbuffer.memory == V4L2_MEMORY_MMAP)
GST_LOG_OBJECT (pool->v4l2elem, " MMAP offset: %u",
- ret->vbuffer.m.offset);
- GST_LOG_OBJECT (pool->v4l2elem, " length: %u", ret->vbuffer.length);
- GST_LOG_OBJECT (pool->v4l2elem, " input: %u", ret->vbuffer.input);
+ meta->vbuffer.m.offset);
+ GST_LOG_OBJECT (pool->v4l2elem, " length: %u", meta->vbuffer.length);
+ GST_LOG_OBJECT (pool->v4l2elem, " input: %u", meta->vbuffer.input);
- data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
+ mem = (guint8 *) v4l2_mmap (0, meta->vbuffer.length,
PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,
- ret->vbuffer.m.offset);
+ meta->vbuffer.m.offset);
- if (data == MAP_FAILED)
+ if (mem == MAP_FAILED)
goto mmap_failed;
- GST_BUFFER_DATA (ret) = data;
- GST_BUFFER_SIZE (ret) = ret->vbuffer.length;
+ GST_BUFFER_DATA (ret) = mem;
+ GST_BUFFER_SIZE (ret) = meta->vbuffer.length;
GST_BUFFER_FLAG_SET (ret, GST_BUFFER_FLAG_READONLY);
- gst_buffer_set_caps (GST_BUFFER (ret), caps);
+ gst_buffer_set_caps (ret, caps);
return ret;
gint errnosave = errno;
GST_WARNING ("Failed QUERYBUF: %s", g_strerror (errnosave));
- gst_buffer_unref (GST_BUFFER (ret));
+ gst_buffer_unref (ret);
errno = errnosave;
return NULL;
}
gint errnosave = errno;
GST_WARNING ("Failed to mmap: %s", g_strerror (errnosave));
- gst_buffer_unref (GST_BUFFER (ret));
+ gst_buffer_unref (ret);
errno = errnosave;
return NULL;
}
* GstV4l2BufferPool:
*/
-static GstMiniObjectClass *buffer_pool_parent_class = NULL;
+static GObjectClass *buffer_pool_parent_class = NULL;
static void
-gst_v4l2_buffer_pool_finalize (GstV4l2BufferPool * pool)
+gst_v4l2_buffer_pool_finalize (GObject * object)
{
+ GstV4l2BufferPool *pool = GST_V4L2_BUFFER_POOL (object);
+
g_mutex_free (pool->lock);
pool->lock = NULL;
pool->buffers = NULL;
}
- GST_MINI_OBJECT_CLASS (buffer_pool_parent_class)->finalize (GST_MINI_OBJECT
- (pool));
+ buffer_pool_parent_class->finalize (object);
}
static void
static void
gst_v4l2_buffer_pool_class_init (gpointer g_class, gpointer class_data)
{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
+ GObjectClass *object_class = G_OBJECT_CLASS (g_class);
buffer_pool_parent_class = g_type_class_peek_parent (g_class);
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- gst_v4l2_buffer_pool_finalize;
+ object_class->finalize = gst_v4l2_buffer_pool_finalize;
}
GType
if (G_UNLIKELY (_gst_v4l2_buffer_pool_type == 0)) {
static const GTypeInfo v4l2_buffer_pool_info = {
- sizeof (GstMiniObjectClass),
+ sizeof (GObjectClass),
NULL,
NULL,
gst_v4l2_buffer_pool_class_init,
(GInstanceInitFunc) gst_v4l2_buffer_pool_init,
NULL
};
- _gst_v4l2_buffer_pool_type = g_type_register_static (GST_TYPE_MINI_OBJECT,
+ _gst_v4l2_buffer_pool_type = g_type_register_static (G_TYPE_OBJECT,
"GstV4l2BufferPool", &v4l2_buffer_pool_info, 0);
}
return _gst_v4l2_buffer_pool_type;
gint n;
struct v4l2_requestbuffers breq;
- pool = (GstV4l2BufferPool *) gst_mini_object_new (GST_TYPE_V4L2_BUFFER_POOL);
+ pool = (GstV4l2BufferPool *) g_object_new (GST_TYPE_V4L2_BUFFER_POOL, NULL);
pool->video_fd = v4l2_dup (fd);
if (pool->video_fd < 0)
pool->requeuebuf = requeuebuf;
pool->type = type;
pool->buffer_count = num_buffers;
- pool->buffers = g_new0 (GstV4l2Buffer *, num_buffers);
+ pool->buffers = g_new0 (GstBuffer *, num_buffers);
pool->avail_buffers = g_async_queue_new ();
/* now, map the buffers: */
{
gint errnosave = errno;
- gst_mini_object_unref (GST_MINI_OBJECT (pool));
+ g_object_unref (pool);
errno = errnosave;
gst_buffer_unref (buf);
}
- gst_mini_object_unref (GST_MINI_OBJECT (pool));
+ g_object_unref (pool);
}
/**
*
* Get an available buffer in the pool
*/
-GstV4l2Buffer *
+GstBuffer *
gst_v4l2_buffer_pool_get (GstV4l2BufferPool * pool, gboolean blocking)
{
- GstV4l2Buffer *buf;
+ GstBuffer *buf;
if (blocking) {
buf = g_async_queue_pop (pool->avail_buffers);
}
if (buf) {
+ GstMetaV4l2 *meta = GST_META_V4L2_GET (buf);
+
GST_V4L2_BUFFER_POOL_LOCK (pool);
- GST_BUFFER_SIZE (buf) = buf->vbuffer.length;
+ GST_BUFFER_SIZE (buf) = meta->vbuffer.length;
GST_BUFFER_FLAG_UNSET (buf, 0xffffffff);
GST_V4L2_BUFFER_POOL_UNLOCK (pool);
}
* Returns: %TRUE for success
*/
gboolean
-gst_v4l2_buffer_pool_qbuf (GstV4l2BufferPool * pool, GstV4l2Buffer * buf)
+gst_v4l2_buffer_pool_qbuf (GstV4l2BufferPool * pool, GstBuffer * buf)
{
- GST_LOG_OBJECT (pool->v4l2elem, "enqueue pool buffer %d", buf->vbuffer.index);
+ GstMetaV4l2 *meta;
- if (v4l2_ioctl (pool->video_fd, VIDIOC_QBUF, &buf->vbuffer) < 0)
+ meta = GST_META_V4L2_GET (buf);
+
+ GST_LOG_OBJECT (pool->v4l2elem, "enqueue pool buffer %d",
+ meta->vbuffer.index);
+
+ if (v4l2_ioctl (pool->video_fd, VIDIOC_QBUF, &meta->vbuffer) < 0)
return FALSE;
pool->num_live_buffers--;
*
* Returns: a buffer
*/
-GstV4l2Buffer *
+GstBuffer *
gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool * pool)
{
GstV4l2Object *v4l2object = get_v4l2_object (pool->v4l2elem);
- GstV4l2Buffer *pool_buffer;
+ GstBuffer *pool_buffer;
struct v4l2_buffer buffer;
memset (&buffer, 0x00, sizeof (buffer));
buffer.type = pool->type;
buffer.memory = V4L2_MEMORY_MMAP;
-
if (v4l2_ioctl (pool->video_fd, VIDIOC_DQBUF, &buffer) >= 0) {
GST_V4L2_BUFFER_POOL_LOCK (pool);
typedef struct _GstV4l2BufferPool GstV4l2BufferPool;
-typedef struct _GstV4l2Buffer GstV4l2Buffer;
+typedef struct _GstMetaV4l2 GstMetaV4l2;
struct _GstV4l2BufferPool
{
- GstMiniObject parent;
+ GObject parent;
GstElement *v4l2elem; /* the v4l2 src/sink that owns us.. maybe we should be owned by v4l2object? */
gboolean requeuebuf; /* if true, unusued buffers are automatically re-QBUF'd */
GAsyncQueue* avail_buffers;/* pool of available buffers, not with the driver and which aren't held outside the bufferpool */
gint video_fd; /* a dup(2) of the v4l2object's video_fd */
guint buffer_count;
- GstV4l2Buffer **buffers;
+ GstBuffer **buffers;
};
-struct _GstV4l2Buffer {
- GstBuffer buffer;
+struct _GstMetaV4l2 {
+ GstMeta meta;
struct v4l2_buffer vbuffer;
GstV4l2BufferPool *pool;
};
+const GstMetaInfo * gst_meta_v4l2_get_info (void);
+#define GST_META_V4L2_GET(buf) ((GstMetaV4l2 *)gst_buffer_get_meta(buf,gst_meta_v4l2_get_info()))
+#define GST_META_V4L2_ADD(buf) ((GstMetaV4l2 *)gst_buffer_add_meta(buf,gst_meta_v4l2_get_info(),NULL))
+
void gst_v4l2_buffer_pool_destroy (GstV4l2BufferPool * pool);
GstV4l2BufferPool *gst_v4l2_buffer_pool_new (GstElement *v4l2elem, gint fd, gint num_buffers, GstCaps * caps, gboolean requeuebuf, enum v4l2_buf_type type);
-GstV4l2Buffer *gst_v4l2_buffer_pool_get (GstV4l2BufferPool *pool, gboolean blocking);
-gboolean gst_v4l2_buffer_pool_qbuf (GstV4l2BufferPool *pool, GstV4l2Buffer *buf);
-GstV4l2Buffer *gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool *pool);
+GstBuffer *gst_v4l2_buffer_pool_get (GstV4l2BufferPool *pool, gboolean blocking);
+gboolean gst_v4l2_buffer_pool_qbuf (GstV4l2BufferPool *pool, GstBuffer *buf);
+GstBuffer *gst_v4l2_buffer_pool_dqbuf (GstV4l2BufferPool *pool);
gint gst_v4l2_buffer_pool_available_buffers (GstV4l2BufferPool *pool);
V4L2_STD_OBJECT_PROPS,
};
+G_LOCK_DEFINE_STATIC (probe_lock);
+
const GList *
gst_v4l2_probe_get_properties (GstPropertyProbe * probe)
{
GObjectClass *klass = G_OBJECT_GET_CLASS (probe);
static GList *list = NULL;
- /* well, not perfect, but better than no locking at all.
- * In the worst case we leak a list node, so who cares? */
- GST_CLASS_LOCK (GST_OBJECT_CLASS (klass));
+ G_LOCK (probe_lock);
if (!list) {
list = g_list_append (NULL, g_object_class_find_property (klass, "device"));
}
- GST_CLASS_UNLOCK (GST_OBJECT_CLASS (klass));
+ G_UNLOCK (probe_lock);
return list;
}
{
Display *dpy;
gint port, idle_id, event_id;
- GMutex *mutex; /* to serialize calls to X11 */
+ GMutex *mutex; /* to serialize calls to X11 */
};
GST_DEBUG_CATEGORY_STATIC (v4l2xv_debug);
/* should be called with mutex held */
static gboolean
-get_render_rect (GstV4l2Object * v4l2object, GstVideoRectangle *rect)
+get_render_rect (GstV4l2Object * v4l2object, GstVideoRectangle * rect)
{
GstV4l2Xv *v4l2xv = v4l2object->xv;
if (v4l2xv && v4l2xv->dpy && v4l2object->xwindow_id) {
}
gboolean
-gst_v4l2_xoverlay_get_render_rect (GstV4l2Object *v4l2object,
- GstVideoRectangle *rect)
+gst_v4l2_xoverlay_get_render_rect (GstV4l2Object * v4l2object,
+ GstVideoRectangle * rect)
{
GstV4l2Xv *v4l2xv = v4l2object->xv;
gboolean ret = FALSE;
* interesting.
*/
while (XCheckWindowEvent (v4l2xv->dpy, v4l2object->xwindow_id,
- PointerMotionMask, &e)) {
+ PointerMotionMask, &e)) {
switch (e.type) {
case MotionNotify:
pointer_x = e.xmotion.x;
GST_DEBUG_OBJECT (v4l2object->element,
"button %d pressed over window at %d,%d",
e.xbutton.button, e.xbutton.x, e.xbutton.y);
- gst_navigation_send_mouse_event (
- GST_NAVIGATION (v4l2object->element),
- "mouse-button-press", e.xbutton.button,
+ gst_navigation_send_mouse_event (GST_NAVIGATION
+ (v4l2object->element), "mouse-button-press", e.xbutton.button,
e.xbutton.x, e.xbutton.y);
break;
case ButtonRelease:
GST_DEBUG_OBJECT (v4l2object->element,
"button %d released over window at %d,%d",
e.xbutton.button, e.xbutton.x, e.xbutton.y);
- gst_navigation_send_mouse_event (
- GST_NAVIGATION (v4l2object->element),
- "mouse-button-release", e.xbutton.button,
+ gst_navigation_send_mouse_event (GST_NAVIGATION
+ (v4l2object->element), "mouse-button-release", e.xbutton.button,
e.xbutton.x, e.xbutton.y);
break;
case KeyPress:
GST_DEBUG_OBJECT (v4l2object->element,
"key %d pressed over window at %d,%d (%s)",
e.xkey.keycode, e.xkey.x, e.xkey.y, key_str);
- gst_navigation_send_key_event (
- GST_NAVIGATION (v4l2object->element),
+ gst_navigation_send_key_event (GST_NAVIGATION (v4l2object->element),
e.type == KeyPress ? "key-press" : "key-release", key_str);
break;
default:
event_mask = ExposureMask | StructureNotifyMask;
if (GST_IS_NAVIGATION (v4l2object->element)) {
event_mask |= PointerMotionMask |
- KeyPressMask | KeyReleaseMask |
- ButtonPressMask | ButtonReleaseMask;
+ KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask;
}
XSelectInput (v4l2xv->dpy, win, event_mask);
v4l2xv->event_id = g_timeout_add (45, event_refresh, v4l2object);
gst_v4l2src_buffer_pool_activate (GstV4l2BufferPool * pool,
GstV4l2Src * v4l2src)
{
- GstV4l2Buffer *buf;
+ GstBuffer *buf;
while ((buf = gst_v4l2_buffer_pool_get (pool, FALSE)) != NULL)
if (!gst_v4l2_buffer_pool_qbuf (pool, buf))
(_("Could not enqueue buffers in device '%s'."),
v4l2src->v4l2object->videodev),
("enqueing buffer %d/%d failed: %s",
- buf->vbuffer.index, v4l2src->num_buffers, g_strerror (errno)));
+ GST_META_V4L2_GET (buf)->vbuffer.index, v4l2src->num_buffers,
+ g_strerror (errno)));
return FALSE;
}
}
/* Called when a buffer is returned from the pipeline */
static void
-gst_ximage_src_return_buf (GstXImageSrc * ximagesrc,
- GstXImageSrcBuffer * ximage)
+gst_ximage_src_return_buf (GstXImageSrc * ximagesrc, GstBuffer * ximage)
{
+ GstMetaXImage *meta = GST_META_XIMAGE_GET (ximage);
+
/* If our geometry changed we can't reuse that image. */
- if ((ximage->width != ximagesrc->width) ||
- (ximage->height != ximagesrc->height)) {
+ if ((meta->width != ximagesrc->width) || (meta->height != ximagesrc->height)) {
GST_DEBUG_OBJECT (ximagesrc,
"destroy image %p as its size changed %dx%d vs current %dx%d",
- ximage, ximage->width, ximage->height,
- ximagesrc->width, ximagesrc->height);
+ ximage, meta->width, meta->height, ximagesrc->width, ximagesrc->height);
g_mutex_lock (ximagesrc->x_lock);
gst_ximageutil_ximage_destroy (ximagesrc->xcontext, ximage);
g_mutex_unlock (ximagesrc->x_lock);
/* In that case we can reuse the image and add it to our image pool. */
GST_LOG_OBJECT (ximagesrc, "recycling image %p in pool", ximage);
/* need to increment the refcount again to recycle */
- gst_buffer_ref (GST_BUFFER (ximage));
+ gst_buffer_ref (ximage);
g_mutex_lock (ximagesrc->pool_lock);
ximagesrc->buffer_pool = g_slist_prepend (ximagesrc->buffer_pool, ximage);
g_mutex_unlock (ximagesrc->pool_lock);
/* Retrieve an XImageSrcBuffer, preferably from our
* pool of existing images and populate it from the window */
-static GstXImageSrcBuffer *
+static GstBuffer *
gst_ximage_src_ximage_get (GstXImageSrc * ximagesrc)
{
- GstXImageSrcBuffer *ximage = NULL;
+ GstBuffer *ximage = NULL;
+ GstMetaXImage *meta;
g_mutex_lock (ximagesrc->pool_lock);
while (ximagesrc->buffer_pool != NULL) {
ximage = ximagesrc->buffer_pool->data;
- if ((ximage->width != ximagesrc->width) ||
- (ximage->height != ximagesrc->height)) {
+ meta = GST_META_XIMAGE_GET (ximage);
+
+ if ((meta->width != ximagesrc->width) ||
+ (meta->height != ximagesrc->height)) {
gst_ximage_buffer_free (ximage);
}
gst_value_get_fraction_numerator (xcontext->par),
gst_value_get_fraction_denominator (xcontext->par), NULL);
- gst_buffer_set_caps (GST_BUFFER (ximage), caps);
+ gst_buffer_set_caps (ximage, caps);
g_mutex_unlock (ximagesrc->x_lock);
gst_caps_unref (caps);
}
g_return_val_if_fail (GST_IS_XIMAGE_SRC (ximagesrc), NULL);
+
+ meta = GST_META_XIMAGE_GET (ximage);
+
#ifdef HAVE_XDAMAGE
if (ximagesrc->have_xdamage && ximagesrc->use_damage &&
ximagesrc->last_ximage != NULL) {
startx, starty, width, height);
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
startx, starty, width, height, AllPlanes, ZPixmap,
- ximage->ximage, startx - ximagesrc->startx,
+ meta->ximage, startx - ximagesrc->startx,
starty - ximagesrc->starty);
}
} else {
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
rects[i].x, rects[i].y,
rects[i].width, rects[i].height,
- AllPlanes, ZPixmap, ximage->ximage, rects[i].x, rects[i].y);
+ AllPlanes, ZPixmap, meta->ximage, rects[i].x, rects[i].y);
}
}
free (rects);
GST_DEBUG_OBJECT (ximagesrc, "Removing cursor from %d,%d", x, y);
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
startx, starty, iwidth, iheight, AllPlanes, ZPixmap,
- ximage->ximage, startx - ximagesrc->startx,
+ meta->ximage, startx - ximagesrc->startx,
starty - ximagesrc->starty);
}
} else {
GST_DEBUG_OBJECT (ximagesrc, "Removing cursor from %d,%d", x, y);
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
- x, y, width, height, AllPlanes, ZPixmap, ximage->ximage, x, y);
+ x, y, width, height, AllPlanes, ZPixmap, meta->ximage, x, y);
}
}
#endif
if (ximagesrc->xcontext->use_xshm) {
GST_DEBUG_OBJECT (ximagesrc, "Retrieving screen using XShm");
XShmGetImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
- ximage->ximage, ximagesrc->startx, ximagesrc->starty, AllPlanes);
+ meta->ximage, ximagesrc->startx, ximagesrc->starty, AllPlanes);
} else
#endif /* HAVE_XSHM */
if (ximagesrc->remote) {
XGetSubImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
ximagesrc->startx, ximagesrc->starty, ximagesrc->width,
- ximagesrc->height, AllPlanes, ZPixmap, ximage->ximage, 0, 0);
+ ximagesrc->height, AllPlanes, ZPixmap, meta->ximage, 0, 0);
} else {
- ximage->ximage =
+ meta->ximage =
XGetImage (ximagesrc->xcontext->disp, ximagesrc->xwindow,
ximagesrc->startx, ximagesrc->starty, ximagesrc->width,
ximagesrc->height, AllPlanes, ZPixmap);
(guint8 *) & (ximagesrc->cursor_image->pixels[((j -
cy) * ximagesrc->cursor_image->width + (i - cx))]);
dest =
- (guint8 *) & (ximage->ximage->data[((j -
+ (guint8 *) & (meta->ximage->data[((j -
ximagesrc->starty) * ximagesrc->width + (i -
ximagesrc->startx)) * (ximagesrc->xcontext->bpp /
8)]);
gst_ximage_src_create (GstPushSrc * bs, GstBuffer ** buf)
{
GstXImageSrc *s = GST_XIMAGE_SRC (bs);
- GstXImageSrcBuffer *image;
+ GstBuffer *image;
GstClockTime base_time;
GstClockTime next_capture_ts;
GstClockTime dur;
{
g_mutex_lock (ximagesrc->pool_lock);
while (ximagesrc->buffer_pool != NULL) {
- GstXImageSrcBuffer *ximage = ximagesrc->buffer_pool->data;
+ GstBuffer *ximage = ximagesrc->buffer_pool->data;
gst_ximage_buffer_free (ximage);
int damage_event_base;
XserverRegion damage_region;
GC damage_copy_gc;
- GstXImageSrcBuffer *last_ximage;
+ GstBuffer *last_ximage;
#endif
};
#include "ximageutil.h"
+const GstMetaInfo *
+gst_meta_ximage_get_info (void)
+{
+ static const GstMetaInfo *meta_ximage_info = NULL;
+
+ if (meta_ximage_info == NULL) {
+ meta_ximage_info =
+ gst_meta_register ("GstMetaXImageSrc", "GstMetaXImageSrc",
+ sizeof (GstMetaXImage), (GstMetaInitFunction) NULL,
+ (GstMetaFreeFunction) NULL, (GstMetaCopyFunction) NULL,
+ (GstMetaSubFunction) NULL, (GstMetaSerializeFunction) NULL,
+ (GstMetaDeserializeFunction) NULL);
+ }
+ return meta_ximage_info;
+}
+
#ifdef HAVE_XSHM
static gboolean error_caught = FALSE;
gst_value_get_fraction_denominator (xcontext->par));
}
-static GstBufferClass *ximagesrc_buffer_parent_class = NULL;
-
static void
-gst_ximagesrc_buffer_finalize (GstXImageSrcBuffer * ximage)
+gst_ximagesrc_buffer_dispose (GstBuffer * ximage)
{
GstElement *parent;
+ GstMetaXImage *meta;
g_return_if_fail (ximage != NULL);
- parent = ximage->parent;
+ meta = GST_META_XIMAGE_GET (ximage);
+
+ parent = meta->parent;
if (parent == NULL) {
g_warning ("XImageSrcBuffer->ximagesrc == NULL");
goto beach;
}
- if (ximage->return_func)
- ximage->return_func (parent, ximage);
+ if (meta->return_func)
+ meta->return_func (parent, ximage);
beach:
-
- GST_MINI_OBJECT_CLASS (ximagesrc_buffer_parent_class)->finalize
- (GST_MINI_OBJECT (ximage));
-
return;
}
void
-gst_ximage_buffer_free (GstXImageSrcBuffer * ximage)
+gst_ximage_buffer_free (GstBuffer * ximage)
{
- /* make sure it is not recycled */
- ximage->width = -1;
- ximage->height = -1;
- gst_buffer_unref (GST_BUFFER (ximage));
-}
+ GstMetaXImage *meta;
-static void
-gst_ximagesrc_buffer_init (GstXImageSrcBuffer * ximage_buffer, gpointer g_class)
-{
-#ifdef HAVE_XSHM
- ximage_buffer->SHMInfo.shmaddr = ((void *) -1);
- ximage_buffer->SHMInfo.shmid = -1;
-#endif
-}
-
-static void
-gst_ximagesrc_buffer_class_init (gpointer g_class, gpointer class_data)
-{
- GstMiniObjectClass *mini_object_class = GST_MINI_OBJECT_CLASS (g_class);
-
- ximagesrc_buffer_parent_class = g_type_class_peek_parent (g_class);
-
- mini_object_class->finalize = (GstMiniObjectFinalizeFunction)
- gst_ximagesrc_buffer_finalize;
-}
+ meta = GST_META_XIMAGE_GET (ximage);
-static GType
-gst_ximagesrc_buffer_get_type (void)
-{
- static GType _gst_ximagesrc_buffer_type;
-
- if (G_UNLIKELY (_gst_ximagesrc_buffer_type == 0)) {
- static const GTypeInfo ximagesrc_buffer_info = {
- sizeof (GstBufferClass),
- NULL,
- NULL,
- gst_ximagesrc_buffer_class_init,
- NULL,
- NULL,
- sizeof (GstXImageSrcBuffer),
- 0,
- (GInstanceInitFunc) gst_ximagesrc_buffer_init,
- NULL
- };
- _gst_ximagesrc_buffer_type = g_type_register_static (GST_TYPE_BUFFER,
- "GstXImageSrcBuffer", &ximagesrc_buffer_info, 0);
- }
- return _gst_ximagesrc_buffer_type;
+ /* make sure it is not recycled */
+ meta->width = -1;
+ meta->height = -1;
+ gst_buffer_unref (ximage);
}
/* This function handles GstXImageSrcBuffer creation depending on XShm availability */
-GstXImageSrcBuffer *
+GstBuffer *
gst_ximageutil_ximage_new (GstXContext * xcontext,
GstElement * parent, int width, int height, BufferReturnFunc return_func)
{
- GstXImageSrcBuffer *ximage = NULL;
+ GstBuffer *ximage = NULL;
+ GstMetaXImage *meta;
gboolean succeeded = FALSE;
- ximage =
- (GstXImageSrcBuffer *) gst_mini_object_new (GST_TYPE_XIMAGESRC_BUFFER);
+ ximage = gst_buffer_new ();
+ GST_MINI_OBJECT_CAST (ximage)->dispose =
+ (GstMiniObjectDisposeFunction) gst_ximagesrc_buffer_dispose;
- ximage->width = width;
- ximage->height = height;
+ meta = GST_META_XIMAGE_ADD (ximage);
+ meta->width = width;
+ meta->height = height;
#ifdef HAVE_XSHM
+ meta->SHMInfo.shmaddr = ((void *) -1);
+ meta->SHMInfo.shmid = -1;
+
if (xcontext->use_xshm) {
- ximage->ximage = XShmCreateImage (xcontext->disp,
+ meta->ximage = XShmCreateImage (xcontext->disp,
xcontext->visual, xcontext->depth,
- ZPixmap, NULL, &ximage->SHMInfo, ximage->width, ximage->height);
- if (!ximage->ximage) {
+ ZPixmap, NULL, &meta->SHMInfo, meta->width, meta->height);
+ if (!meta->ximage) {
goto beach;
}
/* we have to use the returned bytes_per_line for our shm size */
- ximage->size = ximage->ximage->bytes_per_line * ximage->ximage->height;
- ximage->SHMInfo.shmid = shmget (IPC_PRIVATE, ximage->size,
- IPC_CREAT | 0777);
- if (ximage->SHMInfo.shmid == -1)
+ meta->size = meta->ximage->bytes_per_line * meta->ximage->height;
+ meta->SHMInfo.shmid = shmget (IPC_PRIVATE, meta->size, IPC_CREAT | 0777);
+ if (meta->SHMInfo.shmid == -1)
goto beach;
- ximage->SHMInfo.shmaddr = shmat (ximage->SHMInfo.shmid, 0, 0);
- if (ximage->SHMInfo.shmaddr == ((void *) -1))
+ meta->SHMInfo.shmaddr = shmat (meta->SHMInfo.shmid, 0, 0);
+ if (meta->SHMInfo.shmaddr == ((void *) -1))
goto beach;
/* Delete the SHM segment. It will actually go away automatically
* when we detach now */
- shmctl (ximage->SHMInfo.shmid, IPC_RMID, 0);
+ shmctl (meta->SHMInfo.shmid, IPC_RMID, 0);
- ximage->ximage->data = ximage->SHMInfo.shmaddr;
- ximage->SHMInfo.readOnly = FALSE;
+ meta->ximage->data = meta->SHMInfo.shmaddr;
+ meta->SHMInfo.readOnly = FALSE;
- if (XShmAttach (xcontext->disp, &ximage->SHMInfo) == 0)
+ if (XShmAttach (xcontext->disp, &meta->SHMInfo) == 0)
goto beach;
XSync (xcontext->disp, FALSE);
} else
#endif /* HAVE_XSHM */
{
- ximage->ximage = XCreateImage (xcontext->disp,
+ meta->ximage = XCreateImage (xcontext->disp,
xcontext->visual,
xcontext->depth,
- ZPixmap, 0, NULL, ximage->width, ximage->height, xcontext->bpp, 0);
- if (!ximage->ximage)
+ ZPixmap, 0, NULL, meta->width, meta->height, xcontext->bpp, 0);
+ if (!meta->ximage)
goto beach;
/* we have to use the returned bytes_per_line for our image size */
- ximage->size = ximage->ximage->bytes_per_line * ximage->ximage->height;
- ximage->ximage->data = g_malloc (ximage->size);
+ meta->size = meta->ximage->bytes_per_line * meta->ximage->height;
+ meta->ximage->data = g_malloc (meta->size);
XSync (xcontext->disp, FALSE);
}
succeeded = TRUE;
- GST_BUFFER_DATA (ximage) = (guchar *) ximage->ximage->data;
- GST_BUFFER_SIZE (ximage) = ximage->size;
+ GST_BUFFER_DATA (ximage) = (guchar *) meta->ximage->data;
+ GST_BUFFER_SIZE (ximage) = meta->size;
/* Keep a ref to our src */
- ximage->parent = gst_object_ref (parent);
- ximage->return_func = return_func;
+ meta->parent = gst_object_ref (parent);
+ meta->return_func = return_func;
beach:
if (!succeeded) {
gst_ximage_buffer_free (ximage);
/* This function destroys a GstXImageBuffer handling XShm availability */
void
-gst_ximageutil_ximage_destroy (GstXContext * xcontext,
- GstXImageSrcBuffer * ximage)
+gst_ximageutil_ximage_destroy (GstXContext * xcontext, GstBuffer * ximage)
{
+ GstMetaXImage *meta;
+
+ meta = GST_META_XIMAGE_GET (ximage);
+
/* We might have some buffers destroyed after changing state to NULL */
if (!xcontext)
goto beach;
#ifdef HAVE_XSHM
if (xcontext->use_xshm) {
- if (ximage->SHMInfo.shmaddr != ((void *) -1)) {
- XShmDetach (xcontext->disp, &ximage->SHMInfo);
+ if (meta->SHMInfo.shmaddr != ((void *) -1)) {
+ XShmDetach (xcontext->disp, &meta->SHMInfo);
XSync (xcontext->disp, 0);
- shmdt (ximage->SHMInfo.shmaddr);
+ shmdt (meta->SHMInfo.shmaddr);
}
- if (ximage->ximage)
- XDestroyImage (ximage->ximage);
+ if (meta->ximage)
+ XDestroyImage (meta->ximage);
} else
#endif /* HAVE_XSHM */
{
- if (ximage->ximage) {
- XDestroyImage (ximage->ximage);
+ if (meta->ximage) {
+ XDestroyImage (meta->ximage);
}
}
XSync (xcontext->disp, FALSE);
beach:
- if (ximage->parent) {
+ if (meta->parent) {
/* Release the ref to our parent */
- gst_object_unref (ximage->parent);
- ximage->parent = NULL;
+ gst_object_unref (meta->parent);
+ meta->parent = NULL;
}
return;
typedef struct _GstXContext GstXContext;
typedef struct _GstXWindow GstXWindow;
typedef struct _GstXImage GstXImage;
-typedef struct _GstXImageSrcBuffer GstXImageSrcBuffer;
+typedef struct _GstMetaXImage GstMetaXImage;
/* Global X Context stuff */
/**
/* custom ximagesrc buffer, copied from ximagesink */
/* BufferReturnFunc is called when a buffer is finalised */
-typedef void (*BufferReturnFunc) (GstElement *parent, GstXImageSrcBuffer *buf);
+typedef void (*BufferReturnFunc) (GstElement *parent, GstBuffer *buf);
/**
- * GstXImageSrcBuffer:
+ * GstMetaXImage:
* @parent: a reference to the element we belong to
* @ximage: the XImage of this buffer
* @width: the width in pixels of XImage @ximage
* @height: the height in pixels of XImage @ximage
* @size: the size in bytes of XImage @ximage
*
- * Subclass of #GstBuffer containing additional information about an XImage.
+ * Extra data attached to buffers containing additional information about an XImage.
*/
-struct _GstXImageSrcBuffer {
- GstBuffer buffer;
+struct _GstMetaXImage {
+ GstMeta meta;
/* Reference to the ximagesrc we belong to */
GstElement *parent;
gint width, height;
size_t size;
-
+
BufferReturnFunc return_func;
};
+const GstMetaInfo * gst_meta_ximage_get_info (void);
+#define GST_META_XIMAGE_GET(buf) ((GstMetaXImage *)gst_buffer_get_meta(buf,gst_meta_ximage_get_info()))
+#define GST_META_XIMAGE_ADD(buf) ((GstMetaXImage *)gst_buffer_add_meta(buf,gst_meta_ximage_get_info(),NULL))
-GstXImageSrcBuffer *gst_ximageutil_ximage_new (GstXContext *xcontext,
+GstBuffer *gst_ximageutil_ximage_new (GstXContext *xcontext,
GstElement *parent, int width, int height, BufferReturnFunc return_func);
void gst_ximageutil_ximage_destroy (GstXContext *xcontext,
- GstXImageSrcBuffer * ximage);
+ GstBuffer * ximage);
/* Call to manually release a buffer */
-void gst_ximage_buffer_free (GstXImageSrcBuffer *ximage);
-
-#define GST_TYPE_XIMAGESRC_BUFFER (gst_ximagesrc_buffer_get_type())
-#define GST_IS_XIMAGESRC_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_XIMAGESRC_BUFFER))
-#define GST_IS_XIMAGESRC_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_XIMAGESRC_BUFFER))
-#define GST_XIMAGESRC_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_XIMAGESRC_BUFFER, GstXImageSrcBuffer))
-#define GST_XIMAGESRC_BUFFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_XIMAGESRC_BUFFER, GstXImageSrcBufferClass))
-#define GST_XIMAGESRC_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_XIMAGESRC_BUFFER, GstXImageSrcBufferClass))
+void gst_ximage_buffer_free (GstBuffer *ximage);
G_END_DECLS
noinst_PROGRAMS = pulse
pulse_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
-pulse_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-0.10 $(GST_BASE_LIBS) $(GST_LIBS)
+pulse_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-$(GST_MAJORMINOR) $(GST_BASE_LIBS) $(GST_LIBS)
probe_SOURCES = probe.c
probe_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS)
-probe_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-0.10 $(GST_BASE_LIBS) $(GST_LIBS)
+probe_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-$(GST_MAJORMINOR) $(GST_BASE_LIBS) $(GST_LIBS)
test_oss4_SOURCES = test-oss4.c
test_oss4_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
-test_oss4_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-0.10 $(GST_LIBS)
+test_oss4_LDADD = $(GST_PLUGINS_BASE_LIBS) -lgstinterfaces-$(GST_MAJORMINOR) $(GST_LIBS)
test_oss4_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
else
OSS4_TESTS=