mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 03:21:00 +00:00
Update for glib::Enum
/ glib::Boxed
/ glib::flags!
macro renames
This commit is contained in:
parent
651ea7de5f
commit
86f422592b
10 changed files with 46 additions and 48 deletions
|
@ -33,22 +33,22 @@ static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
|||
)
|
||||
});
|
||||
|
||||
#[glib::gflags("EbuR128LevelMode")]
|
||||
#[glib::flags(name = "EbuR128LevelMode")]
|
||||
enum Mode {
|
||||
#[gflags(name = "Calculate momentary loudness (400ms)", nick = "momentary")]
|
||||
#[flags_value(name = "Calculate momentary loudness (400ms)", nick = "momentary")]
|
||||
MOMENTARY = 0b00000001,
|
||||
#[gflags(name = "Calculate short-term loudness (3s)", nick = "short-term")]
|
||||
#[flags_value(name = "Calculate short-term loudness (3s)", nick = "short-term")]
|
||||
SHORT_TERM = 0b00000010,
|
||||
#[gflags(
|
||||
#[flags_value(
|
||||
name = "Calculate relative threshold and global loudness",
|
||||
nick = "global"
|
||||
)]
|
||||
GLOBAL = 0b00000100,
|
||||
#[gflags(name = "Calculate loudness range", nick = "loudness-range")]
|
||||
#[flags_value(name = "Calculate loudness range", nick = "loudness-range")]
|
||||
LOUDNESS_RANGE = 0b00001000,
|
||||
#[gflags(name = "Calculate sample peak", nick = "sample-peak")]
|
||||
#[flags_value(name = "Calculate sample peak", nick = "sample-peak")]
|
||||
SAMPLE_PEAK = 0b00010000,
|
||||
#[gflags(name = "Calculate true peak", nick = "true-peak")]
|
||||
#[flags_value(name = "Calculate true peak", nick = "true-peak")]
|
||||
TRUE_PEAK = 0b00100000,
|
||||
}
|
||||
|
||||
|
|
|
@ -108,9 +108,9 @@ pub(crate) struct FragmentOffset {
|
|||
}
|
||||
|
||||
#[allow(clippy::upper_case_acronyms)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, glib::GEnum)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, glib::Enum)]
|
||||
#[repr(i32)]
|
||||
#[genum(type_name = "GstFMP4MuxHeaderUpdateMode")]
|
||||
#[enum_type(name = "GstFMP4MuxHeaderUpdateMode")]
|
||||
pub(crate) enum HeaderUpdateMode {
|
||||
None,
|
||||
Rewrite,
|
||||
|
|
|
@ -21,7 +21,6 @@ use futures::future::BoxFuture;
|
|||
use futures::lock::Mutex as FutMutex;
|
||||
use futures::prelude::*;
|
||||
|
||||
use glib::GBoxed;
|
||||
use gst::glib;
|
||||
|
||||
use gst::prelude::*;
|
||||
|
@ -61,8 +60,8 @@ pub enum Item {
|
|||
Event(gst::Event),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, GBoxed)]
|
||||
#[gboxed(type_name = "TsTestItemSender")]
|
||||
#[derive(Clone, Debug, glib::Boxed)]
|
||||
#[boxed_type(name = "TsTestItemSender")]
|
||||
struct ItemSender {
|
||||
sender: mpsc::Sender<Item>,
|
||||
}
|
||||
|
|
|
@ -112,8 +112,8 @@ fn proxy_from_str(s: Option<String>) -> Result<Option<String>, glib::Error> {
|
|||
|
||||
const REQWEST_CLIENT_CONTEXT: &str = "gst.reqwest.client";
|
||||
|
||||
#[derive(Clone, Debug, glib::GBoxed)]
|
||||
#[gboxed(type_name = "ReqwestClientContext")]
|
||||
#[derive(Clone, Debug, glib::Boxed)]
|
||||
#[boxed_type(name = "ReqwestClientContext")]
|
||||
struct ClientContext(Arc<ClientContextInner>);
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -21,18 +21,18 @@ use gst::prelude::*;
|
|||
mod imp;
|
||||
mod packet;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum)]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstAwsTranscriberResultStability")]
|
||||
#[enum_type(name = "GstAwsTranscriberResultStability")]
|
||||
pub enum AwsTranscriberResultStability {
|
||||
#[genum(name = "High: stabilize results as fast as possible", nick = "high")]
|
||||
#[enum_value(name = "High: stabilize results as fast as possible", nick = "high")]
|
||||
High = 0,
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "Medium: balance between stability and accuracy",
|
||||
nick = "medium"
|
||||
)]
|
||||
Medium = 1,
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "Low: relatively less stable partial transcription results with higher accuracy",
|
||||
nick = "low"
|
||||
)]
|
||||
|
|
|
@ -14,16 +14,16 @@ mod imp;
|
|||
// This enum may be used to control what type of output the progressbin should produce.
|
||||
// It also serves the secondary purpose of illustrating how to add enum-type properties
|
||||
// to a plugin written in rust.
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum)]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstProgressBinOutput")]
|
||||
#[enum_type(name = "GstProgressBinOutput")]
|
||||
pub enum ProgressBinOutput {
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "Println: Outputs the progress using a println! macro.",
|
||||
nick = "println"
|
||||
)]
|
||||
Println = 0,
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "Debug Category: Outputs the progress as info logs under the element's debug category.",
|
||||
nick = "debug-category"
|
||||
)]
|
||||
|
|
|
@ -22,9 +22,9 @@ mod custom_source;
|
|||
mod imp;
|
||||
mod video_fallback;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum)]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstFallbackSourceRetryReason")]
|
||||
#[enum_type(name = "GstFallbackSourceRetryReason")]
|
||||
enum RetryReason {
|
||||
None,
|
||||
Error,
|
||||
|
@ -33,9 +33,9 @@ enum RetryReason {
|
|||
Timeout,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum)]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstFallbackSourceStatus")]
|
||||
#[enum_type(name = "GstFallbackSourceStatus")]
|
||||
enum Status {
|
||||
Stopped,
|
||||
Buffering,
|
||||
|
|
|
@ -26,13 +26,13 @@ use once_cell::sync::Lazy;
|
|||
|
||||
use std::sync::{Mutex, RwLock};
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum)]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstFallbackSwitchStreamHealth")]
|
||||
#[enum_type(name = "GstFallbackSwitchStreamHealth")]
|
||||
pub(crate) enum StreamHealth {
|
||||
#[genum(name = "Data flow is inactive or late", nick = "inactive")]
|
||||
#[enum_value(name = "Data flow is inactive or late", nick = "inactive")]
|
||||
Inactive = 0,
|
||||
#[genum(name = "Data is currently flowing in the stream", nick = "present")]
|
||||
#[enum_value(name = "Data is currently flowing in the stream", nick = "present")]
|
||||
Present = 1,
|
||||
}
|
||||
|
||||
|
|
|
@ -19,10 +19,10 @@ use gst::glib;
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(
|
||||
Serialize, Deserialize, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::GEnum,
|
||||
Serialize, Deserialize, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum,
|
||||
)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstTtToCea608Mode")]
|
||||
#[enum_type(name = "GstTtToCea608Mode")]
|
||||
pub enum Cea608Mode {
|
||||
PopOn,
|
||||
PaintOn,
|
||||
|
|
|
@ -6,50 +6,49 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use glib::GEnum;
|
||||
use gst::glib;
|
||||
use gst::prelude::*;
|
||||
|
||||
mod imp;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, GEnum)]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstRsPngCompressionLevel")]
|
||||
#[enum_type(name = "GstRsPngCompressionLevel")]
|
||||
pub(crate) enum CompressionLevel {
|
||||
#[genum(name = "Default: Use the default compression level.", nick = "default")]
|
||||
#[enum_value(name = "Default: Use the default compression level.", nick = "default")]
|
||||
Default,
|
||||
#[genum(name = "Fast: A fast compression algorithm.", nick = "fast")]
|
||||
#[enum_value(name = "Fast: A fast compression algorithm.", nick = "fast")]
|
||||
Fast,
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "Best: Uses the algorithm with the best results.",
|
||||
nick = "best"
|
||||
)]
|
||||
Best,
|
||||
#[genum(name = "Huffman: Huffman compression.", nick = "huffman")]
|
||||
#[enum_value(name = "Huffman: Huffman compression.", nick = "huffman")]
|
||||
Huffman,
|
||||
#[genum(name = "Rle: Rle compression.", nick = "rle")]
|
||||
#[enum_value(name = "Rle: Rle compression.", nick = "rle")]
|
||||
Rle,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, GEnum)]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy, glib::Enum)]
|
||||
#[repr(u32)]
|
||||
#[genum(type_name = "GstRsPngFilterType")]
|
||||
#[enum_type(name = "GstRsPngFilterType")]
|
||||
pub(crate) enum FilterType {
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "NoFilter: No filtering applied to the output.",
|
||||
nick = "nofilter"
|
||||
)]
|
||||
NoFilter,
|
||||
#[genum(name = "Sub: filter applied to each pixel.", nick = "sub")]
|
||||
#[enum_value(name = "Sub: filter applied to each pixel.", nick = "sub")]
|
||||
Sub,
|
||||
#[genum(name = "Up: Up filter similar to Sub.", nick = "up")]
|
||||
#[enum_value(name = "Up: Up filter similar to Sub.", nick = "up")]
|
||||
Up,
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "Avg: The Average filter uses the average of the two neighboring pixels.",
|
||||
nick = "avg"
|
||||
)]
|
||||
Avg,
|
||||
#[genum(
|
||||
#[enum_value(
|
||||
name = "Paeth: The Paeth filter computes a simple linear function of the three neighboring pixels.",
|
||||
nick = "paeth"
|
||||
)]
|
||||
|
|
Loading…
Reference in a new issue