// This file is @generated by prost-build.
/// Main message wrapper
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataMessage {
    #[prost(enumeration = "MessageType", tag = "1")]
    pub r#type: i32,
    #[prost(uint64, tag = "2")]
    pub timestamp: u64,
    #[prost(oneof = "data_message::Payload", tags = "3, 4, 5, 6, 7, 8, 9, 10")]
    pub payload: ::core::option::Option<data_message::Payload>,
}
/// Nested message and enum types in `DataMessage`.
pub mod data_message {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Payload {
        #[prost(message, tag = "3")]
        Hello(super::HelloMessage),
        #[prost(message, tag = "4")]
        Init(super::InitMessage),
        #[prost(message, tag = "5")]
        Auth(super::AuthMessage),
        #[prost(message, tag = "6")]
        AuthResponse(super::AuthResponse),
        #[prost(message, tag = "7")]
        H264(super::H264Message),
        #[prost(message, tag = "8")]
        Audio(super::AudioMessage),
        #[prost(message, tag = "9")]
        Ping(super::PingMessage),
        #[prost(message, tag = "10")]
        Pong(super::PongMessage),
    }
}
/// Hello message for initial handshake
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HelloMessage {
    #[prost(uint32, tag = "1")]
    pub version: u32,
    #[prost(string, optional, tag = "2")]
    pub nonce: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "3")]
    pub capabilities: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// UUID string
    #[prost(string, optional, tag = "4")]
    pub client_id: ::core::option::Option<::prost::alloc::string::String>,
}
/// Stream initialization
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct InitMessage {
    /// "Video", "Audio", "KeepAlive"
    #[prost(string, tag = "1")]
    pub stream_type: ::prost::alloc::string::String,
}
/// Authentication
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthMessage {
    #[prost(string, tag = "1")]
    pub auth: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub serial: ::prost::alloc::string::String,
    #[prost(bytes = "vec", tag = "3")]
    pub sign: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "4")]
    pub stream_id: u64,
}
/// Auth response
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthResponse {
    #[prost(bool, tag = "1")]
    pub success: bool,
    #[prost(string, optional, tag = "2")]
    pub message: ::core::option::Option<::prost::alloc::string::String>,
}
/// H264 video frame
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct H264Message {
    #[prost(bytes = "vec", tag = "1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "2")]
    pub timestamp: u64,
    /// 0: Unknown, 1: I-Frame, 2: P-Frame, 3: B-Frame
    #[prost(uint32, tag = "3")]
    pub frame_type: u32,
    #[prost(map = "string, string", tag = "4")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    #[prost(uint32, optional, tag = "5")]
    pub width: ::core::option::Option<u32>,
    #[prost(uint32, optional, tag = "6")]
    pub height: ::core::option::Option<u32>,
}
/// Audio frame
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AudioMessage {
    #[prost(bytes = "vec", tag = "1")]
    pub data: ::prost::alloc::vec::Vec<u8>,
    #[prost(uint64, tag = "2")]
    pub timestamp: u64,
    #[prost(map = "string, string", tag = "3")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// Network stats messages
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PingMessage {
    #[prost(uint64, tag = "1")]
    pub sequence_number: u64,
    #[prost(uint64, tag = "2")]
    pub timestamp: u64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PongMessage {
    #[prost(uint64, tag = "1")]
    pub sequence_number: u64,
    #[prost(uint64, tag = "2")]
    pub timestamp: u64,
    #[prost(uint64, tag = "3")]
    pub receive_timestamp: u64,
}
/// Message types
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MessageType {
    Unknown = 0,
    Hello = 1,
    Init = 2,
    Auth = 3,
    AuthResponse = 4,
    H264 = 5,
    Audio = 6,
    Ping = 7,
    Pong = 8,
}
impl MessageType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unknown => "UNKNOWN",
            Self::Hello => "HELLO",
            Self::Init => "INIT",
            Self::Auth => "AUTH",
            Self::AuthResponse => "AUTH_RESPONSE",
            Self::H264 => "H264",
            Self::Audio => "AUDIO",
            Self::Ping => "PING",
            Self::Pong => "PONG",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "UNKNOWN" => Some(Self::Unknown),
            "HELLO" => Some(Self::Hello),
            "INIT" => Some(Self::Init),
            "AUTH" => Some(Self::Auth),
            "AUTH_RESPONSE" => Some(Self::AuthResponse),
            "H264" => Some(Self::H264),
            "AUDIO" => Some(Self::Audio),
            "PING" => Some(Self::Ping),
            "PONG" => Some(Self::Pong),
            _ => None,
        }
    }
}
