Make format setting optional for -f option
[media-ctl.git] / subdev.h
1 /*
2  * Media controller test application
3  *
4  * Copyright (C) 2010 Ideas on board SPRL <laurent.pinchart@ideasonboard.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  */
19
20 #ifndef __SUBDEV_H__
21 #define __SUBDEV_H__
22
23 #include <linux/v4l2-subdev.h>
24
25 struct media_entity;
26
27 const char *pixelcode_to_string(enum v4l2_mbus_pixelcode code);
28 enum v4l2_mbus_pixelcode string_to_pixelcode(const char *string,
29                                              unsigned int length);
30
31 int v4l2_subdev_get_format(struct media_entity *entity,
32         struct v4l2_mbus_framefmt *format, unsigned int pad,
33         enum v4l2_subdev_format which);
34 int v4l2_subdev_set_format(struct media_entity *entity,
35         struct v4l2_mbus_framefmt *format, unsigned int pad,
36         enum v4l2_subdev_format which);
37 int v4l2_subdev_get_crop(struct media_entity *entity, struct v4l2_rect *rect,
38         unsigned int pad, enum v4l2_subdev_format which);
39 int v4l2_subdev_set_crop(struct media_entity *entity, struct v4l2_rect *rect,
40         unsigned int pad, enum v4l2_subdev_format which);
41 int v4l2_subdev_set_frame_interval(struct media_entity *entity,
42         struct v4l2_fract *interval);
43
44 void v4l2_subdev_print_format(struct media_entity *entity,
45         unsigned int pad, enum v4l2_subdev_format which);
46
47 #endif
48