<?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="startLocalMediaRecorder" tp:name-for-bindings="startLocalMediaRecorder">
            <tp:docstring> Starts a local recorder. Video and/or audio.</tp:docstring>
            <arg type="s" name="videoInputId" 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 startLocalMediaRecorder).</tp:docstring>
            </arg>
        </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="openVideoInput" tp:name-for-bindings="openVideoInput">
            <tp:docstring>Open a video input by URI. A Sink is made available.</tp:docstring>
            <arg type="s" name="inputUri" 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="s" name="inputId" direction="out">
            <tp:docstring>The ID of the input. A sink with this ID is also made available.</tp:docstring>
            </arg>
        </method>

        <method name="closeVideoInput" tp:name-for-bindings="closeVideoInput">
            <tp:docstring>Closes a video input by ID</tp:docstring>
            <arg type="s" name="inputId" direction="in">
            <tp:docstring>The ID of the input to close, as returned by openVideoInput.</tp:docstring>
            </arg>
            <arg type="b" name="closed" direction="out">
            <tp:docstring>Returns true if the input was closed</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>
