All of lore.kernel.org
 help / color / mirror / Atom feed
* V4L2_PIX_FMT_MPEG and S_FMT
@ 2011-06-18 19:11 Christian Gmeiner
  2011-06-18 19:53 ` Hans Verkuil
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Gmeiner @ 2011-06-18 19:11 UTC (permalink / raw)
  To: linux-media

Hi all,

I am still in the process of porting a driver to v4l2 framework. This
device is capable of decoding MPEG-1 and MPEG-2 streams.
See http://dxr3.sourceforge.net/about.html for more details.
So I have programmed this:

static int vidioc_enum_fmt_vid_out(struct file *file, void *fh,
				struct v4l2_fmtdesc *fmt)
{
	if (fmt->index > 0)
		return -EINVAL;

	fmt->flags = V4L2_FMT_FLAG_COMPRESSED;
	fmt->pixelformat = V4L2_PIX_FMT_MPEG;
	strlcpy(fmt->description, "MPEG 1/2", sizeof(fmt->description));

	return 0;
}

There is nothing in struct v4l2_format which indicates MPEG1, MPEG2 or
MPEG4. As a result
of this, it is not possible to return -EINVAL if somebody wants to
decode/playback MPEG4 content.

Any ideas how to achieve it?

Thanks
--
Christian Gmeiner, MSc

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: V4L2_PIX_FMT_MPEG and S_FMT
  2011-06-18 19:11 V4L2_PIX_FMT_MPEG and S_FMT Christian Gmeiner
@ 2011-06-18 19:53 ` Hans Verkuil
  2011-06-26 21:59   ` Christian Gmeiner
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Verkuil @ 2011-06-18 19:53 UTC (permalink / raw)
  To: Christian Gmeiner; +Cc: linux-media

On Saturday, June 18, 2011 21:11:37 Christian Gmeiner wrote:
> Hi all,
> 
> I am still in the process of porting a driver to v4l2 framework. This
> device is capable of decoding MPEG-1 and MPEG-2 streams.

Are we talking about decoding multiplexed streams or elementary streams?
E.g., audio+video or just the elementary video stream?

For decoding elementary streams pixelformats are being defined in an
RFC by Kamil Debski:

http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/34229

For multiplexed streams ivtv just uses V4L2_PIX_FMT_MPEG which can be used
for any MPEG program or transport stream. There is currently no method of
communicating to userspace which audio/video formats inside that PS/TS stream
are supported.

The problem is that that information is hidden inside the stream. If your
hardware does multiplexed stream decoding, then what happens when you give
it an mpeg stream with unsupported codecs? Does the hardware give an error?

Regards,

	Hans

> See http://dxr3.sourceforge.net/about.html for more details.
> So I have programmed this:
> 
> static int vidioc_enum_fmt_vid_out(struct file *file, void *fh,
> 				struct v4l2_fmtdesc *fmt)
> {
> 	if (fmt->index > 0)
> 		return -EINVAL;
> 
> 	fmt->flags = V4L2_FMT_FLAG_COMPRESSED;
> 	fmt->pixelformat = V4L2_PIX_FMT_MPEG;
> 	strlcpy(fmt->description, "MPEG 1/2", sizeof(fmt->description));
> 
> 	return 0;
> }
> 
> There is nothing in struct v4l2_format which indicates MPEG1, MPEG2 or
> MPEG4. As a result
> of this, it is not possible to return -EINVAL if somebody wants to
> decode/playback MPEG4 content.
> 
> Any ideas how to achieve it?
> 
> Thanks
> --
> Christian Gmeiner, MSc
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: V4L2_PIX_FMT_MPEG and S_FMT
  2011-06-18 19:53 ` Hans Verkuil
@ 2011-06-26 21:59   ` Christian Gmeiner
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Gmeiner @ 2011-06-26 21:59 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: linux-media

> On Saturday, June 18, 2011 21:11:37 Christian Gmeiner wrote:
>> Hi all,
>>
>> I am still in the process of porting a driver to v4l2 framework. This
>> device is capable of decoding MPEG-1 and MPEG-2 streams.
>
> Are we talking about decoding multiplexed streams or elementary streams?
> E.g., audio+video or just the elementary video stream?
>

We are talking about elementary video stream only.

> For decoding elementary streams pixelformats are being defined in an
> RFC by Kamil Debski:
>
> http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/34229
>

That would fix the problem I have - fine.

> For multiplexed streams ivtv just uses V4L2_PIX_FMT_MPEG which can be used
> for any MPEG program or transport stream. There is currently no method of
> communicating to userspace which audio/video formats inside that PS/TS stream
> are supported.
>
> The problem is that that information is hidden inside the stream. If your
> hardware does multiplexed stream decoding, then what happens when you give
> it an mpeg stream with unsupported codecs? Does the hardware give an error?
>
> Regards,
>
>        Hans
>
>> See http://dxr3.sourceforge.net/about.html for more details.
>> So I have programmed this:
>>
>> static int vidioc_enum_fmt_vid_out(struct file *file, void *fh,
>>                               struct v4l2_fmtdesc *fmt)
>> {
>>       if (fmt->index > 0)
>>               return -EINVAL;
>>
>>       fmt->flags = V4L2_FMT_FLAG_COMPRESSED;
>>       fmt->pixelformat = V4L2_PIX_FMT_MPEG;
>>       strlcpy(fmt->description, "MPEG 1/2", sizeof(fmt->description));
>>
>>       return 0;
>> }
>>
>> There is nothing in struct v4l2_format which indicates MPEG1, MPEG2 or
>> MPEG4. As a result
>> of this, it is not possible to return -EINVAL if somebody wants to
>> decode/playback MPEG4 content.
>>
>> Any ideas how to achieve it?
>>
>> Thanks
>> --
>> Christian Gmeiner, MSc
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-media" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
>

--
Christian Gmeiner, MSc

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-26 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-18 19:11 V4L2_PIX_FMT_MPEG and S_FMT Christian Gmeiner
2011-06-18 19:53 ` Hans Verkuil
2011-06-26 21:59   ` Christian Gmeiner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.