V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/*
|
|
|
|
init/start/stop/exit stream functions
|
|
|
|
Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
|
|
|
|
Copyright (C) 2004 Chris Kennedy <c@groovy.org>
|
|
|
|
Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* License: GPL
|
|
|
|
* Author: Kevin Thayer <nufan_wfk at yahoo dot com>
|
|
|
|
*
|
|
|
|
* This file will hold API related functions, both internal (firmware api)
|
|
|
|
* and external (v4l2, etc)
|
|
|
|
*
|
|
|
|
* -----
|
|
|
|
* MPG600/MPG160 support by T.Adachi <tadachi@tadachi-net.com>
|
|
|
|
* and Takeru KOMORIYA<komoriya@paken.org>
|
|
|
|
*
|
|
|
|
* AVerMedia M179 GPIO info by Chris Pinkham <cpinkham@bc2va.org>
|
|
|
|
* using information provided by Jiun-Kuei Jung @ AVerMedia.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ivtv-driver.h"
|
|
|
|
#include "ivtv-fileops.h"
|
|
|
|
#include "ivtv-queue.h"
|
|
|
|
#include "ivtv-mailbox.h"
|
|
|
|
#include "ivtv-ioctl.h"
|
2007-08-23 16:32:46 +07:00
|
|
|
#include "ivtv-irq.h"
|
2007-08-23 15:42:59 +07:00
|
|
|
#include "ivtv-yuv.h"
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
#include "ivtv-cards.h"
|
2007-08-23 15:42:59 +07:00
|
|
|
#include "ivtv-streams.h"
|
2010-06-12 23:33:21 +07:00
|
|
|
#include "ivtv-firmware.h"
|
2010-03-28 00:10:13 +07:00
|
|
|
#include <media/v4l2-event.h>
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2008-12-30 16:58:20 +07:00
|
|
|
static const struct v4l2_file_operations ivtv_v4l2_enc_fops = {
|
2008-05-12 21:21:58 +07:00
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.read = ivtv_v4l2_read,
|
|
|
|
.write = ivtv_v4l2_write,
|
|
|
|
.open = ivtv_v4l2_open,
|
2008-10-18 23:42:24 +07:00
|
|
|
.unlocked_ioctl = ivtv_v4l2_ioctl,
|
2008-05-12 21:21:58 +07:00
|
|
|
.release = ivtv_v4l2_close,
|
|
|
|
.poll = ivtv_v4l2_enc_poll,
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
};
|
|
|
|
|
2008-12-30 16:58:20 +07:00
|
|
|
static const struct v4l2_file_operations ivtv_v4l2_dec_fops = {
|
2008-05-12 21:21:58 +07:00
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.read = ivtv_v4l2_read,
|
|
|
|
.write = ivtv_v4l2_write,
|
|
|
|
.open = ivtv_v4l2_open,
|
2008-10-18 23:42:24 +07:00
|
|
|
.unlocked_ioctl = ivtv_v4l2_ioctl,
|
2008-05-12 21:21:58 +07:00
|
|
|
.release = ivtv_v4l2_close,
|
|
|
|
.poll = ivtv_v4l2_dec_poll,
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
};
|
|
|
|
|
2007-08-23 16:32:46 +07:00
|
|
|
#define IVTV_V4L2_DEC_MPG_OFFSET 16 /* offset from 0 to register decoder mpg v4l2 minors on */
|
|
|
|
#define IVTV_V4L2_ENC_PCM_OFFSET 24 /* offset from 0 to register pcm v4l2 minors on */
|
|
|
|
#define IVTV_V4L2_ENC_YUV_OFFSET 32 /* offset from 0 to register yuv v4l2 minors on */
|
|
|
|
#define IVTV_V4L2_DEC_YUV_OFFSET 48 /* offset from 0 to register decoder yuv v4l2 minors on */
|
|
|
|
#define IVTV_V4L2_DEC_VBI_OFFSET 8 /* offset from 0 to register decoder vbi input v4l2 minors on */
|
|
|
|
#define IVTV_V4L2_DEC_VOUT_OFFSET 16 /* offset from 0 to register vbi output v4l2 minors on */
|
|
|
|
|
2007-03-03 18:50:42 +07:00
|
|
|
static struct {
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
const char *name;
|
|
|
|
int vfl_type;
|
2008-10-04 18:36:54 +07:00
|
|
|
int num_offset;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
int dma, pio;
|
|
|
|
enum v4l2_buf_type buf_type;
|
2008-12-30 16:58:20 +07:00
|
|
|
const struct v4l2_file_operations *fops;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
} ivtv_stream_info[] = {
|
|
|
|
{ /* IVTV_ENC_STREAM_TYPE_MPG */
|
2007-08-20 04:59:42 +07:00
|
|
|
"encoder MPG",
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
VFL_TYPE_GRABBER, 0,
|
|
|
|
PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_VIDEO_CAPTURE,
|
|
|
|
&ivtv_v4l2_enc_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_ENC_STREAM_TYPE_YUV */
|
|
|
|
"encoder YUV",
|
|
|
|
VFL_TYPE_GRABBER, IVTV_V4L2_ENC_YUV_OFFSET,
|
|
|
|
PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_VIDEO_CAPTURE,
|
|
|
|
&ivtv_v4l2_enc_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_ENC_STREAM_TYPE_VBI */
|
|
|
|
"encoder VBI",
|
|
|
|
VFL_TYPE_VBI, 0,
|
|
|
|
PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_VBI_CAPTURE,
|
|
|
|
&ivtv_v4l2_enc_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_ENC_STREAM_TYPE_PCM */
|
2007-08-20 04:59:42 +07:00
|
|
|
"encoder PCM",
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
VFL_TYPE_GRABBER, IVTV_V4L2_ENC_PCM_OFFSET,
|
|
|
|
PCI_DMA_FROMDEVICE, 0, V4L2_BUF_TYPE_PRIVATE,
|
|
|
|
&ivtv_v4l2_enc_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_ENC_STREAM_TYPE_RAD */
|
|
|
|
"encoder radio",
|
|
|
|
VFL_TYPE_RADIO, 0,
|
|
|
|
PCI_DMA_NONE, 1, V4L2_BUF_TYPE_PRIVATE,
|
|
|
|
&ivtv_v4l2_enc_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_DEC_STREAM_TYPE_MPG */
|
2007-08-20 04:59:42 +07:00
|
|
|
"decoder MPG",
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
VFL_TYPE_GRABBER, IVTV_V4L2_DEC_MPG_OFFSET,
|
|
|
|
PCI_DMA_TODEVICE, 0, V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
|
|
|
&ivtv_v4l2_dec_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_DEC_STREAM_TYPE_VBI */
|
|
|
|
"decoder VBI",
|
|
|
|
VFL_TYPE_VBI, IVTV_V4L2_DEC_VBI_OFFSET,
|
|
|
|
PCI_DMA_NONE, 1, V4L2_BUF_TYPE_VBI_CAPTURE,
|
|
|
|
&ivtv_v4l2_enc_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_DEC_STREAM_TYPE_VOUT */
|
|
|
|
"decoder VOUT",
|
|
|
|
VFL_TYPE_VBI, IVTV_V4L2_DEC_VOUT_OFFSET,
|
|
|
|
PCI_DMA_NONE, 1, V4L2_BUF_TYPE_VBI_OUTPUT,
|
|
|
|
&ivtv_v4l2_dec_fops
|
|
|
|
},
|
|
|
|
{ /* IVTV_DEC_STREAM_TYPE_YUV */
|
|
|
|
"decoder YUV",
|
|
|
|
VFL_TYPE_GRABBER, IVTV_V4L2_DEC_YUV_OFFSET,
|
|
|
|
PCI_DMA_TODEVICE, 0, V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
|
|
|
&ivtv_v4l2_dec_fops
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
static void ivtv_stream_init(struct ivtv *itv, int type)
|
|
|
|
{
|
|
|
|
struct ivtv_stream *s = &itv->streams[type];
|
2009-02-07 17:02:27 +07:00
|
|
|
struct video_device *vdev = s->vdev;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
/* we need to keep vdev, so restore it afterwards */
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
memset(s, 0, sizeof(*s));
|
2009-02-07 17:02:27 +07:00
|
|
|
s->vdev = vdev;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
/* initialize ivtv_stream fields */
|
|
|
|
s->itv = itv;
|
|
|
|
s->type = type;
|
|
|
|
s->name = ivtv_stream_info[type].name;
|
|
|
|
|
|
|
|
if (ivtv_stream_info[type].pio)
|
|
|
|
s->dma = PCI_DMA_NONE;
|
|
|
|
else
|
|
|
|
s->dma = ivtv_stream_info[type].dma;
|
|
|
|
s->buf_size = itv->stream_buf_size[type];
|
|
|
|
if (s->buf_size)
|
2007-08-19 15:32:33 +07:00
|
|
|
s->buffers = (itv->options.kilobytes[type] * 1024 + s->buf_size - 1) / s->buf_size;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
spin_lock_init(&s->qlock);
|
|
|
|
init_waitqueue_head(&s->waitq);
|
|
|
|
s->id = -1;
|
2007-07-29 05:45:50 +07:00
|
|
|
s->sg_handle = IVTV_DMA_UNMAPPED;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
ivtv_queue_init(&s->q_free);
|
|
|
|
ivtv_queue_init(&s->q_full);
|
|
|
|
ivtv_queue_init(&s->q_dma);
|
|
|
|
ivtv_queue_init(&s->q_predma);
|
|
|
|
ivtv_queue_init(&s->q_io);
|
|
|
|
}
|
|
|
|
|
2007-10-13 15:54:48 +07:00
|
|
|
static int ivtv_prep_dev(struct ivtv *itv, int type)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
{
|
|
|
|
struct ivtv_stream *s = &itv->streams[type];
|
2008-10-04 18:36:54 +07:00
|
|
|
int num_offset = ivtv_stream_info[type].num_offset;
|
2008-11-30 05:38:23 +07:00
|
|
|
int num = itv->instance + ivtv_first_minor + num_offset;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
/* These four fields are always initialized. If vdev == NULL, then
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
this stream is not in use. In that case no other fields but these
|
|
|
|
four can be used. */
|
2009-02-07 17:02:27 +07:00
|
|
|
s->vdev = NULL;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
s->itv = itv;
|
|
|
|
s->type = type;
|
|
|
|
s->name = ivtv_stream_info[type].name;
|
|
|
|
|
|
|
|
/* Check whether the radio is supported */
|
|
|
|
if (type == IVTV_ENC_STREAM_TYPE_RAD && !(itv->v4l2_cap & V4L2_CAP_RADIO))
|
|
|
|
return 0;
|
|
|
|
if (type >= IVTV_DEC_STREAM_TYPE_MPG && !(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT))
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* User explicitly selected 0 buffers for these streams, so don't
|
|
|
|
create them. */
|
2007-10-13 15:54:48 +07:00
|
|
|
if (ivtv_stream_info[type].dma != PCI_DMA_NONE &&
|
2007-08-19 15:32:33 +07:00
|
|
|
itv->options.kilobytes[type] == 0) {
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
IVTV_INFO("Disabled %s device\n", ivtv_stream_info[type].name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
ivtv_stream_init(itv, type);
|
|
|
|
|
|
|
|
/* allocate and initialize the v4l2 video device structure */
|
2009-02-07 17:02:27 +07:00
|
|
|
s->vdev = video_device_alloc();
|
|
|
|
if (s->vdev == NULL) {
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
IVTV_ERR("Couldn't allocate v4l2 video_device for %s\n", s->name);
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
snprintf(s->vdev->name, sizeof(s->vdev->name), "%s %s",
|
|
|
|
itv->v4l2_dev.name, s->name);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
s->vdev->num = num;
|
|
|
|
s->vdev->v4l2_dev = &itv->v4l2_dev;
|
2010-06-27 16:07:26 +07:00
|
|
|
s->vdev->ctrl_handler = itv->v4l2_dev.ctrl_handler;
|
2009-02-07 17:02:27 +07:00
|
|
|
s->vdev->fops = ivtv_stream_info[type].fops;
|
|
|
|
s->vdev->release = video_device_release;
|
|
|
|
s->vdev->tvnorms = V4L2_STD_ALL;
|
|
|
|
ivtv_set_funcs(s->vdev);
|
2007-10-13 15:54:48 +07:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Initialize v4l2 variables and prepare v4l2 devices */
|
|
|
|
int ivtv_streams_setup(struct ivtv *itv)
|
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
|
|
|
/* Setup V4L2 Devices */
|
|
|
|
for (type = 0; type < IVTV_MAX_STREAMS; type++) {
|
|
|
|
/* Prepare device */
|
|
|
|
if (ivtv_prep_dev(itv, type))
|
|
|
|
break;
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (itv->streams[type].vdev == NULL)
|
2007-10-13 15:54:48 +07:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Allocate Stream */
|
|
|
|
if (ivtv_stream_alloc(&itv->streams[type]))
|
|
|
|
break;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
2007-10-13 15:54:48 +07:00
|
|
|
if (type == IVTV_MAX_STREAMS)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return 0;
|
2007-10-13 15:54:48 +07:00
|
|
|
|
|
|
|
/* One or more streams could not be initialized. Clean 'em all up. */
|
2008-05-01 20:31:12 +07:00
|
|
|
ivtv_streams_cleanup(itv, 0);
|
2007-10-13 15:54:48 +07:00
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ivtv_reg_dev(struct ivtv *itv, int type)
|
|
|
|
{
|
|
|
|
struct ivtv_stream *s = &itv->streams[type];
|
|
|
|
int vfl_type = ivtv_stream_info[type].vfl_type;
|
2009-11-27 23:57:15 +07:00
|
|
|
const char *name;
|
2008-10-04 18:36:54 +07:00
|
|
|
int num;
|
2007-10-13 15:54:48 +07:00
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s->vdev == NULL)
|
2007-10-13 15:54:48 +07:00
|
|
|
return 0;
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
num = s->vdev->num;
|
2008-10-04 18:36:54 +07:00
|
|
|
/* card number + user defined offset + device offset */
|
|
|
|
if (type != IVTV_ENC_STREAM_TYPE_MPG) {
|
|
|
|
struct ivtv_stream *s_mpg = &itv->streams[IVTV_ENC_STREAM_TYPE_MPG];
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s_mpg->vdev)
|
|
|
|
num = s_mpg->vdev->num + ivtv_stream_info[type].num_offset;
|
2008-10-04 18:36:54 +07:00
|
|
|
}
|
2009-02-07 17:02:27 +07:00
|
|
|
video_set_drvdata(s->vdev, s);
|
2008-10-04 18:36:54 +07:00
|
|
|
|
2007-10-13 15:54:48 +07:00
|
|
|
/* Register device. First try the desired minor, then any free one. */
|
2009-09-06 17:54:00 +07:00
|
|
|
if (video_register_device_no_warn(s->vdev, vfl_type, num)) {
|
2009-06-19 21:54:00 +07:00
|
|
|
IVTV_ERR("Couldn't register v4l2 device for %s (device node number %d)\n",
|
2008-10-04 18:36:54 +07:00
|
|
|
s->name, num);
|
2009-02-07 17:02:27 +07:00
|
|
|
video_device_release(s->vdev);
|
|
|
|
s->vdev = NULL;
|
2007-10-13 15:54:48 +07:00
|
|
|
return -ENOMEM;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
2009-11-27 23:57:15 +07:00
|
|
|
name = video_device_node_name(s->vdev);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
switch (vfl_type) {
|
|
|
|
case VFL_TYPE_GRABBER:
|
2009-11-27 23:57:15 +07:00
|
|
|
IVTV_INFO("Registered device %s for %s (%d kB)\n",
|
|
|
|
name, s->name, itv->options.kilobytes[type]);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
break;
|
|
|
|
case VFL_TYPE_RADIO:
|
2009-11-27 23:57:15 +07:00
|
|
|
IVTV_INFO("Registered device %s for %s\n",
|
|
|
|
name, s->name);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
break;
|
|
|
|
case VFL_TYPE_VBI:
|
2007-08-19 15:32:33 +07:00
|
|
|
if (itv->options.kilobytes[type])
|
2009-11-27 23:57:15 +07:00
|
|
|
IVTV_INFO("Registered device %s for %s (%d kB)\n",
|
|
|
|
name, s->name, itv->options.kilobytes[type]);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
else
|
2009-11-27 23:57:15 +07:00
|
|
|
IVTV_INFO("Registered device %s for %s\n",
|
|
|
|
name, s->name);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-10-13 15:54:48 +07:00
|
|
|
/* Register v4l2 devices */
|
|
|
|
int ivtv_streams_register(struct ivtv *itv)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
{
|
|
|
|
int type;
|
2007-10-13 15:54:48 +07:00
|
|
|
int err = 0;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2007-10-13 15:54:48 +07:00
|
|
|
/* Register V4L2 devices */
|
|
|
|
for (type = 0; type < IVTV_MAX_STREAMS; type++)
|
|
|
|
err |= ivtv_reg_dev(itv, type);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2007-10-13 15:54:48 +07:00
|
|
|
if (err == 0)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* One or more streams could not be initialized. Clean 'em all up. */
|
2008-05-01 20:31:12 +07:00
|
|
|
ivtv_streams_cleanup(itv, 1);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Unregister v4l2 devices */
|
2008-05-01 20:31:12 +07:00
|
|
|
void ivtv_streams_cleanup(struct ivtv *itv, int unregister)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
{
|
|
|
|
int type;
|
|
|
|
|
|
|
|
/* Teardown all streams */
|
|
|
|
for (type = 0; type < IVTV_MAX_STREAMS; type++) {
|
2009-02-07 17:02:27 +07:00
|
|
|
struct video_device *vdev = itv->streams[type].vdev;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
itv->streams[type].vdev = NULL;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
if (vdev == NULL)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
ivtv_stream_free(&itv->streams[type]);
|
2008-05-01 20:31:12 +07:00
|
|
|
/* Unregister or release device */
|
|
|
|
if (unregister)
|
|
|
|
video_unregister_device(vdev);
|
|
|
|
else
|
|
|
|
video_device_release(vdev);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void ivtv_vbi_setup(struct ivtv *itv)
|
|
|
|
{
|
2008-10-04 18:05:30 +07:00
|
|
|
int raw = ivtv_raw_vbi(itv);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
u32 data[CX2341X_MBOX_MAX_DATA];
|
|
|
|
int lines;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* Reset VBI */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_VBI_LINE, 5, 0xffff , 0, 0, 0, 0);
|
|
|
|
|
|
|
|
/* setup VBI registers */
|
2010-03-14 22:18:18 +07:00
|
|
|
if (raw)
|
|
|
|
v4l2_subdev_call(itv->sd_video, vbi, s_raw_fmt, &itv->vbi.in.fmt.vbi);
|
|
|
|
else
|
|
|
|
v4l2_subdev_call(itv->sd_video, vbi, s_sliced_fmt, &itv->vbi.in.fmt.sliced);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
/* determine number of lines and total number of VBI bytes.
|
|
|
|
A raw line takes 1443 bytes: 2 * 720 + 4 byte frame header - 1
|
|
|
|
The '- 1' byte is probably an unused U or V byte. Or something...
|
|
|
|
A sliced line takes 51 bytes: 4 byte frame header, 4 byte internal
|
|
|
|
header, 42 data bytes + checksum (to be confirmed) */
|
|
|
|
if (raw) {
|
|
|
|
lines = itv->vbi.count * 2;
|
|
|
|
} else {
|
|
|
|
lines = itv->is_60hz ? 24 : 38;
|
|
|
|
if (itv->is_60hz && (itv->hw_flags & IVTV_HW_CX25840))
|
|
|
|
lines += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
itv->vbi.enc_size = lines * (raw ? itv->vbi.raw_size : itv->vbi.sliced_size);
|
|
|
|
|
|
|
|
/* Note: sliced vs raw flag doesn't seem to have any effect
|
|
|
|
TODO: check mode (0x02) value with older ivtv versions. */
|
|
|
|
data[0] = raw | 0x02 | (0xbd << 8);
|
|
|
|
|
|
|
|
/* Every X number of frames a VBI interrupt arrives (frames as in 25 or 30 fps) */
|
|
|
|
data[1] = 1;
|
|
|
|
/* The VBI frames are stored in a ringbuffer with this size (with a VBI frame as unit) */
|
2008-09-04 02:47:14 +07:00
|
|
|
data[2] = raw ? 4 : 4 * (itv->vbi.raw_size / itv->vbi.enc_size);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/* The start/stop codes determine which VBI lines end up in the raw VBI data area.
|
|
|
|
The codes are from table 24 in the saa7115 datasheet. Each raw/sliced/video line
|
|
|
|
is framed with codes FF0000XX where XX is the SAV/EAV (Start/End of Active Video)
|
|
|
|
code. These values for raw VBI are obtained from a driver disassembly. The sliced
|
|
|
|
start/stop codes was deduced from this, but they do not appear in the driver.
|
|
|
|
Other code pairs that I found are: 0x250E6249/0x13545454 and 0x25256262/0x38137F54.
|
|
|
|
However, I have no idea what these values are for. */
|
|
|
|
if (itv->hw_flags & IVTV_HW_CX25840) {
|
|
|
|
/* Setup VBI for the cx25840 digitizer */
|
|
|
|
if (raw) {
|
|
|
|
data[3] = 0x20602060;
|
|
|
|
data[4] = 0x30703070;
|
|
|
|
} else {
|
|
|
|
data[3] = 0xB0F0B0F0;
|
|
|
|
data[4] = 0xA0E0A0E0;
|
|
|
|
}
|
|
|
|
/* Lines per frame */
|
|
|
|
data[5] = lines;
|
|
|
|
/* bytes per line */
|
|
|
|
data[6] = (raw ? itv->vbi.raw_size : itv->vbi.sliced_size);
|
|
|
|
} else {
|
|
|
|
/* Setup VBI for the saa7115 digitizer */
|
|
|
|
if (raw) {
|
|
|
|
data[3] = 0x25256262;
|
|
|
|
data[4] = 0x387F7F7F;
|
|
|
|
} else {
|
|
|
|
data[3] = 0xABABECEC;
|
|
|
|
data[4] = 0xB6F1F1F1;
|
|
|
|
}
|
|
|
|
/* Lines per frame */
|
|
|
|
data[5] = lines;
|
|
|
|
/* bytes per line */
|
|
|
|
data[6] = itv->vbi.enc_size / lines;
|
|
|
|
}
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO(
|
|
|
|
"Setup VBI API header 0x%08x pkts %d buffs %d ln %d sz %d\n",
|
|
|
|
data[0], data[1], data[2], data[5], data[6]);
|
|
|
|
|
|
|
|
ivtv_api(itv, CX2341X_ENC_SET_VBI_CONFIG, 7, data);
|
|
|
|
|
|
|
|
/* returns the VBI encoder memory area. */
|
|
|
|
itv->vbi.enc_start = data[2];
|
|
|
|
itv->vbi.fpi = data[0];
|
|
|
|
if (!itv->vbi.fpi)
|
|
|
|
itv->vbi.fpi = 1;
|
|
|
|
|
2007-08-23 20:13:15 +07:00
|
|
|
IVTV_DEBUG_INFO("Setup VBI start 0x%08x frames %d fpi %d\n",
|
|
|
|
itv->vbi.enc_start, data[1], itv->vbi.fpi);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
/* select VBI lines.
|
|
|
|
Note that the sliced argument seems to have no effect. */
|
|
|
|
for (i = 2; i <= 24; i++) {
|
|
|
|
int valid;
|
|
|
|
|
|
|
|
if (itv->is_60hz) {
|
|
|
|
valid = i >= 10 && i < 22;
|
|
|
|
} else {
|
|
|
|
valid = i >= 6 && i < 24;
|
|
|
|
}
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_VBI_LINE, 5, i - 1,
|
|
|
|
valid, 0 , 0, 0);
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_VBI_LINE, 5, (i - 1) | 0x80000000,
|
|
|
|
valid, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Remaining VBI questions:
|
|
|
|
- Is it possible to select particular VBI lines only for inclusion in the MPEG
|
|
|
|
stream? Currently you can only get the first X lines.
|
|
|
|
- Is mixed raw and sliced VBI possible?
|
|
|
|
- What's the meaning of the raw/sliced flag?
|
|
|
|
- What's the meaning of params 2, 3 & 4 of the Select VBI command? */
|
|
|
|
}
|
|
|
|
|
|
|
|
int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
|
|
|
|
{
|
|
|
|
u32 data[CX2341X_MBOX_MAX_DATA];
|
|
|
|
struct ivtv *itv = s->itv;
|
|
|
|
int captype = 0, subtype = 0;
|
|
|
|
int enable_passthrough = 0;
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s->vdev == NULL)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO("Start encoder stream %s\n", s->name);
|
|
|
|
|
|
|
|
switch (s->type) {
|
|
|
|
case IVTV_ENC_STREAM_TYPE_MPG:
|
|
|
|
captype = 0;
|
|
|
|
subtype = 3;
|
|
|
|
|
|
|
|
/* Stop Passthrough */
|
|
|
|
if (itv->output_mode == OUT_PASSTHROUGH) {
|
|
|
|
ivtv_passthrough_mode(itv, 0);
|
|
|
|
enable_passthrough = 1;
|
|
|
|
}
|
|
|
|
itv->mpg_data_received = itv->vbi_data_inserted = 0;
|
|
|
|
itv->dualwatch_jiffies = jiffies;
|
2010-06-27 16:07:26 +07:00
|
|
|
itv->dualwatch_stereo_mode = v4l2_ctrl_g_ctrl(itv->cxhdl.audio_mode);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
itv->search_pack_header = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case IVTV_ENC_STREAM_TYPE_YUV:
|
|
|
|
if (itv->output_mode == OUT_PASSTHROUGH) {
|
|
|
|
captype = 2;
|
|
|
|
subtype = 11; /* video+audio+decoder */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
captype = 1;
|
|
|
|
subtype = 1;
|
|
|
|
break;
|
|
|
|
case IVTV_ENC_STREAM_TYPE_PCM:
|
|
|
|
captype = 1;
|
|
|
|
subtype = 2;
|
|
|
|
break;
|
|
|
|
case IVTV_ENC_STREAM_TYPE_VBI:
|
|
|
|
captype = 1;
|
|
|
|
subtype = 4;
|
|
|
|
|
|
|
|
itv->vbi.frame = 0;
|
|
|
|
itv->vbi.inserted_frame = 0;
|
|
|
|
memset(itv->vbi.sliced_mpeg_size,
|
|
|
|
0, sizeof(itv->vbi.sliced_mpeg_size));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
s->subtype = subtype;
|
|
|
|
s->buffers_stolen = 0;
|
|
|
|
|
|
|
|
/* Clear Streamoff flags in case left from last capture */
|
|
|
|
clear_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
|
|
|
|
|
|
|
|
if (atomic_read(&itv->capturing) == 0) {
|
2007-08-23 20:13:15 +07:00
|
|
|
int digitizer;
|
|
|
|
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/* Always use frame based mode. Experiments have demonstrated that byte
|
|
|
|
stream based mode results in dropped frames and corruption. Not often,
|
|
|
|
but occasionally. Many thanks go to Leonard Orb who spent a lot of
|
|
|
|
effort and time trying to trace the cause of the drop outs. */
|
|
|
|
/* 1 frame per DMA */
|
|
|
|
/*ivtv_vapi(itv, CX2341X_ENC_SET_DMA_BLOCK_SIZE, 2, 128, 0); */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_DMA_BLOCK_SIZE, 2, 1, 1);
|
|
|
|
|
|
|
|
/* Stuff from Windows, we don't know what it is */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_VERT_CROP_LINE, 1, 0);
|
|
|
|
/* According to the docs, this should be correct. However, this is
|
|
|
|
untested. I don't dare enable this without having tested it.
|
|
|
|
Only very few old cards actually have this hardware combination.
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_VERT_CROP_LINE, 1,
|
|
|
|
((itv->hw_flags & IVTV_HW_SAA7114) && itv->is_60hz) ? 10001 : 0);
|
|
|
|
*/
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_MISC, 2, 3, !itv->has_cx23415);
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_MISC, 2, 8, 0);
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_MISC, 2, 4, 1);
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_MISC, 1, 12);
|
|
|
|
|
|
|
|
/* assign placeholder */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_PLACEHOLDER, 12,
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
|
|
|
2007-08-23 20:13:15 +07:00
|
|
|
if (itv->card->hw_all & (IVTV_HW_SAA7115 | IVTV_HW_SAA717X))
|
|
|
|
digitizer = 0xF1;
|
|
|
|
else if (itv->card->hw_all & IVTV_HW_SAA7114)
|
|
|
|
digitizer = 0xEF;
|
|
|
|
else /* cx25840 */
|
|
|
|
digitizer = 0x140;
|
|
|
|
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_NUM_VSYNC_LINES, 2, digitizer, digitizer);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
/* Setup VBI */
|
|
|
|
if (itv->v4l2_cap & V4L2_CAP_VBI_CAPTURE) {
|
|
|
|
ivtv_vbi_setup(itv);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* assign program index info. Mask 7: select I/P/B, Num_req: 400 max */
|
|
|
|
ivtv_vapi_result(itv, data, CX2341X_ENC_SET_PGM_INDEX_INFO, 2, 7, 400);
|
|
|
|
itv->pgm_info_offset = data[0];
|
|
|
|
itv->pgm_info_num = data[1];
|
|
|
|
itv->pgm_info_write_idx = 0;
|
|
|
|
itv->pgm_info_read_idx = 0;
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO("PGM Index at 0x%08x with %d elements\n",
|
|
|
|
itv->pgm_info_offset, itv->pgm_info_num);
|
|
|
|
|
|
|
|
/* Setup API for Stream */
|
2010-06-27 16:07:26 +07:00
|
|
|
cx2341x_handler_setup(&itv->cxhdl);
|
2007-10-15 03:19:37 +07:00
|
|
|
|
|
|
|
/* mute if capturing radio */
|
|
|
|
if (test_bit(IVTV_F_I_RADIO_USER, &itv->i_flags))
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_MUTE_VIDEO, 1,
|
2010-06-27 16:07:26 +07:00
|
|
|
1 | (v4l2_ctrl_g_ctrl(itv->cxhdl.video_mute_yuv) << 8));
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Vsync Setup */
|
|
|
|
if (itv->has_cx23415 && !test_and_set_bit(IVTV_F_I_DIG_RST, &itv->i_flags)) {
|
|
|
|
/* event notification (on) */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_EVENT_NOTIFICATION, 4, 0, 1, IVTV_IRQ_ENC_VIM_RST, -1);
|
|
|
|
ivtv_clear_irq_mask(itv, IVTV_IRQ_ENC_VIM_RST);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (atomic_read(&itv->capturing) == 0) {
|
|
|
|
/* Clear all Pending Interrupts */
|
|
|
|
ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_CAPTURE);
|
|
|
|
|
|
|
|
clear_bit(IVTV_F_I_EOS, &itv->i_flags);
|
|
|
|
|
2010-06-27 16:07:26 +07:00
|
|
|
cx2341x_handler_set_busy(&itv->cxhdl, 1);
|
|
|
|
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/* Initialize Digitizer for Capture */
|
2009-12-24 23:06:08 +07:00
|
|
|
/* Avoid tinny audio problem - ensure audio clocks are going */
|
|
|
|
v4l2_subdev_call(itv->sd_audio, audio, s_stream, 1);
|
|
|
|
/* Avoid unpredictable PCI bus hang - disable video clocks */
|
2008-11-30 05:38:23 +07:00
|
|
|
v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
|
2010-03-07 07:08:35 +07:00
|
|
|
ivtv_msleep_timeout(300, 1);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
|
2008-11-30 05:38:23 +07:00
|
|
|
v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* begin_capture */
|
|
|
|
if (ivtv_vapi(itv, CX2341X_ENC_START_CAPTURE, 2, captype, subtype))
|
|
|
|
{
|
|
|
|
IVTV_DEBUG_WARN( "Error starting capture!\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Start Passthrough */
|
|
|
|
if (enable_passthrough) {
|
|
|
|
ivtv_passthrough_mode(itv, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (s->type == IVTV_ENC_STREAM_TYPE_VBI)
|
|
|
|
ivtv_clear_irq_mask(itv, IVTV_IRQ_ENC_VBI_CAP);
|
|
|
|
else
|
|
|
|
ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_CAPTURE);
|
|
|
|
|
|
|
|
/* you're live! sit back and await interrupts :) */
|
|
|
|
atomic_inc(&itv->capturing);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ivtv_setup_v4l2_decode_stream(struct ivtv_stream *s)
|
|
|
|
{
|
|
|
|
u32 data[CX2341X_MBOX_MAX_DATA];
|
|
|
|
struct ivtv *itv = s->itv;
|
|
|
|
int datatype;
|
2010-05-24 08:19:11 +07:00
|
|
|
u16 width;
|
|
|
|
u16 height;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s->vdev == NULL)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO("Setting some initial decoder settings\n");
|
|
|
|
|
2010-06-27 16:07:26 +07:00
|
|
|
width = itv->cxhdl.width;
|
|
|
|
height = itv->cxhdl.height;
|
2010-05-24 08:19:11 +07:00
|
|
|
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/* set audio mode to left/stereo for dual/stereo mode. */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
|
|
|
|
|
|
|
|
/* set number of internal decoder buffers */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_SET_DISPLAY_BUFFERS, 1, 0);
|
|
|
|
|
|
|
|
/* prebuffering */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_SET_PREBUFFERING, 1, 1);
|
|
|
|
|
|
|
|
/* extract from user packets */
|
|
|
|
ivtv_vapi_result(itv, data, CX2341X_DEC_EXTRACT_VBI, 1, 1);
|
|
|
|
itv->vbi.dec_start = data[0];
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO("Decoder VBI RE-Insert start 0x%08x size 0x%08x\n",
|
|
|
|
itv->vbi.dec_start, data[1]);
|
|
|
|
|
|
|
|
/* set decoder source settings */
|
|
|
|
/* Data type: 0 = mpeg from host,
|
|
|
|
1 = yuv from encoder,
|
|
|
|
2 = yuv_from_host */
|
|
|
|
switch (s->type) {
|
|
|
|
case IVTV_DEC_STREAM_TYPE_YUV:
|
2010-05-24 08:19:11 +07:00
|
|
|
if (itv->output_mode == OUT_PASSTHROUGH) {
|
|
|
|
datatype = 1;
|
|
|
|
} else {
|
|
|
|
/* Fake size to avoid switching video standard */
|
|
|
|
datatype = 2;
|
|
|
|
width = 720;
|
|
|
|
height = itv->is_out_50hz ? 576 : 480;
|
|
|
|
}
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
IVTV_DEBUG_INFO("Setup DEC YUV Stream data[0] = %d\n", datatype);
|
|
|
|
break;
|
|
|
|
case IVTV_DEC_STREAM_TYPE_MPG:
|
|
|
|
default:
|
|
|
|
datatype = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (ivtv_vapi(itv, CX2341X_DEC_SET_DECODER_SOURCE, 4, datatype,
|
2010-06-27 16:07:26 +07:00
|
|
|
width, height, itv->cxhdl.audio_properties)) {
|
2007-07-22 19:39:56 +07:00
|
|
|
IVTV_DEBUG_WARN("Couldn't initialize decoder source\n");
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
2010-05-24 08:27:49 +07:00
|
|
|
|
|
|
|
/* Decoder sometimes dies here, so wait a moment */
|
|
|
|
ivtv_msleep_timeout(10, 0);
|
|
|
|
|
2010-06-12 23:33:21 +07:00
|
|
|
/* Known failure point for firmware, so check */
|
2010-06-12 23:41:57 +07:00
|
|
|
return ivtv_firmware_check(itv, "ivtv_setup_v4l2_decode_stream");
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
int ivtv_start_v4l2_decode_stream(struct ivtv_stream *s, int gop_offset)
|
|
|
|
{
|
|
|
|
struct ivtv *itv = s->itv;
|
2010-06-12 23:33:21 +07:00
|
|
|
int rc;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s->vdev == NULL)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (test_and_set_bit(IVTV_F_S_STREAMING, &s->s_flags))
|
|
|
|
return 0; /* already started */
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO("Starting decode stream %s (gop_offset %d)\n", s->name, gop_offset);
|
|
|
|
|
2010-06-12 23:33:21 +07:00
|
|
|
rc = ivtv_setup_v4l2_decode_stream(s);
|
|
|
|
if (rc < 0) {
|
|
|
|
clear_bit(IVTV_F_S_STREAMING, &s->s_flags);
|
|
|
|
return rc;
|
|
|
|
}
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
/* set dma size to 65536 bytes */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_SET_DMA_BLOCK_SIZE, 1, 65536);
|
|
|
|
|
V4L/DVB (6717): ivtv: Initial merge of video48 yuv handling into the IVTV_IOC_DMA_FRAME framework
Previously, all yuv data written to /dev/video48 had only basic support with
no double buffering to avoid display tearing.
With this patch, yuv frames written to video48 are now handled by the existing
IVTV_IOC_DMA_FRAME framework. As such, the frames are hardware buffered to
avoid tearing, and honour scaling mode & field order options. Unlike the
proprietary IVTV_IOC_DMA_FRAME ioctl, all parameters are controlled by the
V4L2 API.
Due to mpeg & yuv output restrictions being different, their V4L2 output
controls have been separated. To control the yuv output, the V4L2 calls must
be done via video48.
If the ivtvfb module is loaded, there will be one side effect to this merge.
The yuv output window will be constrained to the visible framebuffer area. In
the event that a virtual framebuffer size is being used, the limit to the
output size will be the virtual dimensions, but only the portion that falls
within the currently visible area of the framebuffer will be shown.
Like the IVTV_IOC_DMA_FRAME ioctl, the supplied frames must be padded to 720
pixels wide. However the height must only be padded up the nearest multiple
of 32. This would mean an image of 102 lines must be padded to 128. As long
as the true source image size is given, the padding will not be visible in
the final output.
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-11-06 00:27:09 +07:00
|
|
|
/* Clear Streamoff */
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
clear_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
|
|
|
|
|
|
|
|
/* Zero out decoder counters */
|
2007-08-23 16:32:46 +07:00
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA_END].data[0]);
|
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA_END].data[1]);
|
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA_END].data[2]);
|
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA_END].data[3]);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA].data[0]);
|
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA].data[1]);
|
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA].data[2]);
|
|
|
|
writel(0, &itv->dec_mbox.mbox[IVTV_MBOX_DMA].data[3]);
|
|
|
|
|
|
|
|
/* turn on notification of dual/stereo mode change */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_SET_EVENT_NOTIFICATION, 4, 0, 1, IVTV_IRQ_DEC_AUD_MODE_CHG, -1);
|
|
|
|
|
|
|
|
/* start playback */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_START_PLAYBACK, 2, gop_offset, 0);
|
|
|
|
|
2010-05-24 08:27:49 +07:00
|
|
|
/* Let things settle before we actually start */
|
|
|
|
ivtv_msleep_timeout(10, 0);
|
|
|
|
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/* Clear the following Interrupt mask bits for decoding */
|
|
|
|
ivtv_clear_irq_mask(itv, IVTV_IRQ_MASK_DECODE);
|
|
|
|
IVTV_DEBUG_IRQ("IRQ Mask is now: 0x%08x\n", itv->irqmask);
|
|
|
|
|
|
|
|
/* you're live! sit back and await interrupts :) */
|
|
|
|
atomic_inc(&itv->decoding);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ivtv_stop_all_captures(struct ivtv *itv)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = IVTV_MAX_STREAMS - 1; i >= 0; i--) {
|
|
|
|
struct ivtv_stream *s = &itv->streams[i];
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s->vdev == NULL)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
continue;
|
|
|
|
if (test_bit(IVTV_F_S_STREAMING, &s->s_flags)) {
|
|
|
|
ivtv_stop_v4l2_encode_stream(s, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
|
|
|
|
{
|
|
|
|
struct ivtv *itv = s->itv;
|
|
|
|
DECLARE_WAITQUEUE(wait, current);
|
|
|
|
int cap_type;
|
|
|
|
int stopmode;
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s->vdev == NULL)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
/* This function assumes that you are allowed to stop the capture
|
|
|
|
and that we are actually capturing */
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO("Stop Capture\n");
|
|
|
|
|
|
|
|
if (s->type == IVTV_DEC_STREAM_TYPE_VOUT)
|
|
|
|
return 0;
|
|
|
|
if (atomic_read(&itv->capturing) == 0)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
switch (s->type) {
|
|
|
|
case IVTV_ENC_STREAM_TYPE_YUV:
|
|
|
|
cap_type = 1;
|
|
|
|
break;
|
|
|
|
case IVTV_ENC_STREAM_TYPE_PCM:
|
|
|
|
cap_type = 1;
|
|
|
|
break;
|
|
|
|
case IVTV_ENC_STREAM_TYPE_VBI:
|
|
|
|
cap_type = 1;
|
|
|
|
break;
|
|
|
|
case IVTV_ENC_STREAM_TYPE_MPG:
|
|
|
|
default:
|
|
|
|
cap_type = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Stop Capture Mode */
|
|
|
|
if (s->type == IVTV_ENC_STREAM_TYPE_MPG && gop_end) {
|
|
|
|
stopmode = 0;
|
|
|
|
} else {
|
|
|
|
stopmode = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* end_capture */
|
|
|
|
/* when: 0 = end of GOP 1 = NOW!, type: 0 = mpeg, subtype: 3 = video+audio */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, stopmode, cap_type, s->subtype);
|
|
|
|
|
|
|
|
if (!test_bit(IVTV_F_S_PASSTHROUGH, &s->s_flags)) {
|
|
|
|
if (s->type == IVTV_ENC_STREAM_TYPE_MPG && gop_end) {
|
|
|
|
/* only run these if we're shutting down the last cap */
|
|
|
|
unsigned long duration;
|
2007-08-24 03:51:07 +07:00
|
|
|
unsigned long then = jiffies;
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2007-08-23 20:13:15 +07:00
|
|
|
add_wait_queue(&itv->eos_waitq, &wait);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
set_current_state(TASK_INTERRUPTIBLE);
|
|
|
|
|
|
|
|
/* wait 2s for EOS interrupt */
|
2007-07-19 21:21:04 +07:00
|
|
|
while (!test_bit(IVTV_F_I_EOS, &itv->i_flags) &&
|
2008-04-17 02:13:15 +07:00
|
|
|
time_before(jiffies,
|
|
|
|
then + msecs_to_jiffies(2000))) {
|
2007-07-19 21:21:04 +07:00
|
|
|
schedule_timeout(msecs_to_jiffies(10));
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* To convert jiffies to ms, we must multiply by 1000
|
|
|
|
* and divide by HZ. To avoid runtime division, we
|
|
|
|
* convert this to multiplication by 1000/HZ.
|
|
|
|
* Since integer division truncates, we get the best
|
|
|
|
* accuracy if we do a rounding calculation of the constant.
|
|
|
|
* Think of the case where HZ is 1024.
|
|
|
|
*/
|
|
|
|
duration = ((1000 + HZ / 2) / HZ) * (jiffies - then);
|
|
|
|
|
|
|
|
if (!test_bit(IVTV_F_I_EOS, &itv->i_flags)) {
|
|
|
|
IVTV_DEBUG_WARN("%s: EOS interrupt not received! stopping anyway.\n", s->name);
|
|
|
|
IVTV_DEBUG_WARN("%s: waited %lu ms.\n", s->name, duration);
|
|
|
|
} else {
|
|
|
|
IVTV_DEBUG_INFO("%s: EOS took %lu ms to occur.\n", s->name, duration);
|
|
|
|
}
|
|
|
|
set_current_state(TASK_RUNNING);
|
2007-08-23 20:13:15 +07:00
|
|
|
remove_wait_queue(&itv->eos_waitq, &wait);
|
2007-08-24 03:51:07 +07:00
|
|
|
set_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
|
2007-08-18 21:46:05 +07:00
|
|
|
/* Handle any pending interrupts */
|
|
|
|
ivtv_msleep_timeout(100, 1);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
atomic_dec(&itv->capturing);
|
|
|
|
|
|
|
|
/* Clear capture and no-read bits */
|
|
|
|
clear_bit(IVTV_F_S_STREAMING, &s->s_flags);
|
|
|
|
|
|
|
|
if (s->type == IVTV_ENC_STREAM_TYPE_VBI)
|
|
|
|
ivtv_set_irq_mask(itv, IVTV_IRQ_ENC_VBI_CAP);
|
|
|
|
|
|
|
|
if (atomic_read(&itv->capturing) > 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-06-27 16:07:26 +07:00
|
|
|
cx2341x_handler_set_busy(&itv->cxhdl, 0);
|
|
|
|
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/* Set the following Interrupt mask bits for capture */
|
|
|
|
ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_CAPTURE);
|
2007-08-19 01:48:42 +07:00
|
|
|
del_timer(&itv->dma_timer);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
2007-07-11 00:58:33 +07:00
|
|
|
/* event notification (off) */
|
|
|
|
if (test_and_clear_bit(IVTV_F_I_DIG_RST, &itv->i_flags)) {
|
|
|
|
/* type: 0 = refresh */
|
|
|
|
/* on/off: 0 = off, intr: 0x10000000, mbox_id: -1: none */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_SET_EVENT_NOTIFICATION, 4, 0, 0, IVTV_IRQ_ENC_VIM_RST, -1);
|
|
|
|
ivtv_set_irq_mask(itv, IVTV_IRQ_ENC_VIM_RST);
|
|
|
|
}
|
|
|
|
|
2010-03-07 07:37:04 +07:00
|
|
|
/* Raw-passthrough is implied on start. Make sure it's stopped so
|
|
|
|
the encoder will re-initialize when next started */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, 1, 2, 7);
|
|
|
|
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
wake_up(&s->waitq);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts)
|
|
|
|
{
|
2010-03-28 00:10:13 +07:00
|
|
|
static const struct v4l2_event ev = {
|
|
|
|
.type = V4L2_EVENT_EOS,
|
|
|
|
};
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
struct ivtv *itv = s->itv;
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (s->vdev == NULL)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (s->type != IVTV_DEC_STREAM_TYPE_YUV && s->type != IVTV_DEC_STREAM_TYPE_MPG)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (!test_bit(IVTV_F_S_STREAMING, &s->s_flags))
|
|
|
|
return 0;
|
|
|
|
|
2007-06-07 19:04:03 +07:00
|
|
|
IVTV_DEBUG_INFO("Stop Decode at %llu, flags: %x\n", (unsigned long long)pts, flags);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
/* Stop Decoder */
|
|
|
|
if (!(flags & VIDEO_CMD_STOP_IMMEDIATELY) || pts) {
|
|
|
|
u32 tmp = 0;
|
|
|
|
|
|
|
|
/* Wait until the decoder is no longer running */
|
|
|
|
if (pts) {
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_STOP_PLAYBACK, 3,
|
|
|
|
0, (u32)(pts & 0xffffffff), (u32)(pts >> 32));
|
|
|
|
}
|
|
|
|
while (1) {
|
|
|
|
u32 data[CX2341X_MBOX_MAX_DATA];
|
|
|
|
ivtv_vapi_result(itv, data, CX2341X_DEC_GET_XFER_INFO, 0);
|
|
|
|
if (s->q_full.buffers + s->q_dma.buffers == 0) {
|
|
|
|
if (tmp == data[3])
|
|
|
|
break;
|
|
|
|
tmp = data[3];
|
|
|
|
}
|
2007-07-19 21:21:04 +07:00
|
|
|
if (ivtv_msleep_timeout(100, 1))
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_STOP_PLAYBACK, 3, flags & VIDEO_CMD_STOP_TO_BLACK, 0, 0);
|
|
|
|
|
|
|
|
/* turn off notification of dual/stereo mode change */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_SET_EVENT_NOTIFICATION, 4, 0, 0, IVTV_IRQ_DEC_AUD_MODE_CHG, -1);
|
|
|
|
|
|
|
|
ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_DECODE);
|
2007-08-19 01:48:42 +07:00
|
|
|
del_timer(&itv->dma_timer);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
clear_bit(IVTV_F_S_NEEDS_DATA, &s->s_flags);
|
|
|
|
clear_bit(IVTV_F_S_STREAMING, &s->s_flags);
|
|
|
|
ivtv_flush_queues(s);
|
|
|
|
|
2010-06-21 01:12:28 +07:00
|
|
|
/* decoder needs time to settle */
|
|
|
|
ivtv_msleep_timeout(40, 0);
|
|
|
|
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
/* decrement decoding */
|
|
|
|
atomic_dec(&itv->decoding);
|
|
|
|
|
|
|
|
set_bit(IVTV_F_I_EV_DEC_STOPPED, &itv->i_flags);
|
|
|
|
wake_up(&itv->event_waitq);
|
2010-03-28 00:10:13 +07:00
|
|
|
v4l2_event_queue(s->vdev, &ev);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
/* wake up wait queues */
|
|
|
|
wake_up(&s->waitq);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ivtv_passthrough_mode(struct ivtv *itv, int enable)
|
|
|
|
{
|
|
|
|
struct ivtv_stream *yuv_stream = &itv->streams[IVTV_ENC_STREAM_TYPE_YUV];
|
|
|
|
struct ivtv_stream *dec_stream = &itv->streams[IVTV_DEC_STREAM_TYPE_YUV];
|
|
|
|
|
2009-02-07 17:02:27 +07:00
|
|
|
if (yuv_stream->vdev == NULL || dec_stream->vdev == NULL)
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
IVTV_DEBUG_INFO("ivtv ioctl: Select passthrough mode\n");
|
|
|
|
|
|
|
|
/* Prevent others from starting/stopping streams while we
|
|
|
|
initiate/terminate passthrough mode */
|
|
|
|
if (enable) {
|
|
|
|
if (itv->output_mode == OUT_PASSTHROUGH) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
if (ivtv_set_output_mode(itv, OUT_PASSTHROUGH) != OUT_PASSTHROUGH)
|
|
|
|
return -EBUSY;
|
|
|
|
|
|
|
|
/* Fully initialize stream, and then unflag init */
|
|
|
|
set_bit(IVTV_F_S_PASSTHROUGH, &dec_stream->s_flags);
|
|
|
|
set_bit(IVTV_F_S_STREAMING, &dec_stream->s_flags);
|
|
|
|
|
|
|
|
/* Setup YUV Decoder */
|
|
|
|
ivtv_setup_v4l2_decode_stream(dec_stream);
|
|
|
|
|
|
|
|
/* Start Decoder */
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_START_PLAYBACK, 2, 0, 1);
|
|
|
|
atomic_inc(&itv->decoding);
|
|
|
|
|
|
|
|
/* Setup capture if not already done */
|
|
|
|
if (atomic_read(&itv->capturing) == 0) {
|
2010-06-27 16:07:26 +07:00
|
|
|
cx2341x_handler_setup(&itv->cxhdl);
|
|
|
|
cx2341x_handler_set_busy(&itv->cxhdl, 1);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Start Passthrough Mode */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_START_CAPTURE, 2, 2, 11);
|
|
|
|
atomic_inc(&itv->capturing);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (itv->output_mode != OUT_PASSTHROUGH)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
/* Stop Passthrough Mode */
|
|
|
|
ivtv_vapi(itv, CX2341X_ENC_STOP_CAPTURE, 3, 1, 2, 11);
|
|
|
|
ivtv_vapi(itv, CX2341X_DEC_STOP_PLAYBACK, 3, 1, 0, 0);
|
|
|
|
|
|
|
|
atomic_dec(&itv->capturing);
|
|
|
|
atomic_dec(&itv->decoding);
|
|
|
|
clear_bit(IVTV_F_S_PASSTHROUGH, &dec_stream->s_flags);
|
|
|
|
clear_bit(IVTV_F_S_STREAMING, &dec_stream->s_flags);
|
|
|
|
itv->output_mode = OUT_NONE;
|
2010-06-27 16:07:26 +07:00
|
|
|
if (atomic_read(&itv->capturing) == 0)
|
|
|
|
cx2341x_handler_set_busy(&itv->cxhdl, 0);
|
V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder
It took three core maintainers, over four years of work, eight new i2c
modules, eleven new V4L2 ioctls, three new DVB video ioctls, a Sliced
VBI API, a new MPEG encoder API, an enhanced DVB video MPEG decoding
API, major YUV/OSD contributions from Ian and John, web/wiki/svn/trac
support from Axel Thimm, (hardware) support from Hauppauge, support and
assistance from the v4l-dvb people and the many, many users of ivtv to
finally make it possible to merge this driver into the kernel.
Thank you all!
Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 22:31:25 +07:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|