1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """ Copyright (C) 2005-2008 Collabora Limited
4 Copyright (C) 2005-2008 Nokia Corporation
5 Copyright (C) 2006 INdT
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 class MediaStreamHandler(dbus.service.Object):
28 Handles signalling the information pertaining to a specific media stream.
29 A client should provide information to this handler as and when it is
33 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='u', out_signature='')
34 def CodecChoice(self, Codec_ID):
36 Inform the connection manager of codec used to receive data.
39 raise NotImplementedError
41 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='us', out_signature='')
42 def Error(self, Error_Code, Message):
44 Inform the connection manager that an error occured in this stream. The
45 connection manager should emit the StreamError signal for the stream on
46 the relevant channel, and remove the stream from the session.
49 raise NotImplementedError
51 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='', out_signature='')
52 def NativeCandidatesPrepared(self):
54 Informs the connection manager that all possible native candisates
55 have been discovered for the moment.
58 raise NotImplementedError
60 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='ss', out_signature='')
61 def NewActiveCandidatePair(self, Native_Candidate_ID, Remote_Candidate_ID):
63 Informs the connection manager that a valid candidate pair
64 has been discovered and streaming is in progress.
67 raise NotImplementedError
69 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='sa(usuussduss)', out_signature='')
70 def NewNativeCandidate(self, Candidate_ID, Transports):
72 Inform this MediaStreamHandler that a new native transport candidate
76 raise NotImplementedError
78 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='a(usuuua{ss})', out_signature='')
79 def Ready(self, Codecs):
81 Inform the connection manager that a client is ready to handle
82 this StreamHandler. Also provide it with info about all supported
86 raise NotImplementedError
88 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='a(usuuua{ss})', out_signature='')
89 def SetLocalCodecs(self, Codecs):
91 Used to provide codecs after Ready(), so the media client can go
92 ready for an incoming call and exchange candidates/codecs before
93 knowing what local codecs are available.
95 This is useful for gatewaying calls between two connection managers.
96 Given an incoming call, you need to call
97 Ready to get the remote codecs before
98 you can use them as the "local" codecs to place the outgoing call,
99 and hence receive the outgoing call's remote codecs to use as the
100 incoming call's "local" codecs.
102 In this situation, you would pass an empty list of codecs to the
103 incoming call's Ready method, then later call SetLocalCodecs on the
104 incoming call in order to respond to the offer.
107 raise NotImplementedError
109 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='u', out_signature='')
110 def StreamState(self, State):
112 Informs the connection manager of the stream's current state, as
113 as specified in Channel.Type.StreamedMedia::ListStreams.
116 raise NotImplementedError
118 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='a(usuuua{ss})', out_signature='')
119 def SupportedCodecs(self, Codecs):
121 Inform the connection manager of the supported codecs for this session.
122 This is called after the connection manager has emitted SetRemoteCodecs
123 to notify what codecs are supported by the peer, and will thus be an
124 intersection of all locally supported codecs (passed to Ready)
125 and those supported by the peer.
128 raise NotImplementedError
130 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='a(usuuua{ss})', out_signature='')
131 def CodecsUpdated(self, Codecs):
133 Inform the connection manager that the parameters of the supported
134 codecs for this session have changed. The connection manager should
135 send the new parameters to the remote contact.
138 This is required for H.264 and Theora, for example.
142 raise NotImplementedError
144 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='b', out_signature='')
145 def HoldState(self, Held):
147 Notify the connection manager that the stream's hold state has
148 been changed successfully in response to SetStreamHeld.
151 raise NotImplementedError
153 @dbus.service.method('org.freedesktop.Telepathy.Media.StreamHandler', in_signature='', out_signature='')
154 def UnholdFailure(self):
156 Notify the connection manager that an attempt to reacquire the
157 necessary hardware or software resources to unhold the stream,
158 in response to SetStreamHeld, has failed.
161 raise NotImplementedError
163 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='sa(usuussduss)')
164 def AddRemoteCandidate(self, Candidate_ID, Transports):
166 Signal emitted when the connection manager wishes to inform the
167 client of a new remote candidate.
172 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='')
175 Signal emitted when the connection manager wishes the stream to be
181 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='s')
182 def RemoveRemoteCandidate(self, Candidate_ID):
184 Signal emitted when the connection manager wishes to inform the
185 client that the remote end has removed a previously usable
189 It seemed like a good idea at the time, but wasn't.
195 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='ss')
196 def SetActiveCandidatePair(self, Native_Candidate_ID, Remote_Candidate_ID):
198 Emitted by the connection manager to inform the client that a
199 valid candidate pair has been discovered by the remote end
200 and streaming is in progress.
205 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='a(sa(usuussduss))')
206 def SetRemoteCandidateList(self, Remote_Candidates):
208 Signal emitted when the connection manager wishes to inform the
209 client of all the available remote candidates at once.
214 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='a(usuuua{ss})')
215 def SetRemoteCodecs(self, Codecs):
217 Signal emitted when the connection manager wishes to inform the
218 client of the codecs supported by the remote end.
219 If these codecs are compatible with the remote codecs, then the client
220 must call SupportedCodecs,
221 otherwise call Error.
226 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='b')
227 def SetStreamPlaying(self, Playing):
229 If emitted with argument TRUE, this means that the connection manager
230 wishes to set the stream playing; this means that the streaming
231 implementation should expect to receive data. If emitted with argument
232 FALSE this signal is basically meaningless and should be ignored.
241 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='b')
242 def SetStreamSending(self, Sending):
244 Signal emitted when the connection manager wishes to set whether or not
245 the stream sends to the remote end.
250 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='y')
251 def StartTelephonyEvent(self, Event):
253 Request that a telephony event (as defined by RFC 4733) is transmitted
254 over this stream until StopTelephonyEvent is called.
259 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='')
260 def StopTelephonyEvent(self):
262 Request that any ongoing telephony events (as defined by RFC 4733)
263 being transmitted over this stream are stopped.
268 @dbus.service.signal('org.freedesktop.Telepathy.Media.StreamHandler', signature='b')
269 def SetStreamHeld(self, Held):
271 Emitted when the connection manager wishes to place the stream on
272 hold (so the streaming client should free hardware or software
273 resources) or take the stream off hold (so the streaming client
274 should reacquire the necessary resources).
276 When placing a channel's streams on hold, the connection manager
277 SHOULD notify the remote contact that this will be done (if
278 appropriate in the protocol) before it emits this signal.
281 It is assumed that relinquishing a resource will not fail.
282 If it does, the call is probably doomed anyway.
285 When unholding a channel's streams, the connection manager
286 SHOULD emit this signal and wait for success to be indicated
287 via HoldState before it notifies the remote contact that the
288 channel has been taken off hold.
291 This means that if a resource is unavailable, the remote
292 contact will never even be told that we tried to acquire it.