mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-10-31 22:58:51 +00:00
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:
parent
6c5a0c2795
commit
4333e90220
1 changed files with 1 additions and 13 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue