memset(svbi->service_lines, 0, sizeof(svbi->service_lines));
svbi->service_set = 0; /* we're done if raw VBI is active */ /* TODO: this will have to be changed for generic_mode VBI */ if ((cx25840_read(client, 0x404) & 0x10) == 0) return 0;
if (is_pal) { for (i = 7; i <= 23; i++) {
u8 v = cx25840_read(client,
state->vbi_regs_offset + 0x424 + i - 7);
svbi->service_lines[0][i] = lcr2vbi[v >> 4];
svbi->service_lines[1][i] = lcr2vbi[v & 0xf];
svbi->service_set |= svbi->service_lines[0][i] |
svbi->service_lines[1][i];
}
} else { for (i = 10; i <= 21; i++) {
u8 v = cx25840_read(client,
state->vbi_regs_offset + 0x424 + i - 10);
/* VBI Offset */ if (is_cx23888(state))
cx25840_write(client, 0x54f, vbi_offset); else
cx25840_write(client, 0x47f, vbi_offset); /* TODO: this will have to be changed for generic_mode VBI */
cx25840_write(client, 0x404, 0x2e); return 0;
}
int cx25840_s_sliced_fmt(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *svbi)
{ struct i2c_client *client = v4l2_get_subdevdata(sd); struct cx25840_state *state = to_state(sd); int is_pal = !(state->std & V4L2_STD_525_60); int vbi_offset = is_pal ? 1 : 0; int i, x;
u8 lcr[24];
for (x = 0; x <= 23; x++)
lcr[x] = 0x00;
/* Setup standard */
cx25840_std_setup(client);
/* Sliced VBI */ /* TODO: this will have to be changed for generic_mode VBI */
cx25840_write(client, 0x404, 0x32); /* Ancillary data */
cx25840_write(client, 0x406, 0x13); if (is_cx23888(state))
cx25840_write(client, 0x54f, vbi_offset); else
cx25840_write(client, 0x47f, vbi_offset);
if (is_pal) { for (i = 0; i <= 6; i++)
svbi->service_lines[0][i] =
svbi->service_lines[1][i] = 0;
} else { for (i = 0; i <= 9; i++)
svbi->service_lines[0][i] =
svbi->service_lines[1][i] = 0;
for (i = 22; i <= 23; i++)
svbi->service_lines[0][i] =
svbi->service_lines[1][i] = 0;
}
for (i = 7; i <= 23; i++) { for (x = 0; x <= 1; x++) { switch (svbi->service_lines[1-x][i]) { case V4L2_SLICED_TELETEXT_B:
lcr[i] |= 1 << (4 * x); break; case V4L2_SLICED_WSS_625:
lcr[i] |= 4 << (4 * x); break; case V4L2_SLICED_CAPTION_525:
lcr[i] |= 6 << (4 * x); break; case V4L2_SLICED_VPS:
lcr[i] |= 9 << (4 * x); break;
}
}
}
if (is_pal) { for (x = 1, i = state->vbi_regs_offset + 0x424;
i <= state->vbi_regs_offset + 0x434; i++, x++)
cx25840_write(client, i, lcr[6 + x]);
} else { for (x = 1, i = state->vbi_regs_offset + 0x424;
i <= state->vbi_regs_offset + 0x430; i++, x++)
cx25840_write(client, i, lcr[9 + x]); for (i = state->vbi_regs_offset + 0x431;
i <= state->vbi_regs_offset + 0x434; i++)
cx25840_write(client, i, 0);
}
cx25840_write(client, state->vbi_regs_offset + 0x43c, 0x16); /* TODO: this will have to be changed for generic_mode VBI */ if (is_cx23888(state))
cx25840_write(client, 0x428, is_pal ? 0x2a : 0x22); else
cx25840_write(client, 0x474, is_pal ? 0x2a : 0x22); return 0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.