rtmp-runtime 0.13.1

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
//! Values the in-crate tests share: the library supplies no limits, so the tests name theirs.

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

pub const MAX_CHUNK_SIZE: u32 = 16 * 1024 * 1024;
pub const MAX_COMMAND_LEN: usize = 64 * 1024;
pub const MAX_FAILED_PUBLISH_ATTEMPTS: u32 = 3;
pub const DEFAULT_AMF0_LIMITS: Amf0Limits = Amf0Limits {
    max_depth: 32,
    max_values: 4096,
};
pub const TEST_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,
};
const CHUNK_SIZE: u32 = 4096;
const WINDOW_ACK_SIZE: u32 = 2_500_000;
const PEER_BANDWIDTH: u32 = 2_500_000;
const PLAY_BUFFER: core::time::Duration = core::time::Duration::from_secs(3);

impl Default for RtmpServerConfig {
    fn default() -> Self {
        RtmpServerConfig::new(
            ServerLimits {
                chunk: TEST_CHUNK_LIMITS,
                amf0: DEFAULT_AMF0_LIMITS,
                max_command_len: MAX_COMMAND_LEN,
                max_failed_publish_attempts: MAX_FAILED_PUBLISH_ATTEMPTS,
            },
            CHUNK_SIZE,
            WINDOW_ACK_SIZE,
            PEER_BANDWIDTH,
        )
    }
}

impl Default for RtmpClientConfig {
    fn default() -> Self {
        RtmpClientConfig::new(
            ClientLimits {
                chunk: TEST_CHUNK_LIMITS,
                amf0: DEFAULT_AMF0_LIMITS,
            },
            CHUNK_SIZE,
            WINDOW_ACK_SIZE,
            PLAY_BUFFER,
        )
    }
}