Skip to content

Commit

Permalink
CEA608: PAINT-ON Mode must keep the last shown captions on the screen
Browse files Browse the repository at this point in the history
[Problem]
PAINT-ON mode is not implemented. From the compliance tests:
* RDC command has no effect except to select paint-on style.
* Next data are written directly to the display upon receipt.
* If other captioning is already on the screen, the four-row
limit is still in effect.

[Solution]
It is a rare use case, we do not support overriding characters in
existing cueBuilders as PAINT-ON would require. But several
compliance tests check if the screen is cleared when the mode
switch happens. We must keep the old captions when switching
to PAINT-ON mode

[Test]
- Live Over-the-Air content, beginning of commercials often uses
PAINT-ON mode
  • Loading branch information
zsmatyas committed Nov 26, 2018
1 parent f4d9ded commit d1e49f2
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,19 @@ private void setCaptionMode(int captionMode) {
int oldCaptionMode = this.captionMode;
this.captionMode = captionMode;

// Clear the working memory.
// Clear the cues and cueBuilders except for Paint-on mode. Paint-on mode may modify characters
// already on the screen. This feature is not fully supported, but we need to keep the previous
// screen content shown
if (captionMode == CC_MODE_PAINT_ON) {
// update the Mode member of all existing cueBuilders even if we are mid-row
for (CueBuilder builder : cueBuilders) {
builder.setCaptionMode(captionMode);
}
return;
}

resetCueBuilders();

if (oldCaptionMode == CC_MODE_PAINT_ON || captionMode == CC_MODE_ROLL_UP
|| captionMode == CC_MODE_UNKNOWN) {
// When switching from paint-on or to roll-up or unknown, we also need to clear the caption.
Expand Down Expand Up @@ -653,6 +664,10 @@ public CueBuilder(int captionMode, int captionRowCount) {
setCaptionRowCount(captionRowCount);
}

public void setCaptionMode(int captionMode) {
this.captionMode = captionMode;
}

public void reset(int captionMode) {
this.captionMode = captionMode;
cueStyles.clear();
Expand Down

0 comments on commit d1e49f2

Please sign in to comment.