Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sdroege/gst-plugin-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/net/ndi
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2022-10-12 19:39:33 +0300
committerSebastian Dröge <sebastian@centricular.com>2022-10-12 21:29:07 +0300
commitfb8192f40b69d394553ab683d98fc7908dc6557b (patch)
tree23e32913457b3a73ec3b005e920f12588ea07123 /net/ndi
parentfedd67dcaab71642d71873cd4605030e0e5e3bd4 (diff)
ndi: Remove unnecessary reference-timestamps feature
Diffstat (limited to 'net/ndi')
-rw-r--r--net/ndi/Cargo.toml5
-rw-r--r--net/ndi/src/lib.rs2
-rw-r--r--net/ndi/src/ndisinkcombiner/imp.rs20
-rw-r--r--net/ndi/src/ndisrcdemux/imp.rs1
-rw-r--r--net/ndi/src/receiver.rs42
5 files changed, 30 insertions, 40 deletions
diff --git a/net/ndi/Cargo.toml b/net/ndi/Cargo.toml
index ba66332f..ba825dcf 100644
--- a/net/ndi/Cargo.toml
+++ b/net/ndi/Cargo.toml
@@ -19,12 +19,11 @@ byteorder = "1.0"
atomic_refcell = "0.1"
[build-dependencies]
-gst-plugin-version-helper = "0.7"
+gst-plugin-version-helper = { path = "../../version-helper" }
[features]
-default = ["interlaced-fields", "reference-timestamps", "sink"]
+default = ["interlaced-fields", "sink"]
interlaced-fields = ["gst/v1_16", "gst-video/v1_16"]
-reference-timestamps = []
sink = ["gst/v1_18", "gst-base/v1_18"]
advanced-sdk = []
diff --git a/net/ndi/src/lib.rs b/net/ndi/src/lib.rs
index d1287ec4..2401c6c3 100644
--- a/net/ndi/src/lib.rs
+++ b/net/ndi/src/lib.rs
@@ -141,10 +141,8 @@ static DEFAULT_RECEIVER_NDI_NAME: Lazy<String> = Lazy::new(|| {
)
});
-#[cfg(feature = "reference-timestamps")]
static TIMECODE_CAPS: Lazy<gst::Caps> =
Lazy::new(|| gst::Caps::new_simple("timestamp/x-ndi-timecode", &[]));
-#[cfg(feature = "reference-timestamps")]
static TIMESTAMP_CAPS: Lazy<gst::Caps> =
Lazy::new(|| gst::Caps::new_simple("timestamp/x-ndi-timestamp", &[]));
diff --git a/net/ndi/src/ndisinkcombiner/imp.rs b/net/ndi/src/ndisinkcombiner/imp.rs
index 1511e192..92d09223 100644
--- a/net/ndi/src/ndisinkcombiner/imp.rs
+++ b/net/ndi/src/ndisinkcombiner/imp.rs
@@ -83,16 +83,16 @@ impl ElementImpl for NdiSinkCombiner {
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = Lazy::new(|| {
let caps = gst_video::VideoCapsBuilder::new()
.format_list([
- gst_video::VideoFormat::Uyvy,
- gst_video::VideoFormat::I420,
- gst_video::VideoFormat::Nv12,
- gst_video::VideoFormat::Nv21,
- gst_video::VideoFormat::Yv12,
- gst_video::VideoFormat::Bgra,
- gst_video::VideoFormat::Bgrx,
- gst_video::VideoFormat::Rgba,
- gst_video::VideoFormat::Rgbx,
- ])
+ gst_video::VideoFormat::Uyvy,
+ gst_video::VideoFormat::I420,
+ gst_video::VideoFormat::Nv12,
+ gst_video::VideoFormat::Nv21,
+ gst_video::VideoFormat::Yv12,
+ gst_video::VideoFormat::Bgra,
+ gst_video::VideoFormat::Bgrx,
+ gst_video::VideoFormat::Rgba,
+ gst_video::VideoFormat::Rgbx,
+ ])
.framerate_range(gst::Fraction::new(1, i32::MAX)..gst::Fraction::new(i32::MAX, 1))
.build();
let src_pad_template = gst::PadTemplate::with_gtype(
diff --git a/net/ndi/src/ndisrcdemux/imp.rs b/net/ndi/src/ndisrcdemux/imp.rs
index cc460274..491e370d 100644
--- a/net/ndi/src/ndisrcdemux/imp.rs
+++ b/net/ndi/src/ndisrcdemux/imp.rs
@@ -283,7 +283,6 @@ impl NdiSrcDemux {
if element.num_src_pads() == 2 {
element.no_more_pads();
}
-
}
for ev in events {
diff --git a/net/ndi/src/receiver.rs b/net/ndi/src/receiver.rs
index 74281b59..ca7d3b4e 100644
--- a/net/ndi/src/receiver.rs
+++ b/net/ndi/src/receiver.rs
@@ -1291,22 +1291,19 @@ impl Receiver {
buffer.set_pts(pts);
buffer.set_duration(duration);
- #[cfg(feature = "reference-timestamps")]
- {
+ gst::ReferenceTimestampMeta::add(
+ buffer,
+ &*TIMECODE_CAPS,
+ gst::ClockTime::from_nseconds(video_frame.timecode() as u64 * 100),
+ gst::ClockTime::NONE,
+ );
+ if video_frame.timestamp() != ndisys::NDIlib_recv_timestamp_undefined {
gst::ReferenceTimestampMeta::add(
buffer,
- &*TIMECODE_CAPS,
- gst::ClockTime::from_nseconds(video_frame.timecode() as u64 * 100),
+ &*TIMESTAMP_CAPS,
+ gst::ClockTime::from_nseconds(video_frame.timestamp() as u64 * 100),
gst::ClockTime::NONE,
);
- if video_frame.timestamp() != ndisys::NDIlib_recv_timestamp_undefined {
- gst::ReferenceTimestampMeta::add(
- buffer,
- &*TIMESTAMP_CAPS,
- gst::ClockTime::from_nseconds(video_frame.timestamp() as u64 * 100),
- gst::ClockTime::NONE,
- );
- }
}
#[cfg(feature = "interlaced-fields")]
@@ -1667,22 +1664,19 @@ impl Receiver {
buffer.set_pts(pts);
buffer.set_duration(duration);
- #[cfg(feature = "reference-timestamps")]
- {
+ gst::ReferenceTimestampMeta::add(
+ buffer,
+ &*TIMECODE_CAPS,
+ gst::ClockTime::from_nseconds(audio_frame.timecode() as u64 * 100),
+ gst::ClockTime::NONE,
+ );
+ if audio_frame.timestamp() != ndisys::NDIlib_recv_timestamp_undefined {
gst::ReferenceTimestampMeta::add(
buffer,
- &*TIMECODE_CAPS,
- gst::ClockTime::from_nseconds(audio_frame.timecode() as u64 * 100),
+ &*TIMESTAMP_CAPS,
+ gst::ClockTime::from_nseconds(audio_frame.timestamp() as u64 * 100),
gst::ClockTime::NONE,
);
- if audio_frame.timestamp() != ndisys::NDIlib_recv_timestamp_undefined {
- gst::ReferenceTimestampMeta::add(
- buffer,
- &*TIMESTAMP_CAPS,
- gst::ClockTime::from_nseconds(audio_frame.timestamp() as u64 * 100),
- gst::ClockTime::NONE,
- );
- }
}
let mut dest = buffer.map_writable().unwrap();