Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294899
b: refs/heads/master
c: a45c0ad
h: refs/heads/master
i:
  294897: 2772a43
  294895: eb9ddaa
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Feb 14, 2012
1 parent 2a199ec commit c9183e4
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 32d7e63c1f4f86ad18404e3f36be99c9910fae9b
refs/heads/master: a45c0ad51d344dad18c6fb67304b4f87cf0ffd59
2 changes: 2 additions & 0 deletions trunk/drivers/media/video/v4l2-compat-ioctl32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,8 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
case VIDIOC_G_ENC_INDEX:
case VIDIOC_ENCODER_CMD:
case VIDIOC_TRY_ENCODER_CMD:
case VIDIOC_DECODER_CMD:
case VIDIOC_TRY_DECODER_CMD:
case VIDIOC_DBG_S_REGISTER:
case VIDIOC_DBG_G_REGISTER:
case VIDIOC_DBG_G_CHIP_IDENT:
Expand Down
28 changes: 28 additions & 0 deletions trunk/drivers/media/video/v4l2-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ static const char *v4l2_ioctls[] = {
[_IOC_NR(VIDIOC_ENCODER_CMD)] = "VIDIOC_ENCODER_CMD",
[_IOC_NR(VIDIOC_TRY_ENCODER_CMD)] = "VIDIOC_TRY_ENCODER_CMD",

[_IOC_NR(VIDIOC_DECODER_CMD)] = "VIDIOC_DECODER_CMD",
[_IOC_NR(VIDIOC_TRY_DECODER_CMD)] = "VIDIOC_TRY_DECODER_CMD",
[_IOC_NR(VIDIOC_DBG_S_REGISTER)] = "VIDIOC_DBG_S_REGISTER",
[_IOC_NR(VIDIOC_DBG_G_REGISTER)] = "VIDIOC_DBG_G_REGISTER",

Expand Down Expand Up @@ -1764,6 +1766,32 @@ static long __video_do_ioctl(struct file *file,
dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
break;
}
case VIDIOC_DECODER_CMD:
{
struct v4l2_decoder_cmd *p = arg;

if (!ops->vidioc_decoder_cmd)
break;
if (ret_prio) {
ret = ret_prio;
break;
}
ret = ops->vidioc_decoder_cmd(file, fh, p);
if (!ret)
dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
break;
}
case VIDIOC_TRY_DECODER_CMD:
{
struct v4l2_decoder_cmd *p = arg;

if (!ops->vidioc_try_decoder_cmd)
break;
ret = ops->vidioc_try_decoder_cmd(file, fh, p);
if (!ret)
dbgarg(cmd, "cmd=%d, flags=%x\n", p->cmd, p->flags);
break;
}
case VIDIOC_G_PARM:
{
struct v4l2_streamparm *p = arg;
Expand Down
53 changes: 53 additions & 0 deletions trunk/include/linux/videodev2.h
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,54 @@ struct v4l2_encoder_cmd {
};
};

/* Decoder commands */
#define V4L2_DEC_CMD_START (0)
#define V4L2_DEC_CMD_STOP (1)
#define V4L2_DEC_CMD_PAUSE (2)
#define V4L2_DEC_CMD_RESUME (3)

/* Flags for V4L2_DEC_CMD_START */
#define V4L2_DEC_CMD_START_MUTE_AUDIO (1 << 0)

/* Flags for V4L2_DEC_CMD_PAUSE */
#define V4L2_DEC_CMD_PAUSE_TO_BLACK (1 << 0)

/* Flags for V4L2_DEC_CMD_STOP */
#define V4L2_DEC_CMD_STOP_TO_BLACK (1 << 0)
#define V4L2_DEC_CMD_STOP_IMMEDIATELY (1 << 1)

/* Play format requirements (returned by the driver): */

/* The decoder has no special format requirements */
#define V4L2_DEC_START_FMT_NONE (0)
/* The decoder requires full GOPs */
#define V4L2_DEC_START_FMT_GOP (1)

/* The structure must be zeroed before use by the application
This ensures it can be extended safely in the future. */
struct v4l2_decoder_cmd {
__u32 cmd;
__u32 flags;
union {
struct {
__u64 pts;
} stop;

struct {
/* 0 or 1000 specifies normal speed,
1 specifies forward single stepping,
-1 specifies backward single stepping,
>1: playback at speed/1000 of the normal speed,
<-1: reverse playback at (-speed/1000) of the normal speed. */
__s32 speed;
__u32 format;
} start;

struct {
__u32 data[16];
} raw;
};
};
#endif


Expand Down Expand Up @@ -2318,6 +2366,11 @@ struct v4l2_create_buffers {
#define VIDIOC_G_SELECTION _IOWR('V', 94, struct v4l2_selection)
#define VIDIOC_S_SELECTION _IOWR('V', 95, struct v4l2_selection)

/* Experimental, these two ioctls may change over the next couple of kernel
versions. */
#define VIDIOC_DECODER_CMD _IOWR('V', 96, struct v4l2_decoder_cmd)
#define VIDIOC_TRY_DECODER_CMD _IOWR('V', 97, struct v4l2_decoder_cmd)

/* Reminder: when adding new ioctls please add support for them to
drivers/media/video/v4l2-compat-ioctl32.c as well! */

Expand Down
4 changes: 4 additions & 0 deletions trunk/include/media/v4l2-ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ struct v4l2_ioctl_ops {
struct v4l2_encoder_cmd *a);
int (*vidioc_try_encoder_cmd) (struct file *file, void *fh,
struct v4l2_encoder_cmd *a);
int (*vidioc_decoder_cmd) (struct file *file, void *fh,
struct v4l2_decoder_cmd *a);
int (*vidioc_try_decoder_cmd) (struct file *file, void *fh,
struct v4l2_decoder_cmd *a);

/* Stream type-dependent parameter ioctls */
int (*vidioc_g_parm) (struct file *file, void *fh,
Expand Down

0 comments on commit c9183e4

Please sign in to comment.