diff --git a/gstreamer-app/src/app_src.rs b/gstreamer-app/src/app_src.rs index 52e641393..016ad580f 100644 --- a/gstreamer-app/src/app_src.rs +++ b/gstreamer-app/src/app_src.rs @@ -229,8 +229,8 @@ impl AppSrc { ret.into_result() } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub fn push_buffer_list( &self, list: gst::BufferList, diff --git a/gstreamer-app/src/lib.rs b/gstreamer-app/src/lib.rs index ee74a68b4..fc69764ae 100644 --- a/gstreamer-app/src/lib.rs +++ b/gstreamer-app/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-audio/src/audio_decoder.rs b/gstreamer-audio/src/audio_decoder.rs index 8d03dbe35..bd58f7c3e 100644 --- a/gstreamer-audio/src/audio_decoder.rs +++ b/gstreamer-audio/src/audio_decoder.rs @@ -34,8 +34,8 @@ pub trait AudioDecoderExtManual: 'static { frames: i32, ) -> Result; - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn finish_subframe( &self, buffer: Option, @@ -43,8 +43,8 @@ pub trait AudioDecoderExtManual: 'static { fn negotiate(&self) -> Result<(), gst::FlowError>; - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn set_output_caps(&self, caps: &gst::Caps) -> Result<(), gst::FlowError>; fn set_output_format(&self, info: &AudioInfo) -> Result<(), gst::FlowError>; @@ -80,8 +80,8 @@ impl> AudioDecoderExtManual for O { ret.into_result() } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn finish_subframe( &self, buffer: Option, @@ -108,8 +108,8 @@ impl> AudioDecoderExtManual for O { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn set_output_caps(&self, caps: &gst::Caps) -> Result<(), gst::FlowError> { unsafe { let ret = from_glib(ffi::gst_audio_decoder_set_output_caps( diff --git a/gstreamer-audio/src/audio_meta.rs b/gstreamer-audio/src/audio_meta.rs index fa3ba53b5..5c8c6bb13 100644 --- a/gstreamer-audio/src/audio_meta.rs +++ b/gstreamer-audio/src/audio_meta.rs @@ -8,16 +8,16 @@ // except according to those terms. use std::fmt; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use std::ptr; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use std::slice; use glib::translate::{from_glib, ToGlib}; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use glib::translate::{from_glib_none, ToGlibPtr}; use gst::prelude::*; @@ -75,20 +75,20 @@ impl fmt::Debug for AudioClippingMeta { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] #[repr(transparent)] pub struct AudioMeta(ffi::GstAudioMeta); -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] unsafe impl Send for AudioMeta {} -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] unsafe impl Sync for AudioMeta {} -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] impl AudioMeta { pub fn add<'a>( buffer: &'a mut gst::BufferRef, @@ -196,8 +196,8 @@ impl AudioMeta { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] unsafe impl MetaAPI for AudioMeta { type GstType = ffi::GstAudioMeta; @@ -206,8 +206,8 @@ unsafe impl MetaAPI for AudioMeta { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] impl fmt::Debug for AudioMeta { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("AudioMeta") diff --git a/gstreamer-audio/src/audio_stream_align.rs b/gstreamer-audio/src/audio_stream_align.rs index d2fbcc3d7..3cc1019d0 100644 --- a/gstreamer-audio/src/audio_stream_align.rs +++ b/gstreamer-audio/src/audio_stream_align.rs @@ -12,8 +12,8 @@ use glib::translate::*; use std::mem; impl AudioStreamAlign { - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub fn process( &mut self, discont: bool, diff --git a/gstreamer-audio/src/functions.rs b/gstreamer-audio/src/functions.rs index 56d610369..9169eaeb4 100644 --- a/gstreamer-audio/src/functions.rs +++ b/gstreamer-audio/src/functions.rs @@ -30,8 +30,8 @@ pub fn audio_buffer_clip( } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn audio_buffer_truncate( buffer: gst::Buffer, bpf: u32, diff --git a/gstreamer-audio/src/lib.rs b/gstreamer-audio/src/lib.rs index 786e10f9f..2f3a6d1b3 100644 --- a/gstreamer-audio/src/lib.rs +++ b/gstreamer-audio/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; @@ -41,16 +41,16 @@ mod audio_meta; pub use crate::audio_meta::*; mod audio_channel_position; pub use crate::audio_channel_position::*; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] mod audio_stream_align; mod functions; pub use crate::functions::*; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub mod audio_buffer; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub use audio_buffer::{AudioBuffer, AudioBufferRef}; mod audio_decoder; diff --git a/gstreamer-base/src/adapter.rs b/gstreamer-base/src/adapter.rs index c9a749ddc..9c2008bde 100644 --- a/gstreamer-base/src/adapter.rs +++ b/gstreamer-base/src/adapter.rs @@ -83,14 +83,14 @@ impl UniqueAdapter { self.0.copy_bytes(offset, size) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn distance_from_discont(&self) -> u64 { self.0.distance_from_discont() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn dts_at_discont(&self) -> gst::ClockTime { self.0.dts_at_discont() } @@ -129,8 +129,8 @@ impl UniqueAdapter { self.0.masked_scan_uint32_peek(mask, pattern, offset, size) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn offset_at_discont(&self) -> u64 { self.0.offset_at_discont() } @@ -143,8 +143,8 @@ impl UniqueAdapter { self.0.prev_dts_at_offset(offset) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn prev_offset(&self) -> (u64, u64) { self.0.prev_offset() } @@ -157,8 +157,8 @@ impl UniqueAdapter { self.0.prev_pts_at_offset(offset) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn pts_at_discont(&self) -> gst::ClockTime { self.0.pts_at_discont() } diff --git a/gstreamer-base/src/aggregator.rs b/gstreamer-base/src/aggregator.rs index a2f8e1b02..331dbbd2d 100644 --- a/gstreamer-base/src/aggregator.rs +++ b/gstreamer-base/src/aggregator.rs @@ -7,23 +7,23 @@ // except according to those terms. use crate::Aggregator; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use glib::prelude::*; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use glib::signal::{connect_raw, SignalHandlerId}; use glib::translate::*; use glib::IsA; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use glib::Value; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use std::boxed::Box as Box_; use std::mem; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use std::mem::transmute; use std::ptr; @@ -32,34 +32,34 @@ pub trait AggregatorExtManual: 'static { fn finish_buffer(&self, buffer: gst::Buffer) -> Result; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn finish_buffer_list( &self, bufferlist: gst::BufferList, ) -> Result; - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn get_property_min_upstream_latency(&self) -> gst::ClockTime; - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn set_property_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime); - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn connect_property_min_upstream_latency_notify( &self, f: F, ) -> SignalHandlerId; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn update_segment(&self, segment: &gst::FormattedSegment); - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn selected_samples( &self, pts: gst::ClockTime, @@ -68,8 +68,8 @@ pub trait AggregatorExtManual: 'static { info: Option<&gst::StructureRef>, ); - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn connect_samples_selected< P, F: Fn( @@ -113,8 +113,8 @@ impl> AggregatorExtManual for O { ret.into_result() } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn finish_buffer_list( &self, bufferlist: gst::BufferList, @@ -128,8 +128,8 @@ impl> AggregatorExtManual for O { ret.into_result() } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn get_property_min_upstream_latency(&self) -> gst::ClockTime { unsafe { let mut value = Value::from_type(::static_type()); @@ -145,8 +145,8 @@ impl> AggregatorExtManual for O { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn set_property_min_upstream_latency(&self, min_upstream_latency: gst::ClockTime) { unsafe { glib::gobject_ffi::g_object_set_property( @@ -157,8 +157,8 @@ impl> AggregatorExtManual for O { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn connect_property_min_upstream_latency_notify( &self, f: F, @@ -175,8 +175,8 @@ impl> AggregatorExtManual for O { ) } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn update_segment(&self, segment: &gst::FormattedSegment) { unsafe { ffi::gst_aggregator_update_segment( @@ -186,8 +186,8 @@ impl> AggregatorExtManual for O { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn selected_samples( &self, pts: gst::ClockTime, @@ -208,8 +208,8 @@ impl> AggregatorExtManual for O { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn connect_samples_selected< P, F: Fn( @@ -279,8 +279,8 @@ impl> AggregatorExtManual for O { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] unsafe extern "C" fn notify_min_upstream_latency_trampoline( this: *mut ffi::GstAggregator, _param_spec: glib::ffi::gpointer, diff --git a/gstreamer-base/src/base_src.rs b/gstreamer-base/src/base_src.rs index dc7e9e3e7..b4fec771c 100644 --- a/gstreamer-base/src/base_src.rs +++ b/gstreamer-base/src/base_src.rs @@ -26,8 +26,8 @@ pub trait BaseSrcExtManual: 'static { fn query_latency(&self) -> Result<(bool, gst::ClockTime, gst::ClockTime), glib::BoolError>; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn new_segment(&self, segment: &gst::Segment) -> Result<(), glib::BoolError>; } @@ -101,8 +101,8 @@ impl> BaseSrcExtManual for O { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn new_segment(&self, segment: &gst::Segment) -> Result<(), glib::BoolError> { unsafe { let ret = from_glib(ffi::gst_base_src_new_segment( diff --git a/gstreamer-base/src/functions.rs b/gstreamer-base/src/functions.rs index 092f7c81a..5351dcd78 100644 --- a/gstreamer-base/src/functions.rs +++ b/gstreamer-base/src/functions.rs @@ -33,8 +33,8 @@ pub fn type_find_helper_for_data, R: AsRef<[u8]>>( } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn type_find_helper_for_data_with_extension, R: AsRef<[u8]>>( obj: Option<&P>, data: R, @@ -80,8 +80,8 @@ pub fn type_find_helper_for_buffer>( } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn type_find_helper_for_buffer_with_extension>( obj: Option<&P>, buf: &gst::Buffer, diff --git a/gstreamer-base/src/lib.rs b/gstreamer-base/src/lib.rs index 7d5211021..89a7b616f 100644 --- a/gstreamer-base/src/lib.rs +++ b/gstreamer-base/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; @@ -38,17 +38,17 @@ mod adapter; pub use crate::adapter::*; mod flow_combiner; pub use crate::flow_combiner::*; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] mod aggregator; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use aggregator::AggregatorExtManual; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] mod aggregator_pad; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use aggregator_pad::AggregatorPadExtManual; mod base_parse; pub use crate::base_parse::BaseParseExtManual; @@ -72,11 +72,11 @@ pub mod prelude { pub use glib::prelude::*; pub use gst::prelude::*; - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use crate::aggregator::AggregatorExtManual; - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use crate::aggregator_pad::AggregatorPadExtManual; pub use crate::auto::traits::*; pub use crate::base_parse::BaseParseExtManual; diff --git a/gstreamer-base/src/subclass/aggregator.rs b/gstreamer-base/src/subclass/aggregator.rs index 9aaf83c94..5fb7a9bc6 100644 --- a/gstreamer-base/src/subclass/aggregator.rs +++ b/gstreamer-base/src/subclass/aggregator.rs @@ -31,8 +31,8 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl { self.parent_clip(aggregator, aggregator_pad, buffer) } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn finish_buffer_list( &self, aggregator: &Self::Type, @@ -58,8 +58,8 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl { self.parent_sink_event(aggregator, aggregator_pad, event) } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn sink_event_pre_queue( &self, aggregator: &Self::Type, @@ -78,8 +78,8 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl { self.parent_sink_query(aggregator, aggregator_pad, query) } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn sink_query_pre_queue( &self, aggregator: &Self::Type, @@ -156,14 +156,14 @@ pub trait AggregatorImpl: AggregatorImplExt + ElementImpl { self.parent_negotiated_src_caps(aggregator, caps) } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn negotiate(&self, aggregator: &Self::Type) -> bool { self.parent_negotiate(aggregator) } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn peek_next_sample( &self, aggregator: &Self::Type, @@ -189,8 +189,8 @@ pub trait AggregatorImplExt: ObjectSubclass { buffer: gst::Buffer, ) -> Result; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_finish_buffer_list( &self, aggregator: &Self::Type, @@ -204,8 +204,8 @@ pub trait AggregatorImplExt: ObjectSubclass { event: gst::Event, ) -> bool; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_sink_event_pre_queue( &self, aggregator: &Self::Type, @@ -220,8 +220,8 @@ pub trait AggregatorImplExt: ObjectSubclass { query: &mut gst::QueryRef, ) -> bool; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_sink_query_pre_queue( &self, aggregator: &Self::Type, @@ -274,12 +274,12 @@ pub trait AggregatorImplExt: ObjectSubclass { caps: &gst::Caps, ) -> Result<(), gst::LoggableError>; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_negotiate(&self, aggregator: &Self::Type) -> bool; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_peek_next_sample( &self, aggregator: &Self::Type, @@ -344,8 +344,8 @@ impl AggregatorImplExt for T { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_finish_buffer_list( &self, aggregator: &Self::Type, @@ -385,8 +385,8 @@ impl AggregatorImplExt for T { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_sink_event_pre_queue( &self, aggregator: &Self::Type, @@ -428,8 +428,8 @@ impl AggregatorImplExt for T { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_sink_query_pre_queue( &self, aggregator: &Self::Type, @@ -668,8 +668,8 @@ impl AggregatorImplExt for T { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_negotiate(&self, aggregator: &Self::Type) -> bool { unsafe { let data = T::type_data(); @@ -686,8 +686,8 @@ impl AggregatorImplExt for T { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn parent_peek_next_sample( &self, aggregator: &Self::Type, @@ -732,7 +732,7 @@ where klass.update_src_caps = Some(aggregator_update_src_caps::); klass.fixate_src_caps = Some(aggregator_fixate_src_caps::); klass.negotiated_src_caps = Some(aggregator_negotiated_src_caps::); - #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] { klass.sink_event_pre_queue = Some(aggregator_sink_event_pre_queue::); klass.sink_query_pre_queue = Some(aggregator_sink_query_pre_queue::); @@ -800,8 +800,8 @@ where .to_glib() } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe extern "C" fn aggregator_finish_buffer_list( ptr: *mut ffi::GstAggregator, buffer_list: *mut gst::ffi::GstBufferList, @@ -842,8 +842,8 @@ where .to_glib() } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe extern "C" fn aggregator_sink_event_pre_queue( ptr: *mut ffi::GstAggregator, aggregator_pad: *mut ffi::GstAggregatorPad, @@ -889,8 +889,8 @@ where .to_glib() } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe extern "C" fn aggregator_sink_query_pre_queue( ptr: *mut ffi::GstAggregator, aggregator_pad: *mut ffi::GstAggregatorPad, @@ -1143,8 +1143,8 @@ where .to_glib() } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe extern "C" fn aggregator_negotiate( ptr: *mut ffi::GstAggregator, ) -> glib::ffi::gboolean @@ -1161,8 +1161,8 @@ where .to_glib() } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe extern "C" fn aggregator_peek_next_sample( ptr: *mut ffi::GstAggregator, pad: *mut ffi::GstAggregatorPad, diff --git a/gstreamer-base/src/subclass/mod.rs b/gstreamer-base/src/subclass/mod.rs index 0d99fd92a..56b6d9f37 100644 --- a/gstreamer-base/src/subclass/mod.rs +++ b/gstreamer-base/src/subclass/mod.rs @@ -18,19 +18,19 @@ mod push_src; pub use self::base_transform::BaseTransformMode; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] mod aggregator; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] mod aggregator_pad; pub mod prelude { - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use super::aggregator::{AggregatorImpl, AggregatorImplExt}; - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use super::aggregator_pad::{AggregatorPadImpl, AggregatorPadImplExt}; pub use super::base_parse::{BaseParseImpl, BaseParseImplExt}; pub use super::base_sink::{BaseSinkImpl, BaseSinkImplExt}; diff --git a/gstreamer-check/src/harness.rs b/gstreamer-check/src/harness.rs index 028516d63..36fdaf1b1 100644 --- a/gstreamer-check/src/harness.rs +++ b/gstreamer-check/src/harness.rs @@ -90,8 +90,8 @@ impl Harness { pad.add_probe(mask, func); } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn add_propose_allocation_meta( &mut self, api: glib::types::Type, @@ -462,8 +462,8 @@ impl Harness { // unsafe { TODO: call ffi::gst_harness_stress_statechange_start_full() } //} - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub fn take_all_data_as_buffer(&mut self) -> Result { unsafe { Option::<_>::from_glib_full(ffi::gst_harness_take_all_data_as_buffer(self.0.as_ptr())) @@ -471,8 +471,8 @@ impl Harness { } } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub fn take_all_data_as_bytes(&mut self) -> Result { unsafe { Option::<_>::from_glib_full(ffi::gst_harness_take_all_data_as_bytes(self.0.as_ptr())) diff --git a/gstreamer-check/src/lib.rs b/gstreamer-check/src/lib.rs index ab44aff08..c2be71d6a 100644 --- a/gstreamer-check/src/lib.rs +++ b/gstreamer-check/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-check/src/test_clock.rs b/gstreamer-check/src/test_clock.rs index a7afc12d2..b1eaee119 100644 --- a/gstreamer-check/src/test_clock.rs +++ b/gstreamer-check/src/test_clock.rs @@ -35,8 +35,8 @@ impl TestClock { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn process_id(&self, pending_id: &gst::ClockId) -> bool { unsafe { from_glib(ffi::gst_test_clock_process_id( @@ -83,8 +83,8 @@ impl TestClock { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn timed_wait_for_multiple_pending_ids( &self, count: u32, diff --git a/gstreamer-controller/src/lib.rs b/gstreamer-controller/src/lib.rs index 65c4248e7..de80457f5 100644 --- a/gstreamer-controller/src/lib.rs +++ b/gstreamer-controller/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-editing-services/src/lib.rs b/gstreamer-editing-services/src/lib.rs index d5755e085..7193f40be 100644 --- a/gstreamer-editing-services/src/lib.rs +++ b/gstreamer-editing-services/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-gl/src/lib.rs b/gstreamer-gl/src/lib.rs index 9fd9f2a93..c1adc64de 100644 --- a/gstreamer-gl/src/lib.rs +++ b/gstreamer-gl/src/lib.rs @@ -7,7 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; @@ -37,14 +37,14 @@ mod gl_context; pub use crate::gl_context::GLContextExtManual; mod gl_display; pub use crate::gl_display::GL_DISPLAY_CONTEXT_TYPE; -#[cfg(any(feature = "egl", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "egl")))] +#[cfg(any(feature = "egl", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "egl")))] mod gl_display_egl; -#[cfg(any(feature = "wayland", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "wayland")))] +#[cfg(any(feature = "wayland", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "wayland")))] mod gl_display_wayland; -#[cfg(any(feature = "x11", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "x11")))] +#[cfg(any(feature = "x11", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "x11")))] mod gl_display_x11; mod gl_video_frame; pub use crate::gl_video_frame::VideoFrameGLExt; diff --git a/gstreamer-net/src/lib.rs b/gstreamer-net/src/lib.rs index 6edb38807..d1d0fa5c1 100644 --- a/gstreamer-net/src/lib.rs +++ b/gstreamer-net/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-pbutils/src/lib.rs b/gstreamer-pbutils/src/lib.rs index 596ff21c3..c92be36d7 100644 --- a/gstreamer-pbutils/src/lib.rs +++ b/gstreamer-pbutils/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-player/src/lib.rs b/gstreamer-player/src/lib.rs index af958e146..1ccb4bd8b 100644 --- a/gstreamer-player/src/lib.rs +++ b/gstreamer-player/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-rtp/src/lib.rs b/gstreamer-rtp/src/lib.rs index 1f7b36e7f..f2c65f98b 100644 --- a/gstreamer-rtp/src/lib.rs +++ b/gstreamer-rtp/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-rtsp-server/src/lib.rs b/gstreamer-rtsp-server/src/lib.rs index 6b17879b4..258563f1f 100644 --- a/gstreamer-rtsp-server/src/lib.rs +++ b/gstreamer-rtsp-server/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-rtsp-server/src/rtsp_media_factory.rs b/gstreamer-rtsp-server/src/rtsp_media_factory.rs index 5f735dcce..89cdd6674 100644 --- a/gstreamer-rtsp-server/src/rtsp_media_factory.rs +++ b/gstreamer-rtsp-server/src/rtsp_media_factory.rs @@ -8,20 +8,20 @@ use crate::RTSPMediaFactory; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] use glib::translate::*; use glib::IsA; pub trait RTSPMediaFactoryExtManual: 'static { - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] fn add_role_from_structure(&self, structure: &gst::StructureRef); } impl> RTSPMediaFactoryExtManual for O { - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] fn add_role_from_structure(&self, structure: &gst::StructureRef) { unsafe { ffi::gst_rtsp_media_factory_add_role_from_structure( diff --git a/gstreamer-rtsp/src/lib.rs b/gstreamer-rtsp/src/lib.rs index 9b8bfa794..d8b111b7f 100644 --- a/gstreamer-rtsp/src/lib.rs +++ b/gstreamer-rtsp/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-sdp/src/lib.rs b/gstreamer-sdp/src/lib.rs index cf6a2cf07..cf63f548a 100644 --- a/gstreamer-sdp/src/lib.rs +++ b/gstreamer-sdp/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; diff --git a/gstreamer-video/src/caps_features.rs b/gstreamer-video/src/caps_features.rs index 45e241f2c..74e9da7fe 100644 --- a/gstreamer-video/src/caps_features.rs +++ b/gstreamer-video/src/caps_features.rs @@ -11,15 +11,15 @@ use std::ffi::CStr; use once_cell::sync::Lazy; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub static CAPS_FEATURE_FORMAT_INTERLACED: Lazy<&'static str> = Lazy::new(|| unsafe { CStr::from_ptr(ffi::GST_CAPS_FEATURE_FORMAT_INTERLACED) .to_str() .unwrap() }); -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub static CAPS_FEATURES_FORMAT_INTERLACED: Lazy = Lazy::new(|| CapsFeatures::new(&[*CAPS_FEATURE_FORMAT_INTERLACED])); diff --git a/gstreamer-video/src/lib.rs b/gstreamer-video/src/lib.rs index 233386366..692909c91 100644 --- a/gstreamer-video/src/lib.rs +++ b/gstreamer-video/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; @@ -30,8 +30,8 @@ mod auto; pub use crate::auto::*; mod caps_features; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub use crate::caps_features::{CAPS_FEATURES_FORMAT_INTERLACED, CAPS_FEATURE_FORMAT_INTERLACED}; pub use crate::caps_features::{ CAPS_FEATURES_META_GST_VIDEO_AFFINE_TRANSFORMATION_META, @@ -64,27 +64,27 @@ pub use crate::video_rectangle::*; mod video_overlay_composition; pub use crate::video_overlay_composition::*; pub mod video_meta; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub use crate::video_meta::VideoCaptionMeta; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub use crate::video_meta::{VideoAFDMeta, VideoBarMeta}; pub use crate::video_meta::{ VideoAffineTransformationMeta, VideoCropMeta, VideoMeta, VideoOverlayCompositionMeta, VideoRegionOfInterestMeta, }; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] mod video_time_code; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub use crate::video_time_code::{ValidVideoTimeCode, VideoTimeCode, VideoTimeCodeMeta}; -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] mod video_time_code_interval; -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] pub use crate::video_time_code_interval::VideoTimeCodeInterval; mod video_buffer_pool; pub use crate::video_buffer_pool::{ diff --git a/gstreamer-video/src/video_decoder.rs b/gstreamer-video/src/video_decoder.rs index 250f7dc04..51c9b0d36 100644 --- a/gstreamer-video/src/video_decoder.rs +++ b/gstreamer-video/src/video_decoder.rs @@ -12,8 +12,8 @@ use crate::video_codec_state::{InNegotiation, Readable, VideoCodecState, VideoCo use crate::VideoCodecFrame; use crate::VideoDecoder; use crate::VideoFormat; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use crate::VideoInterlaceMode; use glib::object::IsA; use glib::translate::*; @@ -35,8 +35,8 @@ extern "C" { } pub trait VideoDecoderExtManual: 'static { - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] fn allocate_output_frame( &self, frame: &mut VideoCodecFrame, @@ -65,8 +65,8 @@ pub trait VideoDecoderExtManual: 'static { height: u32, reference: Option<&VideoCodecState>, ) -> Result, gst::FlowError>; - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn set_interlaced_output_state( &self, fmt: VideoFormat, @@ -95,8 +95,8 @@ pub trait VideoDecoderExtManual: 'static { } impl> VideoDecoderExtManual for O { - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] fn allocate_output_frame( &self, frame: &mut VideoCodecFrame, @@ -267,8 +267,8 @@ impl> VideoDecoderExtManual for O { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] fn set_interlaced_output_state( &self, fmt: VideoFormat, diff --git a/gstreamer-video/src/video_encoder.rs b/gstreamer-video/src/video_encoder.rs index 9d21c1ad9..283e8ca75 100644 --- a/gstreamer-video/src/video_encoder.rs +++ b/gstreamer-video/src/video_encoder.rs @@ -18,8 +18,8 @@ use std::mem; use std::ptr; pub trait VideoEncoderExtManual: 'static { - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] fn allocate_output_frame( &self, frame: &mut VideoCodecFrame, @@ -37,8 +37,8 @@ pub trait VideoEncoderExtManual: 'static { frame: Option, ) -> Result; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result; fn get_latency(&self) -> (gst::ClockTime, gst::ClockTime); @@ -58,8 +58,8 @@ pub trait VideoEncoderExtManual: 'static { } impl> VideoEncoderExtManual for O { - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] fn allocate_output_frame( &self, frame: &mut VideoCodecFrame, @@ -101,8 +101,8 @@ impl> VideoEncoderExtManual for O { ret.into_result() } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn finish_subframe(&self, frame: &VideoCodecFrame) -> Result { let ret: gst::FlowReturn = unsafe { from_glib(ffi::gst_video_encoder_finish_subframe( diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index 8b8be8c6b..dfb42c55c 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -203,8 +203,8 @@ impl fmt::Display for crate::VideoChromaSite { } impl crate::VideoTransferFunction { - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn from_iso(iso: u32) -> Result { assert_initialized_main_thread!(); @@ -219,14 +219,14 @@ impl crate::VideoTransferFunction { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn to_iso(&self) -> u32 { unsafe { ffi::gst_video_transfer_function_to_iso(self.to_glib()) } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn is_equivalent( &self, from_bpp: u32, @@ -245,8 +245,8 @@ impl crate::VideoTransferFunction { } impl crate::VideoColorMatrix { - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn from_iso(iso: u32) -> Result { assert_initialized_main_thread!(); @@ -261,16 +261,16 @@ impl crate::VideoColorMatrix { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn to_iso(&self) -> u32 { unsafe { ffi::gst_video_color_matrix_to_iso(self.to_glib()) } } } impl crate::VideoColorPrimaries { - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn from_iso(iso: u32) -> Result { assert_initialized_main_thread!(); @@ -285,8 +285,8 @@ impl crate::VideoColorPrimaries { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn to_iso(&self) -> u32 { unsafe { ffi::gst_video_color_primaries_to_iso(self.to_glib()) } } @@ -340,7 +340,7 @@ impl fmt::Debug for VideoInfo { .field("multiview_mode", &self.multiview_mode()) .field("multiview_flags", &self.multiview_flags()); - #[cfg(any(feature = "v1_12", feature = "dox"))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] b.field("field_order", &self.field_order()); b.finish() @@ -364,8 +364,8 @@ pub struct VideoInfoBuilder<'a> { stride: Option<&'a [i32]>, multiview_mode: Option, multiview_flags: Option, - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] field_order: Option, } @@ -514,7 +514,7 @@ impl<'a> VideoInfoBuilder<'a> { ptr::write(ptr.offset(1), multiview_flags.to_glib()); } - #[cfg(any(feature = "v1_12", feature = "dox"))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] if let Some(field_order) = self.field_order { let ptr = &mut info.ABI._gst_reserved as *mut _ as *mut i32; ptr::write(ptr.offset(2), field_order.to_glib()); @@ -608,8 +608,8 @@ impl<'a> VideoInfoBuilder<'a> { } } - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] pub fn field_order(self, field_order: crate::VideoFieldOrder) -> Self { Self { field_order: Some(field_order), @@ -627,7 +627,7 @@ impl VideoInfo { assert_initialized_main_thread!(); cfg_if::cfg_if! { - if #[cfg(any(feature = "v1_12", feature = "dox"))] { + if #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] { VideoInfoBuilder { format, width, @@ -722,8 +722,8 @@ impl VideoInfo { self.0.height as u32 } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn field_height(&self) -> u32 { if self.0.interlace_mode == ffi::GST_VIDEO_INTERLACE_MODE_ALTERNATE { (self.0.height as u32 + 1) / 2 @@ -786,8 +786,8 @@ impl VideoInfo { } } - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] pub fn field_order(&self) -> crate::VideoFieldOrder { unsafe { let ptr = &self.0.ABI._gst_reserved as *const _ as *const i32; @@ -999,8 +999,8 @@ impl glib::translate::FromGlibPtrFull<*mut ffi::GstVideoInfo> for VideoInfo { } } -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] impl crate::VideoFieldOrder { pub fn to_str<'a>(self) -> &'a str { unsafe { @@ -1011,8 +1011,8 @@ impl crate::VideoFieldOrder { } } -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] impl str::FromStr for crate::VideoFieldOrder { type Err = glib::error::BoolError; @@ -1027,8 +1027,8 @@ impl str::FromStr for crate::VideoFieldOrder { } } -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] impl fmt::Display for crate::VideoFieldOrder { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { f.write_str((*self).to_str()) @@ -1144,8 +1144,8 @@ mod tests { assert!(info == info2); } - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] #[test] fn test_video_align() { gst::init().unwrap(); @@ -1164,8 +1164,8 @@ mod tests { assert_eq!(info.offset(), [0, 2_082_240]); } - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] #[test] fn test_display() { use std::str::FromStr; diff --git a/gstreamer-video/src/video_meta.rs b/gstreamer-video/src/video_meta.rs index 383048a54..572aa8a15 100644 --- a/gstreamer-video/src/video_meta.rs +++ b/gstreamer-video/src/video_meta.rs @@ -484,20 +484,20 @@ impl fmt::Debug for VideoOverlayCompositionMeta { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] #[repr(transparent)] pub struct VideoCaptionMeta(ffi::GstVideoCaptionMeta); -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] unsafe impl Send for VideoCaptionMeta {} -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] unsafe impl Sync for VideoCaptionMeta {} -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] impl VideoCaptionMeta { pub fn add<'a>( buffer: &'a mut gst::BufferRef, @@ -531,8 +531,8 @@ impl VideoCaptionMeta { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] unsafe impl MetaAPI for VideoCaptionMeta { type GstType = ffi::GstVideoCaptionMeta; @@ -541,8 +541,8 @@ unsafe impl MetaAPI for VideoCaptionMeta { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] impl fmt::Debug for VideoCaptionMeta { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("VideoCaptionMeta") @@ -552,20 +552,20 @@ impl fmt::Debug for VideoCaptionMeta { } } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] #[repr(transparent)] pub struct VideoAFDMeta(ffi::GstVideoAFDMeta); -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe impl Send for VideoAFDMeta {} -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe impl Sync for VideoAFDMeta {} -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] impl VideoAFDMeta { pub fn add( buffer: &mut gst::BufferRef, @@ -600,8 +600,8 @@ impl VideoAFDMeta { } } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe impl MetaAPI for VideoAFDMeta { type GstType = ffi::GstVideoAFDMeta; @@ -610,8 +610,8 @@ unsafe impl MetaAPI for VideoAFDMeta { } } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] impl fmt::Debug for VideoAFDMeta { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("VideoAFDMeta") @@ -622,20 +622,20 @@ impl fmt::Debug for VideoAFDMeta { } } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] #[repr(transparent)] pub struct VideoBarMeta(ffi::GstVideoBarMeta); -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe impl Send for VideoBarMeta {} -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe impl Sync for VideoBarMeta {} -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] impl VideoBarMeta { pub fn add( buffer: &mut gst::BufferRef, @@ -676,8 +676,8 @@ impl VideoBarMeta { } } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] unsafe impl MetaAPI for VideoBarMeta { type GstType = ffi::GstVideoBarMeta; @@ -686,8 +686,8 @@ unsafe impl MetaAPI for VideoBarMeta { } } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] impl fmt::Debug for VideoBarMeta { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("VideoBarMeta") diff --git a/gstreamer-video/src/video_time_code.rs b/gstreamer-video/src/video_time_code.rs index 06a8f957b..a786e1d13 100644 --- a/gstreamer-video/src/video_time_code.rs +++ b/gstreamer-video/src/video_time_code.rs @@ -15,13 +15,13 @@ use std::convert::{TryFrom, TryInto}; use std::fmt; use std::mem; use std::ptr; -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] use std::str; use crate::VideoTimeCodeFlags; -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] use crate::VideoTimeCodeInterval; pub struct VideoTimeCode(ffi::GstVideoTimeCode); @@ -68,8 +68,8 @@ impl VideoTimeCode { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn from_date_time( fps: gst::Fraction, dt: &glib::DateTime, @@ -178,8 +178,8 @@ impl ValidVideoTimeCode { } } - // #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + // #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] // pub fn from_date_time( // fps: gst::Fraction, // dt: &glib::DateTime, @@ -197,8 +197,8 @@ impl ValidVideoTimeCode { } } - #[cfg(any(feature = "v1_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] + #[cfg(any(feature = "v1_12", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] pub fn add_interval( &self, tc_inter: &VideoTimeCodeInterval, @@ -470,8 +470,8 @@ macro_rules! generic_impl { generic_impl!(VideoTimeCode); generic_impl!(ValidVideoTimeCode); -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] impl str::FromStr for VideoTimeCode { type Err = glib::error::BoolError; diff --git a/gstreamer-webrtc/src/lib.rs b/gstreamer-webrtc/src/lib.rs index b30ab1a1e..7627c179d 100644 --- a/gstreamer-webrtc/src/lib.rs +++ b/gstreamer-webrtc/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] pub use ffi; @@ -28,8 +28,8 @@ macro_rules! skip_assert_initialized { mod auto; pub use crate::auto::*; -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] mod web_rtc_data_channel; mod web_rtc_session_description; diff --git a/gstreamer/src/bin.rs b/gstreamer/src/bin.rs index 1428db5b2..d1bc6427c 100644 --- a/gstreamer/src/bin.rs +++ b/gstreamer/src/bin.rs @@ -31,8 +31,8 @@ pub trait GstBinExtManual: 'static { f: F, ) -> SignalHandlerId; - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn iterate_all_by_element_factory_name(&self, factory_name: &str) -> crate::Iterator; fn iterate_all_by_interface(&self, iface: glib::types::Type) -> crate::Iterator; fn iterate_elements(&self) -> crate::Iterator; @@ -108,8 +108,8 @@ impl> GstBinExtManual for O { } } - #[cfg(any(feature = "v1_18", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + #[cfg(any(feature = "v1_18", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] fn iterate_all_by_element_factory_name(&self, factory_name: &str) -> crate::Iterator { unsafe { from_glib_full(ffi::gst_bin_iterate_all_by_element_factory_name( diff --git a/gstreamer/src/buffer.rs b/gstreamer/src/buffer.rs index 3a018745a..978fd0320 100644 --- a/gstreamer/src/buffer.rs +++ b/gstreamer/src/buffer.rs @@ -1283,8 +1283,8 @@ mod tests { assert_eq!(last, 4); } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] #[test] fn test_meta_foreach() { crate::init().unwrap(); @@ -1318,8 +1318,8 @@ mod tests { assert_eq!(&[crate::ClockTime::from(0), crate::SECOND][..], &res[..]); } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] #[test] fn test_meta_foreach_mut() { crate::init().unwrap(); diff --git a/gstreamer/src/bufferlist.rs b/gstreamer/src/bufferlist.rs index 8b21067f2..cee7b80ba 100644 --- a/gstreamer/src/bufferlist.rs +++ b/gstreamer/src/bufferlist.rs @@ -66,8 +66,8 @@ impl BufferListRef { } } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub fn get_writable(&mut self, idx: u32) -> Option<&mut BufferRef> { unsafe { let ptr = ffi::gst_buffer_list_get_writable(self.as_mut_ptr(), idx); @@ -83,8 +83,8 @@ impl BufferListRef { unsafe { ffi::gst_buffer_list_length(self.as_mut_ptr()) as usize } } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub fn calculate_size(&self) -> usize { unsafe { ffi::gst_buffer_list_calculate_size(self.as_mut_ptr()) as usize } } diff --git a/gstreamer/src/bus_unix.rs b/gstreamer/src/bus_unix.rs index c9cedf109..302d3b5ce 100644 --- a/gstreamer/src/bus_unix.rs +++ b/gstreamer/src/bus_unix.rs @@ -13,7 +13,7 @@ cfg_if::cfg_if! { use std::mem; use std::os::unix; - } else if #[cfg(feature = "dox")] { + } else if #[cfg(all(not(doctest), doc))] { // Declare a fake RawFd for doc generation on windows pub mod unix { pub mod io { @@ -39,7 +39,7 @@ impl UnixBusExtManual for Bus { pollfd.fd } - #[cfg(all(not(unix), feature = "dox"))] + #[cfg(all(not(unix), all(not(doctest), doc)))] unix::io::RawFd {} } } diff --git a/gstreamer/src/bus_windows.rs b/gstreamer/src/bus_windows.rs index 76cc7648e..42b991e2d 100644 --- a/gstreamer/src/bus_windows.rs +++ b/gstreamer/src/bus_windows.rs @@ -13,7 +13,7 @@ cfg_if::cfg_if! { use std::mem; use std::os::windows; - } else if #[cfg(feature = "dox")] { + } else if #[cfg(all(not(doctest), doc))] { // Declare a fake RawHandle for doc generation on unix pub mod windows { pub mod io { @@ -39,7 +39,7 @@ impl WindowsBusExtManual for Bus { pollfd.fd as *mut _ } - #[cfg(all(not(windows), feature = "dox"))] + #[cfg(all(not(windows), all(not(doctest), doc)))] windows::io::RawHandle {} } } diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index d13bebe18..4932fd2c6 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -249,8 +249,8 @@ impl CapsRef { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn set_features_simple(&mut self, features: Option) { unsafe { ffi::gst_caps_set_features_simple( diff --git a/gstreamer/src/clock.rs b/gstreamer/src/clock.rs index 82f1086dc..11e48ede3 100644 --- a/gstreamer/src/clock.rs +++ b/gstreamer/src/clock.rs @@ -15,8 +15,8 @@ use crate::ClockSuccess; use crate::ClockTime; use crate::ClockTimeDiff; use glib::ffi::{gboolean, gpointer}; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] use glib::prelude::*; use glib::translate::*; use glib::IsA; @@ -66,14 +66,14 @@ impl ClockId { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn get_clock(&self) -> Option { unsafe { from_glib_full(ffi::gst_clock_id_get_clock(self.to_glib_none().0)) } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn uses_clock>(&self, clock: &P) -> bool { unsafe { from_glib(ffi::gst_clock_id_uses_clock( diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index 5fc9c3b47..4f5ecc26f 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -27,28 +27,28 @@ use crate::StateChange; use crate::StateChangeError; use crate::StateChangeReturn; use crate::StateChangeSuccess; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] use glib::object::Cast; use glib::object::IsA; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] use glib::translate::FromGlibPtrBorrow; use glib::translate::{ from_glib, from_glib_full, from_glib_none, FromGlib, FromGlibPtrContainer, ToGlib, ToGlibPtr, }; use std::ffi::CStr; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] use std::future::Future; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] use std::marker::Unpin; use std::mem; use std::num::NonZeroU64; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] use std::pin::Pin; impl Element { @@ -171,8 +171,8 @@ pub trait ElementExtManual: 'static { fn get_element_flags(&self) -> ElementFlags; - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::too_many_arguments)] fn message_full_with_details( &self, @@ -201,24 +201,24 @@ pub trait ElementExtManual: 'static { fn num_sink_pads(&self) -> u16; fn num_src_pads(&self) -> u16; - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn add_property_deep_notify_watch( &self, property_name: Option<&str>, include_value: bool, ) -> NotifyWatchId; - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn add_property_notify_watch( &self, property_name: Option<&str>, include_value: bool, ) -> NotifyWatchId; - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn remove_property_notify_watch(&self, watch_id: NotifyWatchId); fn query_convert, U: SpecificFormattedValue>( @@ -252,14 +252,14 @@ pub trait ElementExtManual: 'static { seek_pos: V, ) -> Result<(), glib::error::BoolError>; - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn call_async(&self, func: F) where F: FnOnce(&Self) + Send + 'static; - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn call_async_future( &self, func: F, @@ -423,8 +423,8 @@ impl> ElementExtManual for O { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn message_full_with_details( &self, type_: ElementMessageType, @@ -565,8 +565,8 @@ impl> ElementExtManual for O { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn add_property_deep_notify_watch( &self, property_name: Option<&str>, @@ -582,8 +582,8 @@ impl> ElementExtManual for O { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn add_property_notify_watch( &self, property_name: Option<&str>, @@ -599,8 +599,8 @@ impl> ElementExtManual for O { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn remove_property_notify_watch(&self, watch_id: NotifyWatchId) { unsafe { ffi::gst_element_remove_property_notify_watch( @@ -772,8 +772,8 @@ impl> ElementExtManual for O { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn call_async(&self, func: F) where F: FnOnce(&Self) + Send + 'static, @@ -806,8 +806,8 @@ impl> ElementExtManual for O { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] fn call_async_future( &self, func: F, diff --git a/gstreamer/src/event.rs b/gstreamer/src/event.rs index 8c11503c2..c49f23115 100644 --- a/gstreamer/src/event.rs +++ b/gstreamer/src/event.rs @@ -20,8 +20,8 @@ use std::ptr; use glib::translate::{from_glib, from_glib_full, from_glib_none, ToGlib, ToGlibPtr}; use glib::value::ToSendValue; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] use glib::translate::FromGlibPtrContainer; use crate::EventType; @@ -394,8 +394,8 @@ impl<'a> StreamStart<'a> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_stream(&self) -> Option { unsafe { let mut stream = ptr::null_mut(); @@ -459,23 +459,23 @@ impl<'a> Segment<'a> { declare_concrete_event!(StreamCollection); impl<'a> StreamCollection<'a> { - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::new_ret_no_self)] pub fn new(stream_collection: &crate::StreamCollection) -> Event { skip_assert_initialized!(); Self::builder(stream_collection).build() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn builder(stream_collection: &crate::StreamCollection) -> StreamCollectionBuilder { assert_initialized_main_thread!(); StreamCollectionBuilder::new(stream_collection) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_stream_collection(&self) -> crate::StreamCollection { unsafe { let mut stream_collection = ptr::null_mut(); @@ -582,23 +582,23 @@ impl<'a> SinkMessage<'a> { declare_concrete_event!(StreamGroupDone); impl<'a> StreamGroupDone<'a> { - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::new_ret_no_self)] pub fn new(group_id: GroupId) -> Event { skip_assert_initialized!(); Self::builder(group_id).build() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn builder(group_id: GroupId) -> StreamGroupDoneBuilder<'a> { assert_initialized_main_thread!(); StreamGroupDoneBuilder::new(group_id) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_group_id(&self) -> GroupId { unsafe { let mut group_id = mem::MaybeUninit::uninit(); @@ -890,8 +890,8 @@ impl<'a> Seek<'a> { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn get_trickmode_interval(&self) -> crate::ClockTime { unsafe { let mut trickmode_interval = mem::MaybeUninit::uninit(); @@ -1037,23 +1037,23 @@ impl<'a> TocSelect<'a> { declare_concrete_event!(SelectStreams); impl<'a> SelectStreams<'a> { - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::new_ret_no_self)] pub fn new(streams: &'a [&'a str]) -> Event { skip_assert_initialized!(); Self::builder(streams).build() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn builder(streams: &'a [&'a str]) -> SelectStreamsBuilder { assert_initialized_main_thread!(); SelectStreamsBuilder::new(streams) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_streams(&self) -> Vec { unsafe { let mut streams = ptr::null_mut(); @@ -1281,8 +1281,8 @@ pub struct StreamStartBuilder<'a> { stream_id: &'a str, flags: Option, group_id: Option, - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] stream: Option, } @@ -1294,8 +1294,8 @@ impl<'a> StreamStartBuilder<'a> { stream_id, flags: None, group_id: None, - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] stream: None, } } @@ -1314,8 +1314,8 @@ impl<'a> StreamStartBuilder<'a> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn stream(self, stream: crate::Stream) -> Self { Self { stream: Some(stream), @@ -1332,7 +1332,7 @@ impl<'a> StreamStartBuilder<'a> { ffi::gst_event_set_group_id(ev, group_id.0.get()); } - #[cfg(any(feature = "v1_10", feature = "dox"))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] if let Some(ref stream) = s.stream { ffi::gst_event_set_stream(ev, stream.to_glib_none().0); } @@ -1375,15 +1375,15 @@ impl<'a> SegmentBuilder<'a> { event_builder_generic_impl!(|s: &Self| ffi::gst_event_new_segment(s.segment.to_glib_none().0)); } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub struct StreamCollectionBuilder<'a> { builder: EventBuilder<'a>, stream_collection: &'a crate::StreamCollection, } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] impl<'a> StreamCollectionBuilder<'a> { fn new(stream_collection: &'a crate::StreamCollection) -> Self { skip_assert_initialized!(); @@ -1466,15 +1466,15 @@ impl<'a> SinkMessageBuilder<'a> { )); } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub struct StreamGroupDoneBuilder<'a> { builder: EventBuilder<'a>, group_id: GroupId, } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] impl<'a> StreamGroupDoneBuilder<'a> { fn new(group_id: GroupId) -> Self { skip_assert_initialized!(); @@ -1675,7 +1675,7 @@ impl<'a> SeekBuilder<'a> { s.stop.get_value(), ); - #[cfg(any(feature = "v1_16", feature = "dox"))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] if let Some(trickmode_interval) = s.trickmode_interval { ffi::gst_event_set_seek_trickmode_interval(ev, trickmode_interval.to_glib()); } @@ -1783,15 +1783,15 @@ impl<'a> TocSelectBuilder<'a> { event_builder_generic_impl!(|s: &Self| ffi::gst_event_new_toc_select(s.uid.to_glib_none().0)); } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub struct SelectStreamsBuilder<'a> { builder: EventBuilder<'a>, streams: &'a [&'a str], } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] impl<'a> SelectStreamsBuilder<'a> { fn new(streams: &'a [&'a str]) -> Self { skip_assert_initialized!(); diff --git a/gstreamer/src/functions.rs b/gstreamer/src/functions.rs index 8541d8a68..e344a82bb 100644 --- a/gstreamer/src/functions.rs +++ b/gstreamer/src/functions.rs @@ -120,8 +120,8 @@ pub fn parse_launchv_full( } } -#[cfg(any(feature = "v1_12", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))] +#[cfg(any(feature = "v1_12", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_12")))] pub fn calculate_linear_regression( xy: &[(u64, u64)], temp: Option<&mut [(u64, u64)]>, @@ -170,8 +170,8 @@ pub fn calculate_linear_regression( } } -#[cfg(any(feature = "v1_18", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +#[cfg(any(feature = "v1_18", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_18")))] pub fn type_is_plugin_api(type_: glib::types::Type) -> Option { assert_initialized_main_thread!(); unsafe { diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index 9d7e37916..038791b80 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -6,7 +6,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(all(not(doctest), doc), feature(doc_cfg))] #![recursion_limit = "256"] // Re-exported for the subclass gst_plugin_define! macro @@ -83,11 +83,11 @@ pub use crate::tags::{ mod tags_serde; pub mod meta; -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub use crate::meta::MetaSeqnum; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use crate::meta::ReferenceTimestampMeta; pub use crate::meta::{Meta, MetaAPI, MetaRef, MetaRefMut, ParentBufferMeta, ProtectionMeta}; pub mod buffer; @@ -122,11 +122,11 @@ pub use crate::static_caps::*; mod static_pad_template; pub use crate::static_pad_template::*; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub mod promise; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub use promise::{Promise, PromiseError}; pub mod bus; @@ -143,16 +143,16 @@ mod allocation_params; pub use self::allocation_params::AllocationParams; // OS dependent Bus extensions (also import the other plateform mod for doc) -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] cfg_if::cfg_if! { if #[cfg(unix)] { mod bus_unix; - #[cfg(feature = "dox")] + #[cfg(all(not(doctest), doc))] mod bus_windows; } else { mod bus_windows; - #[cfg(feature = "dox")] + #[cfg(all(not(doctest), doc))] mod bus_unix; } } @@ -190,16 +190,16 @@ pub use crate::element::{ pub use crate::object::GstObjectExtManual; // OS dependent Bus extensions (also import the other plateform trait for doc) -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] cfg_if::cfg_if! { if #[cfg(unix)] { pub use bus_unix::UnixBusExtManual; - #[cfg(feature = "dox")] + #[cfg(all(not(doctest), doc))] pub use bus_windows::WindowsBusExtManual; } else { pub use bus_windows::WindowsBusExtManual; - #[cfg(feature = "dox")] + #[cfg(all(not(doctest), doc))] pub use bus_unix::UnixBusExtManual; } } @@ -222,11 +222,11 @@ pub use crate::tag_setter::TagSetterExtManual; mod plugin; pub use crate::plugin::GstPluginExtManual; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub mod stream; -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub mod stream_collection; mod typefind; @@ -320,16 +320,16 @@ pub mod prelude { pub use crate::element::{ElementClassExt, ElementExtManual}; // OS dependent Bus extensions (also import the other plateform trait for doc) - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] cfg_if::cfg_if! { if #[cfg(unix)] { pub use crate::bus_unix::UnixBusExtManual; - #[cfg(feature = "dox")] + #[cfg(all(not(doctest), doc))] pub use crate::bus_windows::WindowsBusExtManual; } else { pub use crate::bus_windows::WindowsBusExtManual; - #[cfg(feature = "dox")] + #[cfg(all(not(doctest), doc))] pub use crate::bus_unix::UnixBusExtManual; } } diff --git a/gstreamer/src/message.rs b/gstreamer/src/message.rs index 3e754794b..6c527b205 100644 --- a/gstreamer/src/message.rs +++ b/gstreamer/src/message.rs @@ -267,8 +267,8 @@ impl<'a> Error<'a> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_details(&self) -> Option<&StructureRef> { unsafe { let mut details = ptr::null(); @@ -317,8 +317,8 @@ impl<'a> Warning<'a> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_details(&self) -> Option<&StructureRef> { unsafe { let mut details = ptr::null(); @@ -367,8 +367,8 @@ impl<'a> Info<'a> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_details(&self) -> Option<&StructureRef> { unsafe { let mut details = ptr::null(); @@ -1338,23 +1338,23 @@ impl<'a> DeviceRemoved<'a> { declare_concrete_message!(PropertyNotify); impl<'a> PropertyNotify<'a> { - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::new_ret_no_self)] pub fn new(property_name: &str) -> Message { skip_assert_initialized!(); Self::builder(property_name).build() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn builder(property_name: &str) -> PropertyNotifyBuilder { assert_initialized_main_thread!(); PropertyNotifyBuilder::new(property_name) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get(&self) -> (Object, &str, Option<&'a glib::Value>) { unsafe { let mut object = ptr::null_mut(); @@ -1383,23 +1383,23 @@ impl<'a> PropertyNotify<'a> { declare_concrete_message!(StreamCollection); impl<'a> StreamCollection<'a> { - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::new_ret_no_self)] pub fn new(collection: &crate::StreamCollection) -> Message { skip_assert_initialized!(); Self::builder(collection).build() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn builder(collection: &crate::StreamCollection) -> StreamCollectionBuilder { assert_initialized_main_thread!(); StreamCollectionBuilder::new(collection) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_stream_collection(&self) -> crate::StreamCollection { unsafe { let mut collection = ptr::null_mut(); @@ -1413,23 +1413,23 @@ impl<'a> StreamCollection<'a> { declare_concrete_message!(StreamsSelected); impl<'a> StreamsSelected<'a> { - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::new_ret_no_self)] pub fn new(collection: &crate::StreamCollection) -> Message { skip_assert_initialized!(); Self::builder(collection).build() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn builder(collection: &crate::StreamCollection) -> StreamsSelectedBuilder { assert_initialized_main_thread!(); StreamsSelectedBuilder::new(collection) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_stream_collection(&self) -> crate::StreamCollection { unsafe { let mut collection = ptr::null_mut(); @@ -1440,8 +1440,8 @@ impl<'a> StreamsSelected<'a> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_streams(&self) -> Vec { unsafe { let n = ffi::gst_message_streams_selected_get_size(self.as_mut_ptr()); @@ -1460,23 +1460,23 @@ impl<'a> StreamsSelected<'a> { declare_concrete_message!(Redirect); impl<'a> Redirect<'a> { - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] #[allow(clippy::new_ret_no_self)] pub fn new(location: &str) -> Message { skip_assert_initialized!(); Self::builder(location).build() } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn builder(location: &str) -> RedirectBuilder { assert_initialized_main_thread!(); RedirectBuilder::new(location) } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn get_entries(&self) -> Vec<(&str, Option, Option<&StructureRef>)> { unsafe { let n = ffi::gst_message_get_num_redirect_entries(self.as_mut_ptr()); @@ -1514,16 +1514,16 @@ impl<'a> Redirect<'a> { declare_concrete_message!(DeviceChanged); impl<'a> DeviceChanged<'a> { - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] #[allow(clippy::new_ret_no_self)] pub fn new(device: &'a crate::Device, changed_device: &'a crate::Device) -> Message { skip_assert_initialized!(); Self::builder(device, changed_device).build() } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn builder( device: &'a crate::Device, changed_device: &'a crate::Device, @@ -1532,8 +1532,8 @@ impl<'a> DeviceChanged<'a> { DeviceChangedBuilder::new(device, changed_device) } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn get_device_changed(&self) -> (crate::Device, crate::Device) { unsafe { let mut device = ptr::null_mut(); @@ -1580,8 +1580,8 @@ impl<'a> MessageBuilder<'a> { } } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] fn other_fields(self, other_fields: &[(&'a str, &'a dyn ToSendValue)]) -> Self { Self { other_fields: self @@ -1613,8 +1613,8 @@ macro_rules! message_builder_generic_impl { } } - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] #[allow(clippy::needless_update)] pub fn other_fields(self, other_fields: &[(&'a str, &'a dyn ToSendValue)]) -> Self { Self { @@ -1632,7 +1632,7 @@ macro_rules! message_builder_generic_impl { ffi::gst_message_set_seqnum(msg, seqnum.0.get()); } - #[cfg(any(feature = "v1_14", feature = "dox"))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] if !self.builder.other_fields.is_empty() { let structure = ffi::gst_message_writable_structure(msg); @@ -1701,8 +1701,8 @@ impl<'a, T: MessageErrorDomain> ErrorBuilder<'a, T> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn details(self, details: Structure) -> Self { Self { details: Some(details), @@ -1712,7 +1712,7 @@ impl<'a, T: MessageErrorDomain> ErrorBuilder<'a, T> { message_builder_generic_impl!(|s: &mut Self, src| { cfg_if::cfg_if! { - if #[cfg(any(feature = "v1_10", feature = "dox"))] { + if #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] { let details = match s.details.take() { None => ptr::null_mut(), Some(details) => details.into_ptr(), @@ -1767,8 +1767,8 @@ impl<'a, T: MessageErrorDomain> WarningBuilder<'a, T> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn details(self, details: Structure) -> Self { Self { details: Some(details), @@ -1778,7 +1778,7 @@ impl<'a, T: MessageErrorDomain> WarningBuilder<'a, T> { message_builder_generic_impl!(|s: &mut Self, src| { cfg_if::cfg_if! { - if #[cfg(any(feature = "v1_10", feature = "dox"))] { + if #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] { let details = match s.details.take() { None => ptr::null_mut(), Some(details) => details.into_ptr(), @@ -1833,8 +1833,8 @@ impl<'a, T: MessageErrorDomain> InfoBuilder<'a, T> { } } - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub fn details(self, details: Structure) -> Self { Self { details: Some(details), @@ -1844,7 +1844,7 @@ impl<'a, T: MessageErrorDomain> InfoBuilder<'a, T> { message_builder_generic_impl!(|s: &mut Self, src| { cfg_if::cfg_if! { - if #[cfg(any(feature = "v1_10", feature = "dox"))] { + if #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] { let details = match s.details.take() { None => ptr::null_mut(), Some(details) => details.into_ptr(), @@ -2608,16 +2608,16 @@ impl<'a> DeviceRemovedBuilder<'a> { )); } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub struct PropertyNotifyBuilder<'a> { builder: MessageBuilder<'a>, property_name: &'a str, value: Option<&'a dyn glib::ToSendValue>, } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] impl<'a> PropertyNotifyBuilder<'a> { fn new(property_name: &'a str) -> Self { skip_assert_initialized!(); @@ -2649,15 +2649,15 @@ impl<'a> PropertyNotifyBuilder<'a> { }); } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub struct StreamCollectionBuilder<'a> { builder: MessageBuilder<'a>, collection: &'a crate::StreamCollection, } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] impl<'a> StreamCollectionBuilder<'a> { fn new(collection: &'a crate::StreamCollection) -> Self { skip_assert_initialized!(); @@ -2672,20 +2672,20 @@ impl<'a> StreamCollectionBuilder<'a> { }); } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub struct StreamsSelectedBuilder<'a> { builder: MessageBuilder<'a>, - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] collection: &'a crate::StreamCollection, - #[cfg(any(feature = "v1_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] + #[cfg(any(feature = "v1_10", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] streams: Option<&'a [&'a crate::Stream]>, } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] impl<'a> StreamsSelectedBuilder<'a> { fn new(collection: &'a crate::StreamCollection) -> Self { skip_assert_initialized!(); @@ -2714,8 +2714,8 @@ impl<'a> StreamsSelectedBuilder<'a> { }); } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] pub struct RedirectBuilder<'a> { builder: MessageBuilder<'a>, location: &'a str, @@ -2725,8 +2725,8 @@ pub struct RedirectBuilder<'a> { entries: Option<&'a [(&'a str, Option<&'a TagList>, Option<&'a Structure>)]>, } -#[cfg(any(feature = "v1_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))] +#[cfg(any(feature = "v1_10", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_10")))] impl<'a> RedirectBuilder<'a> { fn new(location: &'a str) -> Self { skip_assert_initialized!(); @@ -2798,16 +2798,16 @@ impl<'a> RedirectBuilder<'a> { }); } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub struct DeviceChangedBuilder<'a> { builder: MessageBuilder<'a>, device: &'a crate::Device, changed_device: &'a crate::Device, } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] impl<'a> DeviceChangedBuilder<'a> { fn new(device: &'a crate::Device, changed_device: &'a crate::Device) -> Self { skip_assert_initialized!(); diff --git a/gstreamer/src/meta.rs b/gstreamer/src/meta.rs index 2e7167ba2..f6e772d5d 100644 --- a/gstreamer/src/meta.rs +++ b/gstreamer/src/meta.rs @@ -12,18 +12,18 @@ use std::ops; use crate::Buffer; use crate::BufferRef; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] use crate::Caps; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] use crate::CapsRef; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] use crate::ClockTime; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] use glib::translate::ToGlib; use glib::translate::{from_glib, from_glib_none, FromGlib, ToGlibPtr}; @@ -71,8 +71,8 @@ pub unsafe trait MetaAPI: Sync + Send + Sized { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] #[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq)] pub struct MetaSeqnum(u64); @@ -152,8 +152,8 @@ impl<'a, T: MetaAPI> MetaRef<'a, T> { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn get_seqnum(&self) -> MetaSeqnum { unsafe { let meta = self.meta as *const _ as *const ffi::GstMeta; @@ -188,8 +188,8 @@ impl<'a, T: MetaAPI, U> MetaRefMut<'a, T, U> { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn get_seqnum(&self) -> u64 { unsafe { let meta = self.meta as *const _ as *const ffi::GstMeta; @@ -344,20 +344,20 @@ impl fmt::Debug for ProtectionMeta { } } -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] #[repr(transparent)] pub struct ReferenceTimestampMeta(ffi::GstReferenceTimestampMeta); -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] unsafe impl Send for ReferenceTimestampMeta {} -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] unsafe impl Sync for ReferenceTimestampMeta {} -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] impl ReferenceTimestampMeta { pub fn add<'a>( buffer: &'a mut BufferRef, @@ -395,8 +395,8 @@ impl ReferenceTimestampMeta { } } -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] unsafe impl MetaAPI for ReferenceTimestampMeta { type GstType = ffi::GstReferenceTimestampMeta; @@ -405,8 +405,8 @@ unsafe impl MetaAPI for ReferenceTimestampMeta { } } -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] impl fmt::Debug for ReferenceTimestampMeta { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("ReferenceTimestampMeta") diff --git a/gstreamer/src/pad_template.rs b/gstreamer/src/pad_template.rs index ab10cf56d..6b261a2a1 100644 --- a/gstreamer/src/pad_template.rs +++ b/gstreamer/src/pad_template.rs @@ -7,16 +7,16 @@ // except according to those terms. use crate::PadTemplate; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] use crate::StaticPadTemplate; -#[cfg(any(feature = "v1_14", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] +#[cfg(any(feature = "v1_14", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] use glib::translate::*; impl PadTemplate { - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] pub fn from_static_pad_template_with_gtype( pad_template: &StaticPadTemplate, pad_type: glib::types::Type, diff --git a/gstreamer/src/param_spec.rs b/gstreamer/src/param_spec.rs index 5ea65cc1e..d930c3ccd 100644 --- a/gstreamer/src/param_spec.rs +++ b/gstreamer/src/param_spec.rs @@ -9,8 +9,8 @@ use glib::translate::*; pub trait GstParamSpecExt { - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] fn array( name: &str, nick: &str, @@ -31,8 +31,8 @@ pub trait GstParamSpecExt { } impl GstParamSpecExt for glib::ParamSpec { - #[cfg(any(feature = "v1_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))] + #[cfg(any(feature = "v1_14", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_14")))] fn array( name: &str, nick: &str, diff --git a/gstreamer/src/query.rs b/gstreamer/src/query.rs index acf9bc081..00664a150 100644 --- a/gstreamer/src/query.rs +++ b/gstreamer/src/query.rs @@ -1303,8 +1303,8 @@ impl Context { declare_concrete_query!(Bitrate, T); -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] impl Bitrate { pub fn new() -> Self { assert_initialized_main_thread!(); @@ -1312,8 +1312,8 @@ impl Bitrate { } } -#[cfg(any(feature = "v1_16", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] +#[cfg(any(feature = "v1_16", all(not(doctest), doc)))] +#[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] impl Default for Bitrate { fn default() -> Self { Self::new() @@ -1321,8 +1321,8 @@ impl Default for Bitrate { } impl Bitrate { - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn get_bitrate(&self) -> u32 { unsafe { let mut bitrate = mem::MaybeUninit::uninit(); @@ -1333,8 +1333,8 @@ impl Bitrate { } impl Bitrate { - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn set_bitrate(&mut self, bitrate: u32) { unsafe { ffi::gst_query_set_bitrate(self.0.as_mut_ptr(), bitrate); diff --git a/gstreamer/src/sample.rs b/gstreamer/src/sample.rs index 1f2353670..f438e4a14 100644 --- a/gstreamer/src/sample.rs +++ b/gstreamer/src/sample.rs @@ -178,32 +178,32 @@ impl SampleRef { } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn set_buffer(&mut self, buffer: Option<&Buffer>) { unsafe { ffi::gst_sample_set_buffer(self.as_mut_ptr(), buffer.to_glib_none().0) } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn set_buffer_list(&mut self, buffer_list: Option<&BufferList>) { unsafe { ffi::gst_sample_set_buffer_list(self.as_mut_ptr(), buffer_list.to_glib_none().0) } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn set_caps(&mut self, caps: Option<&Caps>) { unsafe { ffi::gst_sample_set_caps(self.as_mut_ptr(), caps.to_glib_none().0) } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn set_segment(&mut self, segment: Option<&Segment>) { unsafe { ffi::gst_sample_set_segment(self.as_mut_ptr(), segment.to_glib_none().0) } } - #[cfg(any(feature = "v1_16", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] + #[cfg(any(feature = "v1_16", all(not(doctest), doc)))] + #[cfg_attr(all(not(doctest), doc), doc(cfg(feature = "v1_16")))] pub fn set_info(&mut self, info: Option) { unsafe { ffi::gst_sample_set_info(