menuconfig BR2_PACKAGE_JANUS_GATEWAY
	bool "janus-gateway"
	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
	depends on BR2_USE_WCHAR # libnice -> libglib2
	depends on BR2_USE_MMU # libnice
	depends on !BR2_STATIC_LIBS # dlopen
	select BR2_PACKAGE_JANSSON
	select BR2_PACKAGE_LIBGLIB2
	select BR2_PACKAGE_LIBNICE
	select BR2_PACKAGE_LIBSRTP
	select BR2_PACKAGE_OPENSSL
	help
	  Janus is an open source, general purpose, WebRTC gateway
	  designed and developed by Meetecho.

	  https://github.com/meetecho/janus-gateway

if BR2_PACKAGE_JANUS_GATEWAY

comment "plugins"

config BR2_PACKAGE_JANUS_GATEWAY_AUDIO_BRIDGE
	bool "audio bridge"
	select BR2_PACKAGE_OPUS

config BR2_PACKAGE_JANUS_GATEWAY_ECHO_TEST
	bool "echo test"

config BR2_PACKAGE_JANUS_GATEWAY_RECORDPLAY
	bool "record and play"

config BR2_PACKAGE_JANUS_GATEWAY_SIP_GATEWAY
	bool "sip gateway"
	select BR2_PACKAGE_SOFIA_SIP

config BR2_PACKAGE_JANUS_GATEWAY_STREAMING
	bool "streaming"
	# SO_REUSEPORT
	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9

comment "streaming plugin needs a toolchain w/ headers >= 3.9"
	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9

config BR2_PACKAGE_JANUS_GATEWAY_TEXT_ROOM
	bool "text room"

config BR2_PACKAGE_JANUS_GATEWAY_VIDEO_CALL
	bool "video call"

config BR2_PACKAGE_JANUS_GATEWAY_VIDEO_ROOM
	bool "video room"

config BR2_PACKAGE_JANUS_GATEWAY_VOICE_MAIL
	bool "voice mail"
	select BR2_PACKAGE_LIBOGG

comment "transports"

config BR2_PACKAGE_JANUS_GATEWAY_MQTT
	bool "MQTT"
	depends on !BR2_STATIC_LIBS
	depends on BR2_TOOLCHAIN_HAS_THREADS
	select BR2_PACKAGE_PAHO_MQTT_C

comment "MQTT transport needs a toolchain w/ threads and dynamic library support"
	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS

config BR2_PACKAGE_JANUS_GATEWAY_RABBITMQ
	bool "RabbitMQ"
	depends on BR2_TOOLCHAIN_HAS_THREADS
	select BR2_PACKAGE_RABBITMQ_C

comment "RabbitMQ transport needs a toolchain w/ threads"
	depends on !BR2_TOOLCHAIN_HAS_THREADS

config BR2_PACKAGE_JANUS_GATEWAY_REST
	bool "REST (HTTP/HTTPS)"
	depends on BR2_TOOLCHAIN_HAS_THREADS
	select BR2_PACKAGE_LIBMICROHTTPD

comment "REST transport needs a toolchain w/ threads"
	depends on !BR2_TOOLCHAIN_HAS_THREADS

config BR2_PACKAGE_JANUS_GATEWAY_UNIX_SOCKETS
	bool "Unix Sockets"
	default y

config BR2_PACKAGE_JANUS_GATEWAY_WEBSOCKETS
	bool "WebSockets"
	depends on BR2_USE_MMU
	select BR2_PACKAGE_LIBWEBSOCKETS

endif

comment "janus-gateway needs a toolchain w/ dynamic library, threads, wchar"
	depends on BR2_USE_MMU
	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
