Lines Matching refs:links
80 struct media_link *links = entity->links;
84 links = (struct media_link*)realloc(links, max_links * sizeof *links);
85 if (links == NULL)
89 links[i].twin->twin = &links[i];
92 entity->links = links;
95 return &entity->links[entity->num_links++];
107 struct media_links_enum links;
110 links.entity = entity->info.id;
111 links.pads = (struct media_pad_desc*)malloc(entity->info.pads * sizeof(struct media_pad_desc));
112 links.links = (struct media_link_desc*)malloc(entity->info.links * sizeof(struct media_link_desc));
114 if (ioctl(media->fd, MEDIA_IOC_ENUM_LINKS, &links) < 0) {
115 ALOGE("Unable to enumerate pads and links (%s)", strerror(errno));
116 free(links.pads);
117 free(links.links);
123 entity->pads[i].index = links.pads[i].index;
124 entity->pads[i].flags = links.pads[i].flags;
127 for (i = 0; i < entity->info.links; ++i) {
128 struct media_link_desc *link = &links.links[i];
159 free(links.pads);
160 free(links.links);
240 /* Number of links (for outbound links) plus number of pads (for
241 * inbound links) is a good safe initial estimate of the total
242 * number of links.
244 entity->max_links = entity->info.pads + entity->info.links;
247 entity->links = (struct media_link*)malloc(entity->max_links * sizeof(*entity->links));
248 if (entity->pads == NULL || entity->links == NULL) {
306 ALOGD("%s: Enumerating pads and links", __func__);
310 ALOGE("Unable to enumerate pads and links for device %s", filename);
323 * links.
352 free(entity->links);
369 * @return A pointer to the connected source pad, or NULL if all links connected
380 struct media_link *link = &pad->entity->links[i];
469 link = &source->entity->links[i];
507 * @brief Reset all links to the disabled state.
510 * Disable all links in the media device. This function is usually used after
511 * opening a media device to reset all links to a known state.
524 struct media_link *link = &entity->links[j];
695 link = &source->entity->links[i];