Added vp9 but not enabled with firmware not supported 37/124937/1
authorSejun Park <sejun79.park@samsung.com>
Thu, 13 Apr 2017 05:43:41 +0000 (14:43 +0900)
committerSejun Park <sejun79.park@samsung.com>
Thu, 13 Apr 2017 05:43:41 +0000 (14:43 +0900)
Change-Id: I254f60ba991a56c7339d36a9f83e552e34bac37b

config/exynos/gstomx.conf
configure.ac
omx/Makefile.am
omx/gstomx.c
omx/gstomxvp9dec.c [new file with mode: 0644]
omx/gstomxvp9dec.h [new file with mode: 0644]
omx/openmax/OMX_VideoExt.h
packaging/gst-omx.spec [changed mode: 0755->0644]

index 7b8f522..c667b34 100644 (file)
@@ -64,6 +64,17 @@ in-port-usebuffer=0
 out-port-usebuffer=1
 hacks=no-component-role;no-disable-outport;no-component-reconfigure
 
+[omxdec_vp9]
+type-name=GstOMXVP9Dec
+core-name=/usr/lib/libExynosOMX_Core.so
+component-name=OMX.Exynos.VP9.Decoder
+rank=258
+in-port-index=0
+out-port-index=1
+in-port-usebuffer=0
+out-port-usebuffer=1
+hacks=no-component-role;no-disable-outport;no-component-reconfigure
+
 [omxdec_vc1]
 type-name=GstOMXWMVDec
 core-name=/usr/lib/libExynosOMX_Core.so
index d40f035..ce0b213 100644 (file)
@@ -204,6 +204,23 @@ if test "x$HAVE_VP8" = "xyes"; then
   AC_DEFINE(HAVE_VP8, 1, [OpenMAX IL has VP8 support])
 fi
 
+dnl check for supporting vp9
+AC_MSG_CHECKING([for supporting vp9])
+AC_ARG_ENABLE(vp9, AC_HELP_STRING([--enable-vp9], [OpenMAX IL has VP9 support]),
+  [
+    case "${enableval}" in
+      yes) HAVE_VP9=yes ;;
+      no)  HAVE_VP9=no ;;
+      *)   AC_MSG_ERROR(bad value ${enableval} for --enable-vp9) ;;
+    esac
+  ],
+  [HAVE_VP9=no])
+AM_CONDITIONAL(HAVE_VP9, test "x$HAVE_VP9" = "xyes")
+AC_MSG_RESULT([$HAVE_VP9])
+if test "x$HAVE_VP9" = "xyes"; then
+  AC_DEFINE(HAVE_VP9, 1, [OpenMAX IL has VP9 support])
+fi
+
 dnl check for supporting theora
 AC_MSG_CHECKING([for supporting theora])
 AC_ARG_ENABLE(theora, AC_HELP_STRING([--enable-theora], [OpenMAX IL has Theora support]),
index c2857f4..ad740bf 100644 (file)
@@ -5,6 +5,11 @@ VP8_C_FILES=gstomxvp8dec.c
 VP8_H_FILES=gstomxvp8dec.h
 endif
 
+if HAVE_VP9
+VP9_C_FILES=gstomxvp9dec.c
+VP9_H_FILES=gstomxvp9dec.h
+endif
+
 if HAVE_THEORA
 THEORA_C_FILES=gstomxtheoradec.c
 THEORA_H_FILES=gstomxtheoradec.h
@@ -30,6 +35,7 @@ libgstomx_la_SOURCES = \
        gstomxh263dec.c \
        gstomxwmvdec.c \
        $(VP8_C_FILES) \
+       $(VP9_C_FILES) \
        $(THEORA_C_FILES) \
        $(HEVC_C_FILES) \
        gstomxmpeg4videoenc.c \
@@ -58,6 +64,7 @@ noinst_HEADERS = \
        gstomxh263dec.h \
        gstomxwmvdec.h \
        $(VP8_H_FILES) \
+       $(VP9_H_FILES) \
        $(THEORA_H_FILES) \
        $(HEVC_H_FILES) \
        gstomxmpeg4videoenc.h \
index 54864e9..4f263e5 100644 (file)
@@ -35,6 +35,7 @@
 #include "gstomxh264dec.h"
 #include "gstomxh263dec.h"
 #include "gstomxvp8dec.h"
+#include "gstomxvp9dec.h"
 #include "gstomxtheoradec.h"
 #include "gstomxwmvdec.h"
 #include "gstomxmpeg4videoenc.h"
@@ -2429,6 +2430,9 @@ static const GGetTypeFunction types[] = {
 #ifdef HAVE_VP8
       , gst_omx_vp8_dec_get_type
 #endif
+#ifdef HAVE_VP9
+      , gst_omx_vp9_dec_get_type
+#endif
 #ifdef HAVE_HEVC
       , gst_omx_h265_dec_get_type
 #endif
diff --git a/omx/gstomxvp9dec.c b/omx/gstomxvp9dec.c
new file mode 100644 (file)
index 0000000..1989929
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *   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 Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * 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
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst.h>
+
+#include "gstomxvp9dec.h"
+
+GST_DEBUG_CATEGORY_STATIC (gst_omx_vp9_dec_debug_category);
+#define GST_CAT_DEFAULT gst_omx_vp9_dec_debug_category
+
+/* prototypes */
+static gboolean gst_omx_vp9_dec_is_format_change (GstOMXVideoDec * dec,
+    GstOMXPort * port, GstVideoCodecState * state);
+static gboolean gst_omx_vp9_dec_set_format (GstOMXVideoDec * dec,
+    GstOMXPort * port, GstVideoCodecState * state);
+
+enum
+{
+  PROP_0
+};
+
+/* class initialization */
+
+#define DEBUG_INIT \
+  GST_DEBUG_CATEGORY_INIT (gst_omx_vp9_dec_debug_category, "omxvp9dec", 0, \
+      "debug category for gst-omx video decoder base class");
+
+G_DEFINE_TYPE_WITH_CODE (GstOMXVP9Dec, gst_omx_vp9_dec,
+    GST_TYPE_OMX_VIDEO_DEC, DEBUG_INIT);
+
+static void
+gst_omx_vp9_dec_class_init (GstOMXVP9DecClass * klass)
+{
+  GstOMXVideoDecClass *videodec_class = GST_OMX_VIDEO_DEC_CLASS (klass);
+  GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
+
+  videodec_class->is_format_change =
+      GST_DEBUG_FUNCPTR (gst_omx_vp9_dec_is_format_change);
+  videodec_class->set_format = GST_DEBUG_FUNCPTR (gst_omx_vp9_dec_set_format);
+
+  videodec_class->cdata.default_sink_template_caps = "video/x-vp9, "
+      "width=(int) [1,MAX], " "height=(int) [1,MAX]";
+
+  gst_element_class_set_static_metadata (element_class,
+      "OpenMAX VP9 Video Decoder",
+      "Codec/Decoder/Video",
+      "Decode VP9 video streams",
+      "Sejun Park <sejun79.park@samsung.com>");
+
+  gst_omx_set_default_role (&videodec_class->cdata, "video_decoder.vp9");
+}
+
+static void
+gst_omx_vp9_dec_init (GstOMXVP9Dec * self)
+{
+}
+
+static gboolean
+gst_omx_vp9_dec_is_format_change (GstOMXVideoDec * dec,
+    GstOMXPort * port, GstVideoCodecState * state)
+{
+  return FALSE;
+}
+
+static gboolean
+gst_omx_vp9_dec_set_format (GstOMXVideoDec * dec, GstOMXPort * port,
+    GstVideoCodecState * state)
+{
+  gboolean ret;
+  OMX_PARAM_PORTDEFINITIONTYPE port_def;
+
+  gst_omx_port_get_port_definition (port, &port_def);
+  port_def.format.video.eCompressionFormat = OMX_VIDEO_CodingVP9;
+  ret = gst_omx_port_update_port_definition (port, &port_def) == OMX_ErrorNone;
+
+  return ret;
+}
diff --git a/omx/gstomxvp9dec.h b/omx/gstomxvp9dec.h
new file mode 100644 (file)
index 0000000..b57651d
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
+ *   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 Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * 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
+ *
+ */
+
+#ifndef __GST_OMX_VP9_DEC_H__
+#define __GST_OMX_VP9_DEC_H__
+
+#include <gst/gst.h>
+#include "gstomxvideodec.h"
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_OMX_VP9_DEC \
+  (gst_omx_vp9_dec_get_type())
+#define GST_OMX_VP9_DEC(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OMX_VP9_DEC,GstOMXVP9Dec))
+#define GST_OMX_VP9_DEC_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OMX_VP9_DEC,GstOMXVP9DecClass))
+#define GST_OMX_VP9_DEC_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OMX_VP9_DEC,GstOMXVP9DecClass))
+#define GST_IS_OMX_VP9_DEC(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OMX_VP9_DEC))
+#define GST_IS_OMX_VP9_DEC_CLASS(obj) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OMX_VP9_DEC))
+
+typedef struct _GstOMXVP9Dec GstOMXVP9Dec;
+typedef struct _GstOMXVP9DecClass GstOMXVP9DecClass;
+
+struct _GstOMXVP9Dec
+{
+  GstOMXVideoDec parent;
+};
+
+struct _GstOMXVP9DecClass
+{
+  GstOMXVideoDecClass parent_class;
+};
+
+GType gst_omx_vp9_dec_get_type (void);
+
+G_END_DECLS
+
+#endif /* __GST_OMX_VP9_DEC_H__ */
+
index 30ea88e..5fdbfbf 100644 (file)
@@ -62,6 +62,7 @@ typedef struct OMX_NALSTREAMFORMATTYPE{
 typedef enum OMX_VIDEO_CODINGEXTTYPE {\r
     OMX_VIDEO_ExtCodingUnused = OMX_VIDEO_CodingKhronosExtensions,\r
     OMX_VIDEO_CodingVP8,        /**< VP8/WebM */\r
+    OMX_VIDEO_CodingVP9,        /**< VP9/WebM */\r
     OMX_VIDEO_CodingHEVC,       /**< ITU H.265/HEVC */\r
 } OMX_VIDEO_CODINGEXTTYPE;\r
 \r
@@ -155,6 +156,36 @@ typedef enum OMX_VIDEO_HEVCLEVELTYPE {
     OMX_VIDEO_HEVCHighTiermax     = 0x7FFFFFFF\r
 } OMX_VIDEO_HEVCLEVELTYPE;\r
 \r
+/** VP9 profiles */\r
+typedef enum OMX_VIDEO_VP9PROFILETYPE {\r
+    OMX_VIDEO_VP9Profile0 = 0x0,\r
+    OMX_VIDEO_VP9Profile1 = 0x1,\r
+    OMX_VIDEO_VP9Profile2 = 0x2,\r
+    OMX_VIDEO_VP9Profile3 = 0x3,\r
+    OMX_VIDEO_VP9ProfileUnknown = 0x6EFFFFFF,\r
+    OMX_VIDEO_VP9ProfileMax = 0x7FFFFFFF\r
+} OMX_VIDEO_VP9PROFILETYPE;\r
+\r
+/** VP9 levels */\r
+typedef enum OMX_VIDEO_VP9LEVELTYPE {\r
+    OMX_VIDEO_VP9Level1  = 0x0,\r
+    OMX_VIDEO_VP9Level11 = 0x1,\r
+    OMX_VIDEO_VP9Level2  = 0x2,\r
+    OMX_VIDEO_VP9Level21 = 0x4,\r
+    OMX_VIDEO_VP9Level3  = 0x8,\r
+    OMX_VIDEO_VP9Level31 = 0x10,\r
+    OMX_VIDEO_VP9Level4  = 0x20,\r
+    OMX_VIDEO_VP9Level41 = 0x40,\r
+    OMX_VIDEO_VP9Level5  = 0x80,\r
+    OMX_VIDEO_VP9Level51 = 0x100,\r
+    OMX_VIDEO_VP9Level52 = 0x200,\r
+    OMX_VIDEO_VP9Level6  = 0x400,\r
+    OMX_VIDEO_VP9Level61 = 0x800,\r
+    OMX_VIDEO_VP9Level62 = 0x1000,\r
+    OMX_VIDEO_VP9LevelUnknown = 0x6EFFFFFF,\r
+    OMX_VIDEO_VP9LevelMax = 0x7FFFFFFF\r
+} OMX_VIDEO_VP9LEVELTYPE;\r
+\r
 /** Structure for controlling HEVC video encoding and decoding */\r
 typedef struct OMX_VIDEO_PARAM_HEVCTYPE {\r
     OMX_U32 nSize;\r
old mode 100755 (executable)
new mode 100644 (file)