diff options
-rw-r--r-- | gst-plugin-cdg/src/cdgdec.rs | 7 | ||||
-rw-r--r-- | gst-plugin-cdg/src/constants.rs | 15 | ||||
-rw-r--r-- | gst-plugin-cdg/src/lib.rs | 1 |
3 files changed, 17 insertions, 6 deletions
diff --git a/gst-plugin-cdg/src/cdgdec.rs b/gst-plugin-cdg/src/cdgdec.rs index 540812bce..83faa526d 100644 --- a/gst-plugin-cdg/src/cdgdec.rs +++ b/gst-plugin-cdg/src/cdgdec.rs @@ -24,12 +24,7 @@ use image::GenericImageView; use muldiv::MulDiv; use std::sync::Mutex; -const CDG_PACKET_SIZE: i32 = 24; -// 75 sectors/sec * 4 packets/sector = 300 packets/sec -const CDG_PACKET_PERIOD: u64 = 300; - -const CDG_WIDTH: u32 = 300; -const CDG_HEIGHT: u32 = 216; +use crate::constants::{CDG_HEIGHT, CDG_PACKET_PERIOD, CDG_PACKET_SIZE, CDG_WIDTH}; struct CdgDec { cat: gst::DebugCategory, diff --git a/gst-plugin-cdg/src/constants.rs b/gst-plugin-cdg/src/constants.rs new file mode 100644 index 000000000..41eae8fca --- /dev/null +++ b/gst-plugin-cdg/src/constants.rs @@ -0,0 +1,15 @@ +// Copyright (C) 2019 Guillaume Desmottes <guillaume.desmottes@collabora.com> +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub(crate) const CDG_PACKET_SIZE: i32 = 24; + +// 75 sectors/sec * 4 packets/sector = 300 packets/sec +pub(crate) const CDG_PACKET_PERIOD: u64 = 300; + +pub(crate) const CDG_WIDTH: u32 = 300; +pub(crate) const CDG_HEIGHT: u32 = 216; diff --git a/gst-plugin-cdg/src/lib.rs b/gst-plugin-cdg/src/lib.rs index 7e33cd5bf..bc723acbc 100644 --- a/gst-plugin-cdg/src/lib.rs +++ b/gst-plugin-cdg/src/lib.rs @@ -14,6 +14,7 @@ extern crate glib; extern crate gstreamer as gst; mod cdgdec; +mod constants; fn plugin_init(plugin: &gst::Plugin) -> Result<(), glib::BoolError> { cdgdec::register(plugin) |