Tue, 21 Dec 2004 22:14:56 +0100
Here we go,
a little patch to enable mpeg1 again.
can somebody please check this with pal equipment, im in NTSC land right
now.
this patch sets everything the way the encoder/specs like it.
( i hope )
thanks,
ben
diff -BurN ivtv-0.2.0-rc3c/driver/ivtv-ioctl.c ivtv-0.2.0-rc3c-
mpeg1/driver/ivtv-ioctl.c
--- ivtv-0.2.0-rc3c/driver/ivtv-ioctl.c 2004-11-18
23:08:11.000000000 -0600
+++ ivtv-0.2.0-rc3c-mpeg1/driver/ivtv-ioctl.c 2004-12-21
15:05:03.000000000 -0600
@@ -593,6 +593,16 @@
wind.width = itv->width = fmt-
>fmt.pix.width;
wind.height = itv->height = fmt-
>fmt.pix.height;
ivtv_saa7115(itv, DECODER_SET_SIZE,
&wind);
+
+ if ( ( itv->codec.stream_type ==
IVTV_STREAM_MPEG1)||
+ ( itv->codec.stream_type ==
IVTV_STREAM_VCD)){
+ /* this is an MPEG1 stream
*/
+
IVTV_DEBUG(IVTV_DEBUG_INFO,"v4l2 ioctl: set "
+ "format : the
current stream_type is MPEG1 "
+ "or VCD, you have
to do a S_CODEC after this "
+ "ioctl\n ");
+
+ }
}
}
else if (fmt->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
@@ -1274,6 +1284,7 @@
case IVTV_IOC_S_CODEC: {
struct ivtv_ioctl_codec *codec = arg;
+ struct video_window wind;
/* FIXME: insert abundant parameter validation
here */
if((codec->bitrate == 0) || (codec->bitrate_peak
== 0) ||
@@ -1283,6 +1294,33 @@
codec->bitrate, codec-
>bitrate_peak);
return -EINVAL;
} else {
+
+ /* check if it is an MPEG1 stream */
+ if ( ( codec->stream_type == IVTV_STREAM_MPEG1)||
+ ( codec->stream_type == IVTV_STREAM_VCD)){
+ /* this is an MPEG1 stream */
+ int tmp_height = (itv->std & V4L2_STD_NTSC) ?
480 : 576;
+
+ /* set vertical mpeg encoder resolution */
+ if ( itv->height != tmp_height/2 ){
+ itv->height = tmp_height/2;
+ }
+ /* mpeg1 is cbr */
+ codec->bitrate_mode = 1;
+
+
+
+ IVTV_DEBUG(IVTV_DEBUG_INFO,"ivtv ioctl: set
codec: "
+ "stream_type is MPEG1 or VCD.
resolution %dx%d.\n",itv->width,itv->height);
+
+
+ /* fix videodecoder resolution */
+ wind.width = itv->width;
+ wind.height = tmp_height;
+ ivtv_saa7115(itv, DECODER_SET_SIZE, &wind);
+
+ }
+
/* Passed the garbage check */
itv->codec = *codec;
}
@@ -1286,9 +1324,8 @@
/* Passed the garbage check */
itv->codec = *codec;
}
-
ivtv_audio_set_bitrate(itv, codec->audio_bitmask &
0x03);
- break;
+ break;
}
case IVTV_IOC_S_GOP_END: {
On 20 Dec 2004 at 20:12, kevin thayer wrote:
> when I first wrote IVTV, the v4l (ie S_FMT) stuff
> didn't have any real notion of how to handle
> compressed streams.. has it been made aware? if not
> then it should only be handled in s_codec i think.
>
> The added complexity of knowing what the codec type is
> (ie mpeg1) and doing some restrictions when changing
> resolution and other parameters may not be worth it..
> when s_codec sets mpeg1, change the resolution. If
> someone wants to change something later, so be it..
> they'll do it the right way when they find that it
> doesn't work :)
>
> -tmk
>
> --- Ben Willers <[EMAIL PROTECTED]> wrote:
>
> > kevin,
> > you're right. it was all there in 0.1.9 ...
> >
> > 0.1.9 only changes the video resolution etc. when it
> > gets a S_CODEC. i think
> > we should also check the parameters when we get a
> > S_FMT.
> > any opinions ?
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> ivtv-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ivtv-devel
------- End of forwarded message -------
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
ivtv-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ivtv-devel