Re: [PULL] http://hg.jannau.net/hdpvr-merge/ - Hauppauge HD PVR driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 18, 2009 at 08:12:17PM -0300, Mauro Carvalho Chehab wrote:
> 
> Everything looks ok, except for this part of your code:
> 
> +static long hdpvr_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> +{
> +       struct hdpvr_fh *fh = (struct hdpvr_fh *)filp->private_data;
> +       struct hdpvr_device *dev = fh->dev;
> +       int res;
> +
> +       if (video_is_unregistered(dev->video_dev))
> +               return -EIO;
> +
> +       mutex_lock(&dev->io_mutex);
> +       switch (cmd) {
> +       case VIDIOC_TRY_ENCODER_CMD:
> +       case VIDIOC_ENCODER_CMD: {
> +               struct v4l2_encoder_cmd *enc = (struct v4l2_encoder_cmd *)arg;
> +               int try = cmd == VIDIOC_TRY_ENCODER_CMD;
> +
> +               memset(&enc->raw, 0, sizeof(enc->raw));
> +               switch (enc->cmd) {
> +               case V4L2_ENC_CMD_START:
> +                       enc->flags = 0;
> +                       if (try)
> +                               return 0;
> +                       res = hdpvr_start_streaming(dev);
> +                       break;
> +               case V4L2_ENC_CMD_STOP:
> +                       if (try)
> +                               return 0;
> +                       res = hdpvr_stop_streaming(dev);
> +                       break;
> +               default:
> +                       v4l2_dbg(MSG_INFO, hdpvr_debug, dev->video_dev,
> +                                "Unsupported encoder cmd %d\n", enc->cmd);
> +                       return -EINVAL;
> +               }
> +               break;
> +       }
> +       default:
> +               res = video_ioctl2(filp, cmd, arg);
> +       }
> +       mutex_unlock(&dev->io_mutex);
> +       return res;
> +}
> 
> Why haven't you just used the two video_ioctl2 handlers for vidioc_encoder_cmd
> and vidioc_try_encoder_cmd, like ivtv and cx18, instead of the above code?

They were missing in the video_ioctl2 handler then I wrote the code.
I forgot to check if that's still the case. I'll change it in a minute.

Janne
> 
> Cheers,
> Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux