<?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>

        <method name="startShmSink" tp:name-for-bindings="startShmSink">
            <tp:docstring>Ask the sink client to do the transfer for a renderer</tp:docstring>
            <arg type="s" name="sinkId" direction="in">
                <tp:docstring>Sink id</tp:docstring>
            </arg>
            <arg type="b" name="value" direction="in">
                <tp:docstring>true to start transfer ; false to stop</tp:docstring>
            </arg>
        </method>

        <method name="createMediaPlayer" tp:name-for-bindings="createMediaPlayer">
            <tp:added version="13.10.0"/>
            <tp:docstring>Create a media player</tp:docstring>
            <arg type="s" name="path" direction="in">
                <tp:docstring>File path</tp:docstring>
            </arg>
            <arg type="s" name="id" direction="out">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
        </method>

        <method name="closeMediaPlayer" tp:name-for-bindings="closeMediaPlayer">
            <tp:added version="13.10.0"/>
            <tp:docstring>Close media player</tp:docstring>
            <arg type="s" name="id" direction="in">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <arg type="b" name="state" direction="out">
                <tp:docstring>true if successfully closed</tp:docstring>
            </arg>
        </method>

        <method name="pausePlayer" tp:name-for-bindings="pausePlayer">
            <tp:added version="13.10.0"/>
            <tp:docstring>Pause media player</tp:docstring>
            <arg type="s" name="id" direction="in">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <arg type="b" name="pause" direction="in">
                <tp:docstring>true if wishes to pause player</tp:docstring>
            </arg>
            <arg type="b" name="state" direction="out">
                <tp:docstring>true if successfully paused</tp:docstring>
            </arg>
        </method>

        <method name="mutePlayerAudio" tp:name-for-bindings="mutePlayerAudio">
            <tp:added version="13.10.0"/>
            <tp:docstring>Mute  media player audio</tp:docstring>
            <arg type="s" name="id" direction="in">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <arg type="b" name="mute" direction="in">
                <tp:docstring>true if wishes to pause player</tp:docstring>
            </arg>
            <arg type="b" name="state" direction="out">
                <tp:docstring>true if successfully muted</tp:docstring>
            </arg>
        </method>

        <method name="playerSeekToTime" tp:name-for-bindings="playerSeekToTime">
            <tp:added version="13.10.0"/>
            <tp:docstring>Seek media player position</tp:docstring>
            <arg type="s" name="id" direction="in">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <arg type="i" name="time" direction="in">
                <tp:docstring>timestamp</tp:docstring>
            </arg>
            <arg type="b" name="state" direction="out">
                <tp:docstring>true if successfully seeked</tp:docstring>
            </arg>
        </method>

        <method name="getPlayerPosition" tp:name-for-bindings="getPlayerPosition">
            <tp:added version="13.10.0"/>
            <tp:docstring>Get media player position</tp:docstring>
            <arg type="s" name="id" direction="in">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <arg type="x" name="position" direction="out">
                <tp:docstring>position in timestamp</tp:docstring>
            </arg>
        </method>

        <method name="getPlayerDuration" tp:name-for-bindings="getPlayerDuration">
            <tp:added version="13.10.0"/>
            <tp:docstring>Get media player position</tp:docstring>
            <arg type="s" name="id" direction="in">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <arg type="x" name="duration" direction="out">
                <tp:docstring>duration in timestamp</tp:docstring>
            </arg>
        </method>

        <method name="setAutoRestart" tp:name-for-bindings="setAutoRestart">
            <tp:added version="13.10.0"/>
            <tp:docstring>Restar media player after it reaches the end</tp:docstring>
            <arg type="s" name="id" direction="in">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <arg type="b" name="restart" direction="in">
                <tp:docstring>true if media player is to restart automaticaly</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="decodingStarted" tp:name-for-bindings="decodingStarted">
            <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="decodingStopped" tp:name-for-bindings="decodingStopped">
            <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>

        <signal name="fileOpened" tp:name-for-bindings="fileOpened">
            <tp:added version="13.10.0"/>
            <tp:docstring>Notify clients of a new media player infos</tp:docstring>
            <arg type="s" name="playerId">
                <tp:docstring>Media player id</tp:docstring>
            </arg>
            <annotation name="org.qtproject.QtDBus.QtTypeName.Out1" value="MapStringString"/>
            <arg type="a{ss}" name="info">
                <tp:docstring>Info from the media player</tp:docstring>
            </arg>
        </signal>
    </interface>
</node>
