Debian Codegraph @

gstreamer/src/videoinfo.hg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2008-2016 The gstreamermm Development Team
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 #include <gstreamermm/caps.h>
21 #include <gstreamermm/videoformat.h>
22 #include <gstreamermm/format.h>
23 #include <gstreamermm/videochroma.h>
24 #include <gst/video/video-info.h>
25
26 _DEFS(gstreamermm,gst)
27
28 namespace Gst
29 {
30
31 _WRAP_ENUM(VideoInterlaceMode, GstVideoInterlaceMode)
32 _WRAP_ENUM(VideoMultiviewMode, GstVideoMultiviewMode)
33 _WRAP_ENUM(VideoMultiviewFramePacking, GstVideoMultiviewFramePacking)
34 _WRAP_ENUM(VideoMultiviewFlags, GstVideoMultiviewFlags)
35 _WRAP_ENUM(VideoFlags, GstVideoFlags)
36
37 /** Information describing image properties. This information can be filled
38 * in from Gst::Caps with from_caps(). The information is also used
39 * to store the specific video info when mapping a video frame with
40 * VideoFrame::map().
41 *
42 * Last reviewed on 2016-09-14 (1.8.0).
43 */
44 class VideoInfo
45 {
46 _CLASS_GENERIC(VideoInfo, GstVideoInfo)
47 _IGNORE(gst_video_info_free)
48 _IGNORE(gst_video_info_copy)
49 public:
50 VideoInfo();
51 VideoInfo(const VideoInfo& other);
52 VideoInfo& operator=(const VideoInfo& other);
53
54 /** This constructor allows to wrap both dynamic and static allocated
55 * GstVideoInfo object. If castitem is either static allocated or
56 * dynamic allocated, but will be freed somewhere else, @a take_ownership
57 * should be set to false. If @a take_ownership is set to true, castitem
58 * is freed in VideoInfo destructor.
59 */
60 VideoInfo(GstVideoInfo* castitem, bool take_ownership);
61 ~VideoInfo();
62
63 GstVideoInfo* gobj() { return gobject_; }
64 const GstVideoInfo* gobj() const { return gobject_; }
65
66 _WRAP_METHOD(void init(), gst_video_info_init)
67 _WRAP_METHOD(void set_format(Gst::VideoFormat format, guint width, guint height), gst_video_info_set_format)
68 _WRAP_METHOD(bool from_caps(const Glib::RefPtr<const Gst::Caps>& caps), gst_video_info_from_caps)
69 _WRAP_METHOD(Glib::RefPtr<Gst::Caps> to_caps() const, gst_video_info_to_caps);
70 _WRAP_METHOD(bool convert(Gst::Format src_format, gint64 src_value, Gst::Format dest_format, gint64& dest_value), gst_video_info_convert)
71 _WRAP_METHOD(bool is_equal(const Gst::VideoInfo& other) const, gst_video_info_is_equal)
72
73 _MEMBER_GET(finfo, finfo, const VideoFormatInfo, const GstVideoFormatInfo*)
74
75 _MEMBER_GET(interlace_mode, interlace_mode, Gst::VideoInterlaceMode, GstVideoInterlaceMode)
76 _MEMBER_SET(interlace_mode, interlace_mode, Gst::VideoInterlaceMode, GstVideoInterlaceMode)
77
78 _MEMBER_GET(flags, flags, Gst::VideoFlags, GstVideoFlags)
79 _MEMBER_SET(flags, flags, Gst::VideoFlags, GstVideoFlags)
80
81 _MEMBER_GET(width, width, gint, gint)
82 _MEMBER_SET(width, width, gint, gint)
83
84 _MEMBER_GET(height, height, gint, gint)
85 _MEMBER_SET(height, height, gint, gint)
86
87 _MEMBER_GET(size, size, gsize, gsize)
88 _MEMBER_SET(size, size, gsize, gsize)
89
90 _MEMBER_GET(views, views, gint, gint)
91 _MEMBER_SET(views, views, gint, gint)
92
93 _MEMBER_GET(chroma_site, chroma_site, Gst::VideoChromaSite, GstVideoChromaSite)
94 _MEMBER_SET(chroma_site, chroma_site, Gst::VideoChromaSite, GstVideoChromaSite)
95
96 _MEMBER_GET(par_n, par_n, gint, gint)
97 _MEMBER_SET(par_n, par_n, gint, gint)
98
99 _MEMBER_GET(par_d, par_d, gint, gint)
100 _MEMBER_SET(par_d, par_d, gint, gint)
101
102 _MEMBER_GET(fps_n, fps_n, gint, gint)
103 _MEMBER_SET(fps_n, fps_n, gint, gint)
104
105 _MEMBER_GET(fps_d, fps_d, gint, gint)
106 _MEMBER_SET(fps_d, fps_d, gint, gint)
107
108 _MEMBER_GET(multiview_mode, ABI.abi.multiview_mode, Gst::VideoMultiviewMode, GstVideoMultiviewMode)
109 _MEMBER_SET(multiview_mode, ABI.abi.multiview_mode, Gst::VideoMultiviewMode, GstVideoMultiviewMode)
110
111 _MEMBER_GET(multiview_flags, ABI.abi.multiview_flags, Gst::VideoMultiviewFlags, GstVideoMultiviewFlags)
112 _MEMBER_SET(multiview_flags, ABI.abi.multiview_flags, Gst::VideoMultiviewFlags, GstVideoMultiviewFlags)
113
114 private:
115 GstVideoInfo* gobject_;
116 bool take_ownership;
117 };
118
119 }