diff options
author | Xabier Rodriguez Calvar <calvaris@igalia.com> | 2016-07-26 19:14:40 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-08-25 10:19:13 +0300 |
commit | 0341f04ce161e9a09345ffe84036bdb023c4e94f (patch) | |
tree | c3faa0d150d9cc41d3fb41d53b9df4a57a84cc9d | |
parent | 89554f665be585afce96aed1dd553fc761707024 (diff) |
videodirection: interface for rotation and flip
A GstVideoOrientationMethod enumeration is also provided for the
admitted property values.
https://bugzilla.gnome.org/show_bug.cgi?id=768687
-rw-r--r-- | docs/libs/gst-plugins-base-libs-docs.sgml | 1 | ||||
-rw-r--r-- | docs/libs/gst-plugins-base-libs-sections.txt | 15 | ||||
-rw-r--r-- | docs/libs/gst-plugins-base-libs.types | 2 | ||||
-rw-r--r-- | gst-libs/gst/video/Makefile.am | 2 | ||||
-rw-r--r-- | gst-libs/gst/video/video.h | 31 | ||||
-rw-r--r-- | gst-libs/gst/video/videodirection.c | 52 | ||||
-rw-r--r-- | gst-libs/gst/video/videodirection.h | 62 | ||||
-rw-r--r-- | gst-plugins-base.spec.in | 1 | ||||
-rw-r--r-- | tests/check/libs/gstlibscpp.cc | 1 | ||||
-rw-r--r-- | tests/check/libs/libsabi.c | 1 | ||||
-rw-r--r-- | tests/icles/test-header-compile | 2 |
11 files changed, 169 insertions, 1 deletions
diff --git a/docs/libs/gst-plugins-base-libs-docs.sgml b/docs/libs/gst-plugins-base-libs-docs.sgml index 57e240780..7e7a58c99 100644 --- a/docs/libs/gst-plugins-base-libs-docs.sgml +++ b/docs/libs/gst-plugins-base-libs-docs.sgml @@ -209,6 +209,7 @@ <xi:include href="xml/gstvideosink.xml" /> <xi:include href="xml/gstcolorbalance.xml" /> <xi:include href="xml/gstcolorbalancechannel.xml" /> + <xi:include href="xml/gstvideodirection.xml" /> <xi:include href="xml/gstvideoorientation.xml" /> <xi:include href="xml/gstvideooverlay.xml" /> <xi:include href="xml/gstvideodecoder.xml" /> diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 4229f90d7..33e64f832 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -881,6 +881,19 @@ gst_stream_volume_get_type </SECTION> <SECTION> +<FILE>gstvideodirection</FILE> +<INCLUDE>gst/video/videodirection.h</INCLUDE> +GstVideoDirection +GstVideoDirectionInterface +<SUBSECTION Standard> +GST_TYPE_VIDEO_DIRECTION +GST_VIDEO_DIRECTION +GST_IS_VIDEO_DIRECTION +GST_VIDEO_DIRECTION_GET_INTERFACE +gst_video_direction_get_type +</SECTION> + +<SECTION> <FILE>gstvideoorientation</FILE> <INCLUDE>gst/video/videoorientation.h</INCLUDE> GstVideoOrientation @@ -2365,6 +2378,8 @@ GST_META_TAG_VIDEO_ORIENTATION_STR GST_META_TAG_VIDEO_SIZE_STR GST_META_TAG_VIDEO_COLORSPACE_STR +GstVideoOrientationMethod + #video-event.h <SUBSECTION> gst_video_event_new_still_frame diff --git a/docs/libs/gst-plugins-base-libs.types b/docs/libs/gst-plugins-base-libs.types index 6ce1f3626..031229f7e 100644 --- a/docs/libs/gst-plugins-base-libs.types +++ b/docs/libs/gst-plugins-base-libs.types @@ -43,6 +43,8 @@ gst_video_sink_get_type #include <gst/video/colorbalance.h> gst_color_balance_get_type gst_color_balance_channel_get_type +#include <gst/video/videodirection.h> +gst_video_direction_get_type #include <gst/video/videoorientation.h> gst_video_orientation_get_type #include <gst/video/videooverlay.h> diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am index 979bf1760..64f49786d 100644 --- a/gst-libs/gst/video/Makefile.am +++ b/gst-libs/gst/video/Makefile.am @@ -38,6 +38,7 @@ libgstvideo_@GST_API_VERSION@_la_SOURCES = \ gstvideoaffinetransformationmeta.c \ gstvideometa.c \ gstvideopool.c \ + videodirection.c \ videoorientation.c \ videooverlay.c \ gstvideodecoder.c \ @@ -73,6 +74,7 @@ libgstvideo_@GST_API_VERSION@include_HEADERS = \ gstvideometa.h \ gstvideoaffinetransformationmeta.h \ gstvideopool.h \ + videodirection.h \ videoorientation.h \ videooverlay.h \ gstvideodecoder.h \ diff --git a/gst-libs/gst/video/video.h b/gst-libs/gst/video/video.h index 3f2350204..f890eaefe 100644 --- a/gst-libs/gst/video/video.h +++ b/gst-libs/gst/video/video.h @@ -57,6 +57,36 @@ struct _GstVideoAlignment guint stride_align[GST_VIDEO_MAX_PLANES]; }; +/** + * GstVideoOrientationMethod: + * @GST_VIDEO_ORIENTATION_IDENTITY: Identity (no rotation) + * @GST_VIDEO_ORIENTATION_90R: Rotate clockwise 90 degrees + * @GST_VIDEO_ORIENTATION_180: Rotate 180 degrees + * @GST_VIDEO_ORIENTATION_90L: Rotate counter-clockwise 90 degrees + * @GST_VIDEO_ORIENTATION_HORIZ: Flip horizontally + * @GST_VIDEO_ORIENTATION_VERT: Flip vertically + * @GST_VIDEO_ORIENTATION_UL_LR: Flip across upper left/lower right diagonal + * @GST_VIDEO_ORIENTATION_UR_LL: Flip across upper right/lower left diagonal + * @GST_VIDEO_ORIENTATION_AUTO: Select flip method based on image-orientation tag + * @GST_VIDEO_ORIENTATION_CUSTOM: Current status depends on plugin internal setup + * + * The different video orientation methods. + * + * Since: 1.10 + */ +typedef enum { + GST_VIDEO_ORIENTATION_IDENTITY, + GST_VIDEO_ORIENTATION_90R, + GST_VIDEO_ORIENTATION_180, + GST_VIDEO_ORIENTATION_90L, + GST_VIDEO_ORIENTATION_HORIZ, + GST_VIDEO_ORIENTATION_VERT, + GST_VIDEO_ORIENTATION_UL_LR, + GST_VIDEO_ORIENTATION_UR_LL, + GST_VIDEO_ORIENTATION_AUTO, + GST_VIDEO_ORIENTATION_CUSTOM, +} GstVideoOrientationMethod; + /* metadata macros */ /** * GST_META_TAG_VIDEO_STR: @@ -137,6 +167,7 @@ G_END_DECLS #include <gst/video/navigation.h> #include <gst/video/video-blend.h> #include <gst/video/video-event.h> +#include <gst/video/videodirection.h> #include <gst/video/videoorientation.h> #include <gst/video/video-overlay-composition.h> #include <gst/video/videooverlay.h> diff --git a/gst-libs/gst/video/videodirection.c b/gst-libs/gst/video/videodirection.c new file mode 100644 index 000000000..da908a9c2 --- /dev/null +++ b/gst-libs/gst/video/videodirection.c @@ -0,0 +1,52 @@ +/* GStreamer + * Copyright (C) 2016 Igalia <calvaris@igalia.com> + * + * videodirection.c: video rotation and flipping interface + * + * 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., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "video.h" + +#define PROP_DIRECTION_DEFAULT GST_VIDEO_ORIENTATION_IDENTITY + +/** + * SECTION:gstvideodirection + * @short_description: Interface for elements providing video + * rotation and flipping controls + * + * The interface allows unified access to control flipping and rotation + * operations of video-sources or operators. + * + * Since: 1.10 + */ + +G_DEFINE_INTERFACE (GstVideoDirection, gst_video_direction, 0); + +static void +gst_video_direction_default_init (GstVideoDirectionInterface * iface) +{ + g_object_interface_install_property (iface, + g_param_spec_enum ("video-direction", "Video direction", + "Video direction: rotation and flipping", + GST_TYPE_VIDEO_ORIENTATION_METHOD, PROP_DIRECTION_DEFAULT, + GST_PARAM_CONTROLLABLE | G_PARAM_READWRITE | G_PARAM_CONSTRUCT | + G_PARAM_STATIC_STRINGS)); +} diff --git a/gst-libs/gst/video/videodirection.h b/gst-libs/gst/video/videodirection.h new file mode 100644 index 000000000..1428489ed --- /dev/null +++ b/gst-libs/gst/video/videodirection.h @@ -0,0 +1,62 @@ +/* GStreamer + * Copyright (C) 2016 Igalia <calvaris@igalia.com> + * + * videodirection.h: video rotation and flipping interface + * + * 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., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __GST_VIDEO_DIRECTION_H__ +#define __GST_VIDEO_DIRECTION_H__ + +#include <gst/gst.h> + +G_BEGIN_DECLS +#define GST_TYPE_VIDEO_DIRECTION \ + (gst_video_direction_get_type ()) +#define GST_VIDEO_DIRECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VIDEO_DIRECTION, GstVideoDirection)) +#define GST_IS_VIDEO_DIRECTION(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VIDEO_DIRECTION)) +#define GST_VIDEO_DIRECTION_GET_INTERFACE(inst) \ + (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_VIDEO_DIRECTION, GstVideoDirectionInterface)) +/** + * GstVideoDirection: + * + * Opaque #GstVideoDirection data structure. + * + * Since: 1.10 + */ +typedef struct _GstVideoDirection GstVideoDirection; +typedef struct _GstVideoDirectionInterface GstVideoDirectionInterface; + +/** + * GstVideoDirectionInterface: + * @iface: parent interface type. + * + * #GstVideoDirectionInterface interface. + * + * Since: 1.10 + */ +struct _GstVideoDirectionInterface +{ + GTypeInterface iface; +}; + +GType gst_video_direction_get_type (void); + +G_END_DECLS +#endif /* __GST_VIDEO_DIRECTION_H__ */ diff --git a/gst-plugins-base.spec.in b/gst-plugins-base.spec.in index c9613f0cf..47e46e77a 100644 --- a/gst-plugins-base.spec.in +++ b/gst-plugins-base.spec.in @@ -221,6 +221,7 @@ GStreamer Plugins Base library development and header files. %{_includedir}/gstreamer-%{majorminor}/gst/audio/streamvolume.h %{_includedir}/gstreamer-%{majorminor}/gst/video/colorbalance.h %{_includedir}/gstreamer-%{majorminor}/gst/video/colorbalancechannel.h +%{_includedir}/gstreamer-%{majorminor}/gst/video/videodirection.h %{_includedir}/gstreamer-%{majorminor}/gst/video/videoorientation.h %{_includedir}/gstreamer-%{majorminor}/gst/video/videooverlay.h %{_includedir}/gstreamer-%{majorminor}/gst/app/app.h diff --git a/tests/check/libs/gstlibscpp.cc b/tests/check/libs/gstlibscpp.cc index 5a84ea3e0..049cac835 100644 --- a/tests/check/libs/gstlibscpp.cc +++ b/tests/check/libs/gstlibscpp.cc @@ -89,6 +89,7 @@ #include <gst/video/video.h> #include <gst/video/colorbalancechannel.h> #include <gst/video/colorbalance.h> +#include <gst/video/videodirection.h> #include <gst/video/videoorientation.h> #include <gst/video/videooverlay.h> #include <gst/video/navigation.h> diff --git a/tests/check/libs/libsabi.c b/tests/check/libs/libsabi.c index 508406ad5..316826e45 100644 --- a/tests/check/libs/libsabi.c +++ b/tests/check/libs/libsabi.c @@ -62,6 +62,7 @@ #include <gst/video/gstvideofilter.h> #include <gst/video/gstvideosink.h> #include <gst/video/colorbalance.h> +#include <gst/video/videodirection.h> #include <gst/video/videoorientation.h> #include <gst/video/videooverlay.h> #include <gst/video/navigation.h> diff --git a/tests/icles/test-header-compile b/tests/icles/test-header-compile index 1e1ffcc8d..02a17b5c3 100644 --- a/tests/icles/test-header-compile +++ b/tests/icles/test-header-compile @@ -48,7 +48,7 @@ for lib in allocators app audio fft pbutils riff rtp rtsp sdp tag video ; do video-info.h video-frame.h gstvideosink.h gstvideofilter.h \ gstvideometa.h gstvideopool.h videoorientation.h videooverlay.h \ gstvideodecoder.h gstvideoencoder.h gstvideoutils.h \ - video-blend.h video-overlay-composition.h" + video-blend.h video-overlay-composition.h videodirection.h" fi CFLAGS=`pkg-config --cflags gstreamer-1.0 gstreamer-$lib-1.0` |