2021-02-08 18:31:22 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2021 Sebastian Dröge <sebastian@centricular.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <gst/base/base.h>
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/video/video.h>
|
|
|
|
|
|
|
|
#include "gstajacommon.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_TYPE_AJA_SRC (gst_aja_src_get_type())
|
|
|
|
#define GST_AJA_SRC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_AJA_SRC, GstAjaSrc))
|
|
|
|
#define GST_AJA_SRC_CAST(obj) ((GstAjaSrc *)obj)
|
|
|
|
#define GST_AJA_SRC_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_AJA_SRC, GstAjaSrcClass))
|
|
|
|
#define GST_IS_AJA_SRC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_AJA_SRC))
|
|
|
|
#define GST_IS_AJA_SRC_CLASS(obj) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_AJA_SRC))
|
|
|
|
|
|
|
|
typedef struct _GstAjaSrc GstAjaSrc;
|
|
|
|
typedef struct _GstAjaSrcClass GstAjaSrcClass;
|
|
|
|
|
|
|
|
struct _GstAjaSrc {
|
|
|
|
GstPushSrc parent;
|
|
|
|
|
|
|
|
// Everything below protected by queue lock
|
|
|
|
GMutex queue_lock;
|
|
|
|
GCond queue_cond;
|
2024-04-18 14:07:25 +00:00
|
|
|
GstVecDeque *queue;
|
2023-06-14 07:54:35 +00:00
|
|
|
guint queue_num_frames;
|
2021-02-08 18:31:22 +00:00
|
|
|
gboolean playing;
|
|
|
|
gboolean shutdown;
|
|
|
|
gboolean flushing;
|
|
|
|
|
2021-08-27 11:40:29 +00:00
|
|
|
GstAjaNtv2Device *device;
|
2021-02-08 18:31:22 +00:00
|
|
|
NTV2DeviceID device_id;
|
|
|
|
GstAllocator *allocator;
|
|
|
|
GstBufferPool *buffer_pool;
|
|
|
|
GstBufferPool *audio_buffer_pool;
|
|
|
|
GstBufferPool *anc_buffer_pool;
|
|
|
|
|
2024-02-23 10:41:44 +00:00
|
|
|
GstClock *clock;
|
|
|
|
|
2021-02-08 18:31:22 +00:00
|
|
|
// Properties
|
|
|
|
gchar *device_identifier;
|
|
|
|
NTV2Channel channel;
|
|
|
|
GstAjaAudioSystem audio_system_setting;
|
|
|
|
GstAjaVideoFormat video_format_setting;
|
2021-07-02 08:03:00 +00:00
|
|
|
GstAjaSdiMode sdi_mode;
|
2021-02-08 18:31:22 +00:00
|
|
|
GstAjaInputSource input_source;
|
2021-02-09 11:24:20 +00:00
|
|
|
GstAjaAudioSource audio_source;
|
2022-04-08 09:07:31 +00:00
|
|
|
GstAjaEmbeddedAudioInput embedded_audio_input;
|
2021-02-09 11:24:20 +00:00
|
|
|
GstAjaTimecodeIndex timecode_index;
|
2022-12-05 10:37:01 +00:00
|
|
|
gboolean rp188;
|
2021-02-08 18:31:22 +00:00
|
|
|
GstAjaReferenceSource reference_source;
|
2022-03-29 07:05:36 +00:00
|
|
|
GstAjaClosedCaptionCaptureMode closed_caption_capture_mode;
|
2021-02-08 18:31:22 +00:00
|
|
|
guint queue_size;
|
2021-08-27 12:02:50 +00:00
|
|
|
guint start_frame, end_frame;
|
2021-02-08 18:31:22 +00:00
|
|
|
guint capture_cpu_core;
|
2021-08-18 14:36:46 +00:00
|
|
|
gboolean signal;
|
2024-01-16 13:19:42 +00:00
|
|
|
gboolean attach_ancillary_meta;
|
2021-02-08 18:31:22 +00:00
|
|
|
|
|
|
|
NTV2AudioSystem audio_system;
|
|
|
|
NTV2VideoFormat video_format;
|
2021-07-02 08:03:00 +00:00
|
|
|
bool quad_mode;
|
2021-02-19 13:57:52 +00:00
|
|
|
NTV2VANCMode vanc_mode;
|
2021-02-09 13:46:48 +00:00
|
|
|
NTV2InputSource configured_input_source;
|
2021-02-08 18:31:22 +00:00
|
|
|
|
2021-07-07 07:31:38 +00:00
|
|
|
GstVideoInfo configured_info; // Based on properties
|
|
|
|
GstVideoInfo current_info; // Based on properties + stream metadata
|
|
|
|
|
2021-02-08 18:31:22 +00:00
|
|
|
gint configured_audio_channels;
|
|
|
|
|
|
|
|
AJAThread *capture_thread;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstAjaSrcClass {
|
|
|
|
GstPushSrcClass parent_class;
|
|
|
|
};
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
GType gst_aja_src_get_type(void);
|
|
|
|
|
|
|
|
G_END_DECLS
|