if (entity == NULL)
return NULL;
- for (++end; isspace(*end); ++end);
+ ++end;
} else {
entity_id = strtoul(p, &end, 10);
entity = media_get_entity_by_id(media, entity_id);
if (entity == NULL)
return NULL;
}
+ for (; isspace(*end); ++end);
if (*end != ':')
return NULL;
{
int ret;
+ if (crop->left == -1 || crop->top == -1)
+ return 0;
+
printf("Setting up crop rectangle %u,%u/%ux%u on pad %s/%u\n",
crop->left, crop->top, crop->width, crop->height,
pad->entity->info.name, pad->index);
return -EINVAL;
}
+ if (pad->type == MEDIA_PAD_TYPE_OUTPUT) {
+ ret = set_crop(pad, &crop);
+ if (ret < 0)
+ return ret;
+ }
+
ret = set_format(pad, &format);
- if (ret < 0) {
- printf("Unable to set format\n");
+ if (ret < 0)
return ret;
- }
- if (crop.left != -1 && crop.top != -1) {
+ if (pad->type == MEDIA_PAD_TYPE_INPUT) {
ret = set_crop(pad, &crop);
- if (ret < 0) {
- printf("Unable to set crop rectangle\n");
+ if (ret < 0)
return ret;
- }
}
if (interval.numerator != 0) {