[gstreamermm] Gst::VideoChroma: wrap video-chroma module
- From: Marcin Kolny <mkolny src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gstreamermm] Gst::VideoChroma: wrap video-chroma module
- Date: Mon, 6 Jul 2015 14:48:27 +0000 (UTC)
commit 2fba5a7f3cafaffec4b6bf1ae3b28aede80cb4b9
Author: Marcin Kolny <marcin kolny flytronic pl>
Date: Mon Jul 6 16:41:06 2015 +0200
Gst::VideoChroma: wrap video-chroma module
* .gitignore: add autogenerated files to ignore list.
* gstreamer/src/filelist.am: add videochroma file to build list.
* gstreamer/src/videochroma.{ccg|hg}: add videochroma wrapper.
* gstreamer/src/videoinfo.hg: add chroma_site parameter accessors.
* tools/m4/convert_gst.m4: add VideoChromaSite enum conversion
definition.
.gitignore | 2 +
gstreamer/src/filelist.am | 1 +
gstreamer/src/videochroma.ccg | 57 ++++++++++++++++++++++++++++++++
gstreamer/src/videochroma.hg | 73 +++++++++++++++++++++++++++++++++++++++++
gstreamer/src/videoinfo.hg | 4 ++
tools/m4/convert_gst.m4 | 1 +
6 files changed, 138 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 5309291..18361a8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -198,6 +198,8 @@ gstreamer/gstreamermm/value.cc
gstreamer/gstreamermm/value.h
gstreamer/gstreamermm/valuelist.cc
gstreamer/gstreamermm/valuelist.h
+gstreamer/gstreamermm/videochroma.cc
+gstreamer/gstreamermm/videochroma.h
gstreamer/gstreamermm/videoorientation.cc
gstreamer/gstreamermm/videoorientation.h
gstreamer/gstreamermm/videosink.cc
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index 6670f45..2e243bc 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -149,6 +149,7 @@ files_hg = \
urihandler.hg \
value.hg \
valuelist.hg \
+ videochroma.hg \
videoformat.hg \
videoinfo.hg \
videoorientation.hg \
diff --git a/gstreamer/src/videochroma.ccg b/gstreamer/src/videochroma.ccg
new file mode 100644
index 0000000..5738046
--- /dev/null
+++ b/gstreamer/src/videochroma.ccg
@@ -0,0 +1,57 @@
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008-2015 The gstreamermm Development Team
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gstreamermm/videoformat.h>
+
+namespace Gst
+{
+
+namespace Enums
+{
+
+Glib::ustring get_name(VideoChromaSite site)
+{
+ return gst_video_chroma_to_string(static_cast<GstVideoChromaSite>(site));
+}
+
+VideoChromaSite video_chroma_site_from_string(const Glib::ustring& s)
+{
+ return static_cast<VideoChromaSite>(gst_video_chroma_from_string(s.c_str()));
+}
+
+}
+
+VideoChromaResample::VideoChromaResample(Gst::VideoChromaMethod method, Gst::VideoChromaSite site,
+ Gst::VideoChromaFlags flags, Gst::VideoFormat format, gint h_factor, gint v_factor)
+{
+ gobject_ = gst_video_chroma_resample_new (static_cast<GstVideoChromaMethod>(method),
+ static_cast<GstVideoChromaSite>(site), static_cast<GstVideoChromaFlags>(flags),
+ static_cast<GstVideoFormat>(format), h_factor, v_factor);
+}
+
+VideoChromaResample::VideoChromaResample(GstVideoChromaResample* castitem)
+{
+ gobject_ = castitem;
+}
+
+VideoChromaResample::~VideoChromaResample()
+{
+ gst_video_chroma_resample_free(gobject_);
+}
+}
diff --git a/gstreamer/src/videochroma.hg b/gstreamer/src/videochroma.hg
new file mode 100644
index 0000000..9a9c438
--- /dev/null
+++ b/gstreamer/src/videochroma.hg
@@ -0,0 +1,73 @@
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008-2015 The gstreamermm Development Team
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gst/video/video-chroma.h>
+
+_DEFS(gstreamermm,gst)
+
+namespace Gst
+{
+ _WRAP_ENUM(VideoChromaSite, GstVideoChromaSite)
+ _WRAP_ENUM(VideoChromaMethod, GstVideoChromaMethod)
+ _WRAP_ENUM(VideoChromaFlags, GstVideoChromaFlags)
+
+ _WRAP_METHOD(void get_info(guint& n_lines, gint& offset) const, gst_video_chroma_resample_get_info)
+}
+
+#include <gstreamermm/videoformat.h>
+
+namespace Gst
+{
+
+namespace Enums
+{
+/** Converts @site to its string representation.
+ * @param site A Gst::VideoChromaSite.
+ * @return a string describing @site.
+ */
+Glib::ustring get_name(VideoChromaSite site);
+
+/** Convert @s to a Gst::VideoChromaSite.
+ * @param s A chromasite string.
+ * @return A Gst::VideoChromaSite or Gst::VIDEO_CHROMA_SITE_UNKNOWN when @s does
+ * not contain a valid chroma description.
+ */
+VideoChromaSite video_chroma_site_from_string(const Glib::ustring& s);
+}
+
+class VideoChromaResample
+{
+ _CLASS_GENERIC(VideoChromaResample, GstVideoChromaResample)
+public:
+ VideoChromaResample(Gst::VideoChromaMethod method, Gst::VideoChromaSite site, Gst::VideoChromaFlags flags,
+ Gst::VideoFormat format, gint h_factor, gint v_factor);
+
+ // it takes ownership of castitem
+ explicit VideoChromaResample(GstVideoChromaResample* castitem);
+
+ ~VideoChromaResample();
+
+ GstVideoChromaResample* gobj() { return gobject_; }
+ const GstVideoChromaResample* gobj() const { return gobject_; }
+
+protected:
+ GstVideoChromaResample* gobject_;
+};
+
+}
diff --git a/gstreamer/src/videoinfo.hg b/gstreamer/src/videoinfo.hg
index ad7fc7b..dc86f01 100644
--- a/gstreamer/src/videoinfo.hg
+++ b/gstreamer/src/videoinfo.hg
@@ -20,6 +20,7 @@
#include <gstreamermm/caps.h>
#include <gstreamermm/videoformat.h>
#include <gstreamermm/format.h>
+#include <gstreamermm/videochroma.h>
#include <gst/video/video-info.h>
_DEFS(gstreamermm,gst)
@@ -65,6 +66,9 @@ public:
_MEMBER_GET(views, views, gint, gint)
_MEMBER_SET(views, views, gint, gint)
+ _MEMBER_GET(chroma_site, chroma_site, Gst::VideoChromaSite, GstVideoChromaSite)
+ _MEMBER_SET(chroma_site, chroma_site, Gst::VideoChromaSite, GstVideoChromaSite)
+
_MEMBER_GET(par_n, par_n, gint, gint)
_MEMBER_SET(par_n, par_n, gint, gint)
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index 15d4e90..12ab676 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -57,6 +57,7 @@ _CONV_ENUM(Gst,TocEntryType)
_CONV_ENUM(Gst,TocScope)
_CONV_ENUM(Gst,TunerChannelFlags)
_CONV_ENUM(Gst,URIType)
+_CONV_ENUM(Gst,VideoChromaSite)
_CONV_ENUM(Gst,VideoFlags)
_CONV_ENUM(Gst,VideoFormat)
_CONV_ENUM(Gst,VideoFormatFlags)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]