Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113871
b: refs/heads/master
c: f03813e
h: refs/heads/master
i:
  113869: b326ac2
  113867: 685daeb
  113863: 948e804
  113855: 9be43e4
v: v3
  • Loading branch information
Dmitry Belimov authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 356daf3 commit e5700ed
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d95af9d09d537d287eea9914c0d1ca4cfa0ec7f
refs/heads/master: f03813e4d1900b619d4cb133506b130e535614f0
17 changes: 11 additions & 6 deletions trunk/drivers/media/video/saa7134/saa6752hs.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static int saa6752hs_qmenu(struct saa6752hs_state *h,
return v4l2_ctrl_query_menu(qmenu, &qctrl, NULL);
}

static int saa6752hs_init(struct i2c_client* client)
static int saa6752hs_init(struct i2c_client *client, u32 leading_null_bytes)
{
unsigned char buf[9], buf2[4];
struct saa6752hs_state *h;
Expand Down Expand Up @@ -705,6 +705,12 @@ static int saa6752hs_init(struct i2c_client* client)
buf[1] = 0x05;
i2c_master_send(client,buf,2);

/* Set leading null byte for TS */
buf[0] = 0xF6;
buf[1] = (leading_null_bytes >> 8) & 0xff;
buf[2] = leading_null_bytes & 0xff;
i2c_master_send(client, buf, 3);

/* compute PAT */
memcpy(localPAT, PAT, sizeof(PAT));
localPAT[17] = 0xe0 | ((h->params.ts_pid_pmt >> 8) & 0x0f);
Expand Down Expand Up @@ -812,14 +818,13 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
int i;

switch (cmd) {
case VIDIOC_INT_INIT:
/* apply settings and start encoder */
saa6752hs_init(client, *(u32 *)arg);
break;
case VIDIOC_S_EXT_CTRLS:
if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
return -EINVAL;
if (ctrls->count == 0) {
/* apply settings and start encoder */
saa6752hs_init(client);
break;
}
/* fall through */
case VIDIOC_TRY_EXT_CTRLS:
case VIDIOC_G_EXT_CTRLS:
Expand Down
15 changes: 12 additions & 3 deletions trunk/drivers/media/video/saa7134/saa7134-empress.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,19 @@ static void ts_reset_encoder(struct saa7134_dev* dev)

static int ts_init_encoder(struct saa7134_dev* dev)
{
struct v4l2_ext_controls ctrls = { V4L2_CTRL_CLASS_MPEG, 0 };

u32 leading_null_bytes = 0;

/* If more cards start to need this, then this
should probably be added to the card definitions. */
switch (dev->board) {
case SAA7134_BOARD_BEHOLD_M6:
case SAA7134_BOARD_BEHOLD_M63:
case SAA7134_BOARD_BEHOLD_M6_EXTRA:
leading_null_bytes = 1;
break;
}
ts_reset_encoder(dev);
saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, &ctrls);
saa7134_i2c_call_clients(dev, VIDIOC_INT_INIT, &leading_null_bytes);
dev->empress_started = 1;
return 0;
}
Expand Down

0 comments on commit e5700ed

Please sign in to comment.