#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[repr(i32)]
pub enum EStreamFrameEvent {
    InputEventStart = 0,
    InputEventSend = 1,
    InputEventRecv = 2,
    InputEventQueued = 3,
    InputEventHandled = 4,
    Start = 5,
    CaptureBegin = 6,
    CaptureEnd = 7,
    ConvertBegin = 8,
    ConvertEnd = 9,
    EncodeBegin = 10,
    EncodeEnd = 11,
    Send = 12,
    Recv = 13,
    DecodeBegin = 14,
    DecodeEnd = 15,
    UploadBegin = 16,
    UploadEnd = 17,
    Complete = 18,
}

impl EStreamFrameEvent {
    pub fn from_i32(val: i32) -> Option<Self> {
        match val {
            x if x == Self::InputEventStart as i32 => Some(Self::InputEventStart),
            x if x == Self::InputEventSend as i32 => Some(Self::InputEventSend),
            x if x == Self::InputEventRecv as i32 => Some(Self::InputEventRecv),
            x if x == Self::InputEventQueued as i32 => Some(Self::InputEventQueued),
            x if x == Self::InputEventHandled as i32 => Some(Self::InputEventHandled),
            x if x == Self::Start as i32 => Some(Self::Start),
            x if x == Self::CaptureBegin as i32 => Some(Self::CaptureBegin),
            x if x == Self::CaptureEnd as i32 => Some(Self::CaptureEnd),
            x if x == Self::ConvertBegin as i32 => Some(Self::ConvertBegin),
            x if x == Self::ConvertEnd as i32 => Some(Self::ConvertEnd),
            x if x == Self::EncodeBegin as i32 => Some(Self::EncodeBegin),
            x if x == Self::EncodeEnd as i32 => Some(Self::EncodeEnd),
            x if x == Self::Send as i32 => Some(Self::Send),
            x if x == Self::Recv as i32 => Some(Self::Recv),
            x if x == Self::DecodeBegin as i32 => Some(Self::DecodeBegin),
            x if x == Self::DecodeEnd as i32 => Some(Self::DecodeEnd),
            x if x == Self::UploadBegin as i32 => Some(Self::UploadBegin),
            x if x == Self::UploadEnd as i32 => Some(Self::UploadEnd),
            x if x == Self::Complete as i32 => Some(Self::Complete),
            _ => None,
        }
    }
}
