summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorTodor Tomov <ttomov@mm-sol.com>2010-08-12 13:55:33 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-08-16 14:58:30 +0200
commitabdf840de983369cc3e65364304fb761c015d5b1 (patch)
tree7c6ec2a3c930b1c10e3adec789d869b20c446fff /main.c
parenta753dba7ed68896912f291f7ca01edb85a66db75 (diff)
Change crop rectangle format from L,T/WxH to (L,T)/WxH
Signed-off-by: Todor Tomov <ttomov@mm-sol.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'main.c')
-rw-r--r--main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/main.c b/main.c
index e143b8c..ec1ff1f 100644
--- a/main.c
+++ b/main.c
@@ -209,7 +209,8 @@ static int parse_crop(struct v4l2_rect *crop, const char *p, char **endp)
{
char *end;
- for (; isspace(*p); ++p);
+ if (*p++ != '(')
+ return -EINVAL;
crop->left = strtoul(p, &end, 10);
if (*end != ',')
@@ -217,6 +218,8 @@ static int parse_crop(struct v4l2_rect *crop, const char *p, char **endp)
p = end + 1;
crop->top = strtoul(p, &end, 10);
+ if (*end++ != ')')
+ return -EINVAL;
if (*end != '/')
return -EINVAL;
@@ -274,7 +277,7 @@ static struct media_entity_pad *parse_pad_format(struct media_device *media,
return NULL;
for (p = end; isspace(*p); p++);
- if (isdigit(*p)) {
+ if (*p == '(') {
ret = parse_crop(crop, p, &end);
if (ret < 0)
return NULL;