Skip to main content

Crate librtmp2

Crate librtmp2 

Source
Expand description

librtmp2 — A Rust port of the librtmp2 RTMP/RTMPS protocol library.

This is a complete 1:1 Rust port of the C library librtmp2. It provides server, client, handshake, chunk, message, AMF, FLV, and E-RTMP functionality.

Re-exports§

pub use media::DeliveryHint;
pub use session::RelayFrame;
pub use types::*;

Modules§

alloc
Custom allocator hooks for librtmp2
amf
AMF0/AMF3 encoder/decoder
buffer
Growable byte buffer
bytes
Byte-swapping and endian helpers
chunk
Chunk reader/writer + csid state
client
Outbound RTMP client
ertmp
Enhanced RTMP v1/v2 extension types
flv
FLV audio/video/script tag parsing
handshake
Legacy RTMP handshake (C0/C1/C2 ↔ S0/S1/S2)
log
Logging subsystem
media
Media helpers shared by the session hot path and server relay cache.
message
Message dispatch, control, and command encode/decode
net
Small networking helpers shared by the server (bind) and client (connect) entry points, plus the platform socket layer every transport sits on.
server
RTMP server listener
session
Connection lifecycle, state machine, publish/play flows
transport
Plaintext + optional TLS byte transport.
types
Core type definitions for librtmp2

Macros§

log_debug
Log at debug level.
log_error
Log at error level.
log_info
Log at info level.
log_warn
Log at warn level.

Constants§

VERSION_STRING
Library version string.

Functions§

error_string
Get the error string for an error code.
lrtmp2_client_connect⚠
Connect (FFI-compatible).
lrtmp2_client_create⚠
Create a client (FFI-compatible). config may be NULL to use defaults (verify rtmps:// peers against the system trust store). When non-NULL, config.tls_ca_file (a CA bundle to trust instead of the system store) and config.tls_insecure (must be exactly 1 to skip verification, for testing only) control rtmps:// verification for this client. Returns NULL if tls_ca_file is non-NULL but not valid UTF-8, rather than silently falling back to default verification.
lrtmp2_client_destroy⚠
Destroy a client (FFI-compatible).
lrtmp2_client_play⚠
Play (FFI-compatible).
lrtmp2_client_poll⚠
Poll client (FFI-compatible).
lrtmp2_client_publish⚠
Publish (FFI-compatible).
lrtmp2_client_send_frame⚠
Send a frame (FFI-compatible).
lrtmp2_conn_get_fd⚠
Get connection fd (FFI-compatible).
lrtmp2_error_string⚠
Get error string (FFI-compatible).
lrtmp2_server_create⚠
Create a server (FFI-compatible).
lrtmp2_server_destroy⚠
Destroy a server (FFI-compatible).
lrtmp2_server_listen⚠
Start listening (FFI-compatible).
lrtmp2_server_poll⚠
Poll for events (FFI-compatible).
lrtmp2_server_stop⚠
Stop the server (FFI-compatible).
lrtmp2_tls_supported
Check TLS support (FFI-compatible).
lrtmp2_version_major
Get major version (FFI-compatible).
lrtmp2_version_minor
Get minor version (FFI-compatible).
lrtmp2_version_patch
Get patch version (FFI-compatible).
lrtmp2_version_string
Get version string (FFI-compatible).
tls_supported
Check if TLS support is available.
version_major
Get the major version number.
version_minor
Get the minor version number.
version_patch
Get the patch version number.
version_string
Get the library version string.