diff options
author | Catalin Climov <devnull@localhost> | 2005-08-17 20:55:37 +0000 |
---|---|---|
committer | Catalin Climov <devnull@localhost> | 2005-08-17 20:55:37 +0000 |
commit | b3f409c46b9b52d0526cc21ac645a19d8f8e7662 (patch) | |
tree | 66f1cf6de83cef0f08993ff57d272f8953671058 /linux/drivers | |
parent | cad4a4110faf2672fc6dec4d5ca6c09ccac2e3e2 (diff) | |
download | mediapointer-dvb-s2-b3f409c46b9b52d0526cc21ac645a19d8f8e7662.tar.gz mediapointer-dvb-s2-b3f409c46b9b52d0526cc21ac645a19d8f8e7662.tar.bz2 |
Small mpeg fixes and cleanups for blackbird.
* cx88-blackbird.c:
- fix mpeg packet size & count
- add VIDIOC_QUERYCAP ioctl for the mpeg stream
- return more information in struct v4l2_format
- fix default window height
* cx88-video.c:
- small cleanups
Signed-off-by: Catalin Climov <catalin@climov.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-blackbird.c | 69 | ||||
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-video.c | 10 |
2 files changed, 68 insertions, 11 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-blackbird.c b/linux/drivers/media/video/cx88/cx88-blackbird.c index e9848fdc9..704259ec6 100644 --- a/linux/drivers/media/video/cx88/cx88-blackbird.c +++ b/linux/drivers/media/video/cx88/cx88-blackbird.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-blackbird.c,v 1.32 2005/08/16 16:29:52 catalin Exp $ + * $Id: cx88-blackbird.c,v 1.33 2005/08/17 20:55:37 catalin Exp $ * * Support for a cx23416 mpeg encoder via cx2388x host port. * "blackbird" reference design. @@ -700,8 +700,11 @@ static void blackbird_codec_settings(struct cx8802_dev *dev) #endif /* assign stream type */ +#if 1 blackbird_api_cmd(dev, BLACKBIRD_API_SET_STREAM_TYPE, 1, 0, BLACKBIRD_STREAM_PROGRAM); - /* blackbird_api_cmd(dev, BLACKBIRD_API_SET_STREAM_TYPE, 1, 0, BLACKBIRD_STREAM_TRANSPORT); */ +#else + blackbird_api_cmd(dev, BLACKBIRD_API_SET_STREAM_TYPE, 1, 0, BLACKBIRD_STREAM_TRANSPORT); +#endif /* assign output port */ blackbird_api_cmd(dev, BLACKBIRD_API_SET_OUTPUT_PORT, 1, 0, BLACKBIRD_OUTPUT_PORT_STREAMING); /* Host */ @@ -861,8 +864,8 @@ static int bb_buf_setup(struct videobuf_queue *q, { struct cx8802_fh *fh = q->priv_data; - fh->dev->ts_packet_size = 512; - fh->dev->ts_packet_count = 100; + fh->dev->ts_packet_size = 188 * 4; /* was: 512 */ + fh->dev->ts_packet_count = 32; /* was: 100 */ *size = fh->dev->ts_packet_size * fh->dev->ts_packet_count; if (0 == *count) @@ -910,12 +913,38 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file, { struct cx8802_fh *fh = file->private_data; struct cx8802_dev *dev = fh->dev; + struct cx88_core *core = dev->core; if (debug > 1) - cx88_print_ioctl(dev->core->name,cmd); + cx88_print_ioctl(core->name,cmd); switch (cmd) { + /* --- capabilities ------------------------------------------ */ + case VIDIOC_QUERYCAP: + { + struct v4l2_capability *cap = arg; + + memset(cap,0,sizeof(*cap)); + strcpy(cap->driver, "cx88_blackbird"); + strlcpy(cap->card, cx88_boards[core->board].name,sizeof(cap->card)); + sprintf(cap->bus_info,"PCI:%s",pci_name(dev->pci)); + cap->version = CX88_VERSION_CODE; + cap->capabilities = + V4L2_CAP_VIDEO_CAPTURE | + V4L2_CAP_READWRITE | +#if 1 + V4L2_CAP_STREAMING | + V4L2_CAP_VBI_CAPTURE | + V4L2_CAP_VIDEO_OVERLAY | +#endif + 0; + if (UNSET != core->tuner_type) + cap->capabilities |= V4L2_CAP_TUNER; + + return 0; + } + /* --- capture ioctls ---------------------------------------- */ case VIDIOC_ENUM_FMT: { @@ -945,7 +974,10 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file, f->fmt.pix.width = dev->width; f->fmt.pix.height = dev->height; f->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; - f->fmt.pix.sizeimage = 1024 * 512 /* FIXME: BUFFER_SIZE */; + f->fmt.pix.field = V4L2_FIELD_NONE; + f->fmt.pix.bytesperline = 0; + f->fmt.pix.sizeimage = 188 * 4 * 1024; /* 1024 * 512 */ /* FIXME: BUFFER_SIZE */; + f->fmt.pix.colorspace = 0; return 0; } @@ -1156,7 +1188,7 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev, dev->pci = pci_dev; dev->core = core; dev->width = 720; - dev->height = 480; + dev->height = 576; err = cx8802_init_common(dev); if (0 != err) @@ -1169,6 +1201,29 @@ static int __devinit blackbird_probe(struct pci_dev *pci_dev, list_add_tail(&dev->devlist,&cx8802_devlist); blackbird_register_video(dev); + + /* initial device configuration: needed ? */ +#if 0 + down(&dev->lock); + init_controls(core); +#if 1 + /* force norm to PAL */ + { + int i; + for (i = 0; i < TVNORMS; i++) + if (tvnorms[i].id == V4L2_STD_PAL_BG) + { + cx88_set_tvnorm(core,&tvnorms[i]); + break; + } + } +#else + cx88_set_tvnorm(core,tvnorms); +#endif + video_mux(core,0); + up(&dev->lock); +#endif + return 0; fail_free: diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c index 7401b1245..705485ea7 100644 --- a/linux/drivers/media/video/cx88/cx88-video.c +++ b/linux/drivers/media/video/cx88/cx88-video.c @@ -1,5 +1,5 @@ /* - * $Id: cx88-video.c,v 1.88 2005/08/17 19:42:11 nsh Exp $ + * $Id: cx88-video.c,v 1.89 2005/08/17 20:55:37 catalin Exp $ * * device driver for Conexant 2388x based TV cards * video4linux video interface @@ -1113,9 +1113,9 @@ static int video_release(struct inode *inode, struct file *file) videobuf_mmap_free(&fh->vbiq); file->private_data = NULL; kfree(fh); - + cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); - + return 0; } @@ -1376,6 +1376,8 @@ static int video_do_ioctl(struct inode *inode, struct file *file, if (video_debug > 1) cx88_print_ioctl(core->name,cmd); switch (cmd) { + + /* --- capabilities ------------------------------------------ */ case VIDIOC_QUERYCAP: { struct v4l2_capability *cap = arg; @@ -1391,7 +1393,7 @@ static int video_do_ioctl(struct inode *inode, struct file *file, V4L2_CAP_READWRITE | V4L2_CAP_STREAMING | V4L2_CAP_VBI_CAPTURE | -#if 0 +#if 1 V4L2_CAP_VIDEO_OVERLAY | #endif 0; |