1 /* GStreamer 2 * Copyright (C) <2015> Jan Schmidt <jan@centricular.com> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef __GST_VIDEO_MULTIVIEW_H__ 21 #define __GST_VIDEO_MULTIVIEW_H__ 22 23 #include <gst/gst.h> 24 #include <gst/video/video-prelude.h> 25 26 G_BEGIN_DECLS 27 28 #define GST_TYPE_VIDEO_MULTIVIEW_FLAGSET (gst_video_multiview_flagset_get_type()) 29 GST_VIDEO_API 30 GType gst_video_multiview_flagset_get_type (void); 31 32 GST_VIDEO_API 33 const gchar * gst_video_multiview_mode_to_caps_string (GstVideoMultiviewMode mview_mode); 34 35 GST_VIDEO_API 36 GstVideoMultiviewMode gst_video_multiview_mode_from_caps_string (const gchar * caps_mview_mode); 37 38 GST_VIDEO_API 39 const GValue *gst_video_multiview_get_mono_modes(void); 40 41 GST_VIDEO_API 42 const GValue *gst_video_multiview_get_unpacked_modes(void); 43 44 GST_VIDEO_API 45 const GValue *gst_video_multiview_get_doubled_height_modes(void); 46 47 GST_VIDEO_API 48 const GValue *gst_video_multiview_get_doubled_width_modes(void); 49 50 GST_VIDEO_API 51 const GValue *gst_video_multiview_get_doubled_size_modes(void); 52 53 GST_VIDEO_API 54 void gst_video_multiview_video_info_change_mode (GstVideoInfo *info, 55 GstVideoMultiviewMode out_mview_mode, GstVideoMultiviewFlags out_mview_flags); 56 57 GST_VIDEO_API 58 gboolean gst_video_multiview_guess_half_aspect (GstVideoMultiviewMode mv_mode, 59 guint width, guint height, guint par_n, guint par_d); 60 61 62 #if 0 /* Place-holder for later MVC support */ 63 #define GST_VIDEO_MULTIVIEW_META_API_TYPE (gst_video_multiview_meta_api_get_type()) 64 #define GST_VIDEO_MULTIVIEW_META_INFO (gst_video_multiview_meta_get_info()) 65 66 typedef struct _GstVideoMultiviewMeta GstVideoMultiviewMeta; 67 typedef struct _GstVideoMultiviewViewInfo GstVideoMultiviewViewInfo; 68 69 GType gst_video_multiview_meta_api_get_type (void); 70 const GstMetaInfo * gst_video_multiview_meta_get_info (void); 71 72 GstVideoMultiviewMeta * gst_buffer_add_video_multiview_meta (GstBuffer *buffer, guint n_views); 73 #define gst_buffer_get_video_multiview_meta(b) ((GstVideoMultiviewMeta *)gst_buffer_get_meta((b),GST_VIDEO_MULTIVIEW_META_API_TYPE)) 74 75 void gst_video_multiview_meta_set_n_views (GstVideoMultiviewMeta *mview_meta, guint n_views); 76 77 typedef enum { 78 GST_VIDEO_MULTIVIEW_VIEW_UNKNOWN = 0, 79 GST_VIDEO_MULTIVIEW_VIEW_MONO = 1, 80 GST_VIDEO_MULTIVIEW_VIEW_LEFT = 2, 81 GST_VIDEO_MULTIVIEW_VIEW_RIGHT = 3 82 } GstVideoMultiviewViewLabel; 83 84 struct _GstVideoMultiviewViewInfo { 85 GstVideoMultiviewViewLabel view_label; 86 87 guint meta_id; /* id of the GstVideoMeta for this view */ 88 89 /*< private >*/ 90 gpointer _gst_reserved[GST_PADDING]; 91 }; 92 93 struct _GstVideoMultiviewMeta { 94 GstMeta meta; 95 96 guint n_views; 97 GstVideoMultiviewViewInfo *view_info; 98 }; 99 #endif 100 101 G_END_DECLS 102 103 #endif 104