forked from mirrors/gstreamer-rs
Improve conversion code for enum variants
This commit is contained in:
parent
7e892b507f
commit
dcd0695567
1 changed files with 39 additions and 39 deletions
|
@ -565,45 +565,45 @@ impl FromGlib<ffi::GstMessageType> for MessageType {
|
||||||
unsafe fn from_glib(value: ffi::GstMessageType) -> Self {
|
unsafe fn from_glib(value: ffi::GstMessageType) -> Self {
|
||||||
skip_assert_initialized!();
|
skip_assert_initialized!();
|
||||||
match value {
|
match value {
|
||||||
0 => MessageType::Unknown,
|
ffi::GST_MESSAGE_UNKNOWN => MessageType::Unknown,
|
||||||
1 => MessageType::Eos,
|
ffi::GST_MESSAGE_EOS => MessageType::Eos,
|
||||||
2 => MessageType::Error,
|
ffi::GST_MESSAGE_ERROR => MessageType::Error,
|
||||||
4 => MessageType::Warning,
|
ffi::GST_MESSAGE_WARNING => MessageType::Warning,
|
||||||
8 => MessageType::Info,
|
ffi::GST_MESSAGE_INFO => MessageType::Info,
|
||||||
16 => MessageType::Tag,
|
ffi::GST_MESSAGE_TAG => MessageType::Tag,
|
||||||
32 => MessageType::Buffering,
|
ffi::GST_MESSAGE_BUFFERING => MessageType::Buffering,
|
||||||
64 => MessageType::StateChanged,
|
ffi::GST_MESSAGE_STATE_CHANGED => MessageType::StateChanged,
|
||||||
128 => MessageType::StateDirty,
|
ffi::GST_MESSAGE_STATE_DIRTY => MessageType::StateDirty,
|
||||||
256 => MessageType::StepDone,
|
ffi::GST_MESSAGE_STEP_DONE => MessageType::StepDone,
|
||||||
512 => MessageType::ClockProvide,
|
ffi::GST_MESSAGE_CLOCK_PROVIDE => MessageType::ClockProvide,
|
||||||
1024 => MessageType::ClockLost,
|
ffi::GST_MESSAGE_CLOCK_LOST => MessageType::ClockLost,
|
||||||
2048 => MessageType::NewClock,
|
ffi::GST_MESSAGE_NEW_CLOCK => MessageType::NewClock,
|
||||||
4096 => MessageType::StructureChange,
|
ffi::GST_MESSAGE_STRUCTURE_CHANGE => MessageType::StructureChange,
|
||||||
8192 => MessageType::StreamStatus,
|
ffi::GST_MESSAGE_STREAM_STATUS => MessageType::StreamStatus,
|
||||||
16384 => MessageType::Application,
|
ffi::GST_MESSAGE_APPLICATION => MessageType::Application,
|
||||||
32768 => MessageType::Element,
|
ffi::GST_MESSAGE_ELEMENT => MessageType::Element,
|
||||||
65536 => MessageType::SegmentStart,
|
ffi::GST_MESSAGE_SEGMENT_START => MessageType::SegmentStart,
|
||||||
131072 => MessageType::SegmentDone,
|
ffi::GST_MESSAGE_SEGMENT_DONE => MessageType::SegmentDone,
|
||||||
262144 => MessageType::DurationChanged,
|
ffi::GST_MESSAGE_DURATION_CHANGED => MessageType::DurationChanged,
|
||||||
524288 => MessageType::Latency,
|
ffi::GST_MESSAGE_LATENCY => MessageType::Latency,
|
||||||
1048576 => MessageType::AsyncStart,
|
ffi::GST_MESSAGE_ASYNC_START => MessageType::AsyncStart,
|
||||||
2097152 => MessageType::AsyncDone,
|
ffi::GST_MESSAGE_ASYNC_DONE => MessageType::AsyncDone,
|
||||||
4194304 => MessageType::RequestState,
|
ffi::GST_MESSAGE_REQUEST_STATE => MessageType::RequestState,
|
||||||
8388608 => MessageType::StepStart,
|
ffi::GST_MESSAGE_STEP_START => MessageType::StepStart,
|
||||||
16777216 => MessageType::Qos,
|
ffi::GST_MESSAGE_QOS => MessageType::Qos,
|
||||||
33554432 => MessageType::Progress,
|
ffi::GST_MESSAGE_PROGRESS => MessageType::Progress,
|
||||||
67108864 => MessageType::Toc,
|
ffi::GST_MESSAGE_TOC => MessageType::Toc,
|
||||||
134217728 => MessageType::ResetTime,
|
ffi::GST_MESSAGE_RESET_TIME => MessageType::ResetTime,
|
||||||
268435456 => MessageType::StreamStart,
|
ffi::GST_MESSAGE_STREAM_START => MessageType::StreamStart,
|
||||||
536870912 => MessageType::NeedContext,
|
ffi::GST_MESSAGE_NEED_CONTEXT => MessageType::NeedContext,
|
||||||
1073741824 => MessageType::HaveContext,
|
ffi::GST_MESSAGE_HAVE_CONTEXT => MessageType::HaveContext,
|
||||||
2147483648 => MessageType::Extended,
|
ffi::GST_MESSAGE_EXTENDED => MessageType::Extended,
|
||||||
2147483649 => MessageType::DeviceAdded,
|
ffi::GST_MESSAGE_DEVICE_ADDED => MessageType::DeviceAdded,
|
||||||
2147483650 => MessageType::DeviceRemoved,
|
ffi::GST_MESSAGE_DEVICE_REMOVED => MessageType::DeviceRemoved,
|
||||||
2147483651 => MessageType::PropertyNotify,
|
ffi::GST_MESSAGE_PROPERTY_NOTIFY => MessageType::PropertyNotify,
|
||||||
2147483652 => MessageType::StreamCollection,
|
ffi::GST_MESSAGE_STREAM_COLLECTION => MessageType::StreamCollection,
|
||||||
2147483653 => MessageType::StreamsSelected,
|
ffi::GST_MESSAGE_STREAMS_SELECTED => MessageType::StreamsSelected,
|
||||||
2147483654 => MessageType::Redirect,
|
ffi::GST_MESSAGE_REDIRECT => MessageType::Redirect,
|
||||||
value => MessageType::__Unknown(value as i32),
|
value => MessageType::__Unknown(value as i32),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue