--- /dev/null
+[general]
+upstream_branch = upstream/1.16
+upstream_tag = ${upstreamversion}
-DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
+DISTCHECK_CONFIGURE_FLAGS=--disable-gtk-doc
if BUILD_EXTERNAL
SUBDIRS_EXT = ext
pkgconfig \
gst-libs \
gst sys $(SUBDIRS_EXT) \
- tools \
tests \
- docs \
po \
common \
m4
DIST_SUBDIRS = \
pkgconfig \
- docs \
gst-libs \
gst sys ext \
- tools \
- tests \
+ tests \
po \
common \
m4
$(top_builddir)/tests/check/elements/gdpdepay \
$(top_builddir)/tests/check/pipelines/streamheader \
$(top_builddir)/tests/examples/audio/testchannels \
- $(top_builddir)/tests/examples/volume/volume \
- $(top_builddir)/tools/gst-discoverer
+ $(top_builddir)/tests/examples/volume/volume
CRUFT_DIRS = \
$(top_srcdir)/docs/design \
- gst-editing-services: library an plugins for non-linear editing
+Bugs fixed in this release
+
+ * 784639 : convertframe: Fix leak in case of vcrop is disalbed
+
==== Download ====
You can find source releases of gstreamer in the download
AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
+dnl check for supporting tbm
+AC_MSG_CHECKING([for supporting tbm])
+AC_ARG_ENABLE(tbm, AC_HELP_STRING([--enable-tbm], [tbm support]),
+ [
+ case "${enableval}" in
+ yes) USE_TBM=yes ;;
+ no) USE_TBM=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-tbm) ;;
+ esac
+ ],
+ [USE_TBM=no])
+AM_CONDITIONAL(USE_TBM, test "x$USE_TBM" = "xyes")
+AC_MSG_RESULT([$USE_TBM])
+if test "x$USE_TBM" = "xyes"; then
+ AC_DEFINE(USE_TBM, 1, [tbm support])
+fi
+
+dnl Check for tv-product
+AC_ARG_ENABLE(tv, AC_HELP_STRING([--enable-tv], [use tv]),
+ [
+ case "${enableval}" in
+ yes) HAVE_TV_PRODUCT=yes ;;
+ no) HAVE_TV_PRODUCT=no ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-tv) ;;
+ esac
+ ],)
+AM_CONDITIONAL([HAVE_TV_PRODUCT], [test "x$HAVE_TV_PRODUCT" = "xyes"])
+
dnl check for gobject-introspection
GOBJECT_INTROSPECTION_CHECK([1.31.1])
dnl used to be used in gst-libs/gst/floatcast/floatcast.h (FIXME: still needed?)
save_libs=$LIBS
LIBS="$LIBS $LIBM"
-AC_C99_FUNC_LRINT
-AC_C99_FUNC_LRINTF
+#AC_C99_FUNC_LRINT
+#AC_C99_FUNC_LRINTF
LIBS=$save_libs
dnl Check for a way to display the function name in debug output
AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
-Wmissing-declarations -Wredundant-decls -Wundef
-Wwrite-strings -Wformat-nonliteral -Wformat-security
- -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
+ -Winit-self -Wmissing-include-dirs -Waddress
-Wno-multichar $NO_WARNINGS])
dnl define correct level for debugging messages
GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
AC_SUBST(GST_PLUGIN_LDFLAGS)
+dnl use tbm
+PKG_CHECK_MODULES(TBM, libdrm libtbm)
+AC_SUBST(TBM_CFLAGS)
+AC_SUBST(TBM_LIBS)
+
dnl *** output files ***
$MKDIR_P tests/check/orc
+++ /dev/null
-version.entities
libgstallocators_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) $(LIBM)
libgstallocators_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) -DBUILDING_GST_ALLOCATORS
libgstallocators_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS)
+libgstallocators_@GST_API_VERSION@__la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
+
+
+if USE_TBM
+libgstallocators_@GST_API_VERSION@_include_HEADERS += \
+ gsttizenmemory.h \
+ gsttizenbufferpool.h
+
+libgstallocators_@GST_API_VERSION@_la_SOURCES += \
+ gsttizenmemory.c \
+ gsttizenbufferpool.c
+
+libgstallocators_@GST_API_VERSION@_la_LIBADD += \
+ $(top_builddir)/gst-libs/gst/video/libgstvideo-@GST_API_VERSION@.la \
+ $(TBM_LIBS)
+
+libgstallocators_@GST_API_VERSION@_la_CFLAGS += $(TBM_CFLAGS)
+endif
if HAVE_INTROSPECTION
BUILT_GIRSOURCES = GstAllocators-@GST_API_VERSION@.gir
#include <gst/allocators/gstfdmemory.h>
#include <gst/allocators/gstphysmemory.h>
+#ifdef USE_TBM
+#include <gst/allocators/gsttizenmemory.h>
+#include <gst/allocators/gsttizenbufferpool.h>
+#endif
+
#endif /* __GST_ALLOCATORS_H__ */
--- /dev/null
+/*
+ * GStreamer tizen buffer pool
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Author: Sejun Park <sejun79.park@samsung.com>
+ *
+ * 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 "gsttizenbufferpool.h"
+#include <tbm_surface_internal.h>
+
+GST_DEBUG_CATEGORY_STATIC (gst_tizen_vidbufpool_debug);
+#define GST_CAT_DEFAULT gst_tizen_vidbufpool_debug
+
+static GQuark gst_tizen_buffer_data_quark = 0;
+
+static void gst_tizen_buffer_pool_finalize (GObject * object);
+
+#define DEBUG_INIT \
+ GST_DEBUG_CATEGORY_INIT (gst_tizen_vidbufpool_debug, "tizenvideopool", 0, \
+ "Tizen bufferpool");
+
+#define gst_tizen_buffer_pool_parent_class parent_class
+G_DEFINE_TYPE_WITH_CODE (GstTizenBufferPool, gst_tizen_buffer_pool,
+ GST_TYPE_BUFFER_POOL, DEBUG_INIT);
+
+struct _GstTizenBufferPoolPrivate
+{
+ GstAllocator *allocator;
+};
+
+static const gchar **
+gst_tizen_buffer_pool_get_options (GstBufferPool * pool)
+{
+ static const gchar *options[] = { GST_BUFFER_POOL_OPTION_VIDEO_META,
+ GST_BUFFER_POOL_OPTION_TIZEN_META, NULL
+ };
+
+ return options;
+}
+
+static gboolean
+gst_tizen_buffer_pool_set_config (GstBufferPool * pool,
+ GstStructure * config)
+{
+ GstTizenBufferPool *_tpool = GST_TIZEN_BUFFER_POOL_CAST (pool);
+ GstVideoInfo info;
+ GstCaps *caps;
+ tbm_format format;
+ tbm_surface_h surface;
+ guint min_buffers, max_buffers;
+ int size;
+
+ if (!gst_buffer_pool_config_get_params (config, &caps, NULL, &min_buffers, &max_buffers))
+ goto wrong_config;
+
+ if (caps == NULL)
+ goto no_caps;
+
+ /* now parse the caps from the config */
+ if (!gst_video_info_from_caps (&info, caps))
+ goto wrong_caps;
+
+ if (GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_UNKNOWN)
+ goto unknown_format;
+
+ _tpool->info = info;
+
+ format = gst_video_format_to_tbm_format (GST_VIDEO_INFO_FORMAT (&info));
+
+ surface = tbm_surface_create (GST_VIDEO_INFO_WIDTH (&info), GST_VIDEO_INFO_HEIGHT (&info), format);
+ size = tbm_surface_internal_get_size (surface);
+
+ tbm_surface_destroy (surface);
+
+ /* enable metadata based on config of the pool */
+ _tpool->add_videometa = gst_buffer_pool_config_has_option (config,
+ GST_BUFFER_POOL_OPTION_VIDEO_META);
+
+ /* parse extra alignment info */
+ _tpool->add_tizenmeta = gst_buffer_pool_config_has_option (config,
+ GST_BUFFER_POOL_OPTION_TIZEN_META);
+
+ gst_buffer_pool_config_set_params (config, caps, size, min_buffers,
+ max_buffers);
+
+ GST_DEBUG_OBJECT (_tpool, "min : %u, max : %u, size : %d", min_buffers, max_buffers, size);
+ return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
+
+ /* ERRORS */
+wrong_config:
+ {
+ GST_WARNING_OBJECT (pool, "invalid config");
+ return FALSE;
+ }
+no_caps:
+ {
+ GST_WARNING_OBJECT (pool, "no caps in config");
+ return FALSE;
+ }
+wrong_caps:
+ {
+ GST_WARNING_OBJECT (pool,
+ "failed getting geometry from caps %" GST_PTR_FORMAT, caps);
+ return FALSE;
+ }
+unknown_format:
+ {
+ GST_WARNING_OBJECT (_tpool, "failed to get format from caps %"
+ GST_PTR_FORMAT, caps);
+ GST_ELEMENT_ERROR (_tpool, RESOURCE, WRITE,
+ ("Failed to create output image buffer of %dx%d pixels",
+ info.width, info.height),
+
+ ("Invalid input caps %" GST_PTR_FORMAT, caps));
+ return FALSE;
+ }
+}
+
+static void
+_destroy_tbm_surface (tbm_surface_h surface)
+{
+ GST_DEBUG ("destroy surface %p", surface);
+ tbm_surface_internal_destroy (surface);
+}
+
+/* This function handles GstBuffer creation */
+static GstFlowReturn
+gst_tizen_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
+ GstBufferPoolAcquireParams * params)
+{
+ GstTizenBufferPool *_tpool = GST_TIZEN_BUFFER_POOL_CAST (pool);
+ GstVideoInfo *info;
+ GstBuffer *buf;
+ GstMemory *tizen_mem;
+ gsize offsets[4] = {0, };
+
+ GST_DEBUG_OBJECT (pool, "gst_tizen_buffer_pool_alloc");
+ info = &_tpool->info;
+
+ if (!(buf = gst_buffer_new ()))
+ goto no_buffer;
+
+ GST_DEBUG_OBJECT (pool, "buffer new :%dx%d : %p", GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info), buf);
+ if (!(tizen_mem = gst_tizen_allocator_alloc ((GstAllocator *)_tpool->allocator, info)))
+ goto mem_create_failed;
+
+ gst_buffer_append_memory (buf, tizen_mem);
+
+ GST_DEBUG_OBJECT (pool, "mem allocated : %p, %dx%d n_plane : %d",
+ buf, GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info), GST_VIDEO_INFO_N_PLANES (info));
+
+ if (_tpool->add_videometa) {
+ GstVideoMeta *vmeta;
+
+ GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
+ /* these are just the defaults for now */
+
+ vmeta = gst_buffer_add_video_meta_full (buf, GST_VIDEO_FRAME_FLAG_NONE,
+ GST_VIDEO_INFO_FORMAT (info),
+ GST_VIDEO_INFO_WIDTH (info),
+ GST_VIDEO_INFO_HEIGHT (info),
+ GST_VIDEO_INFO_N_PLANES (info), offsets, info->stride);
+
+ vmeta->map = gst_tizen_video_memory_map;
+ vmeta->unmap = gst_tizen_video_memory_unmap;
+ }
+
+ gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (buf),
+ gst_tizen_buffer_data_quark, gst_tizen_memory_get_surface (tizen_mem), (GDestroyNotify) _destroy_tbm_surface);
+
+ *buffer = buf;
+ g_ptr_array_add (_tpool->buffers, buf);
+ g_atomic_int_inc (&_tpool->current_buffer_index);
+ g_atomic_int_inc (&_tpool->outstandings);
+
+ return GST_FLOW_OK;
+
+ /* ERROR */
+no_buffer:
+ {
+ GST_WARNING_OBJECT (pool, "Couldn't create buffer");
+ return GST_FLOW_ERROR;
+ }
+
+mem_create_failed:
+ {
+ GST_WARNING_OBJECT (pool, "Couldn't create GstTizen Memory");
+ return GST_FLOW_ERROR;
+ }
+}
+
+
+static GstFlowReturn
+gst_tizen_buffer_pool_acquire_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
+ GstBufferPoolAcquireParams * params)
+{
+ GstFlowReturn ret;
+ GstTizenBufferPool *_tpool = GST_TIZEN_BUFFER_POOL_CAST (bpool);
+ GstBufferPoolClass *pclass = GST_BUFFER_POOL_CLASS (parent_class);
+ gint i, n;
+
+ ret = pclass->acquire_buffer (bpool, buffer, params);
+ if (ret != GST_FLOW_OK) {
+ GST_WARNING_OBJECT (_tpool, "Couldn't acquire buffer");
+ return ret;
+ }
+
+ n = _tpool->buffers->len;
+ for (i = 0; i < n; i++) {
+ GstBuffer *tmp = g_ptr_array_index (_tpool->buffers, i);
+
+ if (tmp == *buffer)
+ break;
+ }
+ g_assert (i != n);
+ g_atomic_int_set(&_tpool->current_buffer_index, i);
+
+ GST_BUFFER_TIMESTAMP (*buffer) = GST_CLOCK_TIME_NONE;
+ GST_BUFFER_OFFSET (*buffer) = GST_BUFFER_OFFSET_NONE;
+ GST_BUFFER_OFFSET_END (*buffer) = GST_BUFFER_OFFSET_NONE;
+
+ g_atomic_int_inc (&_tpool->outstandings);
+
+ g_mutex_lock (&_tpool->lock);
+ _tpool->empty = FALSE;
+ g_mutex_unlock (&_tpool->lock);
+
+ GST_DEBUG_OBJECT (_tpool, "acquire buffer %p, current index %d, num_live_buffer %d", *buffer, i, _tpool->outstandings);
+
+ return GST_FLOW_OK;
+}
+
+static void
+gst_tizen_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
+{
+ GstTizenBufferPool *_tpool = GST_TIZEN_BUFFER_POOL_CAST (bpool);
+
+ GST_BUFFER_POOL_CLASS (gst_tizen_buffer_pool_parent_class)->release_buffer (bpool, buffer);
+
+ if (g_atomic_int_dec_and_test(&_tpool->outstandings)) {
+ g_mutex_lock (&_tpool->lock);
+ _tpool->empty = TRUE;
+ g_mutex_unlock (&_tpool->lock);
+ }
+ GST_DEBUG_OBJECT (_tpool, "release buffer %p, outstandings %d", buffer, _tpool->outstandings);
+}
+
+static void
+gst_tizen_buffer_pool_free_buffer (GstBufferPool * bpool, GstBuffer * buffer)
+{
+ GstTizenBufferPool *_tpool = GST_TIZEN_BUFFER_POOL_CAST (bpool);
+ GST_DEBUG_OBJECT (_tpool, "free buffer %p, %d", buffer, _tpool->outstandings);
+
+ gst_mini_object_set_qdata (GST_MINI_OBJECT (buffer),
+ gst_tizen_buffer_data_quark, NULL, NULL);
+
+ GST_BUFFER_POOL_CLASS (gst_tizen_buffer_pool_parent_class)->free_buffer (bpool,
+ buffer);
+}
+
+static void
+gst_tizen_buffer_pool_dispose (GObject * object)
+{
+ GstTizenBufferPool *_tpool = GST_TIZEN_BUFFER_POOL_CAST (object);
+
+ if (_tpool->allocator) {
+ gst_object_unref (_tpool->allocator);
+ _tpool->allocator = NULL;
+ }
+
+ if (_tpool->buffers) {
+ g_ptr_array_unref (_tpool->buffers);
+ _tpool->buffers = NULL;
+ }
+
+ GST_DEBUG_OBJECT (_tpool, "dispose pool");
+ G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+gst_tizen_buffer_pool_finalize (GObject * object)
+{
+ GstTizenBufferPool *pool = GST_TIZEN_BUFFER_POOL_CAST (object);
+
+
+ g_mutex_clear (&pool->lock);
+
+ G_OBJECT_CLASS (gst_tizen_buffer_pool_parent_class)->finalize (object);
+}
+
+static void
+gst_tizen_buffer_pool_init (GstTizenBufferPool * pool)
+{
+ g_mutex_init (&pool->lock);
+ pool->priv = gst_tizen_buffer_pool_get_instance_private (pool);
+ pool->buffers = g_ptr_array_new ();
+ pool->allocator = gst_tizen_allocator_new ();
+ g_atomic_int_set(&pool->outstandings, 0);
+ GST_LOG_OBJECT (pool, "Tizen buffer pool init %p", pool);
+}
+
+static void
+gst_tizen_buffer_pool_class_init (GstTizenBufferPoolClass * klass)
+{
+ GObjectClass *gobject_class = (GObjectClass *) klass;
+ GstBufferPoolClass *gstbufferpool_class = (GstBufferPoolClass *) klass;
+
+ gst_tizen_buffer_data_quark = g_quark_from_static_string ("GstTizenBufferData");
+
+ gobject_class->dispose = gst_tizen_buffer_pool_dispose;
+ gobject_class->finalize = gst_tizen_buffer_pool_finalize;
+
+ gstbufferpool_class->get_options = gst_tizen_buffer_pool_get_options;
+ gstbufferpool_class->set_config = gst_tizen_buffer_pool_set_config;
+ gstbufferpool_class->alloc_buffer = gst_tizen_buffer_pool_alloc;
+ gstbufferpool_class->free_buffer = gst_tizen_buffer_pool_free_buffer;
+ gstbufferpool_class->acquire_buffer = gst_tizen_buffer_pool_acquire_buffer;
+ gstbufferpool_class->release_buffer = gst_tizen_buffer_pool_release_buffer;
+}
+
+GstBufferPool *
+gst_tizen_buffer_pool_new (void)
+{
+ return GST_BUFFER_POOL_CAST (g_object_new (GST_TYPE_TIZEN_BUFFER_POOL, NULL));
+}
--- /dev/null
+/*
+ * GStreamer tizen buffer pool
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Author: Sejun Park <sejun79.park@samsung.com>
+ *
+ * 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_TIZEN_BUFFERPOOL_H_
+#define _GST_TIZEN_BUFFERPOOL_H_
+
+#include <gst/gst.h>
+#include <gst/video/video.h>
+#include <gst/video/gstvideometa.h>
+#include <gst/video/gstvideopool.h>
+#include <gst/allocators/gsttizenmemory.h>
+
+G_BEGIN_DECLS
+
+/**
+ * GST_BUFFER_POOL_OPTION_TIZEN_META:
+ *
+ * An option that can be activated on bufferpool to request TizenVideo metadata
+ * on buffers from the pool.
+ */
+#define GST_BUFFER_POOL_OPTION_TIZEN_META "GstBufferPoolOptionTizenVideoMeta"
+
+typedef struct _GstTizenBufferPool GstTizenBufferPool;
+typedef struct _GstTizenBufferPoolClass GstTizenBufferPoolClass;
+typedef struct _GstTizenBufferPoolPrivate GstTizenBufferPoolPrivate;
+
+/* buffer pool functions */
+#define GST_TYPE_TIZEN_BUFFER_POOL (gst_tizen_buffer_pool_get_type())
+#define GST_IS_TIZEN_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TIZEN_BUFFER_POOL))
+#define GST_TIZEN_BUFFER_POOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TIZEN_BUFFER_POOL, GstTizenBufferPool))
+#define GST_TIZEN_BUFFER_POOL_CAST(obj) ((GstTizenBufferPool*)(obj))
+
+struct _GstTizenBufferPool
+{
+ GstBufferPool bufferpool;
+
+ GstAllocator *allocator;
+ GstVideoInfo info;
+
+ gboolean add_videometa;
+ gboolean add_tizenmeta;
+
+ GMutex lock;
+
+ GPtrArray *buffers;
+ gint current_buffer_index;
+ gint outstandings;
+ gboolean empty;
+
+ GstTizenBufferPoolPrivate *priv;
+};
+
+struct _GstTizenBufferPoolClass
+{
+ GstBufferPoolClass parent_class;
+};
+
+GST_ALLOCATORS_API
+GType gst_tizen_buffer_pool_get_type (void);
+
+GST_ALLOCATORS_API
+GstBufferPool *gst_tizen_buffer_pool_new (void);
+
+
+G_END_DECLS
+
+#endif /* _GST_TIZEN_BUFFER_POOL_H_ */
--- /dev/null
+/*
+ * GStreamer tizen memory
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Author: Sejun Park <sejun79.park@samsung.com>
+ *
+ * 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 "string.h"
+#include "gstdmabuf.h"
+#include "gsttizenmemory.h"
+#include <tbm_surface_internal.h>
+
+#define GST_TIZEN_ALLOCATOR_NAME "TizenVideoMemory"
+
+GST_DEBUG_CATEGORY_STATIC (gst_tizenmemory_debug);
+#define GST_CAT_DEFAULT gst_tizenmemory_debug
+
+#define parent_class gst_tizen_allocator_parent_class
+G_DEFINE_TYPE_WITH_CODE (GstTizenAllocator, gst_tizen_allocator, GST_TYPE_ALLOCATOR,
+ G_ADD_PRIVATE (GstTizenAllocator);
+ GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "tizenmemory", 0,
+ "GstTizenMemory and GstTizenAllocator"));
+
+typedef struct
+{
+ tbm_format format;
+ GstVideoFormat vformat; /* Gst video format */
+ GstVideoFormat nformat; /* Gst native video format */
+} GstTizenBufferFormats;
+
+static void cached_tizen_disposed_cb (GstTizenAllocator * allocator, GstMiniObject *obj);
+
+GstTizenBufferFormats yuv_formats[] = {
+ {TBM_FORMAT_YUV420, GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_S420},
+ {TBM_FORMAT_NV21, GST_VIDEO_FORMAT_NV21, GST_VIDEO_FORMAT_SN21},
+ {TBM_FORMAT_NV12, GST_VIDEO_FORMAT_NV12, GST_VIDEO_FORMAT_SN12},
+ {TBM_FORMAT_ARGB8888, GST_VIDEO_FORMAT_ARGB, GST_VIDEO_FORMAT_SR32}
+};
+
+tbm_format
+gst_video_format_to_tbm_format (GstVideoFormat format)
+{
+ gint i;
+
+ for (i = 0; i < G_N_ELEMENTS (yuv_formats); i++) {
+ if (yuv_formats[i].nformat == format)
+ return yuv_formats[i].format;
+ }
+ return -1;
+}
+
+static GstTizenMemory *
+_tizen_video_mem_new (GstAllocator * allocator, GstMemory * parent, GstVideoInfo * vinfo,
+ tbm_surface_h surface, gpointer user_data, GDestroyNotify notify)
+{
+ gint width, height;
+ GstTizenMemory *tmem;
+ tbm_surface_info_s sinfo;
+ tbm_format format;
+ gint i;
+
+ tmem = g_slice_new0 (GstTizenMemory);
+
+ /* Creates the tbm_surface with buffer objects. */
+ if (surface) {
+ tbm_surface_internal_ref (surface);
+ tmem->surface = surface;
+ } else {
+ width = GST_VIDEO_INFO_WIDTH (vinfo);
+ height = GST_VIDEO_INFO_HEIGHT (vinfo);
+ format = gst_video_format_to_tbm_format (GST_VIDEO_INFO_FORMAT (vinfo));
+ tmem->surface = tbm_surface_internal_create_with_flags (width, height, format, TBM_BO_NONCACHABLE);
+ }
+
+ if (!tbm_surface_internal_is_valid (tmem->surface)) {
+ GST_ERROR ("Invalid tbm surface");
+ goto failed;
+ }
+
+ tbm_surface_get_info (tmem->surface, &sinfo);
+
+ for (i = 0; i < sinfo.num_planes; i++) {
+ GST_VIDEO_INFO_PLANE_STRIDE (vinfo, i) = sinfo.planes[i].stride;
+ GST_VIDEO_INFO_PLANE_OFFSET (vinfo, i) = sinfo.planes[i].offset;
+ }
+ GST_VIDEO_INFO_SIZE (vinfo) = sinfo.size;
+
+ gst_memory_init (GST_MEMORY_CAST (tmem), GST_MEMORY_FLAG_NO_SHARE,
+ allocator, parent, GST_VIDEO_INFO_SIZE (vinfo), 0, 0,
+ GST_VIDEO_INFO_SIZE (vinfo));
+
+ tmem->info = gst_video_info_copy (vinfo);
+ tmem->notify = notify;
+ tmem->user_data = user_data;
+ g_mutex_init (&tmem->lock);
+
+ GST_DEBUG ("%p: surface: %p size %" G_GSIZE_FORMAT, tmem, tmem->surface,
+ tmem->mem.maxsize);
+
+ return tmem;
+
+ /* ERRORS */
+failed:
+ {
+ GST_ERROR ("Failed to create tbm surface");
+ g_slice_free (GstTizenMemory, tmem);
+ return NULL;
+ }
+}
+
+static void
+gst_tizen_mem_free (GstAllocator * allocator, GstMemory * mem)
+{
+ GstTizenMemory *tmem = (GstTizenMemory *) mem;
+
+ tbm_surface_internal_unref (tmem->surface);
+ GST_DEBUG ("free surface from mem : %p", tmem->surface);
+
+ if (tmem->notify)
+ tmem->notify (tmem->user_data);
+
+ gst_video_info_free (tmem->info);
+ g_mutex_clear (&tmem->lock);
+ g_slice_free (GstTizenMemory, tmem);
+}
+
+static gpointer
+gst_tizen_mem_map (GstMemory * gmem, gsize maxsize, GstMapFlags flags)
+{
+ int err;
+ GstTizenMemory *tmem;
+ tbm_surface_info_s info;
+ gpointer data;
+
+ tmem = (GstTizenMemory *)gmem;
+ g_mutex_lock (&tmem->lock);
+
+ err = tbm_surface_map (tmem->surface, TBM_SURF_OPTION_WRITE|TBM_SURF_OPTION_READ, &info);
+ if (err == TBM_SURFACE_ERROR_NONE) {
+ data = info.planes[0].ptr;
+ } else {
+ GST_ERROR ("failed to get surface info");
+ data = NULL;
+ goto done;
+ }
+
+done:
+ g_mutex_unlock (&tmem->lock);
+
+ return data;
+}
+
+static void
+gst_tizen_mem_unmap (GstMemory * gmem)
+{
+ GstTizenMemory *tmem;
+
+ tmem = (GstTizenMemory *)gmem;
+
+ g_mutex_lock (&tmem->lock);
+ tbm_surface_unmap (tmem->surface);
+ g_mutex_unlock (&tmem->lock);
+}
+
+static void
+gst_tizen_allocator_finalize (GObject *obj)
+{
+ GstTizenAllocator *allocator;
+ GList *iter;
+
+ allocator = GST_TIZEN_ALLOCATOR (obj);
+
+ iter = allocator->priv->mem_cache;
+
+ while (iter) {
+ GstMiniObject *obj = iter->data;
+ gst_mini_object_weak_unref (obj,
+ (GstMiniObjectNotify) cached_tizen_disposed_cb, allocator);
+
+ gst_mini_object_set_qdata (obj,
+ g_quark_from_static_string ("tizenmem"), NULL, NULL);
+ iter = iter->next;
+ }
+
+ g_list_free (allocator->priv->mem_cache);
+ allocator->priv->mem_cache = NULL;
+
+ G_OBJECT_CLASS (parent_class)->finalize (obj);
+}
+
+static GstMemory *
+gst_tizen_mem_share (GstMemory * gmem, gssize offset, gssize size)
+{
+ return NULL;
+}
+
+static GstMemory *
+gst_tizen_mem_copy (GstMemory * gmem, gssize offset, gsize size)
+{
+ gint i;
+ GstMemory *copy;
+ GstTizenMemory *tmem;
+ tbm_surface_h new_surface, old_surface;
+ tbm_format format;
+ tbm_surface_info_s old_surface_info;
+ tbm_surface_info_s new_surface_info;
+
+ tmem = (GstTizenMemory *) gmem;
+
+ GST_DEBUG ("copy memory %p, offset %d, size : %u", tmem, offset, size);
+
+ old_surface = tmem->surface;
+ format = tbm_surface_get_format (old_surface);
+
+ copy = gst_tizen_allocator_alloc (gmem->allocator, tmem->info);
+ new_surface = gst_tizen_memory_get_surface (copy);
+
+ tbm_surface_get_info (old_surface, &old_surface_info);
+ tbm_surface_get_info (new_surface, &new_surface_info);
+
+ for (i = 0; i < tbm_surface_internal_get_num_planes (format); i++) {
+ memcpy (new_surface_info.planes[i].ptr,
+ old_surface_info.planes[i].ptr, new_surface_info.planes[i].size);
+ }
+
+ return copy;
+}
+
+static void
+gst_tizen_allocator_class_init (GstTizenAllocatorClass * klass)
+{
+ GObjectClass *object_class;
+ GstAllocatorClass *allocator_class;
+
+ allocator_class = GST_ALLOCATOR_CLASS (klass);
+ object_class = G_OBJECT_CLASS (klass);
+
+ allocator_class->alloc = NULL;
+ allocator_class->free = gst_tizen_mem_free;
+
+ object_class->finalize = gst_tizen_allocator_finalize;
+}
+
+static void
+gst_tizen_allocator_init (GstTizenAllocator * allocator)
+{
+ GstAllocator *alloc = GST_ALLOCATOR_CAST (allocator);
+
+ allocator->priv = gst_tizen_allocator_get_instance_private (allocator);
+ alloc->mem_type = GST_TIZEN_MEMORY_TYPE;
+ alloc->mem_map = (GstMemoryMapFunction) gst_tizen_mem_map;
+ alloc->mem_unmap = (GstMemoryUnmapFunction) gst_tizen_mem_unmap;
+ alloc->mem_share = (GstMemoryShareFunction) gst_tizen_mem_share;
+ alloc->mem_copy = (GstMemoryCopyFunction) gst_tizen_mem_copy;
+
+ GST_OBJECT_FLAG_SET (allocator, GST_ALLOCATOR_FLAG_CUSTOM_ALLOC);
+}
+
+/**
+ * gst_tizen_allocator_new:
+ *
+ * Return a new tizen allocator.
+ *
+ * Returns: (transfer full): a new fd allocator, or NULL if the allocator
+ * isn't available. Use gst_object_unref() to release the allocator after
+ * usage
+ *
+ */
+GstAllocator *
+gst_tizen_allocator_new (void)
+{
+ return g_object_new (GST_TYPE_TIZEN_ALLOCATOR, NULL);
+}
+
+GstMemory *
+gst_tizen_allocator_alloc (GstAllocator * allocator, GstVideoInfo * vinfo)
+{
+ g_return_val_if_fail (GST_IS_TIZEN_ALLOCATOR (allocator), NULL);
+
+ return (GstMemory *)_tizen_video_mem_new (allocator, NULL, vinfo, NULL, NULL, NULL);
+}
+
+GstMemory *
+gst_tizen_allocator_alloc_surface (GstAllocator * allocator, GstVideoInfo * vinfo,
+ tbm_surface_h surface, gpointer user_data, GDestroyNotify notify)
+{
+ g_return_val_if_fail (GST_IS_TIZEN_ALLOCATOR (allocator), NULL);
+
+ return (GstMemory *)_tizen_video_mem_new (allocator, NULL, vinfo, surface, user_data, notify);
+}
+
+gboolean
+gst_is_tizen_memory (GstMemory * mem)
+{
+ g_return_val_if_fail (mem != NULL, FALSE);
+
+ return GST_IS_TIZEN_ALLOCATOR (mem->allocator);
+}
+
+gint
+gst_tizen_memory_get_num_bos (GstMemory *mem)
+{
+ GstTizenMemory *tmem;
+
+ g_return_val_if_fail (mem != NULL, -1);
+ g_return_val_if_fail (GST_IS_TIZEN_ALLOCATOR (mem->allocator), -1);
+
+ tmem = (GstTizenMemory *)mem;
+
+ return (gint) tbm_surface_internal_get_num_bos (tmem->surface);
+}
+
+void *
+gst_tizen_memory_get_bos (GstMemory * mem, gint bo_idx)
+{
+ gint bo_num;
+ GstTizenMemory *tmem;
+
+ g_return_val_if_fail (mem != NULL, NULL);
+ g_return_val_if_fail (GST_IS_TIZEN_ALLOCATOR (mem->allocator), NULL);
+
+ tmem = (GstTizenMemory *)mem;
+
+ bo_num = tbm_surface_internal_get_num_bos(tmem->surface);
+
+ if (bo_idx > bo_num) {
+ GST_ERROR ("Failed to set set bo_idx");
+ return NULL;
+ }
+
+ return tbm_surface_internal_get_bo(tmem->surface, bo_idx);
+}
+
+void *
+gst_tizen_memory_get_surface (GstMemory * mem)
+{
+ GstTizenMemory *tmem;
+
+ g_return_val_if_fail (mem != NULL, NULL);
+ g_return_val_if_fail (GST_IS_TIZEN_ALLOCATOR (mem->allocator), NULL);
+
+ tmem = (GstTizenMemory *)mem;
+
+ return tmem->surface;
+}
+
+static void
+cached_tizen_disposed_cb (GstTizenAllocator * allocator, GstMiniObject *obj)
+{
+ allocator->priv->mem_cache = g_list_remove (allocator->priv->mem_cache, obj);
+}
+
+GstMemory *
+gst_tizen_allocator_dmabuf_export (GstAllocator * allocator, GstMemory * _tmem, int bo_idx)
+{
+ GstTizenMemory *tmem = (GstTizenMemory *) _tmem;
+ GstTizenAllocator *tallocator = GST_TIZEN_ALLOCATOR (allocator);
+ GstMemory * mem;
+ gint fd;
+ tbm_bo bo;
+
+ g_return_val_if_fail (tmem->surface != NULL, NULL);
+
+ bo = tbm_surface_internal_get_bo (tmem->surface, bo_idx);
+ fd = tbm_bo_export_fd (bo);
+
+ tallocator->priv->dmabuf_alloc = gst_dmabuf_allocator_new ();
+
+ mem = gst_dmabuf_allocator_alloc (tallocator->priv->dmabuf_alloc, fd,
+ gst_memory_get_sizes (_tmem, NULL, NULL));
+
+ /* cache */
+ gst_mini_object_weak_ref (GST_MINI_OBJECT (mem),
+ (GstMiniObjectNotify) cached_tizen_disposed_cb, tallocator);
+
+ tallocator->priv->mem_cache = g_list_prepend (tallocator->priv->mem_cache, mem);
+
+ gst_mini_object_set_qdata (GST_MINI_OBJECT (mem),
+ g_quark_from_static_string ("_tmem"), _tmem,
+ (GDestroyNotify) gst_memory_unref);
+ return mem;
+}
+
+GstTizenMemory *
+gst_tizen_allocator_dmabuf_import (GstAllocator * allocator, gint * fds, gint planes, gsize offsets[4], GstVideoInfo * vinfo)
+{
+ GstTizenMemory *tmem;
+ GstMemory *mem;
+
+ tmem = g_slice_new0 (GstTizenMemory);
+
+ mem = GST_MEMORY_CAST (tmem);
+
+ gst_memory_init (mem, GST_MEMORY_FLAG_NO_SHARE, allocator, NULL,
+ GST_VIDEO_INFO_SIZE (vinfo), 0, 0, GST_VIDEO_INFO_SIZE (vinfo));
+
+
+ return NULL;
+}
+
+gboolean
+gst_tizen_video_memory_map (GstVideoMeta * meta, guint plane, GstMapInfo * info,
+ gpointer * data, gint * stride, GstMapFlags flags)
+{
+ gint err;
+ tbm_surface_info_s surface_info;
+ GstBuffer *buffer = meta->buffer;
+ GstTizenMemory *vmem =
+ (GstTizenMemory *) gst_buffer_get_memory (buffer, 0);
+
+ g_return_val_if_fail (GST_IS_TIZEN_ALLOCATOR (((GstMemory *) vmem)->allocator), FALSE);
+
+ err = tbm_surface_map (vmem->surface, TBM_SURF_OPTION_WRITE|TBM_SURF_OPTION_READ, &surface_info);
+ if (err == TBM_SURFACE_ERROR_NONE) {
+ if (surface_info.num_planes > plane) {
+ *data = surface_info.planes[plane].ptr;
+ *stride = surface_info.planes[plane].stride;
+ GST_DEBUG ("_video_memory_map -> plane : %d, data : %p, stride : %d",
+ plane, *data, *stride);
+ } else {
+ GST_ERROR_OBJECT (meta, "invalid format");
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+gboolean
+gst_tizen_video_memory_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info)
+{
+ GstBuffer *buffer = meta->buffer;
+ GstTizenMemory *vmem =
+ (GstTizenMemory *) gst_buffer_get_memory (buffer, 0);
+
+ g_return_val_if_fail (GST_IS_TIZEN_ALLOCATOR (((GstMemory *) vmem)->allocator), FALSE);
+
+ tbm_surface_unmap (vmem->surface);
+ GST_DEBUG ("_video_memory_unmap -> plane : %d", plane);
+ return TRUE;
+}
--- /dev/null
+/*
+ * GStreamer tizen memory
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Author: Sejun Park <sejun79.park@samsung.com>
+ *
+ * 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_TIZEN_MEMORY_H__
+#define __GST_TIZEN_MEMORY_H__
+
+#include <gst/gst.h>
+#include <gst/allocators/allocators-prelude.h>
+#include <gst/video/video.h>
+#include <gst/video/gstvideometa.h>
+//#include <gst/gstallocator.h>
+#include <gst/gstmemory.h>
+#include <tbm_bufmgr.h>
+#include <tbm_surface.h>
+
+G_BEGIN_DECLS
+
+typedef struct _GstTizenAllocator GstTizenAllocator;
+typedef struct _GstTizenAllocatorClass GstTizenAllocatorClass;
+typedef struct _GstTizenAllocatorPrivate GstTizenAllocatorPrivate;
+
+typedef struct _GstTizenMemory GstTizenMemory;
+#define GST_TYPE_TIZEN_ALLOCATOR (gst_tizen_allocator_get_type())
+
+GST_ALLOCATORS_API
+GType gst_tizen_allocator_get_type(void);
+
+#define GST_IS_TIZEN_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_TIZEN_ALLOCATOR))
+#define GST_IS_TIZEN_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_TIZEN_ALLOCATOR))
+#define GST_TIZEN_ALLOCATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_TIZEN_ALLOCATOR, GstTizenAllocatorClass))
+#define GST_TIZEN_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TIZEN_ALLOCATOR, GstTizenAllocator))
+#define GST_TIZEN_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TIZEN_ALLOCATOR, GstTizenAllocatorClass))
+#define GST_TIZEN_ALLOCATOR_CAST(obj) ((GstTizenAllocator *)(obj))
+
+#define GST_TIZEN_MEMORY_TYPE "TizenVideoMemory"
+
+struct _GstTizenMemory
+{
+ GstMemory mem;
+
+ tbm_surface_h surface;
+ GstVideoInfo *info;
+
+ /* <protected> */
+ GMutex lock;
+
+ /* <private> */
+ GDestroyNotify notify;
+ gpointer user_data;
+
+};
+
+struct _GstTizenAllocatorPrivate
+{
+ GList *mem_cache;
+ GstAllocator *dmabuf_alloc;
+};
+
+/**
+ * GstTizenMemoryAllocator
+ *
+ * Base class for allocators with bo memory
+ */
+struct _GstTizenAllocator
+{
+ GstAllocator parent;
+ GstTizenAllocatorPrivate *priv;
+};
+
+
+struct _GstTizenAllocatorClass
+{
+ GstAllocatorClass parent_class;
+};
+
+GST_ALLOCATORS_API
+GstAllocator * gst_tizen_allocator_new (void);
+
+GST_ALLOCATORS_API
+GstMemory * gst_tizen_allocator_alloc (GstAllocator * allocator, GstVideoInfo * vinfo);
+
+GST_ALLOCATORS_API
+GstMemory * gst_tizen_allocator_alloc_surface (GstAllocator * allocator, GstVideoInfo * vinfo,
+ tbm_surface_h surface, gpointer user_data, GDestroyNotify notify);
+
+GST_ALLOCATORS_API
+gboolean gst_is_tizen_memory (GstMemory *mem);
+
+GST_ALLOCATORS_API
+gint gst_tizen_memory_get_num_bos (GstMemory *mem);
+
+GST_ALLOCATORS_API
+void * gst_tizen_memory_get_bos (GstMemory *mem, gint index);
+
+GST_ALLOCATORS_API
+void * gst_tizen_memory_get_surface (GstMemory *mem);
+
+GST_ALLOCATORS_API
+GstMemory * gst_tizen_allocator_dmabuf_export (GstAllocator * allocator, GstMemory *tmem, int bo_idx);
+
+GST_ALLOCATORS_API
+GstTizenMemory *gst_tizen_allocator_dmabuf_import (GstAllocator * allocator, gint * fds, gint planes, gsize offsets[4], GstVideoInfo * vinfo);
+
+GST_ALLOCATORS_API
+gboolean gst_tizen_video_memory_map (GstVideoMeta * meta, guint plane, GstMapInfo * info,
+ gpointer * data, gint * stride, GstMapFlags flags);
+
+GST_ALLOCATORS_API
+gboolean gst_tizen_video_memory_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info);
+
+GST_ALLOCATORS_API
+tbm_format gst_video_format_to_tbm_format (GstVideoFormat format);
+
+G_END_DECLS
+
+#endif /* _GST_TIZEN_MEMORY_H_ */
+++ /dev/null
-audio-enumtypes.c
-audio-enumtypes.h
-gstaudiopack.h
} else {
GST_DEBUG_OBJECT (dec, "unsupported format; ignoring");
GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
+#ifdef TIZEN_FEATURE_AUDIODECODER_MODIFICATION
+ goto newseg_wrong_format;
+#else
gst_event_unref (event);
ret = FALSE;
+#endif
break;
}
}
break;
}
return ret;
+
+#ifdef TIZEN_FEATURE_AUDIODECODER_MODIFICATION
+newseg_wrong_format:
+ {
+ GST_DEBUG_OBJECT (dec, "received non TIME newsegment");
+ gst_event_unref (event);
+ /* SWALLOW EVENT */
+ return TRUE;
+ }
+#endif
}
static gboolean
+++ /dev/null
-pbutils-enumtypes.c
-pbutils-enumtypes.h
-pbutils-marshal.c
-pbutils-marshal.h
* 40kB is massive overkill for the maximum, I think, but it
* doesn't do any harm (tpm: increased to 64kB after watching
* typefinding fail on a wavpack file that needed 42kB to succeed) */
+#ifdef TIZEN_PROFILE_TV
+#define TYPE_FIND_MIN_SIZE 2048
+#else
#define TYPE_FIND_MIN_SIZE 8192
+#endif
+
#define TYPE_FIND_MAX_SIZE 65536
#define DEFAULT_PULL_BLOCKSIZE 4096
+++ /dev/null
-video-enumtypes.c
-video-enumtypes.h
-video-orc.h
CLEANFILES = $(BUILT_SOURCES)
libgstvideo_@GST_API_VERSION@_la_SOURCES = \
+ cameracontrol.c \
+ cameracontrolchannel.c \
colorbalance.c \
colorbalancechannel.c \
navigation.c \
libgstvideo_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/video
libgstvideo_@GST_API_VERSION@include_HEADERS = \
+ cameracontrol.h \
+ cameracontrolchannel.h \
colorbalance.h \
colorbalancechannel.h \
navigation.h \
--- /dev/null
+/*
+ * GStreamer Camera Control Interface
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jeongmo Yang <jm80.yang@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/*============================================================================================
+EDIT HISTORY FOR MODULE
+
+This section contains comments describing changes made to the module.
+Notice that changes are listed in reverse chronological order.
+
+when who what, where, why
+--------- ------------------------ ----------------------------------------------
+12/09/08 jm80.yang@samsung.com Created
+
+============================================================================================*/
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cameracontrol.h"
+//#include "interfaces-marshal.h"
+
+/**
+ * SECTION:gstcameracontrol
+ * @short_description: Interface for camera control
+ */
+
+enum {
+ CONTROL_VALUE_CHANGED,
+ CONTROL_LAST_SIGNAL
+};
+
+static void gst_camera_control_class_init(GstCameraControlClass *klass);
+
+static guint gst_camera_control_signals[CONTROL_LAST_SIGNAL] = { 0 };
+
+GType gst_camera_control_get_type(void)
+{
+ static GType gst_camera_control_type = 0;
+
+ if (!gst_camera_control_type) {
+ static const GTypeInfo gst_camera_control_info =
+ {
+ sizeof(GstCameraControlClass),
+ (GBaseInitFunc)gst_camera_control_class_init,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 0,
+ 0,
+ NULL,
+ };
+
+ gst_camera_control_type = g_type_register_static(G_TYPE_INTERFACE,
+ "GstCameraControl",
+ &gst_camera_control_info,
+ 0);
+ //g_type_interface_add_prerequisite(gst_camera_control_type, GST_TYPE_IMPLEMENTS_INTERFACE);
+ }
+
+ return gst_camera_control_type;
+}
+
+static void gst_camera_control_class_init(GstCameraControlClass *klass)
+{
+ static gboolean initialized = FALSE;
+
+ if (!initialized) {
+ gst_camera_control_signals[CONTROL_VALUE_CHANGED] =
+ g_signal_new("control-value-changed",
+ GST_TYPE_CAMERA_CONTROL, G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET(GstCameraControlClass, value_changed),
+ NULL, NULL, NULL,
+ //gst_interfaces_marshal_VOID__OBJECT_INT,
+ G_TYPE_NONE, 2, GST_TYPE_CAMERA_CONTROL_CHANNEL, G_TYPE_INT);
+
+ initialized = TRUE;
+ }
+
+ // TODO :
+ klass->camera_control_type = 0;
+
+ /* defauld virtual functions */
+ klass->list_channels = NULL;
+ klass->set_exposure = NULL;
+ klass->get_exposure = NULL;
+ klass->set_capture_mode = NULL;
+ klass->get_capture_mode = NULL;
+ klass->set_strobe = NULL;
+ klass->get_strobe = NULL;
+ klass->set_detect = NULL;
+ klass->get_detect = NULL;
+ klass->set_value = NULL;
+ klass->get_value = NULL;
+ klass->set_zoom = NULL;
+ klass->get_zoom = NULL;
+ klass->set_focus = NULL;
+ klass->get_focus = NULL;
+ klass->start_auto_focus = NULL;
+ klass->stop_auto_focus = NULL;
+ klass->set_focus_level = NULL;
+ klass->get_focus_level = NULL;
+ klass->set_auto_focus_area = NULL;
+ klass->get_auto_focus_area = NULL;
+ klass->set_wdr = NULL;
+ klass->get_wdr = NULL;
+ klass->set_ahs = NULL;
+ klass->get_ahs = NULL;
+ klass->set_part_color = NULL;
+ klass->get_part_color = NULL;
+ klass->get_exif_info = NULL;
+ klass->set_capture_command = NULL;
+ klass->set_record_command = NULL;
+ klass->start_face_zoom = NULL;
+ klass->stop_face_zoom = NULL;
+ klass->set_ae_lock = NULL;
+ klass->get_ae_lock = NULL;
+ klass->set_awb_lock = NULL;
+ klass->get_awb_lock = NULL;
+}
+
+const GList* gst_camera_control_list_channels(GstCameraControl *control)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->list_channels) {
+ return klass->list_channels(control);
+ }
+
+ return NULL;
+}
+
+
+gboolean gst_camera_control_set_value(GstCameraControl *control, GstCameraControlChannel *control_channel, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_value) {
+ return klass->set_value(control, control_channel, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_value(GstCameraControl *control, GstCameraControlChannel *control_channel, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_value) {
+ return klass->get_value(control, control_channel, value);
+ }
+
+ return FALSE;
+}
+
+
+
+gboolean gst_camera_control_set_exposure(GstCameraControl *control, gint type, gint value1, gint value2)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_exposure) {
+ return klass->set_exposure(control, type, value1, value2);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_exposure(GstCameraControl *control, gint type, gint *value1, gint *value2)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_exposure) {
+ return klass->get_exposure(control, type, value1, value2);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_capture_mode(GstCameraControl *control, gint type, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_capture_mode) {
+ return klass->set_capture_mode(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_capture_mode(GstCameraControl *control, gint type, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_capture_mode) {
+ return klass->get_capture_mode(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_strobe(GstCameraControl *control, gint type, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_strobe) {
+ return klass->set_strobe(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_strobe(GstCameraControl *control, gint type, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_strobe) {
+ return klass->get_strobe(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_detect(GstCameraControl *control, gint type, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_detect) {
+ return klass->set_detect(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_detect(GstCameraControl *control, gint type, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_detect) {
+ return klass->get_detect(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_zoom(GstCameraControl *control, gint type, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_zoom) {
+ return klass->set_zoom(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_zoom(GstCameraControl *control, gint type, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_zoom) {
+ return klass->get_zoom(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_focus(GstCameraControl *control, gint mode, gint range)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_focus) {
+ return klass->set_focus(control, mode, range);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_focus(GstCameraControl *control, gint *mode, gint *range)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_focus) {
+ return klass->get_focus(control, mode, range);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_start_auto_focus(GstCameraControl *control)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->start_auto_focus) {
+ return klass->start_auto_focus(control);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_stop_auto_focus(GstCameraControl *control)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->stop_auto_focus) {
+ return klass->stop_auto_focus(control);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_focus_level(GstCameraControl *control, gint manual_level)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_focus_level) {
+ return klass->set_focus_level(control, manual_level);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_focus_level(GstCameraControl *control, gint *manual_level)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_focus_level) {
+ return klass->get_focus_level(control, manual_level);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_auto_focus_area(GstCameraControl *control, GstCameraControlRectType rect)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_auto_focus_area) {
+ return klass->set_auto_focus_area(control, rect);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_auto_focus_area(GstCameraControl *control, GstCameraControlRectType *rect)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_auto_focus_area) {
+ return klass->get_auto_focus_area(control, rect);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_wdr(GstCameraControl *control, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_wdr) {
+ return klass->set_wdr(control, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_wdr(GstCameraControl *control, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_wdr) {
+ return klass->get_wdr(control, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_ahs(GstCameraControl *control, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_ahs) {
+ return klass->set_ahs(control, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_ahs(GstCameraControl *control, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_ahs) {
+ return klass->get_ahs(control, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_part_color(GstCameraControl *control, gint type, gint value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_part_color) {
+ return klass->set_part_color(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_part_color(GstCameraControl *control, gint type, gint *value)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_part_color) {
+ return klass->get_part_color(control, type, value);
+ }
+
+ return FALSE;
+}
+
+gboolean
+gst_camera_control_get_exif_info(GstCameraControl *control, GstCameraControlExifInfo *info)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_exif_info) {
+ return klass->get_exif_info(control, info);
+ }
+
+ return FALSE;
+}
+
+
+gboolean gst_camera_control_get_basic_dev_info(GstCameraControl *control, gint dev_id, GstCameraControlCapsInfoType *info)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_basic_dev_info) {
+ return klass->get_basic_dev_info(control, dev_id, info);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_misc_dev_info(GstCameraControl *control, gint dev_id, GstCameraControlCtrlListInfoType *info)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS( control );
+
+ if (klass && klass->get_misc_dev_info) {
+ return klass->get_misc_dev_info( control, dev_id, info );
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_extra_dev_info(GstCameraControl *control, gint dev_id, GstCameraControlExtraInfoType *info)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_extra_dev_info) {
+ return klass->get_extra_dev_info(control, dev_id, info);
+ }
+
+ return FALSE;
+}
+
+void gst_camera_control_set_capture_command(GstCameraControl *control, GstCameraControlCaptureCommand cmd)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_capture_command) {
+ klass->set_capture_command(control, cmd);
+ }
+
+ return;
+}
+
+void gst_camera_control_set_record_command(GstCameraControl *control, GstCameraControlRecordCommand cmd)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_record_command) {
+ klass->set_record_command(control, cmd);
+ }
+
+ return;
+}
+
+gboolean gst_camera_control_start_face_zoom(GstCameraControl *control, gint x, gint y, gint zoom_level)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->start_face_zoom) {
+ return klass->start_face_zoom(control, x, y, zoom_level);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_stop_face_zoom(GstCameraControl *control)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->stop_face_zoom) {
+ return klass->stop_face_zoom(control);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_ae_lock(GstCameraControl *control, gboolean lock)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_ae_lock) {
+ return klass->set_ae_lock(control, lock);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_ae_lock(GstCameraControl *control, gboolean *lock)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_ae_lock) {
+ return klass->get_ae_lock(control, lock);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_awb_lock(GstCameraControl *control, gboolean lock)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_awb_lock) {
+ return klass->set_awb_lock(control, lock);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_awb_lock(GstCameraControl *control, gboolean *lock)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->get_awb_lock) {
+ return klass->get_awb_lock(control, lock);
+ }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_user_buffer_fd(GstCameraControl *control, int *fds, int number)
+{
+ GstCameraControlClass *klass = GST_CAMERA_CONTROL_GET_CLASS(control);
+
+ if (klass && klass->set_user_buffer_fd) {
+ return klass->set_user_buffer_fd(control, fds, number);
+ }
+
+ return FALSE;
+}
+
+void gst_camera_control_value_changed(GstCameraControl *control, GstCameraControlChannel *control_channel, gint value)
+{
+ g_signal_emit(G_OBJECT(control), gst_camera_control_signals[CONTROL_VALUE_CHANGED], 0, control_channel, value);
+ g_signal_emit_by_name(G_OBJECT(control_channel), "control-value-changed", value);
+}
--- /dev/null
+/*
+ * GStreamer Camera Control Interface
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jeongmo Yang <jm80.yang@samsung.com>
+ *
+ * This library is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Lesser General Public License as published by the
+ * Free Software Foundation; either version 2.1 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+/* ===========================================================================================
+EDIT HISTORY FOR MODULE
+
+ This section contains comments describing changes made to the module.
+ Notice that changes are listed in reverse chronological order.
+
+when who what, where, why
+--------- ------------------------ ------------------------------------------------------
+12/09/08 jm80.yang@samsung.com Created
+
+=========================================================================================== */
+
+#ifndef __GST_CAMERA_CONTROL_H__
+#define __GST_CAMERA_CONTROL_H__
+
+#include <gst/gst.h>
+#include <gst/video/video-prelude.h>
+#include <gst/video/cameracontrolchannel.h>
+//#include <gst/interfaces/interfaces-enumtypes.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_CAMERA_CONTROL \
+ (gst_camera_control_get_type())
+#define GST_CAMERA_CONTROL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CAMERA_CONTROL, GstCameraControl))
+#define GST_CAMERA_CONTROL_GET_CLASS(inst) \
+ (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_CAMERA_CONTROL, GstCameraControlClass))
+#define GST_CAMERA_CONTROL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_CAMERA_CONTROL, GstCameraControlClass))
+#define GST_IS_CAMERA_CONTROL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CAMERA_CONTROL))
+#define GST_IS_CAMERA_CONTROL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CAMERA_CONTROL))
+#define GST_CAMERA_CONTROL_TYPE(klass) (klass->camera_control_type)
+
+
+typedef struct _GstCameraControl GstCameraControl;
+
+typedef enum
+{
+ // TODO : V4L2 Extend
+ GST_CAMERA_CONTROL_HARDWARE,
+ GST_CAMERA_CONTROL_SOFTWARE
+} GstCameraControlType;
+
+/* enumerations for Camera control Exposure types */
+typedef enum
+{
+ GST_CAMERA_CONTROL_F_NUMBER,
+ GST_CAMERA_CONTROL_SHUTTER_SPEED,
+ GST_CAMERA_CONTROL_ISO,
+ GST_CAMERA_CONTROL_PROGRAM_MODE,
+ GST_CAMERA_CONTROL_EXPOSURE_MODE,
+ GST_CAMERA_CONTROL_EXPOSURE_VALUE
+} GstCameraControlExposureType;
+
+/* enumerations for Camera control Capture mode types */
+typedef enum
+{
+ GST_CAMERA_CONTROL_CAPTURE_MODE,
+ GST_CAMERA_CONTROL_OUTPUT_MODE,
+ GST_CAMERA_CONTROL_FRAME_COUNT,
+ GST_CAMERA_CONTROL_JPEG_QUALITY
+} GstCameraControlCaptureModeType;
+
+/* enumerations for Camera control Strobe types */
+typedef enum
+{
+ GST_CAMERA_CONTROL_STROBE_CONTROL,
+ GST_CAMERA_CONTROL_STROBE_CAPABILITIES,
+ GST_CAMERA_CONTROL_STROBE_MODE,
+ GST_CAMERA_CONTROL_STROBE_STATUS,
+ GST_CAMERA_CONTROL_STROBE_EV
+} GstCameraControlStrobeType;
+
+/* enumerations for Camera control Face detection types */
+typedef enum
+{
+ GST_CAMERA_CONTROL_FACE_DETECT_MODE,
+ GST_CAMERA_CONTROL_FACE_DETECT_NUMBER,
+ GST_CAMERA_CONTROL_FACE_FOCUS_SELECT,
+ GST_CAMERA_CONTROL_FACE_SELECT_NUMBER,
+ GST_CAMERA_CONTROL_FACE_DETECT_STATUS
+} GstCameraControlFaceDetectType;
+
+/* enumerations for Camera control Zoom types */
+typedef enum
+{
+ GST_CAMERA_CONTROL_DIGITAL_ZOOM,
+ GST_CAMERA_CONTROL_OPTICAL_ZOOM
+} GstCameraControlZoomType;
+
+/* enumerations for Camera control Part color */
+typedef enum
+{
+ GST_CAMERA_CONTROL_PART_COLOR_SRC,
+ GST_CAMERA_CONTROL_PART_COLOR_DST,
+ GST_CAMERA_CONTROL_PART_COLOR_MODE
+} GstCameraControlPartColorType;
+
+/* enumerations for Camera capture command */
+typedef enum
+{
+ GST_CAMERA_CONTROL_CAPTURE_COMMAND_NONE,
+ GST_CAMERA_CONTROL_CAPTURE_COMMAND_START,
+ GST_CAMERA_CONTROL_CAPTURE_COMMAND_STOP,
+ GST_CAMERA_CONTROL_CAPTURE_COMMAND_STOP_MULTISHOT
+} GstCameraControlCaptureCommand;
+
+/* enumerations for Camera record command */
+typedef enum
+{
+ GST_CAMERA_CONTROL_RECORD_COMMAND_NONE,
+ GST_CAMERA_CONTROL_RECORD_COMMAND_START,
+ GST_CAMERA_CONTROL_RECORD_COMMAND_STOP
+} GstCameraControlRecordCommand;
+
+/////////////////////////////////
+// For Query functionalities //
+// For Querying capabilities //
+/////////////////////////////////
+#define GST_CAMERA_CONTROL_MAX_NUM_FMT_DESC 32
+#define GST_CAMERA_CONTROL_MAX_NUM_RESOLUTION 32
+#define GST_CAMERA_CONTROL_MAX_NUM_AVAILABLE_TPF 16
+#define GST_CAMERA_CONTROL_MAX_NUM_AVAILABLE_FPS 16
+#define GST_CAMERA_CONTROL_MAX_NUM_CTRL_LIST_INFO 64
+#define GST_CAMERA_CONTROL_MAX_NUM_CTRL_MENU 64
+#define GST_CAMERA_CONTROL_MAX_NUM_DETECTED_FACES 16
+#define GST_CAMERA_CONTROL_MAX_SZ_CTRL_NAME_STRING 32
+#define GST_CAMERA_CONTROL_MAX_SZ_DEV_NAME_STRING 32
+
+/*! @struct GstCameraControlFracType
+ * @brief For timeperframe as fraction type
+ * Elapse time consumed by one frame, reverse of FPS
+ */
+typedef struct _GstCameraControlFracType {
+ gint num;
+ gint den;
+} GstCameraControlFracType;
+
+/*! @struct GstCameraControlRectType
+ * @brief For touch auto focusing area and face detection area
+ */
+typedef struct _GstCameraControlRectType {
+ gint x;
+ gint y;
+ gint width;
+ gint height;
+} GstCameraControlRectType;
+
+/*! @struct GstCameraControlResolutionType
+ * @brief For querying supported resolutions
+ */
+typedef struct _GstCameraControlResolutionType {
+ gint w;
+ gint h;
+
+ /* Available time per frame(tpf) as each pixelformat */
+ gint num_avail_tpf;
+ GstCameraControlFracType tpf[GST_CAMERA_CONTROL_MAX_NUM_AVAILABLE_TPF];
+} GstCameraControlResolutionType;
+
+/*! @struct GstCameraControlFmtDescType
+ * @brief For querying supported format type
+ */
+typedef struct _GstCameraControlFmtDescType {
+ /* fourcc name of each pixelformat */
+ guint fcc;
+ gint fcc_use;
+
+ /* Available resolutions as each pixelformat */
+ gint num_resolution;
+ GstCameraControlResolutionType resolutions[GST_CAMERA_CONTROL_MAX_NUM_RESOLUTION];
+} GstCameraControlFmtDescType;
+
+/*! @struct GstCameraControlCapsInfoType
+ * @brief For querying image input capabilities
+ */
+typedef struct _GstCameraControlCapsInfoType {
+ char dev_name[GST_CAMERA_CONTROL_MAX_SZ_DEV_NAME_STRING];
+ int input_idx;
+ gint num_fmt_desc;
+ GstCameraControlFmtDescType fmt_desc[GST_CAMERA_CONTROL_MAX_NUM_FMT_DESC];
+
+ int num_preview_resolution;
+ int preview_resolution_width[GST_CAMERA_CONTROL_MAX_NUM_RESOLUTION];
+ int preview_resolution_height[GST_CAMERA_CONTROL_MAX_NUM_RESOLUTION];
+
+ int num_capture_resolution;
+ int capture_resolution_width[GST_CAMERA_CONTROL_MAX_NUM_RESOLUTION];
+ int capture_resolution_height[GST_CAMERA_CONTROL_MAX_NUM_RESOLUTION];
+
+ int num_preview_fmt;
+ unsigned int preview_fmt[GST_CAMERA_CONTROL_MAX_NUM_FMT_DESC];
+
+ int num_capture_fmt;
+ unsigned int capture_fmt[GST_CAMERA_CONTROL_MAX_NUM_FMT_DESC];
+
+ int num_fps;
+ GstCameraControlFracType fps[GST_CAMERA_CONTROL_MAX_NUM_AVAILABLE_FPS];
+} GstCameraControlCapsInfoType;
+
+/*! @struct GstCameraControlFaceInfo
+ * @brief For face information
+ */
+typedef struct _GstCameraControlFaceInfo {
+ int id;
+ int score;
+ GstCameraControlRectType rect;
+} GstCameraControlFaceInfo;
+
+/*! @struct GstCameraControlFaceDetectInfo
+ * @brief For face detect information
+ */
+typedef struct _GstCameraControlFaceDetectInfo {
+ int num_of_faces;
+ GstCameraControlFaceInfo face_info[GST_CAMERA_CONTROL_MAX_NUM_DETECTED_FACES];
+} GstCameraControlFaceDetectInfo;
+
+/////////////////////////////
+// For Querying controls //
+/////////////////////////////
+enum {
+ GST_CAMERA_CTRL_TYPE_RANGE = 0,
+ GST_CAMERA_CTRL_TYPE_BOOL,
+ GST_CAMERA_CTRL_TYPE_ARRAY,
+ GST_CAMERA_CTRL_TYPE_UNKNOWN,
+ GST_CAMERA_CTRL_TYPE_NUM,
+};
+
+/*! @struct GstCameraControlCtrlMenuType
+ * @brief For querying menu of specified controls
+ */
+typedef struct _GstCameraControlCtrlMenuType {
+ gint menu_index;
+ gchar menu_name[GST_CAMERA_CONTROL_MAX_SZ_CTRL_NAME_STRING];
+} GstCameraControlCtrlMenuType;
+
+/*! @struct GstCameraControlCtrlInfoType
+ * @brief For querying controls detail
+ */
+typedef struct _GstCameraControlCtrlInfoType {
+ gint avsys_ctrl_id;
+ gint v4l2_ctrl_id;
+ gint ctrl_type;
+ gchar ctrl_name[GST_CAMERA_CONTROL_MAX_SZ_CTRL_NAME_STRING];
+ gint min;
+ gint max;
+ gint step;
+ gint default_val;
+ gint num_ctrl_menu;
+ GstCameraControlCtrlMenuType ctrl_menu[GST_CAMERA_CONTROL_MAX_NUM_CTRL_MENU];
+} GstCameraControlCtrlInfoType;
+
+/*! @struct GstCameraControlCtrlListInfoType
+ * @brief For querying controls
+ */
+typedef struct _GstCameraControlCtrlListInfoType {
+ gint num_ctrl_list_info;
+ GstCameraControlCtrlInfoType ctrl_info[GST_CAMERA_CONTROL_MAX_NUM_CTRL_LIST_INFO];
+} GstCameraControlCtrlListInfoType;
+
+/* capabilities field */
+#define GST_CAMERA_STROBE_CAP_NONE 0x0000 /* No strobe supported */
+#define GST_CAMERA_STROBE_CAP_OFF 0x0001 /* Always flash off mode */
+#define GST_CAMERA_STROBE_CAP_ON 0x0002 /* Always use flash light mode */
+#define GST_CAMERA_STROBE_CAP_AUTO 0x0004 /* Flashlight works automatic */
+#define GST_CAMERA_STROBE_CAP_REDEYE 0x0008 /* Red-eye reduction */
+#define GST_CAMERA_STROBE_CAP_SLOWSYNC 0x0010 /* Slow sync */
+#define GST_CAMERA_STROBE_CAP_FRONT_CURTAIN 0x0020 /* Front curtain */
+#define GST_CAMERA_STROBE_CAP_REAR_CURTAIN 0x0040 /* Rear curtain */
+#define GST_CAMERA_STROBE_CAP_PERMANENT 0x0080 /* keep turned on until turning off */
+#define GST_CAMERA_STROBE_CAP_EXTERNAL 0x0100 /* use external strobe */
+
+typedef struct _GstCameraControlExtraInfoType {
+ guint strobe_caps; /* Use above caps field */
+ guint detection_caps; /* Just boolean */
+ guint reserved[4];
+} GstCameraControlExtraInfoType;
+/////////////////////////////////////
+// END For Query functionalities //
+/////////////////////////////////////
+
+
+/* structure for Camera control EXIF information */
+typedef struct _GstCameraControlExifInfo {
+ /* Dynamic value */
+ guint32 exposure_time_numerator; /* Exposure time, given in seconds */
+ guint32 exposure_time_denominator;
+ gint shutter_speed_numerator; /* Shutter speed, given in APEX(Additive System Photographic Exposure) */
+ gint shutter_speed_denominator;
+ gint brigtness_numerator; /* Value of brightness, before firing flash, given in APEX value */
+ gint brightness_denominator;
+ guint16 iso; /* Sensitivity value of sensor */
+ guint16 flash; /* Whether flash is fired(1) or not(0) */
+ gint metering_mode; /* metering mode in EXIF 2.2 */
+ gint exif_image_width; /* Size of image */
+ gint exif_image_height;
+ gint exposure_bias_in_APEX; /* Exposure bias in APEX standard */
+ gint software_used; /* Firmware S/W version */
+
+ /* Fixed value */
+ gint component_configuration; /* color components arrangement */
+ gint colorspace; /* colorspace information */
+ gint focal_len_numerator; /* Lens focal length */
+ gint focal_len_denominator;
+ gint aperture_f_num_numerator; /* Aperture value */
+ gint aperture_f_num_denominator;
+ gint aperture_in_APEX; /* Aperture value in APEX standard */
+ gint max_lens_aperture_in_APEX; /* Max aperture value in APEX standard */
+} GstCameraControlExifInfo;
+
+/* structure for camera control class */
+typedef struct _GstCameraControlClass {
+ GTypeInterface klass;
+ GstCameraControlType camera_control_type;
+
+ /* virtual functions */
+ const GList* (*list_channels) (GstCameraControl *control);
+ gboolean (*set_value) (GstCameraControl *control, GstCameraControlChannel *control_channel, gint value);
+ gboolean (*get_value) (GstCameraControl *control, GstCameraControlChannel *control_channel, gint *value);
+ gboolean (*set_exposure) (GstCameraControl *control, gint type, gint value1, gint value2);
+ gboolean (*get_exposure) (GstCameraControl *control, gint type, gint *value1, gint *value2);
+ gboolean (*set_capture_mode) (GstCameraControl *control, gint type, gint value);
+ gboolean (*get_capture_mode) (GstCameraControl *control, gint type, gint *value);
+ gboolean (*set_strobe) (GstCameraControl *control, gint type, gint value);
+ gboolean (*get_strobe) (GstCameraControl *control, gint type, gint *value);
+ gboolean (*set_detect) (GstCameraControl *control, gint type, gint value);
+ gboolean (*get_detect) (GstCameraControl *control, gint type, gint *value);
+ gboolean (*set_zoom) (GstCameraControl *control, gint type, gint value);
+ gboolean (*get_zoom) (GstCameraControl *control, gint type, gint *value);
+ gboolean (*set_focus) (GstCameraControl *control, gint mode, gint range);
+ gboolean (*get_focus) (GstCameraControl *control, gint *mode, gint *range);
+ gboolean (*start_auto_focus) (GstCameraControl *control);
+ gboolean (*stop_auto_focus) (GstCameraControl *control);
+ gboolean (*set_focus_level) (GstCameraControl *control, gint manual_level);
+ gboolean (*get_focus_level) (GstCameraControl *control, gint *manual_level);
+ gboolean (*set_auto_focus_area) (GstCameraControl *control, GstCameraControlRectType rect);
+ gboolean (*get_auto_focus_area) (GstCameraControl *control, GstCameraControlRectType *rect);
+ gboolean (*set_wdr) (GstCameraControl *control, gint value);
+ gboolean (*get_wdr) (GstCameraControl *control, gint *value);
+ gboolean (*set_ahs) (GstCameraControl *control, gint value);
+ gboolean (*get_ahs) (GstCameraControl *control, gint *value);
+ gboolean (*set_part_color) (GstCameraControl *control, gint type, gint value);
+ gboolean (*get_part_color) (GstCameraControl *control, gint type, gint *value);
+ gboolean (*get_exif_info) (GstCameraControl *control, GstCameraControlExifInfo *info);
+ gboolean (*get_basic_dev_info) (GstCameraControl *control, gint dev_id, GstCameraControlCapsInfoType *info);
+ gboolean (*get_misc_dev_info) (GstCameraControl *control, gint dev_id, GstCameraControlCtrlListInfoType *info);
+ gboolean (*get_extra_dev_info) (GstCameraControl *control, gint dev_id, GstCameraControlExtraInfoType *info);
+ void (*set_capture_command) (GstCameraControl *control, GstCameraControlCaptureCommand cmd);
+ void (*set_record_command) (GstCameraControl *control, GstCameraControlRecordCommand cmd);
+ gboolean (*start_face_zoom) (GstCameraControl *control, gint x, gint y, gint zoom_level);
+ gboolean (*stop_face_zoom) (GstCameraControl *control);
+ gboolean (*set_ae_lock) (GstCameraControl *control, gboolean lock);
+ gboolean (*get_ae_lock) (GstCameraControl *control, gboolean *lock);
+ gboolean (*set_awb_lock) (GstCameraControl *control, gboolean lock);
+ gboolean (*get_awb_lock) (GstCameraControl *control, gboolean *lock);
+ gboolean (*set_user_buffer_fd) (GstCameraControl *control, int *fds, int number);
+
+ /* signals */
+ void (* value_changed) (GstCameraControl *control, GstCameraControlChannel *channel, gint value);
+} GstCameraControlClass;
+
+GST_VIDEO_API
+GType gst_camera_control_get_type(void);
+
+GST_VIDEO_API
+const GList* gst_camera_control_list_channels (GstCameraControl *control);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_value (GstCameraControl *control, GstCameraControlChannel *control_channel, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_value (GstCameraControl *control, GstCameraControlChannel *control_channel, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_exposure (GstCameraControl *control, gint type, gint value1, gint value2);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_exposure (GstCameraControl *control, gint type, gint *value1, gint *value2);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_capture_mode (GstCameraControl *control, gint type, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_capture_mode (GstCameraControl *control, gint type, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_strobe (GstCameraControl *control, gint type, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_strobe (GstCameraControl *control, gint type, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_detect (GstCameraControl *control, gint type, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_detect (GstCameraControl *control, gint type, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_zoom (GstCameraControl *control, gint type, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_zoom (GstCameraControl *control, gint type, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_focus (GstCameraControl *control, gint mode, gint range);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_focus (GstCameraControl *control, gint *mode, gint *range);
+
+GST_VIDEO_API
+gboolean gst_camera_control_start_auto_focus (GstCameraControl *control);
+
+GST_VIDEO_API
+gboolean gst_camera_control_stop_auto_focus (GstCameraControl *control);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_focus_level (GstCameraControl *control, gint manual_level);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_focus_level (GstCameraControl *control, gint *manual_level);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_auto_focus_area (GstCameraControl *control, GstCameraControlRectType rect);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_auto_focus_area (GstCameraControl *control, GstCameraControlRectType *rect);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_wdr (GstCameraControl *control, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_wdr (GstCameraControl *control, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_ahs (GstCameraControl *control, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_ahs (GstCameraControl *control, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_part_color (GstCameraControl *control, gint type, gint value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_part_color (GstCameraControl *control, gint type, gint *value);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_exif_info (GstCameraControl *control, GstCameraControlExifInfo *info);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_basic_dev_info (GstCameraControl *control, gint dev_id, GstCameraControlCapsInfoType *info);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_misc_dev_info (GstCameraControl *control, gint dev_id, GstCameraControlCtrlListInfoType *info);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_extra_dev_info (GstCameraControl *control, gint dev_id, GstCameraControlExtraInfoType *info);
+
+GST_VIDEO_API
+void gst_camera_control_set_capture_command (GstCameraControl *control, GstCameraControlCaptureCommand cmd);
+
+GST_VIDEO_API
+void gst_camera_control_set_record_command (GstCameraControl *control, GstCameraControlRecordCommand cmd);
+
+GST_VIDEO_API
+gboolean gst_camera_control_start_face_zoom (GstCameraControl *control, gint x, gint y, gint zoom_level);
+
+GST_VIDEO_API
+gboolean gst_camera_control_stop_face_zoom (GstCameraControl *control);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_ae_lock (GstCameraControl *control, gboolean lock);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_ae_lock (GstCameraControl *control, gboolean *lock);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_awb_lock (GstCameraControl *control, gboolean lock);
+
+GST_VIDEO_API
+gboolean gst_camera_control_get_awb_lock (GstCameraControl *control, gboolean *lock);
+
+GST_VIDEO_API
+gboolean gst_camera_control_set_user_buffer_fd (GstCameraControl *control, int *fds, int number);
+
+/* trigger signal */
+GST_VIDEO_API
+void gst_camera_control_value_changed (GstCameraControl *control, GstCameraControlChannel *control_channel, gint value);
+
+G_END_DECLS
+
+#endif /* __GST_CAMERA_CONTROL_H__ */
--- /dev/null
+/* GStreamer Camera Control Channel Interface
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jeongmo Yang <jm80.yang@samsung.com>
+ *
+ * cameracontrolchannel.c: cameracontrol 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 "cameracontrolchannel.h"
+
+enum {
+ /* FILL ME */
+ SIGNAL_VALUE_CHANGED,
+ LAST_SIGNAL
+};
+
+static void gst_camera_control_channel_class_init(GstCameraControlChannelClass* klass);
+static void gst_camera_control_channel_init(GstCameraControlChannel* control_channel);
+static void gst_camera_control_channel_dispose(GObject* object);
+
+static GObjectClass *parent_class = NULL;
+static guint signals[LAST_SIGNAL] = { 0 };
+
+GType gst_camera_control_channel_get_type(void)
+{
+ static GType gst_camera_control_channel_type = 0;
+
+ if (!gst_camera_control_channel_type) {
+ static const GTypeInfo camera_control_channel_info = {
+ sizeof (GstCameraControlChannelClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) gst_camera_control_channel_class_init,
+ NULL,
+ NULL,
+ sizeof (GstCameraControlChannel),
+ 0,
+ (GInstanceInitFunc) gst_camera_control_channel_init,
+ NULL
+ };
+
+ gst_camera_control_channel_type = \
+ g_type_register_static(G_TYPE_OBJECT,
+ "GstCameraControlChannel",
+ &camera_control_channel_info,
+ 0);
+ }
+
+ return gst_camera_control_channel_type;
+}
+
+static void gst_camera_control_channel_class_init(GstCameraControlChannelClass* klass)
+{
+ GObjectClass *object_klass = (GObjectClass*) klass;
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ signals[SIGNAL_VALUE_CHANGED] = \
+ g_signal_new("control-value-changed",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GstCameraControlChannelClass, value_changed),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_INT);
+
+ object_klass->dispose = gst_camera_control_channel_dispose;
+}
+
+static void gst_camera_control_channel_init(GstCameraControlChannel* control_channel)
+{
+ control_channel->label = NULL;
+ control_channel->min_value = control_channel->max_value = 0;
+}
+
+static void gst_camera_control_channel_dispose(GObject* object)
+{
+ GstCameraControlChannel *control_channel = GST_CAMERA_CONTROL_CHANNEL(object);
+
+ if (control_channel->label) {
+ g_free (control_channel->label);
+ }
+
+ control_channel->label = NULL;
+
+ if (parent_class->dispose) {
+ parent_class->dispose (object);
+ }
+}
--- /dev/null
+/* GStreamer Camera Control Channel Interface
+ *
+ * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd.
+ *
+ * Contact: Jeongmo Yang <jm80.yang@samsung.com>
+ *
+ * cameracontrolchannel.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_CAMERA_CONTROL_CHANNEL_H__
+#define __GST_CAMERA_CONTROL_CHANNEL_H__
+
+#include <gst/gst.h>
+#include <gst/video/video-prelude.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_CAMERA_CONTROL_CHANNEL \
+ (gst_camera_control_channel_get_type ())
+#define GST_CAMERA_CONTROL_CHANNEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CAMERA_CONTROL_CHANNEL, \
+ GstCameraControlChannel))
+#define GST_CAMERA_CONTROL_CHANNEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_CAMERA_CONTROL_CHANNEL, \
+ GstCameraControlChannelClass))
+#define GST_IS_CAMERA_CONTROL_CHANNEL(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CAMERA_CONTROL_CHANNEL))
+#define GST_IS_CAMERA_CONTROL_CHANNEL_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CAMERA_CONTROL_CHANNEL))
+
+typedef struct _GstCameraControlChannel {
+ GObject parent;
+ gchar *label;
+ gint min_value;
+ gint max_value;
+} GstCameraControlChannel;
+
+typedef struct _GstCameraControlChannelClass {
+ GObjectClass parent;
+
+ /* signals */
+ void (*value_changed)(GstCameraControlChannel *control_channel, gint value);
+
+ gpointer _gst_reserved[GST_PADDING];
+} GstCameraControlChannelClass;
+
+GST_VIDEO_API
+GType gst_camera_control_channel_get_type(void);
+
+G_END_DECLS
+
+#endif /* __GST_CAMERA_CONTROL_CHANNEL_H__ */
GstFlowReturn res;
GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
GstVideoFilterClass *fclass;
+#ifdef USE_TBM
+ GstMapFlags out_map_flags = GST_MAP_WRITE;
+#endif
if (G_UNLIKELY (!filter->negotiated))
goto unknown_format;
GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
goto invalid_buffer;
+#ifdef USE_TBM
+ if (filter->out_info.finfo->format != GST_VIDEO_FORMAT_SN12)
+ out_map_flags |= GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
+
+ if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
+ out_map_flags)) {
+ gst_video_frame_unmap (&in_frame);
+ goto invalid_buffer;
+ }
+#else
if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF)) {
gst_video_frame_unmap (&in_frame);
goto invalid_buffer;
}
+#endif
res = fclass->transform_frame (filter, &in_frame, &out_frame);
gst_video_frame_unmap (&out_frame);
#include <glib.h>
#include <string.h>
#include <math.h>
+#ifdef USE_TBM
+#include <gst/allocators/gsttizenmemory.h>
+#endif
#include "video-orc.h"
convert_fill_border (convert, dest);
}
+#ifdef USE_TBM
+static void
+convert_I420_SN12 (GstVideoConverter * convert, const GstVideoFrame * src,
+ GstVideoFrame * dest )
+{
+ guint8 *mY, *mUV, *Y, *U, *V;
+ gint l1, l2;
+ int i, j;
+ gboolean interlaced = GST_VIDEO_FRAME_IS_INTERLACED (src);
+
+ gint width = convert->in_width;
+ gint height = convert->in_height;
+
+ mY = mUV = Y = U = V = NULL;
+ mY = GST_VIDEO_FRAME_PLANE_DATA (dest, 0);
+ mUV = GST_VIDEO_FRAME_PLANE_DATA (dest, 1);
+
+ for (i = 0; i < GST_ROUND_DOWN_2 (height); i += 2) {
+ GET_LINE_OFFSETS (interlaced, i, l1, l2);
+
+ Y = FRAME_GET_Y_LINE (src, l1);
+ memcpy(mY, Y, width);
+ mY += width;
+ Y = FRAME_GET_Y_LINE (src, l2);
+ memcpy(mY, Y, width);
+ mY += width;
+
+ U = FRAME_GET_U_LINE (src, i >> 1);
+ V = FRAME_GET_V_LINE (src, i >> 1);
+ for (j = 0; j < (width + 1) / 2; j++) {
+ *mUV++ = *U++;
+ *mUV++ = *V++;
+ }
+ }
+}
+#endif
+
static GstVideoFormat
get_scale_format (GstVideoFormat format, gint plane)
{
case GST_VIDEO_FORMAT_NV16_10LE32:
case GST_VIDEO_FORMAT_NV12_10LE40:
case GST_VIDEO_FORMAT_BGR10A2_LE:
+#ifdef USE_TBM
+ case GST_VIDEO_FORMAT_SN12:
+ case GST_VIDEO_FORMAT_ST12:
+#endif
res = format;
g_assert_not_reached ();
break;
+#ifdef TIZEN_FEATURE_VIDEO_MODIFICATION
+ default:
+ break;
+#endif
+
}
return res;
}
in_format = GST_VIDEO_INFO_FORMAT (in_info);
out_format = GST_VIDEO_INFO_FORMAT (out_info);
+#ifdef USE_TBM
+ if(out_format == GST_VIDEO_FORMAT_SN12) {
+ /* do nothing for SN12 output format */
+ return TRUE;
+ }
+#endif
switch (in_format) {
case GST_VIDEO_FORMAT_RGB15:
case GST_VIDEO_FORMAT_RGB16:
return FALSE;
}
break;
+#ifdef USE_TBM
+ case GST_VIDEO_FORMAT_SN12:
+ return TRUE; /* do nothing for SN12 format */
+#endif
default:
break;
}
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_scale_planes},
{GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_Y444, FALSE, FALSE, FALSE, TRUE,
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_scale_planes},
+#ifdef USE_TBM
+ {GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_SN12, FALSE, FALSE, FALSE, TRUE,
+ TRUE, FALSE, FALSE, FALSE, 0, 0, convert_I420_SN12},
+#endif
{GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_GRAY8, FALSE, FALSE, FALSE, TRUE,
TRUE, FALSE, FALSE, FALSE, 0, 0, convert_scale_planes},
{GST_VIDEO_FORMAT_I420, GST_VIDEO_FORMAT_A420, FALSE, FALSE, FALSE, TRUE,
}
}
+#define PACK_INVZ16_LE GST_VIDEO_FORMAT_AYUV64, unpack_INVZ16_LE, 1, pack_INVZ16_LE
+static void
+unpack_INVZ16_LE (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
+ gpointer dest, const gpointer data[GST_VIDEO_MAX_PLANES],
+ const gint stride[GST_VIDEO_MAX_PLANES], gint x, gint y, gint width)
+{
+ int i;
+ const guint16 *restrict s = GET_LINE (y);
+ guint16 *restrict d = dest;
+
+ s += x;
+
+ for (i = 0; i < width; i++) {
+ d[i * 4 + 0] = 0xffff;
+ d[i * 4 + 1] = GST_READ_UINT16_LE (s + i);
+ d[i * 4 + 2] = 0x8000;
+ d[i * 4 + 3] = 0x8000;
+ }
+}
+
+static void
+pack_INVZ16_LE (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
+ const gpointer src, gint sstride, gpointer data[GST_VIDEO_MAX_PLANES],
+ const gint stride[GST_VIDEO_MAX_PLANES], GstVideoChromaSite chroma_site,
+ gint y, gint width)
+{
+ int i;
+ guint16 *restrict d = GET_LINE (y);
+ const guint16 *restrict s = src;
+
+ for (i = 0; i < width; i++) {
+ GST_WRITE_UINT16_LE (d + i, s[i * 4 + 1]);
+ }
+}
+
typedef struct
{
guint32 fourcc;
#define MAKE_GRAY_C_LE_FORMAT(name, desc, depth, pstride, plane, offs, sub, pack) \
{ 0x00000000, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY | GST_VIDEO_FORMAT_FLAG_COMPLEX | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+#define MAKE_DEPTH_FORMAT(name, desc, fourcc, depth, pstride, plane, offs, sub, pack) \
+ { fourcc, {GST_VIDEO_FORMAT_ ##name, G_STRINGIFY(name), desc, GST_VIDEO_FORMAT_FLAG_GRAY | GST_VIDEO_FORMAT_FLAG_LE, depth, pstride, plane, offs, sub, pack } }
+
static const VideoFormat formats[] = {
{0x00000000, {GST_VIDEO_FORMAT_UNKNOWN, "UNKNOWN", "unknown video", 0, DPTH0,
PSTR0, PLANE_NA, OFFS0}},
MAKE_YUV_FORMAT (I420, "raw video", GST_MAKE_FOURCC ('I', '4', '2', '0'),
DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
+ MAKE_YUV_FORMAT (S420, "raw video", GST_MAKE_FOURCC ('S', '4', '2', '0'),
+ DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
MAKE_YUV_FORMAT (YV12, "raw video", GST_MAKE_FOURCC ('Y', 'V', '1', '2'),
DPTH888, PSTR111, PLANE021, OFFS0, SUB420, PACK_420),
MAKE_YUV_FORMAT (YUY2, "raw video", GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'),
DPTH888, PSTR244, PLANE0, OFFS013, SUB422, PACK_YUY2),
MAKE_YUV_FORMAT (UYVY, "raw video", GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'),
DPTH888, PSTR244, PLANE0, OFFS102, SUB422, PACK_UYVY),
+ MAKE_YUV_FORMAT (ITLV, "raw video", GST_MAKE_FOURCC ('I', 'T', 'L', 'V'),
+ DPTH888, PSTR244, PLANE0, OFFS012, SUB422, PACK_UYVY),
MAKE_YUVA_PACK_FORMAT (AYUV, "raw video", GST_MAKE_FOURCC ('A', 'Y', 'U',
'V'), DPTH8888, PSTR4444, PLANE0, OFFS1230, SUB4444, PACK_AYUV),
MAKE_RGB_FORMAT (RGBx, "raw video", DPTH888, PSTR444, PLANE0, OFFS012,
SUB4444, PACK_RGBA),
MAKE_RGBA_FORMAT (BGRA, "raw video", DPTH8888, PSTR4444, PLANE0, OFFS2103,
SUB4444, PACK_BGRA),
+ MAKE_RGBA_FORMAT (SR32, "raw video", DPTH8888, PSTR4444, PLANE0, OFFS2103,
+ SUB4444, PACK_BGRA),
MAKE_RGBA_PACK_FORMAT (ARGB, "raw video", DPTH8888, PSTR4444, PLANE0,
OFFS1230, SUB4444, PACK_ARGB),
MAKE_RGBA_FORMAT (ABGR, "raw video", DPTH8888, PSTR4444, PLANE0, OFFS3210,
DPTH16_16_16, PSTR488, PLANE0, OFFS204, SUB422, PACK_v216),
MAKE_YUV_FORMAT (NV12, "raw video", GST_MAKE_FOURCC ('N', 'V', '1', '2'),
DPTH888, PSTR122, PLANE011, OFFS001, SUB420, PACK_NV12),
+ MAKE_YUV_FORMAT (SN12, "raw video", GST_MAKE_FOURCC ('S', 'N', '1', '2'),
+ DPTH888, PSTR122, PLANE011, OFFS001, SUB420, PACK_NV12),
+ MAKE_YUV_FORMAT (ST12, "raw video", GST_MAKE_FOURCC ('S', 'T', '1', '2'),
+ DPTH888, PSTR122, PLANE011, OFFS001, SUB420, PACK_NV12),
MAKE_YUV_FORMAT (NV21, "raw video", GST_MAKE_FOURCC ('N', 'V', '2', '1'),
DPTH888, PSTR122, PLANE011, OFFS010, SUB420, PACK_NV21),
+ MAKE_YUV_FORMAT (SN21, "raw video", GST_MAKE_FOURCC ('S', 'N', '2', '1'),
+ DPTH888, PSTR122, PLANE011, OFFS010, SUB420, PACK_NV21),
MAKE_GRAY_FORMAT (GRAY8, "raw video", DPTH8, PSTR1, PLANE0, OFFS0, SUB4,
PACK_GRAY8),
MAKE_RGBA_LE_PACK_FORMAT (BGR10A2_LE, "raw video", DPTH10_10_10_2, PSTR4444,
PLANE0,
OFFS0, SUB4444, PACK_BGR10A2_LE),
+ MAKE_DEPTH_FORMAT (INVZ, "raw video", GST_MAKE_FOURCC ('I', 'N', 'V', 'Z'),
+ DPTH16, PSTR2, PLANE0, OFFS0, SUB4, PACK_INVZ16_LE),
+#ifdef TIZEN_PROFILE_TV
+ MAKE_YUV_FORMAT (STV0, "raw video", GST_MAKE_FOURCC ('S', 'T', 'V', '0'),
+ DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
+ MAKE_YUV_FORMAT (STV1, "raw video", GST_MAKE_FOURCC ('S', 'T', 'V', '1'),
+ DPTH888, PSTR111, PLANE012, OFFS0, SUB420, PACK_420),
+#endif
};
static GstVideoFormat
switch (fourcc) {
case GST_MAKE_FOURCC ('I', '4', '2', '0'):
return GST_VIDEO_FORMAT_I420;
+ case GST_MAKE_FOURCC ('S', '4', '2', '0'):
+ return GST_VIDEO_FORMAT_S420;
+#ifdef TIZEN_PROFILE_TV
+ case GST_MAKE_FOURCC ('S', 'T', 'V', '0'):
+ return GST_VIDEO_FORMAT_STV0;
+ case GST_MAKE_FOURCC ('S', 'T', 'V', '1'):
+ return GST_VIDEO_FORMAT_STV1;
+#endif
case GST_MAKE_FOURCC ('Y', 'V', '1', '2'):
return GST_VIDEO_FORMAT_YV12;
case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'):
return GST_VIDEO_FORMAT_YVYU;
case GST_MAKE_FOURCC ('U', 'Y', 'V', 'Y'):
return GST_VIDEO_FORMAT_UYVY;
+ case GST_MAKE_FOURCC ('I', 'T', 'L', 'V'):
+ return GST_VIDEO_FORMAT_ITLV;
case GST_MAKE_FOURCC ('V', 'Y', 'U', 'Y'):
return GST_VIDEO_FORMAT_VYUY;
case GST_MAKE_FOURCC ('A', 'Y', 'U', 'V'):
return GST_VIDEO_FORMAT_Y210;
case GST_MAKE_FOURCC ('N', 'V', '1', '2'):
return GST_VIDEO_FORMAT_NV12;
+ case GST_MAKE_FOURCC ('S', 'N', '1', '2'):
+ return GST_VIDEO_FORMAT_SN12;
+ case GST_MAKE_FOURCC ('S', 'T', '1', '2'):
+ return GST_VIDEO_FORMAT_ST12;
case GST_MAKE_FOURCC ('N', 'V', '2', '1'):
return GST_VIDEO_FORMAT_NV21;
+ case GST_MAKE_FOURCC ('S', 'N', '2', '1'):
+ return GST_VIDEO_FORMAT_SN21;
case GST_MAKE_FOURCC ('N', 'V', '1', '6'):
return GST_VIDEO_FORMAT_NV16;
case GST_MAKE_FOURCC ('N', 'V', '6', '1'):
return GST_VIDEO_FORMAT_VUYA;
case GST_MAKE_FOURCC ('A', 'R', '3', '0'):
return GST_VIDEO_FORMAT_BGR10A2_LE;
-
+ case GST_MAKE_FOURCC ('I', 'N', 'V', 'Z'):
+ return GST_VIDEO_FORMAT_INVZ;
default:
return GST_VIDEO_FORMAT_UNKNOWN;
}
GST_VIDEO_FORMAT_UNKNOWN,
GST_VIDEO_FORMAT_ENCODED,
GST_VIDEO_FORMAT_I420,
+ GST_VIDEO_FORMAT_S420,
GST_VIDEO_FORMAT_YV12,
GST_VIDEO_FORMAT_YUY2,
GST_VIDEO_FORMAT_UYVY,
+ GST_VIDEO_FORMAT_ITLV,
GST_VIDEO_FORMAT_AYUV,
GST_VIDEO_FORMAT_RGBx,
GST_VIDEO_FORMAT_BGRx,
GST_VIDEO_FORMAT_xBGR,
GST_VIDEO_FORMAT_RGBA,
GST_VIDEO_FORMAT_BGRA,
+ GST_VIDEO_FORMAT_SR32,
GST_VIDEO_FORMAT_ARGB,
GST_VIDEO_FORMAT_ABGR,
GST_VIDEO_FORMAT_RGB,
GST_VIDEO_FORMAT_v210,
GST_VIDEO_FORMAT_v216,
GST_VIDEO_FORMAT_NV12,
+ GST_VIDEO_FORMAT_SN12,
+ GST_VIDEO_FORMAT_ST12,
GST_VIDEO_FORMAT_NV21,
+ GST_VIDEO_FORMAT_SN21,
GST_VIDEO_FORMAT_GRAY8,
GST_VIDEO_FORMAT_GRAY16_BE,
GST_VIDEO_FORMAT_GRAY16_LE,
GST_VIDEO_FORMAT_Y410,
GST_VIDEO_FORMAT_VUYA,
GST_VIDEO_FORMAT_BGR10A2_LE,
+ GST_VIDEO_FORMAT_INVZ,
+ GST_VIDEO_FORMAT_STV0, /* TIZEN_PROFILE_TV */
+ GST_VIDEO_FORMAT_STV1, /* TIZEN_PROFILE_TV */
} GstVideoFormat;
#define GST_VIDEO_MAX_PLANES 4
# define GST_VIDEO_OE(s) G_STRINGIFY(s)"_LE"
#endif
-#define GST_VIDEO_FORMATS_ALL "{ I420, YV12, YUY2, UYVY, AYUV, VUYA, RGBx, " \
- "BGRx, xRGB, xBGR, RGBA, BGRA, ARGB, ABGR, RGB, BGR, Y41B, Y42B, YVYU, " \
- "Y444, v210, v216, Y210, Y410, NV12, NV21, GRAY8, GRAY16_BE, GRAY16_LE, v308, RGB16, " \
- "BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, IYU1, ARGB64, " \
- "AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, " \
- "Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, " \
- "A420_10LE, A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, " \
- "P010_10LE, IYU2, VYUY, GBRA, GBRA_10BE, GBRA_10LE, BGR10A2_LE, GBR_12BE, GBR_12LE, " \
- "GBRA_12BE, GBRA_12LE, I420_12BE, I420_12LE, I422_12BE, I422_12LE, " \
- "Y444_12BE, Y444_12LE, GRAY10_LE32, NV12_10LE32, NV16_10LE32, NV12_10LE40 }"
+#define GST_VIDEO_FORMATS_ALL "{ I420, S420, YV12, YUY2, UYVY, ITLV, AYUV, " \
+ "RGBx, BGRx, xRGB, xBGR, RGBA, BGRA, SR32, ARGB, ABGR, RGB, BGR, Y41B, " \
+ "Y42B, YVYU, Y444, v210, v216, NV12, SN12, ST12, NV21, SN21, GRAY8, GRAY16_BE, " \
+ "GRAY16_LE, v308, RGB16, BGR16, RGB15, BGR15, UYVP, A420, RGB8P, YUV9, YVU9, " \
+ "IYU1, ARGB64, AYUV64, r210, I420_10BE, I420_10LE, I422_10BE, I422_10LE, Y444_10BE, " \
+ "Y444_10LE, GBR, GBR_10BE, GBR_10LE, NV16, NV24, NV12_64Z32, A420_10BE, A420_10LE, " \
+ "A422_10BE, A422_10LE, A444_10BE, A444_10LE, NV61, P010_10BE, P010_10LE, IYU2, " \
+ "VYUY, GBRA, GBRA_10BE, GBRA_10LE, GBR_12BE, GBR_12LE, GBRA_12BE, GBRA_12LE, " \
+ "I420_12BE, I420_12LE, I422_12BE, I422_12LE, Y444_12BE, Y444_12LE, GRAY10_LE32, " \
+ "NV12_10LE32, NV16_10LE32, NV12_10LE40, Y210, Y410, VUYA, BGR10A2_LE, INVZ, STV0, STV1 }"
/**
* GST_VIDEO_CAPS_MAKE:
case GST_VIDEO_FORMAT_RGBA:
case GST_VIDEO_FORMAT_BGRx:
case GST_VIDEO_FORMAT_BGRA:
+ case GST_VIDEO_FORMAT_SR32:
case GST_VIDEO_FORMAT_xRGB:
case GST_VIDEO_FORMAT_ARGB:
case GST_VIDEO_FORMAT_xBGR:
break;
case GST_VIDEO_FORMAT_GRAY16_BE:
case GST_VIDEO_FORMAT_GRAY16_LE:
+ case GST_VIDEO_FORMAT_INVZ:
info->stride[0] = GST_ROUND_UP_4 (width * 2);
info->offset[0] = 0;
info->size = info->stride[0] * height;
info->size = info->stride[0] * height;
break;
case GST_VIDEO_FORMAT_I420:
+ case GST_VIDEO_FORMAT_S420:
case GST_VIDEO_FORMAT_YV12: /* same as I420, but plane 1+2 swapped */
+#ifdef TIZEN_PROFILE_TV
+ case GST_VIDEO_FORMAT_STV0:
+ case GST_VIDEO_FORMAT_STV1:
+#endif
info->stride[0] = GST_ROUND_UP_4 (width);
info->stride[1] = GST_ROUND_UP_4 (GST_ROUND_UP_2 (width) / 2);
info->stride[2] = info->stride[1];
info->size = info->stride[0] * height * 4;
break;
case GST_VIDEO_FORMAT_NV12:
+#ifdef TIZEN_FEATURE_VIDEO_MODIFICATION
+ case GST_VIDEO_FORMAT_SN12:
+ case GST_VIDEO_FORMAT_ST12:
+ case GST_VIDEO_FORMAT_SN21:
+#endif
case GST_VIDEO_FORMAT_NV21:
info->stride[0] = GST_ROUND_UP_4 (width);
info->stride[1] = info->stride[0];
info->offset[0] = 0;
info->offset[1] = info->stride[0] * GST_ROUND_UP_2 (height);
+#ifdef TIZEN_FEATURE_VIDEO_MODIFICATION
+ info->size = info->stride[0] * GST_ROUND_UP_2 (height) * 3 / 2;
+#else
cr_h = GST_ROUND_UP_2 (height) / 2;
if (GST_VIDEO_INFO_IS_INTERLACED (info))
cr_h = GST_ROUND_UP_2 (cr_h);
info->size = info->offset[1] + info->stride[0] * cr_h;
+#endif
break;
case GST_VIDEO_FORMAT_NV16:
case GST_VIDEO_FORMAT_NV61:
case GST_VIDEO_FORMAT_ENCODED:
break;
case GST_VIDEO_FORMAT_UNKNOWN:
+#ifdef TIZEN_FEATURE_VIDEO_MODIFICATION
+ default:
+#endif
GST_ERROR ("invalid format");
g_warning ("invalid format");
return FALSE;
return gst_video_overlay_type;
}
+#ifdef TIZEN_FEATURE_WAYLAND_ENHANCEMENT
+/**
+* gst_video_overlay_set_wl_window_wl_surface_id:
+* @overlay: a #GstVideoOverlay to set the window on.
+* @wl_surface_id: a global resource id of wl_surface referencing the wayland window.
+
+* This will call the video overlay's set_wayland_window_handle method. You
+* should use this medtod to tell to an overlay to display video output to a
+* specific window(e.g. an Wayland Window on Wayland).
+* But you can also set handle to waylandsink with gst_video_overlay_set_window_handle().
+*/
+void
+gst_video_overlay_set_wl_window_wl_surface_id (GstVideoOverlay * overlay,
+ gint wl_surface_id)
+{
+ 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_wl_window_wl_surface_id) {
+ iface->set_wl_window_wl_surface_id (overlay, wl_surface_id);
+ }
+}
+
+
+/**
+ * gst_video_overlay_set_display_roi_area:
+ * @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
+ *
+ * Set the ROI(Region of Interest) area of wayland window.
+ * Returns: %FALSE if not supported by the sink.
+ */
+gboolean
+gst_video_overlay_set_display_roi_area (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 > 0 && height > 0, FALSE);
+
+ iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
+
+ if (iface->set_display_roi_area) {
+ iface->set_display_roi_area (overlay, x, y, width, height);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/**
+ * gst_video_overlay_set_video_roi_area:
+ * @overlay: a #GstVideoOverlay
+ * @x_scale: x coordinate ratio value of video source area
+ * based on video width size, valid range is from 0.0 to 1.0.
+ * @y_scale: y coordinate ratio value of video source area
+ * based on video width size, valid range is from 0.0 to 1.0.
+ * @w_scale: width ratio value of the video source area
+ * based on video width size, valid range is from greater than 0.0 to 1.0.
+ * @h_scale: height ratio value of the video source area
+ * based on video width size, valid range is from greater than 0.0 to 1.0.
+ *
+ * Sets the ROI(Region Of Interest) area of video source.
+ * Returns: %FALSE if not supported by the sink.
+**/
+gboolean
+gst_video_overlay_set_video_roi_area (GstVideoOverlay * overlay,
+ gdouble x_scale, gdouble y_scale, gdouble w_scale, gdouble h_scale)
+{
+ 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 (x_scale >= 0.0 && x_scale <= 1.0, FALSE);
+ g_return_val_if_fail (y_scale >= 0.0 && y_scale <= 1.0, FALSE);
+ g_return_val_if_fail (w_scale > 0.0 && w_scale <= 1.0, FALSE);
+ g_return_val_if_fail (h_scale > 0.0 && h_scale <= 1.0, FALSE);
+
+ iface = GST_VIDEO_OVERLAY_GET_INTERFACE (overlay);
+
+ if (iface->set_video_roi_area) {
+ iface->set_video_roi_area (overlay, x_scale, y_scale, w_scale, h_scale);
+ return TRUE;
+ }
+ return FALSE;
+}
+#endif
/**
* gst_video_overlay_set_window_handle:
* @overlay: a #GstVideoOverlay to set the window on.
gint width, gint height);
void (*set_window_handle) (GstVideoOverlay *overlay, guintptr handle);
+#ifdef TIZEN_FEATURE_WAYLAND_ENHANCEMENT
+ void (*set_wl_window_wl_surface_id) (GstVideoOverlay * overlay, gint wl_surface_id);
+
+ void (*set_display_roi_area) (GstVideoOverlay *overlay,
+ gint x, gint y,
+ gint width, gint height);
+
+ void (*set_video_roi_area) (GstVideoOverlay *overlay,
+ gdouble x_scale, gdouble y_scale,
+ gdouble w_scale, gdouble h_scale);
+#endif
};
GST_VIDEO_API
gint last_prop_id,
guint property_id,
const GValue * value);
+#ifdef TIZEN_FEATURE_WAYLAND_ENHANCEMENT
+GST_VIDEO_API
+void gst_video_overlay_set_wl_window_wl_surface_id (GstVideoOverlay * overlay,
+ gint wl_surface_id);
+
+GST_VIDEO_API
+gboolean gst_video_overlay_set_display_roi_area (GstVideoOverlay * overlay,
+ gint x, gint y,
+ gint width, gint height);
+GST_VIDEO_API
+gboolean gst_video_overlay_set_video_roi_area (GstVideoOverlay * overlay,
+ gdouble x_scale, gdouble y_scale,
+ gdouble w_scale, gdouble h_scale);
+#endif
G_END_DECLS
#endif /* __GST_VIDEO_OVERLAY_H__ */
--- /dev/null
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
+++ /dev/null
-Makefile
-Makefile.in
-*.o
-*.lo
-*.la
-.deps
-.libs
+++ /dev/null
-channelmixtest
gboolean expose_allstreams; /* Whether to expose unknow type streams or not */
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzmultiqueue patch : use trustzone flag*/
+ gboolean use_trustzone;
+#endif
GList *filtered; /* elements for which error messages are filtered */
GList *filtered_errors; /* filtered error messages */
PROP_POST_STREAM_TOPOLOGY,
PROP_EXPOSE_ALL_STREAMS,
PROP_CONNECTION_SPEED
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzmultiqueue patch : use trustzone flag*/
+ ,PROP_USE_TRUSTZONE
+#endif
};
static GstBinClass *parent_class;
DEFAULT_EXPOSE_ALL_STREAMS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzmultiqueue patch : use-trustzone property*/
+ g_object_class_install_property (gobject_klass, PROP_USE_TRUSTZONE,
+ g_param_spec_boolean ("use-trustzone", "Add trustzone flag to decodebin2",
+ "Add trustzone flag to decodebin2 to add tzmultiqueue element",
+ 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#endif
/**
* GstDecodeBin2::connection-speed
*
case PROP_EXPOSE_ALL_STREAMS:
dbin->expose_allstreams = g_value_get_boolean (value);
break;
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzmultiqueue patch : use-trustzone property*/
+ case PROP_USE_TRUSTZONE:
+ GST_DEBUG_OBJECT (dbin, "set dbin->use_trustzone to %d", g_value_get_boolean(value));
+ dbin->use_trustzone = g_value_get_boolean (value);
+ break;
+#endif
case PROP_CONNECTION_SPEED:
GST_OBJECT_LOCK (dbin);
dbin->connection_speed = g_value_get_uint64 (value) * 1000;
case PROP_EXPOSE_ALL_STREAMS:
g_value_set_boolean (value, dbin->expose_allstreams);
break;
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzmultiqueue patch : use-trustzone property*/
+ case PROP_USE_TRUSTZONE:
+ g_value_set_boolean (value, dbin->use_trustzone);
+ break;
+#endif
case PROP_CONNECTION_SPEED:
GST_OBJECT_LOCK (dbin);
g_value_set_uint64 (value, dbin->connection_speed / 1000);
group->dbin = dbin;
group->parent = parent;
+#ifdef TIZEN_FEATURE_TRUSTZONE
+ /*tzmultiqueue patch : when this flag is set to TRUE, we will use tzmultiqueue instead of multiqueue element in pipeline*/
+ if (dbin->use_trustzone) {
+ GST_DEBUG_OBJECT (dbin, "decodebin2 use tzmultiqueue");
+ mq = group->multiqueue = gst_element_factory_make ("tzmultiqueue", NULL);
+ }
+ else
+#endif
mq = group->multiqueue = gst_element_factory_make ("multiqueue", NULL);
if (G_UNLIKELY (!group->multiqueue))
goto missing_multiqueue;
G_BEGIN_DECLS
+#ifdef TIZEN_PROFILE_TV
#define DEFAULT_RAW_CAPS \
"video/x-raw(ANY); " \
"audio/x-raw(ANY); " \
"text/x-raw(ANY); " \
+ "text/x-pango-markup; " \
+ "text/plain; " \
"subpicture/x-dvd; " \
"subpicture/x-dvb; " \
"subpicture/x-xsub; " \
"subpicture/x-pgs; " \
"closedcaption/x-cea-608; " \
"closedcaption/x-cea-708"
+#else
+#define DEFAULT_RAW_CAPS \
+ "video/x-raw(ANY); " \
+ "audio/x-raw(ANY); " \
+ "text/x-raw(ANY); " \
+ "subpicture/x-dvd; " \
+ "subpicture/x-dvb; " \
+ "subpicture/x-xsub; " \
+ "subpicture/x-pgs; " \
+ "closedcaption/x-cea-608; " \
+ "closedcaption/x-cea-708"
+#endif
G_END_DECLS
GST_DEBUG_CATEGORY (sub_parse_debug);
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+#define SUBPARSE_SEEK_GET_LOCK(elem) (&elem->seek_lock)
+#define SUBPARSE_SEEK_LOCK(elem) g_mutex_lock(SUBPARSE_SEEK_GET_LOCK(elem))
+#define SUBPARSE_SEEK_TRYLOCK(elem) g_mutex_trylock(SUBPARSE_SEEK_GET_LOCK(elem))
+#define SUBPARSE_SEEK_UNLOCK(elem) g_mutex_unlock(SUBPARSE_SEEK_GET_LOCK(elem))
+#endif
+
#define DEFAULT_ENCODING NULL
#define ATTRIBUTE_REGEX "\\s?[a-zA-Z0-9\\. \t\\(\\)]*"
static const gchar *allowed_srt_tags[] = { "i", "b", "u", NULL };
static const gchar *allowed_vtt_tags[] =
{ "i", "b", "c", "u", "v", "ruby", "rt", NULL };
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+#define DEFAULT_CURRENT_LANGUAGE NULL
+#endif
enum
{
PROP_0,
PROP_ENCODING,
- PROP_VIDEOFPS
+ PROP_VIDEOFPS,
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ PROP_EXTSUB_CURRENT_LANGUAGE
+#endif
};
static void
subparse->textbuf = NULL;
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ g_free (subparse->state.current_language);
+ subparse->state.current_language = NULL;
+
+ g_mutex_clear (&subparse->seek_lock);
+#endif
GST_CALL_PARENT (G_OBJECT_CLASS, dispose, (object));
}
"and the subtitle format requires it subtitles may be out of sync.",
0, 1, G_MAXINT, 1, 24000, 1001,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ g_object_class_install_property (object_class, PROP_EXTSUB_CURRENT_LANGUAGE,
+ g_param_spec_string ("current-language", "Current language",
+ "Current language of the subtitle in external subtitle case.",
+ DEFAULT_CURRENT_LANGUAGE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+#endif
}
static void
subparse->fps_n = 24000;
subparse->fps_d = 1001;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ subparse->state.language_list = NULL;
+ subparse->state.current_language = NULL;
+ subparse->state.langlist_msg_posted = FALSE;
+
+ g_mutex_init (&subparse->seek_lock);
+#endif
}
/*
goto beach;
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ SUBPARSE_SEEK_LOCK (self);
+#endif
/* Convert that seek to a seeking in bytes at position 0,
FIXME: could use an index */
ret = gst_pad_push_event (self->sinkpad,
GST_WARNING_OBJECT (self, "seek to 0 bytes failed");
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ SUBPARSE_SEEK_UNLOCK (self);
+#endif
+
gst_event_unref (event);
break;
}
}
break;
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ case PROP_EXTSUB_CURRENT_LANGUAGE:
+ g_free(subparse->state.current_language);
+ subparse->state.current_language = g_value_dup_string (value);
+ GST_LOG_OBJECT (subparse, "subtitle current language set to %s",
+ GST_STR_NULL (subparse->state.current_language));
+ sami_context_change_language(&subparse->state);
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_VIDEOFPS:
gst_value_set_fraction (value, subparse->fps_n, subparse->fps_d);
break;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ case PROP_EXTSUB_CURRENT_LANGUAGE:
+ g_value_set_string (value, subparse->state.current_language);
+ break;
+#endif
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
encoding, err->message);
g_clear_error (&err);
- /* invalid input encoding, fall back to ISO-8859-15 (always succeeds) */
- ret = gst_convert_to_utf8 (str, len, "ISO-8859-15", consumed, NULL);
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (!strcmp (self->encoding, "EUC-KR")) {
+ GST_LOG_OBJECT (self, "use CP949 as fallback");
+ g_free (self->encoding);
+ self->encoding = g_strdup ("CP949");
+ encoding = self->encoding;
+ ret = gst_convert_to_utf8 (str, len, encoding, consumed, &err);
+ } else {
+#endif
+ /* invalid input encoding, fall back to ISO-8859-15 (always succeeds) */
+ GST_LOG_OBJECT (self, "use ISO-8859-15 as fallback");
+ ret = gst_convert_to_utf8 (str, len, "ISO-8859-15", consumed, NULL);
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ }
+#endif
}
GST_LOG_OBJECT (self,
- "successfully converted %" G_GSIZE_FORMAT " characters from %s to UTF-8"
- "%s", len, encoding, (err) ? " , using ISO-8859-15 as fallback" : "");
+ "successfully converted %" G_GSIZE_FORMAT " characters from %s to UTF-8",
+ len, encoding);
return ret;
}
state->max_duration = 0; /* no limit */
state->state = 0;
state->segment = NULL;
+
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ state->language_list = NULL;
+
+ g_free(state->current_language);
+ state->current_language = NULL;
+
+ state->langlist_msg_posted = FALSE;
+#endif
}
static void
GstCaps *caps = NULL;
gchar *line, *subtitle;
gboolean need_tags = FALSE;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ GstMessage *m = NULL;
+#endif
if (self->first_buffer) {
GstMapInfo map;
line + offset);
subtitle = self->parse_line (&self->state, line + offset);
g_free (line);
-
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (!self->state.langlist_msg_posted && self->state.language_list) {
+ m = gst_message_new_element (GST_OBJECT_CAST (self), gst_structure_new("Ext_Sub_Language_List",
+ "lang_list", G_TYPE_POINTER, self->state.language_list, NULL));
+
+ gst_element_post_message (GST_ELEMENT_CAST (self), m);
+ self->state.langlist_msg_posted = TRUE;
+ GST_DEBUG_OBJECT (self, "curr lang as : %s ", GST_STR_NULL(self->state.current_language));
+ }
+#endif
if (subtitle) {
guint subtitle_len = strlen (subtitle);
case GST_EVENT_SEGMENT:
{
const GstSegment *s;
+
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (self->first_buffer) {
+ if (!SUBPARSE_SEEK_TRYLOCK (self)) {
+ /* new seeking request is in process */
+ GST_WARNING_OBJECT (self, "ignore the old newsegment event");
+ ret = TRUE;
+ gst_event_unref (event);
+ break;
+ }
+ } else {
+ SUBPARSE_SEEK_LOCK (self);
+ }
+#endif
+
gst_event_parse_segment (event, &s);
if (s->format == GST_FORMAT_TIME)
gst_event_copy_segment (event, &self->segment);
* trigger sending of the saved requested seek segment
* or the one taken here from upstream */
self->need_segment = TRUE;
+
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ SUBPARSE_SEEK_UNLOCK (self);
+#endif
+
break;
}
case GST_EVENT_FLUSH_START:
gchar *alignment; /* "", "start", "middle", "end" */
gconstpointer allowed_tags; /* list of markup tags allowed in the cue text. */
gboolean allows_tag_attributes;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ GList* language_list;
+ gchar* current_language;
+ gboolean langlist_msg_posted;
+#endif
} ParserState;
typedef gchar* (*Parser) (ParserState *state, const gchar *line);
/* seek */
guint64 offset;
-
+
/* Segment */
GstSegment segment;
gboolean need_segment;
-
+
gboolean flushing;
gboolean valid_utf8;
gchar *detected_encoding;
gboolean first_buffer;
/* used by frame based parsers */
- gint fps_n, fps_d;
+ gint fps_n, fps_d;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ GMutex seek_lock;
+#endif
};
struct _GstSubParseClass {
typedef struct _HtmlParser HtmlParser;
typedef struct _HtmlContext HtmlContext;
typedef struct _GstSamiContext GstSamiContext;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+typedef struct _LanguageStruct GstLangStruct;
+struct _LanguageStruct
+{
+ gchar *language_code;
+ gchar *language_key;
+};
+#endif
struct _GstSamiContext
{
* content of the sync elements to buf */
guint64 time1; /* previous start attribute in sync tag */
guint64 time2; /* current start attribute in sync tag */
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ guint64 time3; /* To store the last current time when language is changed */
+ GList *lang_list; /* Language list for an external subtitle file */
+ gchar *current_language; /* Current language parsed */
+ gchar *desired_language; /* Language set by user */
+ gboolean language_changed; /* language changed signal */
+ gboolean end_body; /* </BODY> reached */
+#endif
};
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+#define strcasestr _gst_ascii_strcasestr
+
+/* From https://github.com/freebsd/freebsd/blob/master/contrib/file/src/strcasestr.c
+ * Updated to use GLib types and GLib string functions
+ *
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Find the first occurrence of find in s, ignore case.
+ */
+
+static gchar *
+_gst_ascii_strcasestr (const gchar * s, const gchar * find)
+{
+ gchar c, sc;
+ gsize len;
+
+ if ((c = *find++) != 0) {
+ c = g_ascii_tolower (c);
+ len = strlen (find);
+ do {
+ do {
+ if ((sc = *s++) == 0)
+ return (NULL);
+ } while (g_ascii_tolower (sc) != c);
+ } while (g_ascii_strncasecmp (s, find, len) != 0);
+ s--;
+ }
+ return (gchar *) (gintptr) (s);
+}
+#endif
+
struct _HtmlParser
{
void (*start_element) (HtmlContext * ctx,
gint count = 0, i;
gchar **attrs;
const gchar *found, *next;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ const gchar *name_temp = NULL;
+ gint j = 0;
+#endif
/* split element name and attributes */
next = string_token (string, " ", &name);
attrs[i] = attr_name;
attrs[i + 1] = attr_value;
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ /* sometimes spaces can be there in between !-- and P
+ * that also we have to take care */
+ if (!g_ascii_strcasecmp("!--", name)) {
+ gchar* tempchar = (gchar*)(string + 3);
+ while (*tempchar == ' ') {
+ tempchar++;
+ if (*tempchar == 'P' || *tempchar == 'p') {
+ *(name + 3) = *tempchar;
+ *(name + 4) = '\0';
+ next = tempchar + 1;
+ break;
+ }
+ }
+ }
+ if (next && (!g_ascii_strcasecmp("!--P", name))) {
+ gint attrindex = 0;
+ count = 0;
+ /* count attributes */
+ found = next + 1;
+ while (TRUE) {
+ found = (gchar*)strcasestr (found, "lang:");
+ if (!found)
+ break;
+ found++;
+ count++;
+ }
+ g_strfreev (attrs);
+
+ attrs = g_new0 (gchar *, count * 2);
+
+ for (i = 0; i < count; i++) {
+ gchar *attr_name = NULL, *attr_value = NULL;
+
+ next = (gchar*)strcasestr (next, "lang:");
+ if (!next)
+ break;
+
+ attr_value = (gchar*)g_malloc0 (3);
+ next = next + 5;
+ /* skip spaces */
+ while (*next == ' ')
+ next++;
+ strncpy (attr_value, next, 2);
+ attr_value[2] = '\0';
+ GST_LOG ("Language value comes as %s", attr_value);
+ name_temp = next;
+ while (TRUE) {
+ if (*name_temp == '{') {
+ int character_count = 0;
+
+ while (TRUE) {
+ name_temp--;
+
+ if (*name_temp == '.') {
+ attr_name = (gchar*) g_malloc0 (character_count + 1);
+ break;
+ }
+ else if (*name_temp != ' ')
+ character_count++;
+ }
+ break;
+ }
+ name_temp--;
+ }
+ name_temp++;
+ if (attr_name != NULL) {
+ for (j = 0; *(name_temp + j) != ' '; j++) {
+ attr_name[j] = *(name_temp + j);
+ }
+ attr_name[j] = '\0';
+ attrs[attrindex++] = attr_name;
+ attrs[attrindex++] = attr_value;
+ }
+ }
+ } else {
+ count = 0;
+ }
+#endif
ctxt->parser->start_element (ctxt, name,
(const gchar **) attrs, ctxt->user_data);
if (must_close) {
return;
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ /* after seeking,
+ the subtitle file will be delivered from the start again. */
+ if (strcasestr(next, "<SAMI>"))
+ next = strcasestr(next, "<SAMI>");
+#endif
+
next = string_token (next, ">", &element);
next++;
if (g_str_has_suffix (next, "/")) {
sctx->time1 = sctx->time2;
sctx->time2 = atoi ((const char *) value) * GST_MSECOND;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ sctx->time3 = sctx->time2;
+#endif
sctx->time2 = MAX (sctx->time2, sctx->time1);
g_string_append (sctx->resultbuf, sctx->buf->str);
sctx->has_result = (sctx->resultbuf->len != 0) ? TRUE : FALSE;
sami_context_push_state (sctx, SPAN_TAG);
}
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+static void
+handle_p (GstSamiContext * sctx, const gchar ** atts)
+{
+ int i;
+ const int str_size = 128;
+
+ if (atts != NULL) {
+ for (i = 0; (atts[i] != NULL); i += 2) {
+ const gchar *key, *value;
+
+ key = atts[i];
+ value = atts[i + 1];
+
+ if (sctx->current_language && value && strcmp(sctx->current_language, value)
+ && (sctx->time1 == sctx->time2))
+ sctx->language_changed = TRUE;
+ else if (!sctx->current_language)
+ sctx->current_language = (gchar*) g_malloc0 (str_size);
+
+ if (key && !g_ascii_strcasecmp ("class", key) && value) {
+ strncpy (sctx->current_language, value, str_size - 1);
+
+ if (sctx->desired_language == NULL) {
+ sctx->desired_language = g_strdup(value);
+ GST_LOG("no language list was found and desired lang was set to %s", sctx->desired_language);
+ }
+ }
+ if (sctx->language_changed)
+ {
+ sctx->time1 = 0;
+ sctx->time2 = sctx->time3;
+ sctx->language_changed = FALSE;
+ }
+ if (!value)
+ continue;
+ }
+ }
+}
+
+static void
+handle_start_language_list (GstSamiContext * sctx, const gchar ** atts)
+{
+ int i = 0;
+ int attrIndex = 0;
+ GstLangStruct *new = NULL;
+ GstLangStruct *temp = NULL;
+
+ if (atts != NULL) {
+ if (g_list_length (sctx->lang_list)) {
+ GST_LOG ("We already got the language list");
+ return;
+ }
+ for (i = 0; (atts[attrIndex] != NULL); i++) {
+ const gchar *key, *value;
+
+ key = atts[attrIndex++];
+ value = atts[attrIndex++];
+
+ GST_LOG ("Inside handle_start_language_list key: %s, value: %s", key, value);
+
+ if (!value)
+ continue;
+
+ new = g_new0 (GstLangStruct, 1);
+ new->language_code = (gchar*) g_malloc0 (strlen(value) + 1);
+ if (new->language_code && value)
+ g_strlcpy (new->language_code, value, strlen(value) + 1);
+ new->language_key = (gchar*) g_malloc0 (strlen(key) + 1);
+ if (new->language_key && key)
+ g_strlcpy (new->language_key, key, strlen(key) + 1);
+ sctx->lang_list = g_list_append (sctx->lang_list, new);
+ temp = g_list_nth_data (sctx->lang_list, i);
+ if (sctx->desired_language == NULL && key){
+ sctx->desired_language = g_strdup(key);
+ GST_WARNING("set desired lang %s", sctx->desired_language);
+ }
+
+ if (temp)
+ GST_LOG ("Inside handle_start_language_list of glist key: %s, value: %s",
+ temp->language_key, temp->language_code);
+ }
+ }
+}
+#endif
static void
handle_start_element (HtmlContext * ctx, const gchar * name,
} else if (!g_ascii_strcasecmp ("ruby", name)) {
sami_context_push_state (sctx, RUBY_TAG);
} else if (!g_ascii_strcasecmp ("br", name)) {
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (sctx->current_language && sctx->desired_language &&
+ !strcmp(sctx->current_language, sctx->desired_language))
+#endif
g_string_append_c (sctx->buf, '\n');
/* FIXME: support for furigana/ruby once implemented in pango */
} else if (!g_ascii_strcasecmp ("rt", name)) {
g_string_append (sctx->rubybuf, "<span size='xx-small' rise='-100'>");
sami_context_push_state (sctx, RT_TAG);
} else if (!g_ascii_strcasecmp ("i", name)) {
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (sctx->current_language && sctx->desired_language &&
+ !strcmp(sctx->current_language, sctx->desired_language)) {
+#endif
g_string_append (sctx->buf, "<i>");
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ }
+#endif
sami_context_push_state (sctx, ITALIC_TAG);
} else if (!g_ascii_strcasecmp ("p", name)) {
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ handle_p (sctx, atts);
+ } else if (!g_ascii_strcasecmp ("!--P", name)) {
+ handle_start_language_list (sctx, atts);
+#endif
}
}
(!g_ascii_strcasecmp ("sami", name))) {
/* We will usually have one buffer left when the body is closed
* as we need the next sync to actually send it */
+
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ sctx->end_body = TRUE;
+#endif
+
if (sctx->buf->len != 0) {
/* Only set a new start time if we don't have text pending */
if (sctx->resultbuf->len == 0)
if (!sctx->in_sync)
return;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (has_tag (sctx->state, RT_TAG) && (sctx->current_language && sctx->desired_language &&
+ !strcmp(sctx->current_language, sctx->desired_language))) {
+#else
if (has_tag (sctx->state, RT_TAG)) {
+#endif
g_string_append_c (sctx->rubybuf, ' ');
g_string_append (sctx->rubybuf, text);
g_string_append_c (sctx->rubybuf, ' ');
} else {
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (sctx->current_language && sctx->desired_language &&
+ !strcmp(sctx->current_language, sctx->desired_language))
+#endif
g_string_append (sctx->buf, text);
}
}
context->rubybuf = g_string_new ("");
context->resultbuf = g_string_new ("");
context->state = g_string_new ("");
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ g_free(context->current_language);
+ context->current_language = NULL;
+
+ g_free(context->desired_language);
+ context->desired_language = NULL;
+
+ if (context->lang_list) {
+ GstLangStruct *temp = NULL;
+ int i = 0;
+
+ while ((temp = g_list_nth_data (context->lang_list, i))) {
+ g_free (temp->language_code);
+ temp->language_code = NULL;
+
+ g_free (temp->language_key);
+ temp->language_key = NULL;
+
+ g_free (temp);
+ i++;
+ }
+ g_list_free (context->lang_list);
+ }
+ context->lang_list = NULL;
+
+ context->language_changed = FALSE;
+ context->end_body = FALSE;
+#endif
state->user_data = context;
}
sami_context_deinit (ParserState * state)
{
GstSamiContext *context = (GstSamiContext *) state->user_data;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ GstLangStruct *temp = NULL;
+ int i = 0;
+#endif
if (context) {
html_context_free (context->htmlctxt);
g_string_free (context->rubybuf, TRUE);
g_string_free (context->resultbuf, TRUE);
g_string_free (context->state, TRUE);
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (context->lang_list) {
+ while ((temp = g_list_nth_data (context->lang_list, i))) {
+ g_free (temp->language_code);
+ temp->language_code = NULL;
+
+ g_free (temp->language_key);
+ temp->language_key = NULL;
+
+ g_free (temp);
+ i++;
+ }
+ g_list_free (context->lang_list);
+ }
+ context->lang_list = NULL;
+
+ g_free (context->current_language);
+ context->current_language = NULL;
+
+ g_free (context->desired_language);
+ context->desired_language = NULL;
+#endif
+
g_free (context);
state->user_data = NULL;
}
}
}
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+void
+sami_context_change_language (ParserState * state)
+{
+ GstSamiContext *context = (GstSamiContext *) state->user_data;
+ if (context->desired_language) {
+ GST_LOG ("desired language was %s", context->desired_language);
+ g_free (context->desired_language);
+ context->desired_language = NULL;
+ }
+ if(state->current_language) {
+ context->desired_language = g_strdup(state->current_language);
+ GST_WARNING ("desired language changed to %s", GST_STR_NULL(context->desired_language));
+ }
+}
+#endif
+
gchar *
parse_sami (ParserState * state, const gchar * line)
{
gchar *unescaped = unescape_string (line);
html_context_parse (context->htmlctxt, (gchar *) unescaped,
strlen (unescaped));
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (context->lang_list)
+ state->language_list = context->lang_list;
+
+ if (context->desired_language && g_strcmp0(context->desired_language, state->current_language)) {
+ g_free (state->current_language);
+ state->current_language = g_strdup(context->desired_language);
+ GST_WARNING("current lang is updated %s", state->current_language);
+ }
+#endif
g_free (unescaped);
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (context->desired_language && context->current_language) {
+ if ((!strcmp(context->current_language, context->desired_language)) || context->end_body) {
+#endif
+ if (context->has_result) {
+ if (context->rubybuf->len) {
+ context->rubybuf = g_string_append_c (context->rubybuf, '\n');
+ g_string_prepend (context->resultbuf, context->rubybuf->str);
+ context->rubybuf = g_string_truncate (context->rubybuf, 0);
+ }
- if (context->has_result) {
- if (context->rubybuf->len) {
- context->rubybuf = g_string_append_c (context->rubybuf, '\n');
- g_string_prepend (context->resultbuf, context->rubybuf->str);
- context->rubybuf = g_string_truncate (context->rubybuf, 0);
+ ret = g_string_free (context->resultbuf, FALSE);
+ context->resultbuf = g_string_new ("");
+ state->start_time = context->time1;
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ if (!GST_CLOCK_TIME_IS_VALID(context->time2))
+ state->duration = GST_CLOCK_TIME_NONE;
+ else
+ state->duration = context->time2 - context->time1;
+#else
+ state->duration = context->time2 - context->time1;
+#endif
+ context->has_result = FALSE;
+ }
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+ context->end_body = FALSE;
}
-
- ret = g_string_free (context->resultbuf, FALSE);
- context->resultbuf = g_string_new ("");
- state->start_time = context->time1;
- state->duration = context->time2 - context->time1;
- context->has_result = FALSE;
}
+#endif
+
return ret;
}
void sami_context_deinit (ParserState * state);
void sami_context_reset (ParserState * state);
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+void sami_context_change_language (ParserState * state);
+#endif
G_END_DECLS
+++ /dev/null
-gsttcp-enumtypes.c
-gsttcp-enumtypes.h
-gsttcp-marshal.c
-gsttcp-marshal.h
-fdsetstress
}
/*** text/uri-list ***/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps uri_caps = GST_STATIC_CAPS ("text/uri-list");
#define URI_CAPS (gst_static_caps_get(&uri_caps))
data++; \
} \
}
+
static void
uri_type_find (GstTypeFind * tf, gpointer unused)
{
gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY, URI_CAPS);
}
}
+#endif
/*** application/itc ***/
static GstStaticCaps itc_caps = GST_STATIC_CAPS ("application/itc");
return FALSE;
}
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps generic_xml_caps = GST_STATIC_CAPS ("application/xml");
#define GENERIC_XML_CAPS (gst_static_caps_get(&generic_xml_caps))
gst_type_find_suggest (tf, GST_TYPE_FIND_MINIMUM, GENERIC_XML_CAPS);
}
}
-
+#endif
/*** application/dash+xml ****************************************************/
static GstStaticCaps dash_caps = GST_STATIC_CAPS ("application/dash+xml");
}
/*** application/smil *********************************************************/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps smil_caps = GST_STATIC_CAPS ("application/smil");
#define SMIL_CAPS (gst_static_caps_get(&smil_caps))
}
}
}
-
+#endif
/*** audio/midi ***/
static GstStaticCaps mid_caps = GST_STATIC_CAPS ("audio/midi");
/*** video/x-fli ***/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps flx_caps = GST_STATIC_CAPS ("video/x-fli");
#define FLX_CAPS gst_static_caps_get(&flx_caps)
return;
}
}
-
+#endif
/*** application/x-id3 ***/
static GstStaticCaps id3_caps = GST_STATIC_CAPS ("application/x-id3");
}
/*** audio/x-ttafile ***/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps tta_caps = GST_STATIC_CAPS ("audio/x-ttafile");
#define TTA_CAPS gst_static_caps_get(&tta_caps)
}
}
}
-
+#endif
/*** audio/x-flac ***/
static GstStaticCaps flac_caps = GST_STATIC_CAPS ("audio/x-flac");
}
/*** gsm ***/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
/* can only be detected by using the extension, in which case we use the default
* GSM properties */
static GstStaticCaps gsm_caps =
}
}
}
+#endif
/*** video/mpeg systemstream ***/
+#if defined(TIZEN_PROFILE_TV) || !defined(TIZEN_FEATURE_DISABLE_MIME_TYPES)
static GstStaticCaps mpeg_sys_caps = GST_STATIC_CAPS ("video/mpeg, "
"systemstream = (boolean) true, mpegversion = (int) [ 1, 2 ]");
#define MPEG_SYS_CAPS gst_static_caps_get(&mpeg_sys_caps)
+#endif
#define IS_MPEG_HEADER(data) (G_UNLIKELY((((guint8 *)(data))[0] == 0x00) && \
(((guint8 *)(data))[1] == 0x00) && \
(((guint8 *)(data))[2] == 0x01)))
-
+#if defined(TIZEN_PROFILE_TV) || !defined(TIZEN_FEATURE_DISABLE_MIME_TYPES)
#define IS_MPEG_PACK_CODE(b) ((b) == 0xBA)
#define IS_MPEG_SYS_CODE(b) ((b) == 0xBB)
#define IS_MPEG_PACK_HEADER(data) (IS_MPEG_HEADER (data) && \
#define MPEG2_MIN_SYS_HEADERS 2
#define MPEG2_MAX_SYS_HEADERS 5
+#endif
static gboolean
mpeg_sys_is_valid_pack (GstTypeFind * tf, const guint8 * data, guint len,
return FALSE;
}
+#if defined(TIZEN_PROFILE_TV) || !defined(TIZEN_FEATURE_DISABLE_MIME_TYPES)
static gboolean
mpeg_sys_is_valid_pes (GstTypeFind * tf, const guint8 * data, guint len,
guint * pack_size)
"mpegversion", G_TYPE_INT, mpegversion, NULL);
}
};
+#endif
/*** video/mpegts Transport Stream ***/
static GstStaticCaps mpegts_caps = GST_STATIC_CAPS ("video/mpegts, "
}
/*** audio/x-svx ***/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps svx_caps = GST_STATIC_CAPS ("audio/x-svx");
#define SVX_CAPS gst_static_caps_get(&svx_caps)
gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY + 10, APE_CAPS);
}
}
-
+#endif
/*** ISO FORMATS ***/
/*** audio/x-m4a ***/
}
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
/*** video/mj2 and image/jp2 ***/
static GstStaticCaps mj2_caps = GST_STATIC_CAPS ("video/mj2");
if (found_cod && found_qcd && found_sot)
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, JPC_CAPS);
}
-
+#endif
/*** video/quicktime ***/
if (STRNCMP (&data[4], "ftypisom", 8) == 0 ||
STRNCMP (&data[4], "ftypavc1", 8) == 0 ||
+#ifdef TIZEN_FEATURE_TYPEFIND_ENHANCEMENT
+ STRNCMP (&data[4], "ftypwmf ", 8) == 0 ||
+#endif
STRNCMP (&data[4], "ftypmp42", 8) == 0) {
tip = GST_TYPE_FIND_MAXIMUM;
variant = "iso";
/*** image/x-quicktime ***/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps qtif_caps = GST_STATIC_CAPS ("image/x-quicktime");
#define QTIF_CAPS gst_static_caps_get(&qtif_caps)
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SWF_CAPS);
}
}
-
+#endif
/*** application/vnd.ms-sstr+xml ***/
static void
NULL);
}
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
/*** image/tiff ***/
static GstStaticCaps tiff_caps = GST_STATIC_CAPS ("image/tiff, "
"endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }");
}
}
}
+#endif
/*** image/x-exr ***/
static GstStaticCaps exr_caps = GST_STATIC_CAPS ("image/x-exr");
}
}
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps sds_caps = GST_STATIC_CAPS ("audio/x-sds");
#define SDS_CAPS (gst_static_caps_get(&sds_caps))
}
}
}
-
+#endif
/*** Matroska/WebM ***/
#define EBML_HEADER 0x1A45DFA3
}
/*** application/mxf ***/
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static GstStaticCaps mxf_caps = GST_STATIC_CAPS ("application/mxf");
#define MXF_MAX_PROBE_LENGTH (1024 * 64)
"format", G_TYPE_STRING, format, NULL);
}
}
-
+#endif
/*** Ogg variants ***/
static GstStaticCaps ogg_caps =
}
}
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
/*** kate ***/
static void
kate_type_find (GstTypeFind * tf, gpointer private)
"application/x-kate", NULL);
}
}
+#endif
/*** WEBVTTT subtitles ***/
static GstStaticCaps webvtt_caps =
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, WEBVTT_CAPS);
}
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
/*** application/x-ogm-video or audio***/
static GstStaticCaps ogmvideo_caps =
gst_type_find_suggest (tf, GST_TYPE_FIND_NEARLY_CERTAIN, AR_CAPS);
}
}
+#endif
/*** audio/x-au ***/
}
}
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
/*** audio/x-paris ***/
/* NOTE: do not replace this function with two TYPE_FIND_REGISTER_START_WITH */
static GstStaticCaps paris_caps = GST_STATIC_CAPS ("audio/x-paris");
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, VIVO_CAPS);
}
}
-
+#endif
/*** XDG MIME typefinder (to avoid false positives mostly) ***/
#ifdef USE_GIO
#endif /* USE_GIO */
/*** Windows icon typefinder (to avoid false positives mostly) ***/
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
static void
windows_icon_typefind (GstTypeFind * find, gpointer user_data)
{
"application/x-yuv4mpeg", "y4mversion", G_TYPE_INT, 2, NULL);
}
}
+#endif
/*** DVD ISO images (looks like H.264, see #674069) ***/
static void
au_type_find, "au,snd", AU_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_RIFF (plugin, "video/x-msvideo", GST_RANK_PRIMARY,
"avi", "AVI ");
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER_RIFF (plugin, "audio/qcelp", GST_RANK_PRIMARY,
"qcp", "QLCM");
TYPE_FIND_REGISTER_RIFF (plugin, "video/x-cdxa", GST_RANK_PRIMARY,
TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-vcd", GST_RANK_PRIMARY,
"dat", "\000\377\377\377\377\377\377\377\377\377\377\000", 12,
GST_TYPE_FIND_MAXIMUM);
+#endif
TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-imelody", GST_RANK_PRIMARY,
"imy,ime,imelody", "BEGIN:IMELODY", 13, GST_TYPE_FIND_MAXIMUM);
TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-scc", GST_RANK_PRIMARY,
"mid,midi", "RMID");
TYPE_FIND_REGISTER (plugin, "audio/mobile-xmf", GST_RANK_PRIMARY,
mxmf_type_find, "mxmf", MXMF_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "video/x-fli", GST_RANK_MARGINAL, flx_type_find,
"flc,fli", FLX_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "application/x-id3v2", GST_RANK_PRIMARY + 103,
id3v2_type_find, "mp3,mp2,mp1,mpga,ogg,flac,tta", ID3_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/x-id3v1", GST_RANK_PRIMARY + 101,
id3v1_type_find, "mp3,mp2,mp1,mpga,ogg,flac,tta", ID3_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/x-apetag", GST_RANK_PRIMARY + 102,
apetag_type_find, "mp3,ape,mpc,wv", APETAG_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "audio/x-ttafile", GST_RANK_PRIMARY,
tta_type_find, "tta", TTA_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/x-mod", GST_RANK_SECONDARY, mod_type_find,
"669,amf,ams,dbm,digi,dmf,dsm,gdm,far,imf,it,j2b,mdl,med,mod,mt2,mtm,"
"okt,psm,ptm,sam,s3m,stm,stx,ult,umx,xm", MOD_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "audio/mpeg", GST_RANK_PRIMARY, mp3_type_find,
"mp3,mp2,mp1,mpga", MP3_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/x-ac3", GST_RANK_PRIMARY, ac3_type_find,
"ac3,eac3", AC3_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/x-dts", GST_RANK_SECONDARY, dts_type_find,
"dts", DTS_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "audio/x-gsm", GST_RANK_PRIMARY, NULL, "gsm",
GSM_CAPS, NULL, NULL);
+#endif
+#ifdef TIZEN_PROFILE_TV
TYPE_FIND_REGISTER (plugin, "video/mpeg-sys", GST_RANK_PRIMARY,
mpeg_sys_type_find, "mpe,mpeg,mpg", MPEG_SYS_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "video/mpegts", GST_RANK_PRIMARY,
mpeg_ts_type_find, "ts,mts", MPEGTS_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/ogg", GST_RANK_PRIMARY,
q3gp_type_find, "3gp", Q3GP_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "video/quicktime", GST_RANK_PRIMARY,
qt_type_find, "mov,mp4", QT_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "image/x-quicktime", GST_RANK_SECONDARY,
qtif_type_find, "qif,qtif,qti", QTIF_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "image/jp2", GST_RANK_PRIMARY,
TYPE_FIND_REGISTER (plugin, "text/html", GST_RANK_SECONDARY, html_type_find,
"htm,html", HTML_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER_START_WITH (plugin, "application/vnd.rn-realmedia",
GST_RANK_SECONDARY, "ra,ram,rm,rmvb", ".RMF", 4, GST_TYPE_FIND_MAXIMUM);
TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-pn-realaudio",
GST_RANK_SECONDARY, "ra,ram,rm,rmvb", ".ra\375", 4,
GST_TYPE_FIND_MAXIMUM);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "application/x-shockwave-flash",
GST_RANK_SECONDARY, swf_type_find, "swf,swfl", SWF_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "application/xges",
GST_RANK_PRIMARY, xges_type_find, "xges", XGES_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/dash+xml",
"txt", UTF16_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "text/utf-32", GST_RANK_MARGINAL, utf32_type_find,
"txt", UTF32_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "text/uri-list", GST_RANK_MARGINAL, uri_type_find,
"ram", URI_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "application/itc", GST_RANK_SECONDARY,
itc_type_find, "itc", ITC_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/x-hls", GST_RANK_MARGINAL,
hls_type_find, "m3u8", HLS_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/sdp", GST_RANK_SECONDARY,
sdp_type_find, "sdp", SDP_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "application/smil", GST_RANK_SECONDARY,
smil_type_find, "smil", SMIL_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/ttml+xml", GST_RANK_SECONDARY,
ttml_xml_type_find, "ttml+xml", TTML_XML_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/xml", GST_RANK_MARGINAL,
xml_type_find, "xml", GENERIC_XML_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER_RIFF (plugin, "audio/x-wav", GST_RANK_PRIMARY, "wav",
"WAVE");
TYPE_FIND_REGISTER (plugin, "audio/x-aiff", GST_RANK_SECONDARY,
aiff_type_find, "aiff,aif,aifc", AIFF_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "audio/x-svx", GST_RANK_SECONDARY, svx_type_find,
"iff,svx", SVX_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/x-paris", GST_RANK_SECONDARY,
shn_type_find, "shn", SHN_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/x-ape", GST_RANK_SECONDARY,
ape_type_find, "ape", APE_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "image/jpeg", GST_RANK_PRIMARY + 15,
jpeg_type_find, "jpg,jpe,jpeg", JPEG_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_START_WITH (plugin, "image/gif", GST_RANK_PRIMARY, "gif",
"png", "\211PNG\015\012\032\012", 8, GST_TYPE_FIND_MAXIMUM);
TYPE_FIND_REGISTER (plugin, "image/bmp", GST_RANK_PRIMARY, bmp_type_find,
"bmp", BMP_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "image/tiff", GST_RANK_PRIMARY, tiff_type_find,
"tif,tiff", TIFF_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_RIFF (plugin, "image/webp", GST_RANK_PRIMARY,
"webp", "WEBP");
+#endif
TYPE_FIND_REGISTER (plugin, "image/x-exr", GST_RANK_PRIMARY, exr_type_find,
"exr", EXR_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "image/x-portable-pixmap", GST_RANK_SECONDARY,
pnm_type_find, "pnm,ppm,pgm,pbm", PNM_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "video/x-matroska", GST_RANK_PRIMARY,
matroska_type_find, "mkv,mka,mk3d,webm", MATROSKA_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "application/mxf", GST_RANK_PRIMARY,
mxf_type_find, "mxf", MXF_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_START_WITH (plugin, "video/x-mve", GST_RANK_SECONDARY,
GST_TYPE_FIND_MAXIMUM);
TYPE_FIND_REGISTER (plugin, "video/x-dv", GST_RANK_SECONDARY, dv_type_find,
"dv,dif", DV_CAPS, NULL, NULL);
+#endif
TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-amr-nb-sh", GST_RANK_PRIMARY,
"amr", "#!AMR", 5, GST_TYPE_FIND_LIKELY);
TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-amr-wb-sh", GST_RANK_PRIMARY,
"amr", "#!AMR-WB", 7, GST_TYPE_FIND_MAXIMUM);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "audio/iLBC-sh", GST_RANK_PRIMARY, ilbc_type_find,
"ilbc", ILBC_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/x-sbc", GST_RANK_MARGINAL, sbc_type_find,
GST_RANK_SECONDARY, "Z", "\037\235", 2, GST_TYPE_FIND_LIKELY);
TYPE_FIND_REGISTER (plugin, "subtitle/x-kate", GST_RANK_MARGINAL,
kate_type_find, NULL, NULL, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "application/x-subtitle-vtt", GST_RANK_MARGINAL,
webvtt_type_find, "vtt", WEBVTT_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/x-flac", GST_RANK_PRIMARY, flac_type_find,
vorbis_type_find, NULL, VORBIS_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "video/x-theora", GST_RANK_PRIMARY,
theora_type_find, NULL, THEORA_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "application/x-ogm-video", GST_RANK_PRIMARY,
ogmvideo_type_find, NULL, OGMVIDEO_CAPS, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "application/x-ogm-audio", GST_RANK_PRIMARY,
NULL, CMML_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_START_WITH (plugin, "application/x-executable",
GST_RANK_MARGINAL, NULL, "\177ELF", 4, GST_TYPE_FIND_MAXIMUM);
+#endif
TYPE_FIND_REGISTER (plugin, "audio/aac", GST_RANK_SECONDARY, aac_type_find,
"aac,adts,adif,loas", AAC_CAPS, NULL, NULL);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-spc", GST_RANK_SECONDARY,
"spc", "SNES-SPC700 Sound File Data", 27, GST_TYPE_FIND_MAXIMUM);
TYPE_FIND_REGISTER (plugin, "audio/x-wavpack", GST_RANK_SECONDARY,
TYPE_FIND_REGISTER_START_WITH (plugin, "application/msword",
GST_RANK_SECONDARY, "doc", "\320\317\021\340\241\261\032\341", 8,
GST_TYPE_FIND_LIKELY);
+#endif
/* Mac OS X .DS_Store files tend to be taken for video/mpeg */
TYPE_FIND_REGISTER_START_WITH (plugin, "application/octet-stream",
GST_RANK_SECONDARY, "DS_Store", "\000\000\000\001Bud1", 8,
GST_TYPE_FIND_LIKELY);
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER_START_WITH (plugin, "image/vnd.adobe.photoshop",
GST_RANK_SECONDARY, "psd", "8BPS\000\001\000\000\000\000", 10,
GST_TYPE_FIND_LIKELY);
y4m_typefind, NULL, NULL, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "image/x-icon", GST_RANK_MARGINAL,
windows_icon_typefind, NULL, NULL, NULL, NULL);
+#endif
#ifdef USE_GIO
TYPE_FIND_REGISTER (plugin, "xdgmime-base", GST_RANK_MARGINAL,
xdgmime_typefind, NULL, NULL, NULL, NULL);
#endif
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "image/x-degas", GST_RANK_MARGINAL,
degas_type_find, NULL, NULL, NULL, NULL);
+#endif
TYPE_FIND_REGISTER (plugin, "application/octet-stream", GST_RANK_MARGINAL,
dvdiso_type_find, NULL, NULL, NULL, NULL);
TYPE_FIND_REGISTER (plugin, "audio/audible", GST_RANK_MARGINAL,
aa_type_find, "aa,aax", AA_CAPS, NULL, NULL);
-
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
TYPE_FIND_REGISTER (plugin, "audio/x-tap-tap", GST_RANK_PRIMARY,
tap_type_find, "tap", TAP_CAPS, NULL, NULL);
TYPE_FIND_REGISTER_START_WITH (plugin, "audio/x-tap-dmp",
GST_RANK_SECONDARY, "dmp", "DC2N-TAP-RAW", 12, GST_TYPE_FIND_LIKELY);
+#endif
return TRUE;
}
$(GST_CFLAGS)
libgstvideoconvert_la_LIBADD = \
$(top_builddir)/gst-libs/gst/video/libgstvideo-$(GST_API_VERSION).la \
+ $(top_builddir)/gst-libs/gst/allocators/libgstallocators-$(GST_API_VERSION).la \
+ $(GST_ALLOCATORS_LIBS) \
$(GST_BASE_LIBS) \
$(GST_LIBS) \
$(LIBM)
#include <gst/video/gstvideometa.h>
#include <gst/video/gstvideopool.h>
+#ifdef USE_TBM
+#include <gst/allocators/gsttizenbufferpool.h>
+#endif
+
#include <string.h>
GST_DEBUG_CATEGORY (videoconvert_debug);
};
#define CSP_VIDEO_CAPS GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ";" \
- GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("ANY", GST_VIDEO_FORMATS_ALL)
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("ANY", GST_VIDEO_FORMATS_ALL) ";" \
+ GST_VIDEO_CAPS_MAKE("{ SUYV , SYVY , S420 , ITLV }") ";" \
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("ANY", "{ SUYV , SYVY , S420 , ITLV }")
+
+#define CSP_VIDEO_SRC_CAPS GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ";" \
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("ANY", GST_VIDEO_FORMATS_ALL) ";" \
+ GST_VIDEO_CAPS_MAKE("{ SUYV , SYVY , S420 , ITLV , SN12 }") ";" \
+ GST_VIDEO_CAPS_MAKE_WITH_FEATURES ("ANY", "{ SUYV , SYVY , S420 , ITLV , SN12 }")
static GstStaticPadTemplate gst_video_convert_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS (CSP_VIDEO_CAPS)
+ GST_STATIC_CAPS (CSP_VIDEO_SRC_CAPS)
);
static GstStaticPadTemplate gst_video_convert_sink_template =
static GstFlowReturn gst_video_convert_transform_frame (GstVideoFilter * filter,
GstVideoFrame * in_frame, GstVideoFrame * out_frame);
+#ifdef USE_TBM
+static gboolean gst_video_convert_decide_allocation (GstBaseTransform * bsrc,
+ GstQuery * query);
+static GstFlowReturn gst_video_convert_prepare_output_buffer (GstBaseTransform * trans,
+ GstBuffer *input, GstBuffer **outbuf);
+#endif
+
/* copies the given caps */
static GstCaps *
gst_video_convert_caps_remove_format_info (GstCaps * caps)
{
GstVideoConvert *space = GST_VIDEO_CONVERT (obj);
+#ifdef USE_TBM
+ if (space->pool) {
+ gst_buffer_pool_set_active (space->pool, FALSE);
+ gst_object_unref (space->pool);
+ space->pool = NULL;
+ }
+#endif
+
if (space->convert) {
gst_video_converter_free (space->convert);
}
gstvideofilter_class->transform_frame =
GST_DEBUG_FUNCPTR (gst_video_convert_transform_frame);
+#ifdef USE_TBM
+ gstbasetransform_class->decide_allocation = gst_video_convert_decide_allocation;
+ gstbasetransform_class->prepare_output_buffer = gst_video_convert_prepare_output_buffer;
+#endif
+
g_object_class_install_property (gobject_class, PROP_DITHER,
g_param_spec_enum ("dither", "Dither", "Apply dithering while converting",
gst_video_dither_method_get_type (), DEFAULT_PROP_DITHER,
static void
gst_video_convert_init (GstVideoConvert * space)
{
+#ifdef USE_TBM
+ space->pool = NULL;
+#endif
space->dither = DEFAULT_PROP_DITHER;
space->dither_quantization = DEFAULT_PROP_DITHER_QUANTIZATION;
space->chroma_resampler = DEFAULT_PROP_CHROMA_RESAMPLER;
return GST_FLOW_OK;
}
+#ifdef USE_TBM
+static gboolean
+gst_video_convert_decide_allocation (GstBaseTransform * trans,
+ GstQuery * query)
+{
+ GstVideoConvert *vc = NULL;
+ GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
+ vc = GST_VIDEO_CONVERT_CAST(trans);
+
+ if (filter->out_info.finfo->format == GST_VIDEO_FORMAT_SN12 ) {
+ guint size;
+ GstStructure *config;
+ GstCaps *caps = NULL;
+ GstVideoInfo vinfo;
+ gst_query_parse_allocation (query, &caps, NULL);
+ gst_video_info_init (&vinfo);
+ gst_video_info_from_caps (&vinfo, caps);
+
+ size = vinfo.size;
+
+ if (caps) {
+ vc->pool = gst_tizen_buffer_pool_new ();
+ config = gst_buffer_pool_get_config (vc->pool);
+
+ gst_buffer_pool_config_set_params (config, caps, size, 4, 10);
+ gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
+ gst_buffer_pool_set_config (vc->pool, config);
+
+ if (!gst_buffer_pool_set_active (vc->pool, TRUE)) {
+ gst_object_unref (vc->pool);
+ vc->pool = NULL;
+ GST_INFO ("Failed to activate internal pool");
+ }
+ } else {
+ GST_ERROR("Not using our internal pool and copying buffers for downstream");
+ return FALSE;
+ }
+ }
+ GST_DEBUG("[%s]Creating Tizen Buffer Pool", __FUNCTION__);
+
+ return GST_BASE_TRANSFORM_CLASS (parent_class)->decide_allocation (trans, query);
+}
+
+static GstFlowReturn
+gst_video_convert_prepare_output_buffer (GstBaseTransform * trans,
+ GstBuffer *input, GstBuffer **outbuf)
+{
+ GstBuffer *buf = NULL;
+ GstVideoConvert *vc = NULL;
+ GstVideoFilter *filter = GST_VIDEO_FILTER_CAST (trans);
+
+ vc = GST_VIDEO_CONVERT_CAST (trans);
+
+ if (filter->out_info.finfo->format == GST_VIDEO_FORMAT_SN12 ) {
+ if (gst_buffer_pool_acquire_buffer (vc->pool, &buf, 0) != GST_FLOW_OK) {
+ GST_ERROR("[%s] memory prepare failed.",__FUNCTION__);
+ return GST_FLOW_ERROR;
+ }
+
+ if (input != buf)
+ GST_BASE_TRANSFORM_CLASS (parent_class)->copy_metadata (trans, input, buf);
+ *outbuf = buf;
+
+ return GST_FLOW_OK;
+ }
+ return GST_BASE_TRANSFORM_CLASS (parent_class)->prepare_output_buffer(trans, input, outbuf);
+}
+#endif
+
static gboolean
plugin_init (GstPlugin * plugin)
{
GstVideoPrimariesMode primaries_mode;
gdouble alpha_value;
gint n_threads;
+#ifdef USE_TBM
+ GstBufferPool *pool;
+#endif
};
struct _GstVideoConvertClass
+++ /dev/null
-Makefile
-Makefile.in
-*.o
-*.lo
-*.la
-.deps
-.libs
+++ /dev/null
-generate_sine_table
if (self->current_volume == 0.0 || self->current_mute) {
orc_memset (map.data, 0, map.size);
+#ifndef TIZEN_FEATURE_VOLUME_MODIFICATION
+ /* if set this flag, it will be drop at baseaudiosink and it cause pa close. */
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_GAP);
+#endif
} else if (self->current_volume != 1.0) {
self->process (self, map.data, map.size);
}
+++ /dev/null
-codeset.m4
-gettext.m4
-glibc21.m4
-iconv.m4
-intdiv0.m4
-inttypes-pri.m4
-inttypes.m4
-inttypes_h.m4
-isc-posix.m4
-lcmessage.m4
-lib-ld.m4
-lib-link.m4
-lib-prefix.m4
-progtest.m4
-stdint_h.m4
-uintmax_t.m4
-ulonglong.m4
--- /dev/null
+%bcond_with x
+%define gst_branch 1.0
+%define _lib_gstreamer_dir %{_libdir}/gstreamer-%{gst_branch}
+%define _libdebug_dir %{_libdir}/debug/usr/lib
+
+Name: gst-plugins-base
+Version: 1.16.2
+Release: 1
+License: LGPL-2.0+
+Summary: GStreamer Streaming-Media Framework Plug-Ins
+Url: http://gstreamer.freedesktop.org/
+Group: Multimedia/Framework
+Source: http://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-%{version}.tar.xz
+Source100: common.tar.gz
+BuildRequires: gettext-tools
+BuildRequires: pkgconfig(glib-2.0) >= 2.32
+BuildRequires: pkgconfig(gstreamer-1.0)
+BuildRequires: orc >= 0.4.16
+BuildRequires: python
+%if "%{tizen_profile_name}" != "tv"
+BuildRequires: update-desktop-files
+%endif
+BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.31.1
+BuildRequires: pkgconfig(alsa) >= 0.9.1
+BuildRequires: pkgconfig(freetype2) >= 2.0.9
+BuildRequires: pkgconfig(libxml-2.0)
+BuildRequires: pkgconfig(ogg) >= 1.0
+BuildRequires: pkgconfig(theoradec) >= 1.1
+BuildRequires: pkgconfig(theoraenc) >= 1.1
+BuildRequires: pkgconfig(vorbis) >= 1.0
+BuildRequires: pkgconfig(vorbisenc) >= 1.0
+BuildRequires: pkgconfig(zlib)
+
+BuildRequires: pkgconfig(libdrm)
+BuildRequires: pkgconfig(libtbm)
+%if %{with x}
+BuildRequires: pkgconfig(ice)
+BuildRequires: pkgconfig(sm)
+BuildRequires: pkgconfig(xext)
+BuildRequires: pkgconfig(xv)
+BuildRequires: pkgconfig(xfixes)
+BuildRequires: pkgconfig(dri2proto)
+BuildRequires: pkgconfig(libdri2)
+%endif
+
+Requires: gstreamer >= 1.0.0
+Supplements: gstreamer
+Provides: %{name}-profile_tv = %{version}-%{release}
+Provides: %{name}-profile_common = %{version}-%{release}
+Provides: %{name}-profile_wearable = %{version}-%{release}
+Provides: %{name}-profile_ivi = %{version}-%{release}
+
+%description
+GStreamer is a streaming media framework based on graphs of filters
+that operate on media data. Applications using this library can do
+anything media-related, from real-time sound processing to playing
+videos. Its plug-in-based architecture means that new data types or
+processing capabilities can be added simply by installing new plug-ins.
+
+%package extension-adder
+Summary: libgstadder.so for gst-plugins-base
+Requires: %{name} = %{version}-%{release}
+Provides: %{name}-profile_mobile = %{version}-%{release}
+%description extension-adder
+Libgstadder.so for gst-plugin-base. Supplicant for gst-plugin-base.
+This is for Tizen mobile profile.
+
+%package devel
+Summary: Include files and Libraries
+Requires: %{name} = %{version}
+
+%description devel
+This package contains all necessary include files and libraries needed
+to compile and link applications that use gstreamer-plugins-base.
+
+%prep
+%setup -q -n gst-plugins-base-%{version}
+%setup -q -T -D -a 100
+
+%build
+# FIXME: GTKDOC_CFLAGS, GST_OBJ_CFLAGS:
+# Silently ignored compilation of uninstalled gtk-doc scanners without RPM_OPT_FLAGS.
+export V=1
+NOCONFIGURE=1 ./autogen.sh
+export CFLAGS="%{optflags} -fno-strict-aliasing\
+ -DTIZEN_FEATURE_WAYLAND_ENHANCEMENT\
+ -DTIZEN_FEATURE_TYPEFIND_ENHANCEMENT\
+ -DTIZEN_FEATURE_AUDIODECODER_MODIFICATION\
+ -DTIZEN_FEATURE_DISABLE_MIME_TYPES\
+ -DTIZEN_FEATURE_VIDEO_MODIFICATION\
+ -DTIZEN_FEATURE_SUBPARSE_MODIFICATION\
+ -DTIZEN_FEATURE_VOLUME_MODIFICATION\
+%if "%{tizen_profile_name}" == "tv"
+ -DTIZEN_PROFILE_TV\
+ -DTIZEN_FEATURE_TRUSTZONE\
+%endif
+ -fstack-protector-strong\
+ -Wl,-z,relro\
+ -D_FORTIFY_SOURCE=2\
+ "
+%configure\
+ --disable-static\
+ --enable-experimental\
+ --disable-gtk-doc\
+ --enable-introspection\
+ --disable-encoding\
+ --disable-examples\
+%if "%{tizen_profile_name}" == "tv"
+ --enable-tv\
+%endif
+ --enable-tbm
+make %{?_smp_mflags}
+
+%install
+rm -rf %{buildroot}
+%make_install
+%find_lang %{name}-%{gst_branch}
+mv %{name}-%{gst_branch}.lang %{name}.lang
+rm -rf %{buildroot}%{_libdir}/girepository-%{gst_branch}/*.typelib
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%lang_package
+
+%files
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%license COPYING
+
+%{_lib_gstreamer_dir}/libgstalsa.so
+%{_lib_gstreamer_dir}/libgstapp.so
+%{_lib_gstreamer_dir}/libgstaudioconvert.so
+%{_lib_gstreamer_dir}/libgstaudiomixer.so
+%{_lib_gstreamer_dir}/libgstaudiorate.so
+%{_lib_gstreamer_dir}/libgstaudioresample.so
+%{_lib_gstreamer_dir}/libgstaudiotestsrc.so
+%{_lib_gstreamer_dir}/libgstcompositor.so
+%{_lib_gstreamer_dir}/libgstgio.so
+%{_lib_gstreamer_dir}/libgstogg.so
+%{_lib_gstreamer_dir}/libgstplayback.so
+%{_lib_gstreamer_dir}/libgstoverlaycomposition.so
+%{_lib_gstreamer_dir}/libgstsubparse.so
+%{_lib_gstreamer_dir}/libgsttcp.so
+%{_lib_gstreamer_dir}/libgsttheora.so
+%{_lib_gstreamer_dir}/libgsttypefindfunctions.so
+%{_lib_gstreamer_dir}/libgstvideoconvert.so
+%{_lib_gstreamer_dir}/libgstvideorate.so
+%{_lib_gstreamer_dir}/libgstvideoscale.so
+%{_lib_gstreamer_dir}/libgstvideotestsrc.so
+%{_lib_gstreamer_dir}/libgstvolume.so
+%{_lib_gstreamer_dir}/libgstvorbis.so
+%{_lib_gstreamer_dir}/libgstpbtypes.so
+%{_lib_gstreamer_dir}/libgstrawparse.so
+
+%if %{with x}
+%{_lib_gstreamer_dir}/libgstximagesink.so
+%{_lib_gstreamer_dir}/libgstxvimagesink.so
+%endif
+
+%{_libdir}/libgstapp*.so.*
+%{_libdir}/libgstaudio*.so.*
+%{_libdir}/libgstallocators*.so.*
+%{_libdir}/libgstfft*.so.*
+%{_libdir}/libgstpbutils*.so.*
+%{_libdir}/libgstriff*.so.*
+%{_libdir}/libgstrtp*.so.*
+%{_libdir}/libgstrtsp*.so.*
+%{_libdir}/libgstsdp*.so.*
+%{_libdir}/libgsttag*.so.*
+%{_libdir}/libgstvideo*.so.*
+%dir %{_datadir}/gst-plugins-base/
+%dir %{_datadir}/gst-plugins-base/%{gst_branch}/
+%{_datadir}/gst-plugins-base/%{gst_branch}/license-translations.dict
+
+%files extension-adder
+%{_lib_gstreamer_dir}/libgstadder.so
+%license COPYING
+
+%files devel
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%{_includedir}/gstreamer-%{gst_branch}/*
+%{_libdir}/*.so
+%{_libdir}/pkgconfig/*.pc
+%{_datadir}/gir-1.0/*.gir
Requires.private: @ORC_PC@
Version: @VERSION@
Libs: -L${libdir} -lgstvideo-@GST_API_VERSION@
-Cflags: -I${includedir}
+Cflags: -I${includedir} -DTIZEN_FEATURE_WAYLAND_ENHANCEMENT
+++ /dev/null
-gst-device-monitor-?.0
-gst-discoverer-?.0
-gst-play-?.0