go7007 development
Hello,
I am working on adding the Sensoray 2250 to the go7007 staging tree, starting from GregKH's staging patch here:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
gregkh-05-staging-2.6.27.patch
In particular, we are stuck how to change the MPEG format with standard IOCTL calls. In particular, this comment in the driver go7007.h below needs explanation:
/* DEPRECATED -- use V4L2_PIX_FMT_MPEG and then call GO7007IOC_S_MPEG_PARAMS
* to select between MPEG1, MPEG2, and MPEG4 */
#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M','P','G','4') /* MPEG4 */
The existing driver, for backward-compatibility , allowed V4L2_PIX_FMT_MPEG4 to be used for v4l2_format.pixelformat with VIDIOC_S_FMT.
GO7007IOC_S_MPEG_PARAMS is a custom ioctl call and we would rather have this done through v4l2 calls. We also can't seem to find where MPEG1, MPEG2, and MPEG4 elementary streams are defined in the V4L2 API. We checked other drivers, but could not find anything. The closest thing we found was the V4L2_CID_MPEG_STREAM_TYPE control, but the enums do not define elementary streams nor MPEG4.
Your advice is appreciated.
Thanks.
Signature · 9 lines
Pete Eberlein Sensoray Co., Inc. Email: [email protected] http://www.sensoray.com -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
Hi Pete,
Quoted 28 lines · On Friday 17 October 2008 17:21:51 Pete wrote:
Hello,
I am working on adding the Sensoray 2250 to the go7007 staging tree, starting from GregKH's staging patch here:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
gregkh-05-staging-2.6.27.patchIn particular, we are stuck how to change the MPEG format with standard IOCTL calls. In particular, this comment in the driver
go7007.hbelow needs explanation:/* DEPRECATED -- use
V4L2_PIX_FMT_MPEGand then callGO7007IOC_S_MPEG_PARAMS* to select between MPEG1, MPEG2, and MPEG4 */#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M','P','G','4') /* MPEG4 */The existing driver, for backward-compatibility , allowed
V4L2_PIX_FMT_MPEG4to be used for v4l2_format.pixelformat withVIDIOC_S_FMT.
GO7007IOC_S_MPEG_PARAMSis a custom ioctl call and we would rather have this done through v4l2 calls. We also can't seem to find where MPEG1, MPEG2, and MPEG4 elementary streams are defined in the V4L2 API. We checked other drivers, but could not find anything. The closest thing we found was theV4L2_CID_MPEG_STREAM_TYPEcontrol, but the enums do not define elementary streams nor MPEG4.
Quoted 3 lines
Your advice is appreciated.
Thanks.
It would be really nice to have this driver in the kernel.
All MPEG streams use V4L2_PIX_FMT_MPEG and set the exact stream type through V4L2_CID_MPEG_STREAM_TYPE. You probably need to add a few new stream types to this control for the elementary streams. I think something like TYPE_MPEG_ELEM might do the trick, and then you can use the audio and video encoding controls to select the precise audio/video encoding.
I don't know enough about the capabilities, so perhaps TYPE_MPEG1/2/4_ELEM is required instead of a more generic TYPE_MPEG_ELEM.
Since I designed the MPEG API for V4L2 I guess I'm the right person to help you. I also have a Plextor TV402U since I always wanted to get the go7007 driver into the kernel, but I never had the time so I'm glad you've picked it up.
Regards,
Hans
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 34 lines · Hans Verkuil
Hi Pete,
Quoted 30 lines · On Friday 17 October 2008 17:21:51 Pete wrote:
Hello,
I am working on adding the Sensoray 2250 to the go7007 staging tree, starting from GregKH's staging patch here:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
gregkh-05-staging-2.6.27.patchIn particular, we are stuck how to change the MPEG format with standard IOCTL calls. In particular, this comment in the driver
go7007.hbelow needs explanation:/* DEPRECATED -- use
V4L2_PIX_FMT_MPEGand then callGO7007IOC_S_MPEG_PARAMS* to select between MPEG1, MPEG2, and MPEG4 */#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M','P','G','4') /* MPEG4 */The existing driver, for backward-compatibility , allowed
V4L2_PIX_FMT_MPEG4to be used for v4l2_format.pixelformat withVIDIOC_S_FMT.
GO7007IOC_S_MPEG_PARAMSis a custom ioctl call and we would rather have this done through v4l2 calls. We also can't seem to find where MPEG1, MPEG2, and MPEG4 elementary streams are defined in the V4L2 API. We checked other drivers, but could not find anything. The closest thing we found was theV4L2_CID_MPEG_STREAM_TYPEcontrol, but the enums do not define elementary streams nor MPEG4.Your advice is appreciated.
Quoted 10 lines
Quoted 2 lines
Thanks.
It would be really nice to have this driver in the kernel.
All MPEG streams use
V4L2_PIX_FMT_MPEGand set the exact stream type throughV4L2_CID_MPEG_STREAM_TYPE. You probably need to add a few new stream types to this control for the elementary streams. I think something likeTYPE_MPEG_ELEMmight do the trick, and then you can use the audio and video encoding controls to select the precise audio/video encoding.I don't know enough about the capabilities, so perhaps TYPE_MPEG1/2/4_ELEM is required instead of a more generic
TYPE_MPEG_ELEM.
The generic approach seems better. There will be boards with H264 encapsulated in MPEG2 transport stream. I'd recommend keeping the encapsulation/mux format in V4L2_CID_MPEG_STREAM_TYPE, but not necessarily the encoding.
Otherwise you'll have V4L2_MPEG_STREAM_TYPE_MPEG2_TS_MPEG4_ENCODING, etc.. Maybe V4L2_CID_MPEG_STREAM_TYPE needs a comment that it is the encapsulation(or mux format), and the encoding should be defined in V4L2_CID_MPEG_VIDEO_ENCODING?
So for this Go7007, we suggest adding V4L2_MPEG_STREAM_TYPE_ELEM to V4L2_CID_MPEG_STREAM_TYPE.
We also suggest adding V4L2_MPEG_VIDEO_ENCODING_MPEG_4 to V4L2_CID_MPEG_VIDEO_ENCODING. Of course, there is the question of what version of MPEG4, but we'll leave that for another day.
What do you think?
Quoted 7 lines
Since I designed the MPEG API for V4L2 I guess I'm the right person to help you. I also have a Plextor TV402U since I always wanted to get the go7007 driver into the kernel, but I never had the time so I'm glad you've picked it up.
Regards,
Hans
Good to hear, and thanks for the quick response.
Dean
Signature · 11 lines
Dean Anderson Sensoray Co., Inc. Email: [email protected] http://www.sensoray.com -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 55 lines · On Friday 17 October 2008 18:07:41 Dean Anderson wrote:
Quoted 45 lines · Hans Verkuil
Hi Pete,
Quoted 29 lines · On Friday 17 October 2008 17:21:51 Pete wrote:
Hello,
I am working on adding the Sensoray 2250 to the go7007 staging tree, starting from GregKH's staging patch here:
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
gregkh-05-staging-2.6.27.patchIn particular, we are stuck how to change the MPEG format with standard IOCTL calls. In particular, this comment in the driver
go7007.hbelow needs explanation:/* DEPRECATED -- use
V4L2_PIX_FMT_MPEGand then callGO7007IOC_S_MPEG_PARAMS* to select between MPEG1, MPEG2, and MPEG4 */
#defineV4L2_PIX_FMT_MPEG4v4l2_fourcc('M','P','G','4')/*
MPEG4 */The existing driver, for backward-compatibility , allowed
V4L2_PIX_FMT_MPEG4to be used for v4l2_format.pixelformat withVIDIOC_S_FMT.
GO7007IOC_S_MPEG_PARAMSis a custom ioctl call and we would rather have this done through v4l2 calls. We also can't seem to find where MPEG1, MPEG2, and MPEG4 elementary streams are defined in the V4L2 API. We checked other drivers, but could not find anything. The closest thing we found was theV4L2_CID_MPEG_STREAM_TYPEcontrol, but the enums do not define elementary streams nor MPEG4.Quoted 3 lines
Your advice is appreciated.
Thanks.
It would be really nice to have this driver in the kernel.
All MPEG streams use
V4L2_PIX_FMT_MPEGand set the exact stream type throughV4L2_CID_MPEG_STREAM_TYPE. You probably need to add a few new stream types to this control for the elementary streams. I think something likeTYPE_MPEG_ELEMmight do the trick, and then you can use the audio and video encoding controls to select the precise audio/video encoding.Quoted 3 lines
I don't know enough about the capabilities, so perhaps TYPE_MPEG1/2/4_ELEM is required instead of a more generic
TYPE_MPEG_ELEM.The generic approach seems better. There will be boards with H264 encapsulated in MPEG2 transport stream. I'd recommend keeping the encapsulation/mux format in
V4L2_CID_MPEG_STREAM_TYPE, but not necessarily the encoding.
Quoted 4 lines
Otherwise you'll have
V4L2_MPEG_STREAM_TYPE_MPEG2_TS_MPEG4_ENCODING, etc.. MaybeV4L2_CID_MPEG_STREAM_TYPEneeds a comment that it is the encapsulation(or mux format), and the encoding should be defined inV4L2_CID_MPEG_VIDEO_ENCODING?
I think the v4l2 spec is clear enough on this topic.
Quoted 7 lines
So for this Go7007, we suggest adding
V4L2_MPEG_STREAM_TYPE_ELEMtoV4L2_CID_MPEG_STREAM_TYPE.
We also suggest addingV4L2_MPEG_VIDEO_ENCODING_MPEG_4toV4L2_CID_MPEG_VIDEO_ENCODING. Of course, there is the question of what version of MPEG4, but we'll leave that for another day.What do you think?
Agreed. Note that V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC already exists in the master v4l-dvb tree http://linuxtv.org/hg/v4l-dvb, also some newer audio encodings. These are merged in the latest 2.6.28 git tree as well.
When the go7007 driver has stabilized a bit and switched to the generic ioctls rather than using custom ioctls then you probably want to have you code merged in v4l-dvb. I expect a lot of internal API additions and improvements in the coming months so it's probably good to pay attention to the master tree to see what is happening there.
Quoted 11 lines
Quoted 9 lines
Since I designed the MPEG API for V4L2 I guess I'm the right person to help you. I also have a Plextor TV402U since I always wanted to get the go7007 driver into the kernel, but I never had the time so I'm glad you've picked it up.
Regards,
Hans
Good to hear, and thanks for the quick response.
No problem.
Regards,
Hans
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
PATCH 1/1 Add MPEG4 and Elementary streams (was Re: go7007 development)
In reply to Hans VerkuilHello Hans,
Quoted 6 lines · Hans Verkuil
All MPEG streams use
V4L2_PIX_FMT_MPEGand set the exact stream type throughV4L2_CID_MPEG_STREAM_TYPE. You probably need to add a few new stream types to this control for the elementary streams. I think something likeTYPE_MPEG_ELEMmight do the trick, and then you can use the audio and video encoding controls to select the precise audio/video encoding.
Here is a patch that adds the two defines we need for the go7007 driver extended MPEG controls. Please consider it for inclusion in the v4l-dvb tree.
V4L2_MPEG_STREAM_TYPE_MPEG_ELEM will be used for elementary MPEG streams, whose type and encoding will be determined by examining a header in the stream. For more information, see
http://en.wikipedia.org/wiki/Elementary_stream
V4L2_MPEG_VIDEO_ENCODING_MPEG_4 will be used for MPEG-4 Part 2 (Simple Profile, Advanced Simple Profile, etc) encoding. This is not the same as MPEG-4 AVC (Part 10, Advanced Video Coding).
Thanks.
Signature · 33 lines
Pete Eberlein Sensoray Co., Inc. Email: [email protected] http://www.sensoray.com Signed-off-by: Pete Eberlein <[email protected]> --- diff -r fe810917c6ca linux/include/linux/videodev2.h --- a/linux/include/linux/videodev2.h Fri Oct 24 13:19:14 2008 -0200 +++ b/linux/include/linux/videodev2.h Fri Oct 24 09:57:46 2008 -0700 @@ -892,6 +892,7 @@ enum v4l2_mpeg_stream_type { V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3, /* MPEG-2 DVD-compatible stream */ V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4, /* MPEG-1 VCD-compatible stream */ V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5, /* MPEG-2 SVCD-compatible stream */ + V4L2_MPEG_STREAM_TYPE_MPEG_ELEM = 6, /* MPEG elementary stream */ }; #define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1) #define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2) @@ -1027,6 +1028,7 @@ enum v4l2_mpeg_video_encoding { V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1, V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC = 2, + V4L2_MPEG_VIDEO_ENCODING_MPEG_4 = 3, }; #define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201) enum v4l2_mpeg_video_aspect { -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list