From f6dc14b9465d04f727e55160ed722ea7ca47d20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 3 Dec 2021 10:19:22 +0200 Subject: [PATCH] Add a few missing docs aliases for constants --- gstreamer-video/src/video_info.rs | 1 + gstreamer/src/buffer.rs | 2 ++ gstreamer/src/clock_time.rs | 5 +++++ gstreamer/src/format.rs | 3 +++ 4 files changed, 11 insertions(+) diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index c83692191..d0569f1fc 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -8,6 +8,7 @@ use std::mem; use std::ptr; use std::str; +#[doc(alias = "GST_VIDEO_MAX_PLANES")] pub const VIDEO_MAX_PLANES: usize = ffi::GST_VIDEO_MAX_PLANES as usize; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index 15341325d..ab7de85e9 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -1179,8 +1179,10 @@ impl Eq for MappedBuffer {} unsafe impl Send for MappedBuffer {} unsafe impl Sync for MappedBuffer {} +#[doc(alias = "GST_BUFFER_COPY_METADATA")] pub const BUFFER_COPY_METADATA: crate::BufferCopyFlags = crate::BufferCopyFlags::from_bits_truncate(ffi::GST_BUFFER_COPY_METADATA); +#[doc(alias = "GST_BUFFER_COPY_ALL")] pub const BUFFER_COPY_ALL: crate::BufferCopyFlags = crate::BufferCopyFlags::from_bits_truncate(ffi::GST_BUFFER_COPY_ALL); diff --git a/gstreamer/src/clock_time.rs b/gstreamer/src/clock_time.rs index 62808ceb1..232ad95d7 100644 --- a/gstreamer/src/clock_time.rs +++ b/gstreamer/src/clock_time.rs @@ -15,10 +15,15 @@ use std::{cmp, fmt, str}; pub struct ClockTime(pub(crate) u64); impl ClockTime { + #[doc(alias = "GST_SECOND")] pub const SECOND: ClockTime = ClockTime(1_000_000_000); + #[doc(alias = "GST_MSECOND")] pub const MSECOND: ClockTime = ClockTime(1_000_000); + #[doc(alias = "GST_USECOND")] pub const USECOND: ClockTime = ClockTime(1_000); + #[doc(alias = "GST_NSECOND")] pub const NSECOND: ClockTime = ClockTime(1); + // checker-ignore-item pub const MAX: ClockTime = ClockTime(ffi::GST_CLOCK_TIME_NONE - 1); pub const fn hours(self) -> u64 { diff --git a/gstreamer/src/format.rs b/gstreamer/src/format.rs index 513b553e7..1d1a0ee23 100644 --- a/gstreamer/src/format.rs +++ b/gstreamer/src/format.rs @@ -42,6 +42,7 @@ pub type Time = ClockTime; #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug, Default)] pub struct Buffers(pub u64); impl Buffers { + #[doc(alias = "GST_BUFFER_OFFSET_NONE")] pub const OFFSET_NONE: u64 = ffi::GST_BUFFER_OFFSET_NONE; pub const MAX: Self = Self(Self::OFFSET_NONE - 1); } @@ -49,7 +50,9 @@ impl Buffers { #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug, Default)] pub struct Percent(pub u32); impl Percent { + #[doc(alias = "GST_FORMAT_PERCENT_MAX")] pub const MAX: Self = Self(ffi::GST_FORMAT_PERCENT_MAX as u32); + #[doc(alias = "GST_FORMAT_PERCENT_SCALE")] pub const SCALE: u32 = ffi::GST_FORMAT_PERCENT_SCALE as u32; }