Shorten structures names:
struct media_entity_link => struct media_link
struct media_entity_pad => struct media_pad
Signed-off-by: Todor Tomov <ttomov@mm-sol.com>
}
for (j = 0; j < entity->num_links; j++) {
}
for (j = 0; j < entity->num_links; j++) {
- struct media_entity_link *link = &entity->links[j];
+ struct media_link *link = &entity->links[j];
if (link->source->entity != entity)
continue;
if (link->source->entity != entity)
continue;
printf("%*cdevice node name %s\n", padding, ' ', entity->devname);
for (j = 0; j < entity->info.pads; j++) {
printf("%*cdevice node name %s\n", padding, ' ', entity->devname);
for (j = 0; j < entity->info.pads; j++) {
- struct media_entity_pad *pad = &entity->pads[j];
+ struct media_pad *pad = &entity->pads[j];
printf("\tpad%u: %s ", j, media_pad_type_to_string(pad->flags));
printf("\tpad%u: %s ", j, media_pad_type_to_string(pad->flags));
printf("\n");
for (k = 0; k < entity->num_links; k++) {
printf("\n");
for (k = 0; k < entity->num_links; k++) {
- struct media_entity_link *link = &entity->links[k];
+ struct media_link *link = &entity->links[k];
if (link->source->entity != entity ||
link->source->index != j)
if (link->source->entity != entity ||
link->source->index != j)
-static struct media_entity_pad *parse_pad(struct media_device *media, const char *p, char **endp)
+static struct media_pad *parse_pad(struct media_device *media, const char *p, char **endp)
{
unsigned int entity_id, pad;
struct media_entity *entity;
{
unsigned int entity_id, pad;
struct media_entity *entity;
return &entity->pads[pad];
}
return &entity->pads[pad];
}
-static struct media_entity_link *parse_link(struct media_device *media, const char *p, char **endp)
+static struct media_link *parse_link(struct media_device *media, const char *p, char **endp)
- struct media_entity_link *link;
- struct media_entity_pad *source;
- struct media_entity_pad *sink;
+ struct media_link *link;
+ struct media_pad *source;
+ struct media_pad *sink;
unsigned int i;
char *end;
unsigned int i;
char *end;
static int setup_link(struct media_device *media, const char *p, char **endp)
{
static int setup_link(struct media_device *media, const char *p, char **endp)
{
- struct media_entity_link *link;
+ struct media_link *link;
-static struct media_entity_pad *parse_pad_format(struct media_device *media,
+static struct media_pad *parse_pad_format(struct media_device *media,
struct v4l2_mbus_framefmt *format, struct v4l2_rect *crop,
struct v4l2_fract *interval, const char *p, char **endp)
{
struct v4l2_mbus_framefmt *format, struct v4l2_rect *crop,
struct v4l2_fract *interval, const char *p, char **endp)
{
- struct media_entity_pad *pad;
-static int set_format(struct media_entity_pad *pad, struct v4l2_mbus_framefmt *format)
+static int set_format(struct media_pad *pad, struct v4l2_mbus_framefmt *format)
-static int set_crop(struct media_entity_pad *pad, struct v4l2_rect *crop)
+static int set_crop(struct media_pad *pad, struct v4l2_rect *crop)
static int setup_format(struct media_device *media, const char *p, char **endp)
{
struct v4l2_mbus_framefmt format = { 0, 0, 0 };
static int setup_format(struct media_device *media, const char *p, char **endp)
{
struct v4l2_mbus_framefmt format = { 0, 0, 0 };
- struct media_entity_pad *pad;
struct v4l2_rect crop = { -1, -1, -1, -1 };
struct v4l2_fract interval = { 0, 0 };
unsigned int i;
struct v4l2_rect crop = { -1, -1, -1, -1 };
struct v4l2_fract interval = { 0, 0 };
unsigned int i;
*/
if (pad->flags & MEDIA_PAD_FLAG_OUTPUT) {
for (i = 0; i < pad->entity->num_links; ++i) {
*/
if (pad->flags & MEDIA_PAD_FLAG_OUTPUT) {
for (i = 0; i < pad->entity->num_links; ++i) {
- struct media_entity_link *link = &pad->entity->links[i];
+ struct media_link *link = &pad->entity->links[i];
struct v4l2_mbus_framefmt remote_format;
if (!(link->flags & MEDIA_LINK_FLAG_ACTIVE))
struct v4l2_mbus_framefmt remote_format;
if (!(link->flags & MEDIA_LINK_FLAG_ACTIVE))
- struct media_entity_pad *pad;
pad = parse_pad(media, media_opts.pad, NULL);
if (pad == NULL) {
pad = parse_pad(media, media_opts.pad, NULL);
if (pad == NULL) {
/*
* media_entity_remote_pad -
*/
/*
* media_entity_remote_pad -
*/
-struct media_entity_pad *media_entity_remote_source(struct media_entity_pad *pad)
+struct media_pad *media_entity_remote_source(struct media_pad *pad)
return NULL;
for (i = 0; i < pad->entity->num_links; ++i) {
return NULL;
for (i = 0; i < pad->entity->num_links; ++i) {
- struct media_entity_link *link = &pad->entity->links[i];
+ struct media_link *link = &pad->entity->links[i];
if (!(link->flags & MEDIA_LINK_FLAG_ACTIVE))
continue;
if (!(link->flags & MEDIA_LINK_FLAG_ACTIVE))
continue;
* media_setup_link -
*/
int media_setup_link(struct media_device *media,
* media_setup_link -
*/
int media_setup_link(struct media_device *media,
- struct media_entity_pad *source,
- struct media_entity_pad *sink,
+ struct media_pad *source,
+ struct media_pad *sink,
- struct media_entity_link *link;
+ struct media_link *link;
struct media_link_desc ulink;
unsigned int i;
int ret;
struct media_link_desc ulink;
unsigned int i;
int ret;
struct media_entity *entity = &media->entities[i];
for (j = 0; j < entity->num_links; j++) {
struct media_entity *entity = &media->entities[i];
for (j = 0; j < entity->num_links; j++) {
- struct media_entity_link *link = &entity->links[j];
+ struct media_link *link = &entity->links[j];
if (link->flags & MEDIA_LINK_FLAG_IMMUTABLE ||
link->source->entity != entity)
if (link->flags & MEDIA_LINK_FLAG_IMMUTABLE ||
link->source->entity != entity)
-static struct media_entity_link *media_entity_add_link(struct media_entity *entity)
+static struct media_link *media_entity_add_link(struct media_entity *entity)
{
if (entity->num_links >= entity->max_links) {
{
if (entity->num_links >= entity->max_links) {
- struct media_entity_link *links = entity->links;
+ struct media_link *links = entity->links;
unsigned int max_links = entity->max_links * 2;
unsigned int i;
unsigned int max_links = entity->max_links * 2;
unsigned int i;
for (i = 0; i < entity->info.links; ++i) {
struct media_link_desc *link = &links.links[i];
for (i = 0; i < entity->info.links; ++i) {
struct media_link_desc *link = &links.links[i];
- struct media_entity_link *fwdlink;
- struct media_entity_link *backlink;
+ struct media_link *fwdlink;
+ struct media_link *backlink;
struct media_entity *source;
struct media_entity *sink;
struct media_entity *source;
struct media_entity *sink;
-struct media_entity_link {
- struct media_entity_pad *source;
- struct media_entity_pad *sink;
- struct media_entity_link *twin;
+struct media_link {
+ struct media_pad *source;
+ struct media_pad *sink;
+ struct media_link *twin;
__u32 flags;
__u32 padding[3];
};
__u32 flags;
__u32 padding[3];
};
-struct media_entity_pad {
struct media_entity *entity;
__u32 index;
__u32 flags;
struct media_entity *entity;
__u32 index;
__u32 flags;
struct media_entity {
struct media_entity_desc info;
struct media_entity {
struct media_entity_desc info;
- struct media_entity_pad *pads;
- struct media_entity_link *links;
+ struct media_pad *pads;
+ struct media_link *links;
unsigned int max_links;
unsigned int num_links;
unsigned int max_links;
unsigned int num_links;
struct media_device *media_open(const char *name, int verbose);
void media_close(struct media_device *media);
struct media_device *media_open(const char *name, int verbose);
void media_close(struct media_device *media);
-struct media_entity_pad *media_entity_remote_source(struct media_entity_pad *pad);
+struct media_pad *media_entity_remote_source(struct media_pad *pad);
static inline unsigned int media_entity_type(struct media_entity *entity)
{
static inline unsigned int media_entity_type(struct media_entity *entity)
{
struct media_entity *media_get_entity_by_id(struct media_device *media,
__u32 id);
int media_setup_link(struct media_device *media,
struct media_entity *media_get_entity_by_id(struct media_device *media,
__u32 id);
int media_setup_link(struct media_device *media,
- struct media_entity_pad *source, struct media_entity_pad *sink,
+ struct media_pad *source, struct media_pad *sink,
__u32 flags);
int media_reset_links(struct media_device *media);
__u32 flags);
int media_reset_links(struct media_device *media);