Rtmp
module Io : sig ... end
I/O helper functions.
module Flv : sig ... end
Operations on flv files.
module Amf : sig ... end
AMF0
Low-level functions.
High-level functions.
module Message : sig ... end
module IMap : sig ... end
type connection = {
mutable start_time : float; |
mutable last_time : float; |
socket : Unix.file_descr; |
mutable chunk_size : int; |
mutable last_timestamp : Stdlib.Int32.t IMap.t; |
mutable last_message_length : int IMap.t; |
mutable last_message_stream_id : Stdlib.Int32.t IMap.t; |
mutable last_message_type_id : int IMap.t; |
mutable partial_messages : Message.t list; |
messages : Message.t Stdlib.Queue.t; |
}
Parameters for a given connection.
val create_connection : Unix.file_descr -> connection
Create a connection.
val now : connection -> int32
Current timestamp.
val delta : connection -> int32
Current timestamp delta.
val chunkify : connection -> chunk_stream_id:int -> timestamp:int32 -> message_type_id:int ->
message_stream_id:int32 -> string -> unit
Write a long message with chunks.
val control_message : connection -> int -> string -> unit
Send a control message.
val set_chunk_size : connection -> int -> unit
val abort_message : connection -> int32 -> unit
val acknowledgement : connection -> int32 -> unit
val user_control : connection -> int -> string -> unit
Send a user control message.
val stream_begin : connection -> int32 -> unit
val ping_request : connection -> int32 -> unit
val ping_response : connection -> int32 -> unit
val window_acknowledgement_size : connection -> int -> unit
val set_peer_bandwidth : connection -> int -> [< `Dynamic | `Hard | `Soft ] -> unit
val command : connection -> ?timestamp:int32 -> ?message_stream_id:int32 ->
string -> int -> Amf.t list -> unit
val audio : connection -> ?timestamp:int32 -> ?message_stream_id:int32 -> string -> unit
val video : connection -> ?timestamp:int32 -> ?message_stream_id:int32 -> string -> unit
val data : connection -> ?message_stream_id:int32 -> Amf.t list -> unit
val handshake : connection -> unit
Perform handshake.
val read_chunk : connection -> unit
Read a chunk.
val has_message : connection -> bool
val pop_message : connection -> Stdlib.Int32.t * Stdlib.Int32.t * [> `Acknowledgement of int32 | `Audio of string | `Command of int * [> `Connect | `Create_stream | `Delete_stream of int | `On_bandwidth_done | `On_status of Amf.t | `Publish of string * string | `Result of Amf.t array | `Unhandled of string * Amf.t array ] | `Data of Amf.t list | `Peer_banddwidth of int32 * [> `Dynamic | `Hard | `Soft ] | `Set_chunk_size of int | `Video of string | `Window_acknowledgement_size of int32 ]
val handle_messages : connection -> (timestamp:Stdlib.Int32.t -> stream:Stdlib.Int32.t ->
[> `Acknowledgement of int32 | `Audio of string | `Command of int * [> `Connect | `Create_stream | `Delete_stream of int | `On_bandwidth_done | `On_status of Amf.t | `Publish of string * string | `Result of Amf.t array | `Unhandled of string * Amf.t array ] | `Data of Amf.t list | `Peer_banddwidth of int32 * [> `Dynamic | `Hard | `Soft ] | `Set_chunk_size of int | `Video of string | `Window_acknowledgement_size of int32 ] -> unit) -> unit
Pass all available messages to a function.
val read_chunks : ?handler:(timestamp:Stdlib.Int32.t -> stream:Stdlib.Int32.t ->
[> `Acknowledgement of int32 | `Audio of string | `Command of int * [> `Connect | `Create_stream | `Delete_stream of int | `On_bandwidth_done | `On_status of Amf.t | `Publish of string * string | `Result of Amf.t array | `Unhandled of string * Amf.t array ] | `Data of Amf.t list | `Peer_banddwidth of int32 * [> `Dynamic | `Hard | `Soft ] | `Set_chunk_size of int | `Video of string | `Window_acknowledgement_size of int32 ] -> unit)
-> connection -> unit
Read as many chunks as available.