Commit 43fe0336 authored by ogg.k.ogg.k's avatar ogg.k.ogg.k
Browse files

flush all kate events from the renderer upon flushing/seeking

parent ddfa229e
......@@ -78,6 +78,14 @@ public class Renderer {
return img;
}
/**
* Flushes all events.
*/
public void flush() {
items.removeAllElements();
dirty = true;
}
public boolean isDirty() {
return dirty;
}
......
......@@ -34,6 +34,16 @@ public class KateOverlay extends Overlay
private Pad kateSinkPad = new Pad(Pad.SINK, "katesink") {
protected boolean eventFunc (com.fluendo.jst.Event event) {
/* don't propagate, the video sink is the master */
switch (event.getType()) {
case com.fluendo.jst.Event.FLUSH_START:
case com.fluendo.jst.Event.FLUSH_STOP:
case com.fluendo.jst.Event.NEWSEGMENT:
onFlush();
break;
default:
break;
}
return true;
}
......@@ -66,6 +76,16 @@ public class KateOverlay extends Overlay
Debug.log(Debug.DEBUG, "Kate overlay got Kate event: "+new String(ev.text));
}
/**
* Upon a flushing event, remove any existing event, now obsolete.
* This needs locking so the Kate events are not changed while the
* overlay is rendering them to an image.
*/
protected synchronized void onFlush() {
tr.flush();
Debug.log(Debug.DEBUG, "Kate overlay flushing");
}
/**
* Overlay the Kate renderer onto the given image.
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment