Add a few missing docs aliases for constants

This commit is contained in:
Sebastian Dröge 2021-12-03 10:19:22 +02:00
parent 7cc1523e7d
commit f6dc14b946
4 changed files with 11 additions and 0 deletions

View file

@ -8,6 +8,7 @@ use std::mem;
use std::ptr; use std::ptr;
use std::str; use std::str;
#[doc(alias = "GST_VIDEO_MAX_PLANES")]
pub const VIDEO_MAX_PLANES: usize = ffi::GST_VIDEO_MAX_PLANES as usize; pub const VIDEO_MAX_PLANES: usize = ffi::GST_VIDEO_MAX_PLANES as usize;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]

View file

@ -1179,8 +1179,10 @@ impl<T> Eq for MappedBuffer<T> {}
unsafe impl<T> Send for MappedBuffer<T> {} unsafe impl<T> Send for MappedBuffer<T> {}
unsafe impl<T> Sync for MappedBuffer<T> {} unsafe impl<T> Sync for MappedBuffer<T> {}
#[doc(alias = "GST_BUFFER_COPY_METADATA")]
pub const BUFFER_COPY_METADATA: crate::BufferCopyFlags = pub const BUFFER_COPY_METADATA: crate::BufferCopyFlags =
crate::BufferCopyFlags::from_bits_truncate(ffi::GST_BUFFER_COPY_METADATA); crate::BufferCopyFlags::from_bits_truncate(ffi::GST_BUFFER_COPY_METADATA);
#[doc(alias = "GST_BUFFER_COPY_ALL")]
pub const BUFFER_COPY_ALL: crate::BufferCopyFlags = pub const BUFFER_COPY_ALL: crate::BufferCopyFlags =
crate::BufferCopyFlags::from_bits_truncate(ffi::GST_BUFFER_COPY_ALL); crate::BufferCopyFlags::from_bits_truncate(ffi::GST_BUFFER_COPY_ALL);

View file

@ -15,10 +15,15 @@ use std::{cmp, fmt, str};
pub struct ClockTime(pub(crate) u64); pub struct ClockTime(pub(crate) u64);
impl ClockTime { impl ClockTime {
#[doc(alias = "GST_SECOND")]
pub const SECOND: ClockTime = ClockTime(1_000_000_000); pub const SECOND: ClockTime = ClockTime(1_000_000_000);
#[doc(alias = "GST_MSECOND")]
pub const MSECOND: ClockTime = ClockTime(1_000_000); pub const MSECOND: ClockTime = ClockTime(1_000_000);
#[doc(alias = "GST_USECOND")]
pub const USECOND: ClockTime = ClockTime(1_000); pub const USECOND: ClockTime = ClockTime(1_000);
#[doc(alias = "GST_NSECOND")]
pub const NSECOND: ClockTime = ClockTime(1); pub const NSECOND: ClockTime = ClockTime(1);
// checker-ignore-item
pub const MAX: ClockTime = ClockTime(ffi::GST_CLOCK_TIME_NONE - 1); pub const MAX: ClockTime = ClockTime(ffi::GST_CLOCK_TIME_NONE - 1);
pub const fn hours(self) -> u64 { pub const fn hours(self) -> u64 {

View file

@ -42,6 +42,7 @@ pub type Time = ClockTime;
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug, Default)] #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug, Default)]
pub struct Buffers(pub u64); pub struct Buffers(pub u64);
impl Buffers { impl Buffers {
#[doc(alias = "GST_BUFFER_OFFSET_NONE")]
pub const OFFSET_NONE: u64 = ffi::GST_BUFFER_OFFSET_NONE; pub const OFFSET_NONE: u64 = ffi::GST_BUFFER_OFFSET_NONE;
pub const MAX: Self = Self(Self::OFFSET_NONE - 1); 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)] #[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Debug, Default)]
pub struct Percent(pub u32); pub struct Percent(pub u32);
impl Percent { impl Percent {
#[doc(alias = "GST_FORMAT_PERCENT_MAX")]
pub const MAX: Self = Self(ffi::GST_FORMAT_PERCENT_MAX as u32); 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; pub const SCALE: u32 = ffi::GST_FORMAT_PERCENT_SCALE as u32;
} }