{
    "module": "multimedia",
    "depends": [
        "gui"
    ],
    "condition": "module.gui",
    "testDir": "../../config.tests",

    "commandline": {
        "options": {
            "alsa": "boolean",
            "evr": { "type": "boolean" },
            "directshow": { "type": "boolean" },
            "wmf": { "type": "boolean" },
            "gstreamer": { "type": "optionalString", "values": [ "no", "yes", "0.10", "1.0" ] },
            "pulseaudio": "boolean"
        }
    },

    "libraries": {
        "alsa": {
            "label": "ALSA",
            "test": "alsa",
            "sources": [
                "-lasound"
            ]
        },
        "avfoundation": {
            "label": "AVFoundation",
            "test": "avfoundation",
            "sources": [
                { "libs": "-framework AVFoundation -framework Foundation" }
            ]
        },
        "directshow": {
            "label": "DirectShow",
            "test": "directshow",
            "sources": [
                { "libs": "-lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32" }
            ]
        },
        "gstreamer_0_10": {
            "label": "GStreamer 0.10",
            "export": "gstreamer",
            "test": "gstreamer",
            "sources": [
                { "type": "pkgConfig",
                  "args": "gstreamer-0.10 gstreamer-base-0.10 gstreamer-audio-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gstreamer-interfaces-0.10" }
            ]
        },
        "gstreamer_1_0": {
            "label": "GStreamer 1.0",
            "export": "gstreamer",
            "test": "gstreamer",
            "sources": [
                { "type": "pkgConfig",
                  "args": "gstreamer-1.0 gstreamer-base-1.0 gstreamer-audio-1.0 gstreamer-video-1.0 gstreamer-pbutils-1.0 gstreamer-allocators-1.0" },
                { "libs": "-lgstreamer-1.0 -lgstbase-1.0 -lgstaudio-1.0 -lgstvideo-1.0 -lgstpbutils-1.0 -lglib-2.0 -lgobject-2.0",
                  "condition": "config.win32 || config.macos" },
                { "libs": "", "condition": "config.android && input.gstreamer != ''" }
            ]
        },
        "gstreamer_app_0_10": {
            "label": "GStreamer App 0.10",
            "export": "gstreamer_app",
            "test": "gstreamer_appsrc",
            "use": "gstreamer_0_10",
            "sources": [
                { "type": "pkgConfig", "args": "gstreamer-app-0.10" }
            ]
        },
        "gstreamer_app_1_0": {
            "label": "GStreamer App 1.0",
            "export": "gstreamer_app",
            "test": "gstreamer_appsrc",
            "use": "gstreamer_1_0",
            "sources": [
                { "type": "pkgConfig", "args": "gstreamer-app-1.0" },
                { "libs": "-lgstapp-1.0", "condition": "config.win32 || config.macos" },
                { "libs": "", "condition": "config.android && input.gstreamer != ''" }
            ]
        },
        "gstreamer_photography_0_10": {
            "label": "GStreamer Photography 0.10",
            "export": "gstreamer_photography",
            "test": "gstreamer_photography",
            "use": "gstreamer_0_10",
            "sources": [
                { "libs": "-lgstphotography-0.10" }
            ]
        },
        "gstreamer_photography_1_0": {
            "label": "GStreamer Photography 1.0",
            "export": "gstreamer_photography",
            "test": "gstreamer_photography",
            "use": "gstreamer_1_0",
            "sources": [
                { "libs": "-lgstphotography-1.0" }
            ]
        },
        "gstreamer_gl_1_0": {
            "label": "GStreamer OpenGL 1.0",
            "export": "gstreamer_gl",
            "test":  {
                "include": "gst/gl/gl.h"
            },
            "use": "gstreamer_1_0",
            "sources": [
                { "type": "pkgConfig", "args": "gstreamer-gl-1.0" }
            ]
        },
        "libresourceqt5": {
            "label": "libresourceqt5",
            "test": "resourcepolicy",
            "sources": [
                { "type": "pkgConfig", "args": "libresourceqt5" }
            ]
        },
        "mmrenderer": {
            "label": "MMRenderer",
            "test": "mmrenderer",
            "sources": [
                { "libs": "-lmmrndclient -lstrm" }
            ]
        },
        "openal": {
            "label": "OpenAL",
            "test": "openal",
            "sources": [
                { "type": "pkgConfig", "args": "openal" },
                { "libs": "-lOpenAL32", "condition": "config.win32" },
                { "libs": "-framework OpenAL", "condition": "config.darwin" },
                { "libs": "-lopenal", "condition": "config.unix && !config.darwin" }
            ]
        },
        "pulseaudio": {
            "label": "PulseAudio >= 0.9.10",
            "test": "pulseaudio",
            "sources": [
                { "type": "pkgConfig", "args": "libpulse >= 0.9.10 libpulse-mainloop-glib" }
            ]
        },
        "wmf": {
            "label": "WMF",
            "test": "wmf",
            "sources": [
                { "libs": "-lstrmiids -ldmoguids -luuid -lmsdmo -lole32 -loleaut32 -lMf -lMfuuid -lMfplat -lPropsys" }
            ]
        }
    },

    "tests": {
        "evr": {
            "label": "evr.h",
            "type": "compile",
            "test": "evr"
        },
        "gstreamer_encodingprofiles": {
            "label": "GStreamer encoding-profile.h",
            "type": "compile",
            "use": "gstreamer",
            "test": "gstreamer_encodingprofiles"
        },
        "gpu_vivante": {
            "label": "Vivante GPU",
            "type": "compile",
            "test": "gpu_vivante"
        },
        "linux_v4l": {
            "label": "Video for Linux",
            "type": "compile",
            "test": "linux_v4l"
        },
        "wasapi": {
            "label": "Windows Audio Services",
            "type": "compile",
            "test": "wasapi"
        },
        "wmsdk": {
            "label": "wmsdk.h",
            "type": "compile",
            "test": "wmsdk"
        },
        "wshellitem": {
            "label": "WShellItem",
            "type": "compile",
            "test": "wshellitem"
        }
    },

    "features": {
        "alsa": {
            "label": "ALSA",
            "condition": "config.unix && !config.qnx && libs.alsa",
            "output": [ "feature", "privateFeature" ]
        },
        "avfoundation": {
            "label": "AVFoundation",
            "emitIf": "config.darwin",
            "condition": "libs.avfoundation",
            "output": [ "feature", "privateFeature" ]
        },
        "directshow": {
            "label": "DirectShow",
            "condition": "config.win32 && libs.directshow",
            "output": [ "feature", "privateFeature" ]
        },
        "evr": {
            "label": "evr.h",
            "condition": "config.win32 && tests.evr",
            "output": [ "feature", "privateFeature" ]
        },
        "gstreamer_0_10": {
            "label": "GStreamer 0.10",
            "disable": "input.gstreamer == '1.0' || input.gstreamer == 'no'",
            "enable": "input.gstreamer == '0.10'",
            "condition": "!features.gstreamer_1_0 && libs.gstreamer_0_10",
            "output": [ "privateFeature" ]
        },
        "gstreamer_1_0": {
            "label": "GStreamer 1.0",
            "disable": "input.gstreamer == '0.10' || input.gstreamer == 'no'",
            "enable": "input.gstreamer == '1.0'",
            "condition": "libs.gstreamer_1_0",
            "output": [ "privateFeature" ]
        },
        "gstreamer": {
            "condition": "features.gstreamer_1_0 || features.gstreamer_0_10",
            "output": [ "privateFeature" ]
        },
        "gstreamer_app": {
            "label": "GStreamer App",
            "condition": "(features.gstreamer_1_0 && libs.gstreamer_app_1_0) || (features.gstreamer_0_10 && libs.gstreamer_app_0_10)",
            "output": [ "privateFeature" ]
        },
        "gstreamer_encodingprofiles": {
            "label": "GStreamer encoding-profile.h",
            "condition": "features.gstreamer && tests.gstreamer_encodingprofiles",
            "output": [ "privateFeature" ]
        },
        "gstreamer_photography": {
            "label": "GStreamer Photography",
            "condition": "(features.gstreamer_1_0 && libs.gstreamer_photography_1_0) || (features.gstreamer_0_10 && libs.gstreamer_photography_0_10)",
            "output": [ "privateFeature" ]
        },
        "gstreamer_gl": {
            "label": "GStreamer OpenGL",
            "condition": "features.opengl && features.gstreamer_1_0 && libs.gstreamer_gl_1_0",
            "output": [ "privateFeature" ]
        },
        "gpu_vivante": {
            "label": "Vivante GPU",
            "condition": "features.gui && features.opengles2 && tests.gpu_vivante",
            "output": [ "privateFeature" ]
        },
        "resourcepolicy": {
            "label": "Resource Policy (libresourceqt5)",
            "condition": "libs.libresourceqt5",
            "output": [ "privateFeature" ]
        },
        "linux_v4l": {
            "label": "Video for Linux",
            "condition": "config.unix && tests.linux_v4l",
            "output": [ "privateFeature" ]
        },
        "mmrenderer": {
            "label": "MMRenderer",
            "emitIf": "config.qnx",
            "condition": "libs.mmrenderer",
            "output": [ "feature", "privateFeature" ]
        },
        "openal": {
            "label": "OpenAL",
            "condition": "libs.openal",
            "output": [ "feature", "privateFeature" ]
        },
        "pulseaudio": {
            "label": "PulseAudio",
            "autoDetect": "config.unix",
            "condition": "libs.pulseaudio",
            "output": [ "feature", "privateFeature" ]
        },
        "wasapi": {
            "label": "Windows Audio Services",
            "condition": "config.win32 && tests.wasapi",
            "output": [ "privateFeature" ]
        },
        "wmsdk": {
            "label": "wmsdk.h",
            "condition": "config.win32 && tests.wmsdk",
            "output": [ "privateFeature" ]
        },
        "wshellitem": {
            "label": "WShellItem",
            "condition": "config.win32 && features.directshow && tests.wshellitem",
            "output": [ "feature", "privateFeature" ]
        },
        "wmf": {
            "label": "Windows Media Foundation",
            "condition": "config.win32 && libs.wmf",
            "output": [ "privateFeature" ]
        }
    },

    "report": [
    ],

    "summary": [
        {
            "section": "Qt Multimedia",
            "entries": [
                "alsa",
                "gstreamer_1_0",
                "gstreamer_0_10",
                "linux_v4l",
                "openal",
                "pulseaudio",
                "resourcepolicy",
                "mmrenderer",
                "avfoundation",
                "wasapi",
                "directshow",
                "wmf"
            ]
        }
    ]
}
