The patch number 8105 was added via Hans Verkuil <[EMAIL PROTECTED]> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: [EMAIL PROTECTED] ------ From: Hans Verkuil <[EMAIL PROTECTED]> cx2341x: add TS capability The cx18 can support transport streams with newer firmwares. Add a TS capability to the generic cx2341x module. Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]> --- linux/drivers/media/video/cx18/cx18-controls.c | 4 + linux/drivers/media/video/cx2341x.c | 33 ++++++++++------ linux/drivers/media/video/cx23885/cx23885-417.c | 2 linux/drivers/media/video/cx88/cx88-blackbird.c | 3 - linux/drivers/media/video/ivtv/ivtv-controls.c | 4 + linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 3 - linux/include/media/cx2341x.h | 7 +-- 7 files changed, 37 insertions(+), 19 deletions(-) diff -r 2ea57f76416a -r a34f635c9f54 linux/drivers/media/video/cx18/cx18-controls.c --- a/linux/drivers/media/video/cx18/cx18-controls.c Sun Jun 22 13:57:31 2008 +0200 +++ b/linux/drivers/media/video/cx18/cx18-controls.c Sun Jun 22 14:03:28 2008 +0200 @@ -92,11 +92,13 @@ int cx18_queryctrl(struct file *file, vo int cx18_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) { + struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; struct v4l2_queryctrl qctrl; qctrl.id = qmenu->id; cx18_queryctrl(file, fh, &qctrl); - return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); + return v4l2_ctrl_query_menu(qmenu, &qctrl, + cx2341x_ctrl_get_menu(&cx->params, qmenu->id)); } int cx18_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) diff -r 2ea57f76416a -r a34f635c9f54 linux/drivers/media/video/cx2341x.c --- a/linux/drivers/media/video/cx2341x.c Sun Jun 22 13:57:31 2008 +0200 +++ b/linux/drivers/media/video/cx2341x.c Sun Jun 22 14:03:28 2008 +0200 @@ -84,7 +84,7 @@ EXPORT_SYMBOL(cx2341x_mpeg_ctrls); /* Map the control ID to the correct field in the cx2341x_mpeg_params struct. Return -EINVAL if the ID is unknown, else return 0. */ -static int cx2341x_get_ctrl(struct cx2341x_mpeg_params *params, +static int cx2341x_get_ctrl(const struct cx2341x_mpeg_params *params, struct v4l2_ext_control *ctrl) { switch (ctrl->id) { @@ -424,7 +424,7 @@ static int cx2341x_ctrl_query_fill(struc return 0; } -int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, +int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, struct v4l2_queryctrl *qctrl) { int err; @@ -584,9 +584,9 @@ int cx2341x_ctrl_query(struct cx2341x_mp } EXPORT_SYMBOL(cx2341x_ctrl_query); -const char **cx2341x_ctrl_get_menu(u32 id) -{ - static const char *mpeg_stream_type[] = { +const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id) +{ + static const char *mpeg_stream_type_without_ts[] = { "MPEG-2 Program Stream", "", "MPEG-1 System Stream", @@ -596,6 +596,16 @@ const char **cx2341x_ctrl_get_menu(u32 i NULL }; + static const char *mpeg_stream_type_with_ts[] = { + "MPEG-2 Program Stream", + "MPEG-2 Transport Stream", + "MPEG-1 System Stream", + "MPEG-2 DVD-compatible Stream", + "MPEG-1 VCD-compatible Stream", + "MPEG-2 SVCD-compatible Stream", + NULL + }; + static const char *cx2341x_video_spatial_filter_mode_menu[] = { "Manual", "Auto", @@ -634,7 +644,8 @@ const char **cx2341x_ctrl_get_menu(u32 i switch (id) { case V4L2_CID_MPEG_STREAM_TYPE: - return mpeg_stream_type; + return (p->capabilities & CX2341X_CAP_HAS_TS) ? + mpeg_stream_type_with_ts : mpeg_stream_type_without_ts; case V4L2_CID_MPEG_AUDIO_L1_BITRATE: case V4L2_CID_MPEG_AUDIO_L3_BITRATE: return NULL; @@ -694,7 +705,7 @@ int cx2341x_ext_ctrls(struct cx2341x_mpe if (err) break; if (qctrl.type == V4L2_CTRL_TYPE_MENU) - menu_items = cx2341x_ctrl_get_menu(qctrl.id); + menu_items = cx2341x_ctrl_get_menu(params, qctrl.id); err = v4l2_ctrl_check(ctrl, &qctrl, menu_items); if (err) break; @@ -937,9 +948,9 @@ int cx2341x_update(void *priv, cx2341x_m } EXPORT_SYMBOL(cx2341x_update); -static const char *cx2341x_menu_item(struct cx2341x_mpeg_params *p, u32 id) -{ - const char **menu = cx2341x_ctrl_get_menu(id); +static const char *cx2341x_menu_item(const struct cx2341x_mpeg_params *p, u32 id) +{ + const char **menu = cx2341x_ctrl_get_menu(p, id); struct v4l2_ext_control ctrl; if (menu == NULL) @@ -956,7 +967,7 @@ invalid: return "<invalid>"; } -void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix) +void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix) { int is_mpeg1 = p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1; int temporal = p->video_temporal_filter; diff -r 2ea57f76416a -r a34f635c9f54 linux/drivers/media/video/cx23885/cx23885-417.c --- a/linux/drivers/media/video/cx23885/cx23885-417.c Sun Jun 22 13:57:31 2008 +0200 +++ b/linux/drivers/media/video/cx23885/cx23885-417.c Sun Jun 22 14:03:28 2008 +0200 @@ -1173,7 +1173,7 @@ static int cx23885_querymenu(struct cx23 qctrl.id = qmenu->id; cx23885_queryctrl(dev, &qctrl); return v4l2_ctrl_query_menu(qmenu, &qctrl, - cx2341x_ctrl_get_menu(qmenu->id)); + cx2341x_ctrl_get_menu(&dev->mpeg_params, qmenu->id)); } int cx23885_do_ioctl(struct inode *inode, struct file *file, int radio, diff -r 2ea57f76416a -r a34f635c9f54 linux/drivers/media/video/cx88/cx88-blackbird.c --- a/linux/drivers/media/video/cx88/cx88-blackbird.c Sun Jun 22 13:57:31 2008 +0200 +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c Sun Jun 22 14:03:28 2008 +0200 @@ -733,7 +733,8 @@ static int vidioc_querymenu (struct file qctrl.id = qmenu->id; blackbird_queryctrl(dev, &qctrl); - return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); + return v4l2_ctrl_query_menu(qmenu, &qctrl, + cx2341x_ctrl_get_menu(&dev->params, qmenu->id)); } static int vidioc_querycap (struct file *file, void *priv, diff -r 2ea57f76416a -r a34f635c9f54 linux/drivers/media/video/ivtv/ivtv-controls.c --- a/linux/drivers/media/video/ivtv/ivtv-controls.c Sun Jun 22 13:57:31 2008 +0200 +++ b/linux/drivers/media/video/ivtv/ivtv-controls.c Sun Jun 22 14:03:28 2008 +0200 @@ -89,11 +89,13 @@ int ivtv_queryctrl(struct file *file, vo int ivtv_querymenu(struct file *file, void *fh, struct v4l2_querymenu *qmenu) { + struct ivtv *itv = ((struct ivtv_open_id *)fh)->itv; struct v4l2_queryctrl qctrl; qctrl.id = qmenu->id; ivtv_queryctrl(file, fh, &qctrl); - return v4l2_ctrl_query_menu(qmenu, &qctrl, cx2341x_ctrl_get_menu(qmenu->id)); + return v4l2_ctrl_query_menu(qmenu, &qctrl, + cx2341x_ctrl_get_menu(&itv->params, qmenu->id)); } int ivtv_s_ctrl(struct file *file, void *fh, struct v4l2_control *vctrl) diff -r 2ea57f76416a -r a34f635c9f54 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Jun 22 13:57:31 2008 +0200 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Jun 22 14:03:28 2008 +0200 @@ -2030,7 +2030,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct case V4L2_CTRL_TYPE_MENU: ciptr->type = pvr2_ctl_enum; ciptr->def.type_enum.value_names = - cx2341x_ctrl_get_menu(ciptr->v4l_id); + cx2341x_ctrl_get_menu(&hdw->enc_ctl_state, + ciptr->v4l_id); for (cnt1 = 0; ciptr->def.type_enum.value_names[cnt1] != NULL; cnt1++) { } diff -r 2ea57f76416a -r a34f635c9f54 linux/include/media/cx2341x.h --- a/linux/include/media/cx2341x.h Sun Jun 22 13:57:31 2008 +0200 +++ b/linux/include/media/cx2341x.h Sun Jun 22 14:03:28 2008 +0200 @@ -27,6 +27,7 @@ enum cx2341x_port { enum cx2341x_cap { CX2341X_CAP_HAS_SLICED_VBI = 1 << 0, + CX2341X_CAP_HAS_TS = 1 << 1, }; struct cx2341x_mpeg_params { @@ -88,13 +89,13 @@ int cx2341x_update(void *priv, cx2341x_m int cx2341x_update(void *priv, cx2341x_mbox_func func, const struct cx2341x_mpeg_params *old, const struct cx2341x_mpeg_params *new); -int cx2341x_ctrl_query(struct cx2341x_mpeg_params *params, +int cx2341x_ctrl_query(const struct cx2341x_mpeg_params *params, struct v4l2_queryctrl *qctrl); -const char **cx2341x_ctrl_get_menu(u32 id); +const char **cx2341x_ctrl_get_menu(const struct cx2341x_mpeg_params *p, u32 id); int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params, int busy, struct v4l2_ext_controls *ctrls, unsigned int cmd); void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p); -void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix); +void cx2341x_log_status(const struct cx2341x_mpeg_params *p, const char *prefix); /* Firmware names */ #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw" --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/a34f635c9f5418460a46db460b0bc56f4891e601 _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits