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 /** 29 * GstVideoMultiviewFlagsSet: 30 * 31 * See #GstVideoMultiviewFlags. 32 */ 33 #define GST_TYPE_VIDEO_MULTIVIEW_FLAGSET (gst_video_multiview_flagset_get_type()) 34 GST_VIDEO_API 35 GType gst_video_multiview_flagset_get_type (void); 36 37 GST_VIDEO_API 38 const gchar * gst_video_multiview_mode_to_caps_string (GstVideoMultiviewMode mview_mode); 39 40 GST_VIDEO_API 41 GstVideoMultiviewMode gst_video_multiview_mode_from_caps_string (const gchar * caps_mview_mode); 42 43 GST_VIDEO_API 44 const GValue *gst_video_multiview_get_mono_modes(void); 45 46 GST_VIDEO_API 47 const GValue *gst_video_multiview_get_unpacked_modes(void); 48 49 GST_VIDEO_API 50 const GValue *gst_video_multiview_get_doubled_height_modes(void); 51 52 GST_VIDEO_API 53 const GValue *gst_video_multiview_get_doubled_width_modes(void); 54 55 GST_VIDEO_API 56 const GValue *gst_video_multiview_get_doubled_size_modes(void); 57 58 GST_VIDEO_API 59 void gst_video_multiview_video_info_change_mode (GstVideoInfo *info, 60 GstVideoMultiviewMode out_mview_mode, GstVideoMultiviewFlags out_mview_flags); 61 62 GST_VIDEO_API 63 gboolean gst_video_multiview_guess_half_aspect (GstVideoMultiviewMode mv_mode, 64 guint width, guint height, guint par_n, guint par_d); 65 66 67 #if 0 /* Place-holder for later MVC support */ 68 #define GST_VIDEO_MULTIVIEW_META_API_TYPE (gst_video_multiview_meta_api_get_type()) 69 #define GST_VIDEO_MULTIVIEW_META_INFO (gst_video_multiview_meta_get_info()) 70 71 typedef struct _GstVideoMultiviewMeta GstVideoMultiviewMeta; 72 typedef struct _GstVideoMultiviewViewInfo GstVideoMultiviewViewInfo; 73 74 GType gst_video_multiview_meta_api_get_type (void); 75 const GstMetaInfo * gst_video_multiview_meta_get_info (void); 76 77 GstVideoMultiviewMeta * gst_buffer_add_video_multiview_meta (GstBuffer *buffer, guint n_views); 78 #define gst_buffer_get_video_multiview_meta(b) ((GstVideoMultiviewMeta *)gst_buffer_get_meta((b),GST_VIDEO_MULTIVIEW_META_API_TYPE)) 79 80 void gst_video_multiview_meta_set_n_views (GstVideoMultiviewMeta *mview_meta, guint n_views); 81 82 typedef enum { 83 GST_VIDEO_MULTIVIEW_VIEW_UNKNOWN = 0, 84 GST_VIDEO_MULTIVIEW_VIEW_MONO = 1, 85 GST_VIDEO_MULTIVIEW_VIEW_LEFT = 2, 86 GST_VIDEO_MULTIVIEW_VIEW_RIGHT = 3 87 } GstVideoMultiviewViewLabel; 88 89 struct _GstVideoMultiviewViewInfo { 90 GstVideoMultiviewViewLabel view_label; 91 92 guint meta_id; /* id of the GstVideoMeta for this view */ 93 94 /*< private >*/ 95 gpointer _gst_reserved[GST_PADDING]; 96 }; 97 98 struct _GstVideoMultiviewMeta { 99 GstMeta meta; 100 101 guint n_views; 102 GstVideoMultiviewViewInfo *view_info; 103 }; 104 #endif 105 106 G_END_DECLS 107 108 #endif 109