<?xml version="1.0" ?>
<node name="/cx.ring.Ring.VideoManager" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
    <interface name="cx.ring.Ring.VideoManager">
        <!-- Video device methods -->

        <method name="getDeviceList" tp:name-for-bindings="getDeviceList">
            <tp:docstring>Returns a list of ids for detected devices</tp:docstring>
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="VectorString"/>
            <arg type="as" name="list" direction="out">
            </arg>
        </method>

        <method name="getCapabilities" tp:name-for-bindings="getCapabilities">
            <tp:docstring>Returns a map of map of array of strings, containing the capabilities (channel, size, rate) for a given device id</tp:docstring>
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringMapStringVectorString"/>
            <arg type="s" name="deviceId" direction="in">
            </arg>
            <arg type="a{sa{sas}}" name="cap" direction="out">
            </arg>
        </method>

        <method name="getSettings" tp:name-for-bindings="getSettings">
            <tp:docstring>Returns a map of settings for the given device id</tp:docstring>
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/>
            <arg type="s" name="deviceId" direction="in">
            </arg>
            <arg type="a{ss}" name="map" direction="out">
            </arg>
        </method>

        <method name="applySettings" tp:name-for-bindings="applySettings">
            <tp:docstring>Set the preferred settings for a given device id</tp:docstring>
            <arg type="s" name="deviceId" direction="in">
            </arg>
            <annotation name="org.qtproject.QtDBus.QtTypeName.In1" value="MapStringString"/>
            <arg type="a{ss}" name="settings" direction="in">
            </arg>
        </method>

        <method name="getDefaultDevice" tp:name-for-bindings="getDefaultDevice">
            <tp:docstring>Returns the default device id</tp:docstring>
            <arg type="s" name="deviceId" direction="out">
            </arg>
        </method>

        <method name="setDefaultDevice" tp:name-for-bindings="setDefaultDevice">
            <tp:docstring>Sets the default device id</tp:docstring>
            <arg type="s" name="deviceId" direction="in">
            </arg>
        </method>

        <method name="startLocalRecorder" tp:name-for-bindings="startLocalRecorder">
            <tp:docstring> Starts a local recorder. Video and/or audio are recorded from preferred devices.</tp:docstring>
            <arg type="b" name="audioOnly" direction="in">
            </arg>
            <arg type="s" name="filepath" direction="in">
            <tp:docstring> Base file path for local recording. This is not the final path as the file extension will be added (final path can be obtained as return value of this method).</tp:docstring>
            </arg>
            <arg type="s" name="finalPath" direction="out">
            <tp:docstring> Output path of newly started local recording. This file path also serves as recording identifier for stopLocalRecorder.</tp:docstring>
            </arg>
        </method>

        <method name="stopLocalRecorder" tp:name-for-bindings="stopLocalRecorder">
            <arg type="s" name="filepath" direction="in">
            <tp:docstring> Identifier for local recorder to be stopped (obtained as return value of startLocalRecorder).</tp:docstring>
            </arg>
        </method>

        <method name="startCamera" tp:name-for-bindings="startCamera">
            <tp:docstring> Starts the video camera, which renders the active v4l2 device's video to shared memory. Useful for testing/debugging camera settings</tp:docstring>
        </method>

        <method name="stopCamera" tp:name-for-bindings="stopCamera">
        </method>

        <method name="startAudioDevice" tp:name-for-bindings="startAudioDevice">
            <tp:docstring> Starts the audio layer stream, so the audio device can be read.</tp:docstring>
        </method>

        <method name="stopAudioDevice" tp:name-for-bindings="stopAudioDevice">
        </method>

        <method name="switchInput" tp:name-for-bindings="switchInput">
            <arg type="s" name="resource" direction="in">
                <tp:docstring>
                    A media resource locator (MRL).
                    Currently, the following are supported:
                    <ul>
                        <li>camera://DEVICE</li>
                        <li>display://DISPLAY_NAME[ WIDTHxHEIGHT]</li>
                        <li>file://IMAGE_PATH</li>
                    </ul>
                </tp:docstring>
            </arg>
            <arg type="b" name="switched" direction="out">
                <tp:docstring>Returns true if the input stream was successfully changed, false otherwise</tp:docstring>
            </arg>
        </method>

        <method name="hasCameraStarted" tp:name-for-bindings="hasCameraStarted">
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="Bool"/>
            <arg type="b" name="started" direction="out">
            <tp:docstring>Returns true if the camera has already started, false otherwise</tp:docstring>
            </arg>
        </method>

        <method name="getDecodingAccelerated" tp:name-for-bindings="getDecodingAccelerated">
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="Bool"/>
            <arg type="b" name="state" direction="out">
            <tp:docstring>Returns true if hardware decoding is enabled, false otherwise</tp:docstring>
            </arg>
        </method>

        <method name="setDecodingAccelerated" tp:name-for-bindings="setDecodingAccelerated">
            <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="Bool"/>
            <arg type="b" name="state" direction="in">
            <tp:docstring>Toggle hardware decoding</tp:docstring>
            </arg>
        </method>

        <method name="getEncodingAccelerated" tp:name-for-bindings="getEncodingAccelerated">
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="Bool"/>
            <arg type="b" name="state" direction="out">
            <tp:docstring>Returns true if hardware encoding is enabled, false otherwise</tp:docstring>
            </arg>
        </method>

        <method name="setEncodingAccelerated" tp:name-for-bindings="setEncodingAccelerated">
            <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="Bool"/>
            <arg type="b" name="state" direction="in">
            <tp:docstring>Toggle hardware encoding</tp:docstring>
            </arg>
        </method>

        <method name="setDeviceOrientation" tp:name-for-bindings="setDeviceOrientation">
            <arg type="s" name="deviceId" direction="in">
                <tp:docstring>Device id</tp:docstring>
            </arg>
            <arg type="i" name="angle" direction="in">
                <tp:docstring>Angle of device in degrees (counterclockwise)</tp:docstring>
            </arg>
        </method>

        <method name="getRenderer" tp:name-for-bindings="getRenderer">
            <tp:docstring>Returns a map of information about a call's renderer.</tp:docstring>
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="MapStringString"/>
            <arg type="s" name="callId" direction="in">
                <tp:docstring>Call ID to get info about.</tp:docstring>
            </arg>
            <arg type="a{ss}" name="map" direction="out">
                <tp:docstring>Map containing renderer info, with empty strings and "0" if not found.</tp:docstring>
            </arg>
        </method>

        <signal name="deviceEvent" tp:name-for-bindings="deviceEvent">
           <tp:docstring>Signal triggered by changes in the detected v4l2 devices, e.g. a camera being unplugged.</tp:docstring>
        </signal>

        <signal name="startedDecoding" tp:name-for-bindings="startedDecoding">
            <tp:docstring>Signal triggered when video is available in a shared memory buffer.</tp:docstring>
            <arg type="s" name="id">
              <tp:docstring>The ID of the call associated with the video, or "local" in the case of local video</tp:docstring>
            </arg>
            <arg type="s" name="shmPath">
              <tp:docstring>The path of the newly created shared memory</tp:docstring>
            </arg>
            <arg type="i" name="width">
              <tp:docstring>The width of the video in the shared memory</tp:docstring>
            </arg>
            <arg type="i" name="height">
              <tp:docstring>The height of the video in the shared memory</tp:docstring>
            </arg>
            <arg type="b" name="isMixer">
              <tp:docstring>Whether or not this texture belongs to a video mixer or is a single texture</tp:docstring>
            </arg>
        </signal>

        <signal name="stoppedDecoding" tp:name-for-bindings="stoppedDecoding">
            <tp:docstring>Signal triggered when video is no longer available in a shared memory buffer.</tp:docstring>
            <arg type="s" name="id">
              <tp:docstring>The ID of the call associated with the video, or "local" in the case of local video</tp:docstring>
            </arg>
            <arg type="s" name="shmPath">
              <tp:docstring>The path of the newly created shared memory</tp:docstring>
            </arg>
            <arg type="b" name="isMixer">
              <tp:docstring>Whether or not this texture belongs to a video mixer or is a single texture</tp:docstring>
            </arg>
        </signal>
    </interface>
</node>
