pub struct StreamBuilder<'a> { /* private fields */ }Expand description
Builder for configuring a GVSP stream.
Implementations§
Source§impl<'a> StreamBuilder<'a>
impl<'a> StreamBuilder<'a>
Sourcepub fn new(device: &'a mut GigeDevice) -> Self
pub fn new(device: &'a mut GigeDevice) -> Self
Create a new builder bound to an opened GigeDevice.
Default packet-size policy is preserve: the camera’s current
GevSCPSPacketSize is used as-is. Call StreamBuilder::auto_packet_size
to set from the NIC MTU and path-probe, or StreamBuilder::packet_size
for an explicit ceiling (ADR-0021).
Sourcepub fn probe(self, enable: bool) -> Self
pub fn probe(self, enable: bool) -> Self
Whether to path-probe with a GVSP test packet before streaming (default: on, under every packet-size policy).
It applies under the default preserve policy too, which is not a contradiction: the probe never raises a size, so it cannot override the value an operator set. It can only decline to stream at a size the path demonstrably drops — something no register read can discover, because both endpoints accept it. Turning it off is what makes preserve literal.
Turning it off restores the pre-0.4.2 behaviour: whatever
GevSCPSPacketSize holds is assumed to reach the host.
That is wrong on any path narrower than both endpoints
(#112), so
the only good reason to disable it is a device that misbehaves when
asked for a test packet — in which case please open an issue, because
the probe is written to tolerate a device that simply ignores it.
Sourcepub fn dest(self, dest: StreamDest) -> Self
pub fn dest(self, dest: StreamDest) -> Self
Configure the stream destination.
Sourcepub fn target_mtu(self, mtu: u32) -> Self
pub fn target_mtu(self, mtu: u32) -> Self
Cap the MTU used when computing the GVSP packet size in
StreamBuilder::auto_packet_size mode.
The interface’s own MTU is still read; this only lowers the request.
Sourcepub fn auto_packet_size(self) -> Self
pub fn auto_packet_size(self) -> Self
Set GevSCPSPacketSize from the host NIC MTU, then path-probe (SR-13).
This is the explicit opt-in that replaces the old always-write-MTU
default (ADR-0021). It is not the pre-0.4 --auto false ⇒ 1500
behaviour.
Sourcepub fn packet_size(self, size: u32) -> Self
pub fn packet_size(self, size: u32) -> Self
Write this GVSP packet size (a ceiling for the path probe).
Sourcepub fn packet_delay(self, delay: u32) -> Self
pub fn packet_delay(self, delay: u32) -> Self
Override the GVSP inter-packet delay.
Sourcepub fn destination_port(self, port: u16) -> Self
pub fn destination_port(self, port: u16) -> Self
Configure the UDP port used for streaming (defaults to 0 => device chosen).
Sourcepub fn multicast(self, group: Option<Ipv4Addr>) -> Self
pub fn multicast(self, group: Option<Ipv4Addr>) -> Self
Configure multicast reception when the device is set to multicast mode.
Sourcepub fn rcvbuf_bytes(self, size: usize) -> Self
pub fn rcvbuf_bytes(self, size: usize) -> Self
Custom receive buffer size for the UDP socket.