# dev_media: audio/video device-driver layer.
# Leaf component: upper layers depend on it one-way; it must not depend back.

set(incs)
set(srcs)

if (CONFIG_DEV_AUDIO_EN)
	list(APPEND incs
		dev_audio
		)

	list(APPEND srcs
		dev_audio/dev_audio.c
		)
endif()

# Video: core video plus camera / rotation / display sub-drivers.
if (CONFIG_DEV_VIDEO_EN)
	# frame_queue: shared by capture and display
	list(APPEND incs
		frame_queue
		dev_video
		)

	list(APPEND srcs
		frame_queue/frame_que.c
		dev_video/dev_video.c
		)

	# Camera header dir (shared by DVP/UVC)
	if (CONFIG_DEV_DVP_CAMERA_EN OR CONFIG_DEV_UVC_CAMERA_EN)
		list(APPEND incs
			dev_video/dev_camera
			)
	endif()

	# DVP camera
	if (CONFIG_DEV_DVP_CAMERA_EN)
		list(APPEND srcs
			dev_video/dev_camera/dev_dvp_camera.c
			)
	endif()

	# Hardware rotation
	if (CONFIG_DEV_ROTT_EN)
		list(APPEND incs
			dev_video/dev_rott
			)

		list(APPEND srcs
			dev_video/dev_rott/dev_rott.c
			)
	endif()

	# UVC camera
	if (CONFIG_DEV_UVC_CAMERA_EN)
		list(APPEND srcs
			dev_video/dev_camera/dev_uvc_camera.c
			)
	endif()

	# Display output
	if (CONFIG_DEV_DISPLAY_EN)
		list(APPEND incs
			dev_video/dev_display
			)

		list(APPEND srcs
			dev_video/dev_display/dev_display.c
			)
	endif()
endif()

# Lower-level media/driver stacks the dev_* wrappers build on.
set(priv_req media_service multimedia wifi_transfer avdk_utils lwip_intf_v2_1 bk_wifi_driver bk_bluetooth bk_camera bk_video_pipeline bk_display)

armino_component_register(SRCS "${srcs}" INCLUDE_DIRS "${incs}" PRIV_REQUIRES "${priv_req}")
