Struct libpulse_binding::stream::FlagSet
source ·
[−]#[repr(transparent)]pub struct FlagSet { /* private fields */ }
Expand description
Flag set.
Implementations
Create the stream corked, requiring an explicit Stream::uncork()
call to uncork it.
Interpolate the latency for this stream. When enabled, Stream::get_latency()
and
Stream::get_time()
will try to estimate the current record/playback time based on
the local time that passed since the last timing info update. Using this option has the
advantage of not requiring a whole round trip when the current playback/recording time
is needed. Consider using this option when requesting latency information frequently.
This is especially useful on long latency network connections. It makes a lot of sense
to combine this option with AUTO_TIMING_UPDATE
.
Don’t force the time to increase monotonically. If this option is enabled,
Stream::get_time()
will not necessarily return always monotonically increasing time
values on each call. This may confuse applications which cannot deal with time going
‘backwards’, but has the advantage that bad transport latency estimations that caused
the time to jump ahead can be corrected quickly, without the need to wait.
If set timing update requests are issued periodically automatically. Combined with
INTERPOLATE_TIMING
you will be able to query the current time and latency with
Stream::get_time()
and Stream::get_latency()
at all times without a packet round
trip.
Don’t remap channels by their name, instead map them simply by their index. Implies
NO_REMIX_CHANNELS
.
When remapping channels by name, don’t upmix or downmix them to related channels. Copy them into matching channels of the device 1:1.
Use the sample format of the sink/device this stream is being connected to, and possibly
ignore the format the sample spec contains – but you still have to pass a valid value
in it as a hint to PulseAudio what would suit your stream best. If this is used you
should query the used sample format after creating the stream by using
Stream::get_sample_spec()
. Also, if you specified manual buffer metrics it is
recommended to update them with Stream::set_buffer_attr()
to compensate for the
changed frame sizes.
When creating streams with Stream::new_extended()
, this flag has no effect. If you
specify a format with PCM encoding, and you want the server to choose the sample format,
then you should leave the sample format unspecified in the Info
object. This also
means that you can’t use Info::new_from_sample_spec()
, because that function always
sets the sample format.
Use the sample rate of the sink, and possibly ignore the rate the sample spec contains.
Usage similar to FIX_FORMAT
.
When creating streams with Stream::new_extended()
, this flag has no effect. If you
specify a format with PCM encoding, and you want the server to choose the sample rate,
then you should leave the rate unspecified in the Info
object. This also means that
you can’t use Info::new_from_sample_spec()
, because that function always sets the
sample rate.
Use the number of channels and the channel map of the sink, and possibly ignore the number
of channels and the map the sample spec and the passed channel map contains. Usage similar
to FIX_FORMAT
.
When creating streams with Stream::new_extended()
, this flag has no effect. If you
specify a format with PCM encoding, and you want the server to choose the channel count
and/or channel map, then you should leave the channels and/or the channel map
unspecified in the Info
object. This also means that you can’t use
Info::new_from_sample_spec()
, because that function always sets the channel count
(but if you only want to leave the channel map unspecified, then
Info::new_from_sample_spec()
works, because the channel map parameter is optional).
Don’t allow moving of this stream to another sink/device. Useful if you use any of the
Fix*
flags and want to make sure that resampling never takes place – which might
happen if the stream is moved to another sink/source with a different sample
spec/channel map.
Allow dynamic changing of the sampling rate during playback with
Stream::update_sample_rate()
.
Find peaks instead of resampling.
Create in muted state. If neither START_UNMUTED
nor this is specified, it is left to
the server to decide whether to create the stream in muted or in un-muted state.
Try to adjust the latency of the sink/source based on the requested buffer metrics and
adjust buffer metrics accordingly. Also see BufferAttr
. This option may not be
specified at the same time as EARLY_REQUESTS
.
Enable compatibility mode for legacy clients that rely on a “classic” hardware device
fragment-style playback model. If this option is set, the minreq
value of the buffer
metrics gets a new meaning: instead of just specifying that no requests asking for less
new data than this value will be made to the client it will also guarantee that requests
are generated as early as this limit is reached. This flag should only be set in very
few situations where compatibility with a fragment-based playback model needs to be kept
and the client applications cannot deal with data requests that are delayed to the
latest moment possible. (Usually these are programs that use usleep() or a similar call
in their playback loops instead of sleeping on the device itself.) Also see
BufferAttr
. This option may not be specified at the same time as ADJUST_LATENCY
.
If set this stream won’t be taken into account when it is checked whether the device this stream is connected to should auto-suspend.
Create in unmuted state. If neither START_MUTED
nor this is specified, it is left to
the server to decide whether to create the stream in muted or in unmuted state.
If the sink/source this stream is connected to is suspended during the creation of this stream, cause it to fail. If the sink/source is being suspended during creation of this stream, make sure this stream is terminated.
If a volume is passed when this stream is created, consider it relative to the sink’s current volume, never as absolute device volume. If this is not specified the volume will be consider absolute when the sink is in flat volume mode, relative otherwise.
Used to tag content that will be rendered by passthrough sinks. The data will be left as is and not reformatted, resampled.
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
Returns true
if there are flags common to both self
and other
.
Returns true
if all of the flags in other
are contained within self
.
Inserts or removes the specified flags depending on the passed value.
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations
Disables all flags disabled in the set.
Adds the set of flags.
Toggles the set of flags.
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Creates a value from an iterator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Disables all flags enabled in the set.
Auto Trait Implementations
impl RefUnwindSafe for FlagSet
impl UnwindSafe for FlagSet
Blanket Implementations
Mutably borrows from an owned value. Read more