mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-23 09:28:09 +00:00
cea608overlay: handle CLEAR status
+ log errors Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/754>
This commit is contained in:
parent
3b6ab8f722
commit
a3fad9e028
1 changed files with 27 additions and 13 deletions
|
@ -349,23 +349,37 @@ impl Cea608Overlay {
|
||||||
}
|
}
|
||||||
|
|
||||||
if Some(cc_type) == state.selected_field {
|
if Some(cc_type) == state.selected_field {
|
||||||
if let Ok(Status::Ready) = state
|
match state
|
||||||
.caption_frame
|
.caption_frame
|
||||||
.decode((triple[1] as u16) << 8 | triple[2] as u16, 0.0)
|
.decode((triple[1] as u16) << 8 | triple[2] as u16, 0.0)
|
||||||
{
|
{
|
||||||
let text = match state.caption_frame.to_text(true) {
|
Ok(Status::Ready) => {
|
||||||
Ok(text) => text,
|
let text = match state.caption_frame.to_text(true) {
|
||||||
Err(_) => {
|
Ok(text) => text,
|
||||||
gst_error!(
|
Err(_) => {
|
||||||
CAT,
|
gst_error!(
|
||||||
obj: pad,
|
CAT,
|
||||||
"Failed to convert caption frame to text"
|
obj: pad,
|
||||||
);
|
"Failed to convert caption frame to text"
|
||||||
continue;
|
);
|
||||||
}
|
continue;
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
self.overlay_text(element, &text, state);
|
self.overlay_text(element, &text, state);
|
||||||
|
}
|
||||||
|
Ok(Status::Clear) => {
|
||||||
|
self.overlay_text(element, "", state);
|
||||||
|
}
|
||||||
|
Ok(Status::Ok) => (),
|
||||||
|
Err(err) => {
|
||||||
|
gst_error!(
|
||||||
|
CAT,
|
||||||
|
obj: pad,
|
||||||
|
"Failed to decode caption frame: {:?}",
|
||||||
|
err
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.reset_timeout(state, pts);
|
self.reset_timeout(state, pts);
|
||||||
|
|
Loading…
Reference in a new issue