tttocea608: use crate defined is_* functions instead of reeimplementing them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1398>
This commit is contained in:
Matthew Waters 2023-11-03 14:36:51 +11:00
parent 6c5a0c2795
commit 4333e90220

View file

@ -15,25 +15,13 @@ use gst::glib::once_cell::sync::Lazy;
use crate::ffi; use crate::ffi;
use std::sync::Mutex; use std::sync::Mutex;
use crate::cea608utils::{Cea608Mode, TextStyle}; use crate::cea608utils::{is_basicna, is_specialna, is_westeu, Cea608Mode, TextStyle};
use crate::ttutils::{Chunk, Line, Lines}; use crate::ttutils::{Chunk, Line, Lines};
fn is_punctuation(word: &str) -> bool { fn is_punctuation(word: &str) -> bool {
word == "." || word == "," || word == "?" || word == "!" || word == ";" || word == ":" word == "." || word == "," || word == "?" || word == "!" || word == ";" || word == ":"
} }
fn is_basicna(cc_data: u16) -> bool {
0x0000 != (0x6000 & cc_data)
}
fn is_westeu(cc_data: u16) -> bool {
0x1220 == (0x7660 & cc_data)
}
fn is_specialna(cc_data: u16) -> bool {
0x1130 == (0x7770 & cc_data)
}
#[allow(clippy::trivially_copy_pass_by_ref)] #[allow(clippy::trivially_copy_pass_by_ref)]
fn eia608_from_utf8_1(c: &[u8; 5]) -> u16 { fn eia608_from_utf8_1(c: &[u8; 5]) -> u16 {
assert!(c[4] == 0); assert!(c[4] == 0);