rtmp-runtime 0.13.0

Sans-IO RTMP 1.0 (Adobe Real-Time Messaging Protocol) publish engine for both ends: a driveable ingest server state machine and a publish client over the handshake, chunk stream, AMF0, and message layers; optional tokio socket adapter.
Documentation
//! The numbers these tests pass: the library supplies none.

use core::time::Duration;

use rtmp_runtime::amf0::Amf0Limits;
use rtmp_runtime::chunk::ChunkLimits;
use rtmp_runtime::client::{ClientLimits, RtmpClientConfig};
use rtmp_runtime::server::{RtmpServerConfig, ServerLimits};

pub const MAX_CHUNK_SIZE: u32 = 16 * 1024 * 1024;
pub const MAX_COMMAND_LEN: usize = 64 * 1024;
pub const MAX_AMF0_VALUES: usize = 4096;
pub const AMF0_LIMITS: Amf0Limits = Amf0Limits {
    max_depth: 32,
    max_values: MAX_AMF0_VALUES,
};
pub const CHUNK_LIMITS: ChunkLimits = ChunkLimits {
    max_chunk_size: MAX_CHUNK_SIZE,
    max_message_len: 8 * 1024 * 1024,
    max_csids: 64,
    max_in_progress_bytes: 16 * 1024 * 1024,
};
pub const SERVER_LIMITS: ServerLimits = ServerLimits {
    chunk: CHUNK_LIMITS,
    amf0: AMF0_LIMITS,
    max_command_len: MAX_COMMAND_LEN,
    max_failed_publish_attempts: 3,
};

pub fn server_config() -> RtmpServerConfig {
    RtmpServerConfig::new(SERVER_LIMITS, 4096, 2_500_000, 2_500_000)
}

pub fn client_config() -> RtmpClientConfig {
    RtmpClientConfig::new(
        ClientLimits {
            chunk: CHUNK_LIMITS,
            amf0: AMF0_LIMITS,
        },
        4096,
        2_500_000,
        Duration::from_secs(3),
    )
}