for (i = 0; i < ent->num_pads; i++) if (ent->pads[i].flags & MEDIA_PAD_FL_SINK) returnfalse; returntrue;
}
conststruct vimc_pix_map *vimc_pix_map_by_index(unsignedint i)
{ if (i >= ARRAY_SIZE(vimc_pix_map_list)) return NULL;
return &vimc_pix_map_list[i];
}
u32 vimc_mbus_code_by_index(unsignedint index)
{ unsignedint i, j;
for (i = 0; i < ARRAY_SIZE(vimc_pix_map_list); i++) { for (j = 0; j < ARRAY_SIZE(vimc_pix_map_list[i].code); j++) { if (!vimc_pix_map_list[i].code[j]) break;
if (!index) return vimc_pix_map_list[i].code[j];
index--;
}
} return0;
}
conststruct vimc_pix_map *vimc_pix_map_by_code(u32 code)
{ unsignedint i, j;
for (i = 0; i < ARRAY_SIZE(vimc_pix_map_list); i++) { for (j = 0; j < ARRAY_SIZE(vimc_pix_map_list[i].code); j++) { if (vimc_pix_map_list[i].code[j] == code) return &vimc_pix_map_list[i];
}
} return NULL;
}
for (i = 0; i < ARRAY_SIZE(vimc_pix_map_list); i++) { if (vimc_pix_map_list[i].pixelformat == pixelformat) return &vimc_pix_map_list[i];
} return NULL;
}
/* Colorspace must match. */ if (source_fmt.colorspace != sink_fmt.colorspace) return -EPIPE;
/* Colorimetry must match if they are not set to DEFAULT */ if (source_fmt.ycbcr_enc != V4L2_YCBCR_ENC_DEFAULT &&
sink_fmt.ycbcr_enc != V4L2_YCBCR_ENC_DEFAULT &&
source_fmt.ycbcr_enc != sink_fmt.ycbcr_enc) return -EPIPE;
/* Expose this subdev to user space */
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; if (sd->ctrl_handler)
sd->flags |= V4L2_SUBDEV_FL_HAS_EVENTS;
/* Initialize the media entity */
ret = media_entity_pads_init(&sd->entity, num_pads, pads); if (ret) return ret;
/* *Finalizethesubdevinitializationifitsupportsactivestates.Use *thecontrolhandlerlockasthestatelockifavailable.
*/ if (int_ops && int_ops->init_state) { if (sd->ctrl_handler)
sd->state_lock = sd->ctrl_handler->lock;
ret = v4l2_subdev_init_finalize(sd); if (ret) {
dev_err(v4l2_dev->dev, "%s: subdev initialization failed (err=%d)\n",
name, ret); goto err_clean_m_ent;
}
}
/* Register the subdev with the v4l2 and the media framework */
ret = v4l2_device_register_subdev(v4l2_dev, sd); if (ret) {
dev_err(v4l2_dev->dev, "%s: subdev register failed (err=%d)\n",
name, ret); goto err_clean_sd;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.