Commit 0ed4a6ea authored by Oliver Endriss's avatar Oliver Endriss Committed by Mauro Carvalho Chehab

V4L/DVB (7118): dvb-ttpci: Improved display of still pictures

Improved display of still pictures (VIDEO_STILLPICTURE ioctl).
Ensure that both fields are displayed for progressive frames.

Thanks to Reinhard Nissl and Klaus Schmidinger for finding out
that the FREEZE command does this.

Thanks-to: Reinhard Nissl <rnissl@gmx.de>
Thanks-to: Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de>
Signed-off-by: default avatarOliver Endriss <o.endriss@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 251130bf
...@@ -966,6 +966,7 @@ static u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x ...@@ -966,6 +966,7 @@ static u8 iframe_header[] = { 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x80, 0x00, 0x
static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len, int nonblock) static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len, int nonblock)
{ {
int i, n; int i, n;
int progressive = 0;
dprintk(2, "av7110:%p, \n", av7110); dprintk(2, "av7110:%p, \n", av7110);
...@@ -974,6 +975,14 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len ...@@ -974,6 +975,14 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
return -EBUSY; return -EBUSY;
} }
for (i = 0; i < len - 5; i++) {
/* get progressive flag from picture extension */
if (buf[i] == 0x00 && buf[i+1] == 0x00 &&
buf[i+2] == 0x01 && (unsigned char)buf[i+3] == 0xb5 &&
(buf[i+4] & 0xf0) == 0x10)
progressive = buf[i+5] & 0x08;
}
/* setting n always > 1, fixes problems when playing stillframes /* setting n always > 1, fixes problems when playing stillframes
consisting of I- and P-Frames */ consisting of I- and P-Frames */
n = MIN_IFRAME / len + 1; n = MIN_IFRAME / len + 1;
...@@ -985,6 +994,10 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len ...@@ -985,6 +994,10 @@ static int play_iframe(struct av7110 *av7110, char __user *buf, unsigned int len
dvb_play(av7110, buf, len, 0, 1); dvb_play(av7110, buf, len, 0, 1);
av7110_ipack_flush(&av7110->ipack[1]); av7110_ipack_flush(&av7110->ipack[1]);
if (progressive)
return vidcom(av7110, AV_VIDEO_CMD_FREEZE, 1);
else
return 0; return 0;
} }
......
Markdown is supported
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