cdg: factor out constants module

This commit is contained in:
Guillaume Desmottes 2019-05-26 14:48:33 +02:00
parent dc45b7f8ac
commit 79cef6cbf7
3 changed files with 17 additions and 6 deletions

View file

@ -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,

View file

@ -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;

View file

@ -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)