Lines Matching refs:media
65 struct media_device *media, in __media_debug_set_handler() argument
70 media->debug_handler = debug_handler; in __media_debug_set_handler()
71 media->debug_priv = debug_priv; in __media_debug_set_handler()
73 media->debug_handler = __media_debug_default; in __media_debug_set_handler()
74 media->debug_priv = NULL; in __media_debug_set_handler()
84 static int __media_enum_links(struct media_device *media) in __media_enum_links() argument
118 static int __media_get_media_fd(const char *filename, struct media_device *media) in __media_get_media_fd() argument
126 media->fd = open(filename, O_RDWR, 0); in __media_get_media_fd()
127 if (media->fd < 0) { in __media_get_media_fd()
128 ALOGE("Open sysfs media device failed, media->fd: %d", media->fd); in __media_get_media_fd()
132 ALOGD("%s: media->fd: %d", __func__, media->fd); in __media_get_media_fd()
134 return media->fd; in __media_get_media_fd()
138 static int __media_enum_entities(struct media_device *media) in __media_enum_entities() argument
148 struct media_device *media; in __media_open_debug() local
151 media = (struct media_device *)calloc(1, sizeof(struct media_device)); in __media_open_debug()
152 if (media == NULL) { in __media_open_debug()
153 ALOGE("media: %p", media); in __media_open_debug()
157 __media_debug_set_handler(media, debug_handler, debug_priv); in __media_open_debug()
160 ALOGD("%s: media: %p", __func__, media); in __media_open_debug()
162 media->fd = __media_get_media_fd(filename, media); in __media_open_debug()
163 if (media->fd < 0) { in __media_open_debug()
164 exynos_media_close(media); in __media_open_debug()
169 ALOGD("%s: media->fd: %d", __func__, media->fd); in __media_open_debug()
170 ret = __media_enum_entities(media); in __media_open_debug()
174 exynos_media_close(media); in __media_open_debug()
178 ALOGD("%s: Found %u entities", __func__, media->entities_count); in __media_open_debug()
181 ret = __media_enum_links(media); in __media_open_debug()
184 exynos_media_close(media); in __media_open_debug()
188 return media; in __media_open_debug()
214 void exynos_media_close(struct media_device *media) in exynos_media_close() argument
218 if (media->fd != -1) in exynos_media_close()
219 close(media->fd); in exynos_media_close()
221 for (i = 0; i < media->entities_count; ++i) { in exynos_media_close()
222 struct media_entity *entity = &media->entities[i]; in exynos_media_close()
230 free(media->entities); in exynos_media_close()
231 free(media); in exynos_media_close()
260 struct media_entity *exynos_media_get_entity_by_name(struct media_device *media, in exynos_media_get_entity_by_name() argument
266 for (i = 0; i < media->entities_count; ++i) { in exynos_media_get_entity_by_name()
267 entity = &media->entities[i]; in exynos_media_get_entity_by_name()
285 struct media_entity *exynos_media_get_entity_by_id(struct media_device *media, in exynos_media_get_entity_by_id() argument
290 for (i = 0; i < media->entities_count; ++i) { in exynos_media_get_entity_by_id()
291 struct media_entity *entity = &media->entities[i]; in exynos_media_get_entity_by_id()
316 int exynos_media_setup_link(struct media_device *media, in exynos_media_setup_link() argument
333 int exynos_media_reset_links(struct media_device *media) in exynos_media_reset_links() argument
412 struct media_pad *exynos_media_parse_pad(struct media_device *media, in exynos_media_parse_pad() argument
430 struct media_device *media, in exynos_media_parse_link() argument
440 source = exynos_media_parse_pad(media, p, &end); in exynos_media_parse_link()
448 sink = exynos_media_parse_pad(media, p, &end); in exynos_media_parse_link()
475 struct media_device *media, in exynos_media_parse_setup_link() argument
492 int exynos_media_parse_setup_links(struct media_device *media, const char *p) in exynos_media_parse_setup_links() argument