Merge branch 'upstream/1.16' into tizen_gst_1.16.2 87/222887/7
authorGilbok Lee <gilbok.lee@samsung.com>
Fri, 17 Jan 2020 07:02:38 +0000 (16:02 +0900)
committerGilbok Lee <gilbok.lee@samsung.com>
Wed, 12 Feb 2020 02:34:28 +0000 (11:34 +0900)
Change-Id: I1bc8038f8df8189776f4b2d4b70e3822430e840b

55 files changed:
.gbs.conf [new file with mode: 0644]
Makefile.am
RELEASE
configure.ac
docs/.gitignore [deleted file]
gst-libs/gst/Makefile.am [changed mode: 0644->0755]
gst-libs/gst/allocators/Makefile.am [changed mode: 0644->0755]
gst-libs/gst/allocators/allocators.h [changed mode: 0644->0755]
gst-libs/gst/allocators/gsttizenbufferpool.c [new file with mode: 0644]
gst-libs/gst/allocators/gsttizenbufferpool.h [new file with mode: 0644]
gst-libs/gst/allocators/gsttizenmemory.c [new file with mode: 0644]
gst-libs/gst/allocators/gsttizenmemory.h [new file with mode: 0644]
gst-libs/gst/app/gstappsink.h [changed mode: 0644->0755]
gst-libs/gst/audio/.gitignore [deleted file]
gst-libs/gst/audio/gstaudiodecoder.c
gst-libs/gst/pbutils/.gitignore [deleted file]
gst-libs/gst/tag/gsttagdemux.c
gst-libs/gst/video/.gitignore [deleted file]
gst-libs/gst/video/Makefile.am
gst-libs/gst/video/cameracontrol.c [new file with mode: 0644]
gst-libs/gst/video/cameracontrol.h [new file with mode: 0644]
gst-libs/gst/video/cameracontrolchannel.c [new file with mode: 0644]
gst-libs/gst/video/cameracontrolchannel.h [new file with mode: 0644]
gst-libs/gst/video/gstvideofilter.c
gst-libs/gst/video/video-converter.c
gst-libs/gst/video/video-format.c
gst-libs/gst/video/video-format.h
gst-libs/gst/video/video-info.c
gst-libs/gst/video/videooverlay.c
gst-libs/gst/video/videooverlay.h
gst-plugins-base.manifest [new file with mode: 0644]
gst/adder/.gitignore [deleted file]
gst/audioconvert/.gitignore [deleted file]
gst/playback/.gitignore [deleted file]
gst/playback/gstdecodebin2.c
gst/playback/gstrawcaps.h
gst/subparse/gstsubparse.c
gst/subparse/gstsubparse.h
gst/subparse/samiparse.c
gst/subparse/samiparse.h
gst/tcp/.gitignore [deleted file]
gst/typefind/gsttypefindfunctions.c
gst/videoconvert/Makefile.am [changed mode: 0644->0755]
gst/videoconvert/gstvideoconvert.c
gst/videoconvert/gstvideoconvert.h
gst/videoscale/.gitignore [deleted file]
gst/videotestsrc/.gitignore [deleted file]
gst/volume/.gitignore [deleted file]
gst/volume/gstvolume.c
m4/.gitignore [deleted file]
packaging/common.tar.gz [new file with mode: 0644]
packaging/gst-plugins-base.spec [new file with mode: 0644]
pkgconfig/.gitignore [deleted file]
pkgconfig/gstreamer-video.pc.in
tools/.gitignore [deleted file]

diff --git a/.gbs.conf b/.gbs.conf
new file mode 100644 (file)
index 0000000..8d1776a
--- /dev/null
+++ b/.gbs.conf
@@ -0,0 +1,3 @@
+[general]
+upstream_branch = upstream/1.16
+upstream_tag = ${upstreamversion}
index 21cdb5e..d81f733 100644 (file)
@@ -1,4 +1,4 @@
-DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
+DISTCHECK_CONFIGURE_FLAGS=--disable-gtk-doc
 
 if BUILD_EXTERNAL
 SUBDIRS_EXT = ext
@@ -10,20 +10,16 @@ SUBDIRS =                   \
        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
@@ -74,8 +70,7 @@ CRUFT_FILES = \
        $(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 \
diff --git a/RELEASE b/RELEASE
index 662aafa..592538f 100644 (file)
--- a/RELEASE
+++ b/RELEASE
@@ -51,6 +51,10 @@ with other GStreamer modules for a complete multimedia experience.
 
  - 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
index 180f7aa..73a093e 100644 (file)
@@ -154,6 +154,34 @@ AM_CONDITIONAL(HAVE_CXX, test "x$working_cxx" = "xyes")
 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])
 
@@ -265,8 +293,8 @@ dnl Check for fast float to int casting as defined in C99
 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
@@ -449,7 +477,7 @@ dnl define an ERROR_CXXFLAGS Makefile variable
 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
@@ -909,6 +937,11 @@ dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
 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
diff --git a/docs/.gitignore b/docs/.gitignore
deleted file mode 100644 (file)
index e5a7abe..0000000
+++ /dev/null
@@ -1 +0,0 @@
-version.entities
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index d122054..c996e6a
@@ -19,6 +19,24 @@ libgstallocators_@GST_API_VERSION@_la_SOURCES = \
 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
old mode 100644 (file)
new mode 100755 (executable)
index b616aa2..d0dadaa
 #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__ */
 
diff --git a/gst-libs/gst/allocators/gsttizenbufferpool.c b/gst-libs/gst/allocators/gsttizenbufferpool.c
new file mode 100644 (file)
index 0000000..d643425
--- /dev/null
@@ -0,0 +1,342 @@
+/*
+ * 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));
+}
diff --git a/gst-libs/gst/allocators/gsttizenbufferpool.h b/gst-libs/gst/allocators/gsttizenbufferpool.h
new file mode 100644 (file)
index 0000000..8734df1
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * 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_ */
diff --git a/gst-libs/gst/allocators/gsttizenmemory.c b/gst-libs/gst/allocators/gsttizenmemory.c
new file mode 100644 (file)
index 0000000..16d6b64
--- /dev/null
@@ -0,0 +1,457 @@
+/*
+ * 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;
+}
diff --git a/gst-libs/gst/allocators/gsttizenmemory.h b/gst-libs/gst/allocators/gsttizenmemory.h
new file mode 100644 (file)
index 0000000..ccf31f3
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * 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_ */
old mode 100644 (file)
new mode 100755 (executable)
diff --git a/gst-libs/gst/audio/.gitignore b/gst-libs/gst/audio/.gitignore
deleted file mode 100644 (file)
index 9e8783a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-audio-enumtypes.c
-audio-enumtypes.h
-gstaudiopack.h
index c3d445b..f2047a3 100644 (file)
@@ -2358,8 +2358,12 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event)
         } 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;
         }
       }
@@ -2483,6 +2487,16 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event)
       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
diff --git a/gst-libs/gst/pbutils/.gitignore b/gst-libs/gst/pbutils/.gitignore
deleted file mode 100644 (file)
index 71267e4..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-pbutils-enumtypes.c
-pbutils-enumtypes.h
-pbutils-marshal.c
-pbutils-marshal.h
index f545857..f572ff3 100644 (file)
@@ -113,7 +113,12 @@ struct _GstTagDemuxPrivate
  * 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
diff --git a/gst-libs/gst/video/.gitignore b/gst-libs/gst/video/.gitignore
deleted file mode 100644 (file)
index 36b511d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-video-enumtypes.c
-video-enumtypes.h
-video-orc.h
index b101f00..0d35cf8 100644 (file)
@@ -21,6 +21,8 @@ lib_LTLIBRARIES = libgstvideo-@GST_API_VERSION@.la
 CLEANFILES = $(BUILT_SOURCES)
 
 libgstvideo_@GST_API_VERSION@_la_SOURCES = \
+       cameracontrol.c         \
+       cameracontrolchannel.c  \
        colorbalance.c          \
        colorbalancechannel.c   \
        navigation.c            \
@@ -60,6 +62,8 @@ nodist_libgstvideo_@GST_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
 
 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            \
diff --git a/gst-libs/gst/video/cameracontrol.c b/gst-libs/gst/video/cameracontrol.c
new file mode 100644 (file)
index 0000000..c2274bc
--- /dev/null
@@ -0,0 +1,593 @@
+/*
+ * 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);
+}
diff --git a/gst-libs/gst/video/cameracontrol.h b/gst-libs/gst/video/cameracontrol.h
new file mode 100644 (file)
index 0000000..0b57ff3
--- /dev/null
@@ -0,0 +1,517 @@
+/*
+ * 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__ */
diff --git a/gst-libs/gst/video/cameracontrolchannel.c b/gst-libs/gst/video/cameracontrolchannel.c
new file mode 100644 (file)
index 0000000..86c7ce9
--- /dev/null
@@ -0,0 +1,112 @@
+/* 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);
+       }
+}
diff --git a/gst-libs/gst/video/cameracontrolchannel.h b/gst-libs/gst/video/cameracontrolchannel.h
new file mode 100644 (file)
index 0000000..31aa41d
--- /dev/null
@@ -0,0 +1,67 @@
+/* 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__ */
index 4d63eea..05961e8 100644 (file)
@@ -252,6 +252,9 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
   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;
@@ -264,11 +267,22 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
             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);
index 09344d6..4feeae6 100644 (file)
@@ -34,6 +34,9 @@
 #include <glib.h>
 #include <string.h>
 #include <math.h>
+#ifdef USE_TBM
+#include <gst/allocators/gsttizenmemory.h>
+#endif
 
 #include "video-orc.h"
 
@@ -5821,6 +5824,43 @@ convert_scale_planes (GstVideoConverter * convert,
   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)
 {
@@ -5923,9 +5963,18 @@ 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;
 }
@@ -5976,6 +6025,12 @@ setup_scale (GstVideoConverter * convert)
   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:
@@ -5992,6 +6047,10 @@ setup_scale (GstVideoConverter * convert)
         return FALSE;
       }
       break;
+#ifdef USE_TBM
+    case GST_VIDEO_FORMAT_SN12:
+      return TRUE; /* do nothing for SN12 format */
+#endif
     default:
       break;
   }
@@ -6345,6 +6404,10 @@ static const VideoTransform transforms[] = {
       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,
index d1b8bd4..c602d04 100644 (file)
@@ -5338,6 +5338,41 @@ pack_bgr10a2_le (const GstVideoFormatInfo * info, GstVideoPackFlags flags,
   }
 }
 
+#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;
@@ -5467,6 +5502,9 @@ typedef struct
 #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}},
@@ -5475,12 +5513,16 @@ static const VideoFormat formats[] = {
 
   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,
@@ -5495,6 +5537,8 @@ static const VideoFormat formats[] = {
       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,
@@ -5518,8 +5562,14 @@ static const VideoFormat formats[] = {
       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),
@@ -5670,6 +5720,14 @@ static const VideoFormat formats[] = {
   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
@@ -5852,6 +5910,14 @@ gst_video_format_from_fourcc (guint32 fourcc)
   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'):
@@ -5860,6 +5926,8 @@ gst_video_format_from_fourcc (guint32 fourcc)
       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'):
@@ -5878,8 +5946,14 @@ gst_video_format_from_fourcc (guint32 fourcc)
       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'):
@@ -5922,7 +5996,8 @@ gst_video_format_from_fourcc (guint32 fourcc)
       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;
   }
index 30189b2..b35b99b 100644 (file)
@@ -128,9 +128,11 @@ typedef enum {
   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,
@@ -138,6 +140,7 @@ typedef enum {
   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,
@@ -149,7 +152,10 @@ typedef enum {
   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,
@@ -211,6 +217,9 @@ typedef enum {
   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
@@ -553,16 +562,16 @@ gconstpointer  gst_video_format_get_palette          (GstVideoFormat format, gsi
 # 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:
index 7aed055..d426db2 100644 (file)
@@ -782,6 +782,7 @@ fill_planes (GstVideoInfo * info)
     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:
@@ -828,6 +829,7 @@ fill_planes (GstVideoInfo * info)
       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;
@@ -857,7 +859,12 @@ fill_planes (GstVideoInfo * info)
       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];
@@ -911,15 +918,24 @@ fill_planes (GstVideoInfo * info)
       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:
@@ -1119,6 +1135,9 @@ fill_planes (GstVideoInfo * info)
     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;
index f37f172..00dac44 100644 (file)
@@ -327,6 +327,101 @@ gst_video_overlay_get_type (void)
   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.
index 93530c4..1e6e829 100644 (file)
@@ -67,6 +67,17 @@ struct _GstVideoOverlayInterface {
                                 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
@@ -113,7 +124,21 @@ gboolean        gst_video_overlay_set_property          (GObject         * objec
                                                          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__ */
diff --git a/gst-plugins-base.manifest b/gst-plugins-base.manifest
new file mode 100644 (file)
index 0000000..97e8c31
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
diff --git a/gst/adder/.gitignore b/gst/adder/.gitignore
deleted file mode 100644 (file)
index 08f5ed3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-*.o
-*.lo
-*.la
-.deps
-.libs
diff --git a/gst/audioconvert/.gitignore b/gst/audioconvert/.gitignore
deleted file mode 100644 (file)
index 696560c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-channelmixtest
diff --git a/gst/playback/.gitignore b/gst/playback/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
index 38ef398..3b4bd41 100644 (file)
@@ -182,6 +182,10 @@ struct _GstDecodeBin
 
   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 */
 
@@ -279,6 +283,10 @@ enum
   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;
@@ -989,6 +997,14 @@ gst_decode_bin_class_init (GstDecodeBinClass * klass)
           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
    *
@@ -1301,6 +1317,13 @@ gst_decode_bin_set_property (GObject * object, guint prop_id,
     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;
@@ -1353,6 +1376,12 @@ gst_decode_bin_get_property (GObject * object, guint prop_id,
     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);
@@ -3825,6 +3854,14 @@ gst_decode_group_new (GstDecodeBin * dbin, GstDecodeChain * parent)
   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;
index 1fc1d7d..76e57b3 100644 (file)
 
 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
 
index 4254158..6d806de 100644 (file)
 
 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
@@ -120,6 +133,12 @@ gst_sub_parse_dispose (GObject * object)
     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));
 }
 
@@ -158,6 +177,13 @@ gst_sub_parse_class_init (GstSubParseClass * klass)
           "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
@@ -188,6 +214,13 @@ gst_sub_parse_init (GstSubParse * subparse)
 
   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
 }
 
 /*
@@ -270,6 +303,9 @@ gst_sub_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
         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,
@@ -291,6 +327,10 @@ gst_sub_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
         GST_WARNING_OBJECT (self, "seek to 0 bytes failed");
       }
 
+#ifdef TIZEN_FEATURE_SUBPARSE_MODIFICATION
+      SUBPARSE_SEEK_UNLOCK (self);
+#endif
+
       gst_event_unref (event);
       break;
     }
@@ -330,6 +370,15 @@ gst_sub_parse_set_property (GObject * object, guint prop_id,
       }
       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;
@@ -351,6 +400,11 @@ gst_sub_parse_get_property (GObject * object, guint prop_id,
     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;
@@ -494,13 +548,26 @@ convert_encoding (GstSubParse * self, const gchar * str, gsize len,
         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;
 }
@@ -1375,6 +1442,15 @@ parser_state_init (ParserState * state)
   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
@@ -1721,6 +1797,9 @@ handle_buffer (GstSubParse * self, GstBuffer * buf)
   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;
@@ -1778,7 +1857,16 @@ handle_buffer (GstSubParse * self, GstBuffer * buf)
         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);
 
@@ -1881,6 +1969,21 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
     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);
@@ -1901,6 +2004,11 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
        * 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:
index 64aab34..78bf5fe 100644 (file)
@@ -78,6 +78,11 @@ typedef struct {
   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);
@@ -101,11 +106,11 @@ struct _GstSubParse {
 
   /* seek */
   guint64 offset;
-  
+
   /* Segment */
   GstSegment    segment;
   gboolean      need_segment;
-  
+
   gboolean flushing;
   gboolean valid_utf8;
   gchar   *detected_encoding;
@@ -114,7 +119,10 @@ struct _GstSubParse {
   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 {
index 377c6d7..88df038 100644 (file)
 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
 {
@@ -52,8 +60,78 @@ 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,
@@ -470,6 +548,10 @@ html_context_handle_element (HtmlContext * ctxt,
   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);
@@ -512,7 +594,86 @@ html_context_handle_element (HtmlContext * ctxt,
     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) {
@@ -537,6 +698,13 @@ html_context_parse (HtmlContext * ctxt, gchar * text, gsize text_len)
         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, "/")) {
@@ -659,6 +827,9 @@ handle_start_sync (GstSamiContext * sctx, const gchar ** atts)
           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;
@@ -731,6 +902,91 @@ handle_start_font (GstSamiContext * sctx, const gchar ** atts)
     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,
@@ -748,6 +1004,10 @@ 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)) {
@@ -757,9 +1017,21 @@ handle_start_element (HtmlContext * ctx, const gchar * 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
   }
 }
 
@@ -776,6 +1048,11 @@ handle_end_element (HtmlContext * ctx, const char *name, gpointer user_data)
       (!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)
@@ -805,11 +1082,20 @@ handle_text (HtmlContext * ctx, const gchar * text, gsize text_len,
   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);
   }
 }
@@ -834,6 +1120,34 @@ sami_context_init (ParserState * state)
   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;
 }
@@ -842,6 +1156,10 @@ void
 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);
@@ -850,6 +1168,29 @@ sami_context_deinit (ParserState * state)
     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;
   }
@@ -872,6 +1213,23 @@ sami_context_reset (ParserState * state)
   }
 }
 
+#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)
 {
@@ -881,20 +1239,46 @@ 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;
 }
index 12f8c9e..060e6cb 100644 (file)
@@ -31,6 +31,9 @@ void    sami_context_init   (ParserState * state);
 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
 
diff --git a/gst/tcp/.gitignore b/gst/tcp/.gitignore
deleted file mode 100644 (file)
index 45ededd..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-gsttcp-enumtypes.c
-gsttcp-enumtypes.h
-gsttcp-marshal.c
-gsttcp-marshal.h
-fdsetstress
index 11cee9a..95d81f1 100644 (file)
@@ -362,7 +362,7 @@ utf32_type_find (GstTypeFind * tf, gpointer unused)
 }
 
 /*** 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))
@@ -378,6 +378,7 @@ static GstStaticCaps uri_caps = GST_STATIC_CAPS ("text/uri-list");
     data++;                                                             \
   }                                                                     \
 }
+
 static void
 uri_type_find (GstTypeFind * tf, gpointer unused)
 {
@@ -424,6 +425,7 @@ 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");
@@ -657,6 +659,7 @@ xml_check_first_element (GstTypeFind * tf, const gchar * element, guint elen,
   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))
@@ -667,7 +670,7 @@ xml_type_find (GstTypeFind * tf, gpointer unused)
     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");
@@ -732,7 +735,7 @@ sdp_type_find (GstTypeFind * tf, gpointer unused)
 }
 
 /*** 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))
@@ -783,7 +786,7 @@ html_type_find (GstTypeFind * tf, gpointer unused)
     }
   }
 }
-
+#endif
 /*** audio/midi ***/
 
 static GstStaticCaps mid_caps = GST_STATIC_CAPS ("audio/midi");
@@ -829,7 +832,7 @@ mxmf_type_find (GstTypeFind * tf, gpointer unused)
 
 
 /*** 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)
@@ -858,7 +861,7 @@ flx_type_find (GstTypeFind * tf, gpointer unused)
     return;
   }
 }
-
+#endif
 /*** application/x-id3 ***/
 
 static GstStaticCaps id3_caps = GST_STATIC_CAPS ("application/x-id3");
@@ -913,7 +916,7 @@ apetag_type_find (GstTypeFind * tf, gpointer unused)
 }
 
 /*** 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)
@@ -929,7 +932,7 @@ tta_type_find (GstTypeFind * tf, gpointer unused)
     }
   }
 }
-
+#endif
 /*** audio/x-flac ***/
 static GstStaticCaps flac_caps = GST_STATIC_CAPS ("audio/x-flac");
 
@@ -1943,7 +1946,7 @@ dts_type_find (GstTypeFind * tf, gpointer unused)
 }
 
 /*** 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 =
@@ -2139,16 +2142,19 @@ multipart_type_find (GstTypeFind * tf, gpointer unused)
     }
   }
 }
+#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) &&            \
@@ -2164,6 +2170,7 @@ static GstStaticCaps mpeg_sys_caps = GST_STATIC_CAPS ("video/mpeg, "
 
 #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,
@@ -2217,6 +2224,7 @@ 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)
@@ -2415,6 +2423,7 @@ suggest:
         "mpegversion", G_TYPE_INT, mpegversion, NULL);
   }
 };
+#endif
 
 /*** video/mpegts Transport Stream ***/
 static GstStaticCaps mpegts_caps = GST_STATIC_CAPS ("video/mpegts, "
@@ -3044,7 +3053,7 @@ aiff_type_find (GstTypeFind * tf, gpointer unused)
 }
 
 /*** 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)
@@ -3093,7 +3102,7 @@ ape_type_find (GstTypeFind * tf, gpointer unused)
     gst_type_find_suggest (tf, GST_TYPE_FIND_LIKELY + 10, APE_CAPS);
   }
 }
-
+#endif
 /*** ISO FORMATS ***/
 
 /*** audio/x-m4a ***/
@@ -3178,6 +3187,7 @@ q3gp_type_find (GstTypeFind * tf, gpointer unused)
 
 }
 
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
 /*** video/mj2 and image/jp2 ***/
 static GstStaticCaps mj2_caps = GST_STATIC_CAPS ("video/mj2");
 
@@ -3302,7 +3312,7 @@ jpc_type_find (GstTypeFind * tf, gpointer unused)
   if (found_cod && found_qcd && found_sot)
     gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, JPC_CAPS);
 }
-
+#endif
 
 /*** video/quicktime ***/
 
@@ -3331,6 +3341,9 @@ qt_type_find (GstTypeFind * tf, gpointer unused)
 
     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";
@@ -3435,7 +3448,7 @@ done:
 
 
 /*** 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)
@@ -3795,7 +3808,7 @@ swf_type_find (GstTypeFind * tf, gpointer unused)
     gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SWF_CAPS);
   }
 }
-
+#endif
 /*** application/vnd.ms-sstr+xml ***/
 
 static void
@@ -4062,6 +4075,7 @@ bmp_type_find (GstTypeFind * tf, gpointer unused)
       NULL);
 }
 
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
 /*** image/tiff ***/
 static GstStaticCaps tiff_caps = GST_STATIC_CAPS ("image/tiff, "
     "endianness = (int) { BIG_ENDIAN, LITTLE_ENDIAN }");
@@ -4087,6 +4101,7 @@ tiff_type_find (GstTypeFind * tf, gpointer ununsed)
     }
   }
 }
+#endif
 
 /*** image/x-exr ***/
 static GstStaticCaps exr_caps = GST_STATIC_CAPS ("image/x-exr");
@@ -4222,6 +4237,7 @@ pnm_type_find (GstTypeFind * tf, gpointer ununsed)
   }
 }
 
+#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))
@@ -4275,7 +4291,7 @@ ircam_type_find (GstTypeFind * tf, gpointer ununsed)
     }
   }
 }
-
+#endif
 /*** Matroska/WebM ***/
 
 #define EBML_HEADER           0x1A45DFA3
@@ -4534,6 +4550,7 @@ matroska_type_find (GstTypeFind * tf, gpointer ununsed)
 }
 
 /*** application/mxf ***/
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
 static GstStaticCaps mxf_caps = GST_STATIC_CAPS ("application/mxf");
 
 #define MXF_MAX_PROBE_LENGTH (1024 * 64)
@@ -4613,7 +4630,7 @@ dv_type_find (GstTypeFind * tf, gpointer private)
         "format", G_TYPE_STRING, format, NULL);
   }
 }
-
+#endif
 
 /*** Ogg variants ***/
 static GstStaticCaps ogg_caps =
@@ -4792,6 +4809,7 @@ theora_type_find (GstTypeFind * tf, gpointer private)
   }
 }
 
+#ifndef TIZEN_FEATURE_DISABLE_MIME_TYPES
 /*** kate ***/
 static void
 kate_type_find (GstTypeFind * tf, gpointer private)
@@ -4820,6 +4838,7 @@ kate_type_find (GstTypeFind * tf, gpointer private)
         "application/x-kate", NULL);
   }
 }
+#endif
 
 /*** WEBVTTT subtitles ***/
 static GstStaticCaps webvtt_caps =
@@ -4856,6 +4875,7 @@ webvtt_type_find (GstTypeFind * tf, gpointer private)
   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 =
@@ -5055,6 +5075,7 @@ ar_type_find (GstTypeFind * tf, gpointer unused)
     gst_type_find_suggest (tf, GST_TYPE_FIND_NEARLY_CERTAIN, AR_CAPS);
   }
 }
+#endif
 
 /*** audio/x-au ***/
 
@@ -5100,6 +5121,7 @@ nuv_type_find (GstTypeFind * tf, gpointer unused)
   }
 }
 
+#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");
@@ -5323,7 +5345,7 @@ vivo_type_find (GstTypeFind * tf, gpointer unused)
     gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, VIVO_CAPS);
   }
 }
-
+#endif
 /*** XDG MIME typefinder (to avoid false positives mostly) ***/
 
 #ifdef USE_GIO
@@ -5381,7 +5403,7 @@ xdgmime_typefind (GstTypeFind * find, gpointer user_data)
 #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)
 {
@@ -5546,6 +5568,7 @@ y4m_typefind (GstTypeFind * tf, gpointer private)
         "application/x-yuv4mpeg", "y4mversion", G_TYPE_INT, 2, NULL);
   }
 }
+#endif
 
 /*** DVD ISO images (looks like H.264, see #674069) ***/
 static void
@@ -5841,6 +5864,7 @@ plugin_init (GstPlugin * plugin)
       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,
@@ -5848,6 +5872,7 @@ plugin_init (GstPlugin * plugin)
   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,
@@ -5865,29 +5890,37 @@ plugin_init (GstPlugin * plugin)
       "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,
@@ -5913,6 +5946,7 @@ plugin_init (GstPlugin * plugin)
       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,
@@ -5924,13 +5958,16 @@ plugin_init (GstPlugin * plugin)
 
   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",
@@ -5946,24 +5983,29 @@ plugin_init (GstPlugin * plugin)
       "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,
@@ -5984,6 +6026,7 @@ plugin_init (GstPlugin * plugin)
       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",
@@ -5992,16 +6035,19 @@ plugin_init (GstPlugin * plugin)
       "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,
@@ -6009,10 +6055,12 @@ plugin_init (GstPlugin * plugin)
       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,
@@ -6039,6 +6087,7 @@ plugin_init (GstPlugin * plugin)
       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,
@@ -6047,6 +6096,7 @@ plugin_init (GstPlugin * plugin)
       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,
@@ -6063,8 +6113,10 @@ plugin_init (GstPlugin * plugin)
       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,
@@ -6115,10 +6167,12 @@ plugin_init (GstPlugin * plugin)
   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);
@@ -6128,14 +6182,17 @@ plugin_init (GstPlugin * plugin)
       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);
 
@@ -6150,11 +6207,12 @@ plugin_init (GstPlugin * plugin)
 
   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;
 }
old mode 100644 (file)
new mode 100755 (executable)
index 7bbfe7f..6867330
@@ -7,6 +7,8 @@ libgstvideoconvert_la_CFLAGS = \
        $(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)
index afd1eba..eab0e3b 100644 (file)
 #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);
@@ -86,13 +90,20 @@ enum
 };
 
 #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 =
@@ -113,6 +124,13 @@ static gboolean gst_video_convert_set_info (GstVideoFilter * filter,
 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)
@@ -502,6 +520,14 @@ gst_video_convert_finalize (GObject * obj)
 {
   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);
   }
@@ -548,6 +574,11 @@ gst_video_convert_class_init (GstVideoConvertClass * klass)
   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,
@@ -596,6 +627,9 @@ gst_video_convert_class_init (GstVideoConvertClass * klass)
 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;
@@ -716,6 +750,75 @@ gst_video_convert_transform_frame (GstVideoFilter * filter,
   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)
 {
index a8a5863..c81bc4b 100644 (file)
@@ -57,6 +57,9 @@ struct _GstVideoConvert {
   GstVideoPrimariesMode primaries_mode;
   gdouble alpha_value;
   gint n_threads;
+#ifdef USE_TBM  
+  GstBufferPool *pool;
+#endif  
 };
 
 struct _GstVideoConvertClass
diff --git a/gst/videoscale/.gitignore b/gst/videoscale/.gitignore
deleted file mode 100644 (file)
index 08f5ed3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-Makefile
-Makefile.in
-*.o
-*.lo
-*.la
-.deps
-.libs
diff --git a/gst/videotestsrc/.gitignore b/gst/videotestsrc/.gitignore
deleted file mode 100644 (file)
index 24c1bf2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-generate_sine_table
diff --git a/gst/volume/.gitignore b/gst/volume/.gitignore
deleted file mode 100644 (file)
index 1549b67..0000000
+++ /dev/null
@@ -1 +0,0 @@
-demo
index fc10191..5bdaad4 100644 (file)
@@ -795,7 +795,10 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
 
   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);
   }
diff --git a/m4/.gitignore b/m4/.gitignore
deleted file mode 100644 (file)
index ae2f6d8..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-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
diff --git a/packaging/common.tar.gz b/packaging/common.tar.gz
new file mode 100644 (file)
index 0000000..16dbe65
Binary files /dev/null and b/packaging/common.tar.gz differ
diff --git a/packaging/gst-plugins-base.spec b/packaging/gst-plugins-base.spec
new file mode 100644 (file)
index 0000000..ee23afd
--- /dev/null
@@ -0,0 +1,187 @@
+%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
diff --git a/pkgconfig/.gitignore b/pkgconfig/.gitignore
deleted file mode 100644 (file)
index 6fd0ef0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.pc
index af96773..569db50 100644 (file)
@@ -13,5 +13,5 @@ Requires: gstreamer-@GST_API_VERSION@ gstreamer-base-@GST_API_VERSION@
 Requires.private: @ORC_PC@
 Version: @VERSION@
 Libs: -L${libdir} -lgstvideo-@GST_API_VERSION@
-Cflags: -I${includedir}
+Cflags: -I${includedir} -DTIZEN_FEATURE_WAYLAND_ENHANCEMENT
 
diff --git a/tools/.gitignore b/tools/.gitignore
deleted file mode 100644 (file)
index 2a374d3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-gst-device-monitor-?.0
-gst-discoverer-?.0
-gst-play-?.0