3 * Copyright (C) 2011 David Schleef <ds@schleef.org>
4 * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com>
5 * Copyright (C) 2015 Florian Langlois <florian.langlois@fr.thalesgroup.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
23 #ifndef __GST_DECKLINK_VIDEO_SRC_H__
24 #define __GST_DECKLINK_VIDEO_SRC_H__
27 #include <gst/base/base.h>
28 #include <gst/video/video.h>
29 #include "gstdecklink.h"
33 #define GST_TYPE_DECKLINK_VIDEO_SRC \
34 (gst_decklink_video_src_get_type())
35 #define GST_DECKLINK_VIDEO_SRC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_DECKLINK_VIDEO_SRC, GstDecklinkVideoSrc))
37 #define GST_DECKLINK_VIDEO_SRC_CAST(obj) \
38 ((GstDecklinkVideoSrc*)obj)
39 #define GST_DECKLINK_VIDEO_SRC_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_DECKLINK_VIDEO_SRC, GstDecklinkVideoSrcClass))
41 #define GST_IS_DECKLINK_VIDEO_SRC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_DECKLINK_VIDEO_SRC))
43 #define GST_IS_DECKLINK_VIDEO_SRC_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_DECKLINK_VIDEO_SRC))
46 typedef struct _GstDecklinkVideoSrc GstDecklinkVideoSrc;
47 typedef struct _GstDecklinkVideoSrcClass GstDecklinkVideoSrcClass;
52 SIGNAL_STATE_AVAILABLE,
53 } GstDecklinkSignalState;
55 struct _GstDecklinkVideoSrc
59 GstDecklinkModeEnum mode;
60 GstDecklinkModeEnum caps_mode;
61 gint aspect_ratio_flag; /* -1 when unknown, 0 not set, 1 set */
62 BMDPixelFormat caps_format;
63 GstDecklinkConnectionEnum connection;
65 gboolean output_stream_time;
66 GstClockTime skip_first_time;
67 gboolean drop_no_signal_frames;
68 GstClockTime expected_stream_time;
71 guint64 first_stream_time;
74 GstDecklinkVideoFormat video_format;
75 GstDecklinkProfileId profile_id;
76 BMDTimecodeFormat timecode_format;
78 GstDecklinkInput *input;
83 GstQueueArray *current_frames;
84 GstDecklinkSignalState signal_state;
88 /* Protected by lock */
89 GstClockTime first_time;
92 GstClockTime *times_temp;
93 guint window_size, window_fill;
94 gboolean window_filled;
95 guint window_skip, window_skip_count;
97 GstClockTime xbase, b;
98 GstClockTime num, den;
99 } current_time_mapping;
101 GstClockTime xbase, b;
102 GstClockTime num, den;
104 gboolean next_time_mapping_pending;
106 GstVideoVBIParser *vbiparser;
107 GstVideoFormat anc_vformat;
110 gint last_cc_vbi_line;
111 gint last_cc_vbi_line_field2;
112 gboolean output_afd_bar;
113 gint last_afd_bar_vbi_line;
114 gint last_afd_bar_vbi_line_field2;
117 GstClockTime skip_from_timestamp;
118 GstClockTime skip_to_timestamp;
121 struct _GstDecklinkVideoSrcClass
123 GstPushSrcClass parent_class;
126 GType gst_decklink_video_src_get_type (void);
128 GST_ELEMENT_REGISTER_DECLARE (decklinkvideosrc);
132 #endif /* __GST_DECKLINK_VIDEO_SRC_H__ */