Debian Codegraph @

gstreamer/src/videosink.hg

raw
1 /* gstreamermm - a C++ wrapper for gstreamer
2 *
3 * Copyright 2008 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/basesink.h>
21
22 _DEFS(gstreamermm,gst)
23
24 namespace Gst
25 {
26
27 /** A helper structure for the Gst::VideoSink class representing a rectangular
28 * area.
29 */
30 struct VideoRectangle
31 {
32 /// The X coordinate of the rectangle's top-left point.
33 int x;
34
35 /// The Y coordinate of rectangle's top-left point.
36 int y;
37
38 /// The width of the rectangle.
39 int w;
40
41 /// The height of the rectangle.
42 int h;
43 };
44
45 /** A base class for video sinks.
46 * Gst::VideoSink provides useful functions and a base class for video sinks.
47 *
48 * Gst::VideoSink will configure the default base sink to drop frames that
49 * arrive later than 20ms as this is considered the default threshold for
50 * observing out-of-sync frames.
51 *
52 * @ingroup GstBaseClasses
53 */
54 class VideoSink : public Gst::BaseSink
55 {
56 _CLASS_GOBJECT(VideoSink, GstVideoSink, GST_VIDEO_SINK, Gst::BaseSink, GstBaseSink)
57
58 public:
59 /** Get height of Gst::VideoSink.
60 */
61 _MEMBER_GET(height, height, int, gint)
62
63 /** Get width of Gst::VideoSink.
64 */
65 _MEMBER_GET(width, width, int, gint)
66
67 #m4 _CONVERSION(`const Gst::VideoRectangle&', `GstVideoRectangle', `reinterpret_cast<const $2&>($3)')
68 #m4 _CONVERSION(`Gst::VideoRectangle&', `GstVideoRectangle*', `reinterpret_cast<GstVideoRectangle*>(&$3)')
69 _WRAP_METHOD(static void center_rect(const Gst::VideoRectangle& src, const Gst::VideoRectangle& dst, Gst::VideoRectangle& result, bool scaling = false), gst_video_sink_center_rect)
70
71 _WRAP_PROPERTY("show-preroll-frame", bool)
72 };
73
74 } // namespace Gst