media/webrtc/signaling/include/CC_Call.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #pragma once
     7 #include "CC_Common.h"
     8 #include "ECC_Types.h"
     9 #include "mozilla/RefPtr.h"
    11 extern "C"
    12 {
    13 #include "ccapi_types.h"
    14 }
    16 #if defined(__cplusplus) && __cplusplus >= 201103L
    17 typedef struct Timecard Timecard;
    18 #else
    19 #include "timecard.h"
    20 #endif
    22 namespace CSF
    23 {
    24     class ECC_API CC_Call
    25     {
    26     public:
    27         NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CC_Call)
    29     protected:
    30         CC_Call () { }
    32     public:
    33         virtual ~CC_Call () {}
    35 		virtual void setRemoteWindow (VideoWindowHandle window) = 0;
    37 		virtual int setExternalRenderer(VideoFormat videoFormat, ExternalRendererHandle renderer) = 0;
    39 		virtual void sendIFrame	() = 0;
    41         virtual CC_CallInfoPtr getCallInfo () = 0;
    43         virtual std::string toString() = 0;
    45         /**
    46            Originate call - API to go offhook and dial specified digits on a given call
    48            @param [in] video_pref - video direction desired on call
    49            @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook
    51            @return true or false.
    52          */
    53         virtual bool originateCall (cc_sdp_direction_t video_pref, const std::string & digits) = 0;
    55         /**
    56            Use this function to answer an incoming call.
    58            @param[in] video_pref - video direction desired on call
    60            @return true or false.
    61          */
    62         virtual bool answerCall (cc_sdp_direction_t video_pref) = 0;
    64         /**
    65            Use this function to put an active call on hold.
    67            @param[in] reason - If the user chooses to put the call on hold then
    68                                CC_HOLD_REASON_NONE should be the value passed in here.
    70            @return true or false. If it's not appropriate to put this call on
    71                    hold at the moment then this function will return false.
    72          */
    73         virtual bool hold (cc_hold_reason_t reason) = 0;
    75         /**
    76            Use this function to resume a call that is currently on hold.
    78            @param [in] video_pref - video direction desired on call
    80            @return true or false
    81          */
    82         virtual bool resume (cc_sdp_direction_t video_pref) = 0;
    84         /**
    85            Use this function to end an active call.
    87            @return true or false
    88          */
    89         virtual bool endCall() = 0;
    91         /**
    92            Send digits on the call - can be invoked either to dial additional digits or send DTMF
    94            @param [in] digit - digit to be dialed
    96            @return true or false
    97          */
    98         virtual bool sendDigit (cc_digit_t digit) = 0;
   100         /**
   101            Send Backspace - Delete last digit dialed.
   103            @return true or false
   104          */
   105         virtual bool backspace() = 0;
   107         /**
   108            Redial
   110            @param [in] video_pref - video direction desired on call
   111            @return true or false
   112          */
   113         virtual bool redial (cc_sdp_direction_t video_pref) = 0;
   115         /**
   116            Initiate Call Forward All
   118            @return true or false
   119          */
   120         virtual bool initiateCallForwardAll() = 0;
   122         /**
   123            end Consult leg - used to end consult leg when the user picks active calls list for xfer/conf
   125            @return true or false
   126          */
   127         virtual bool endConsultativeCall() = 0;
   129         /**
   130            Initiate a conference
   132            @param [in] video_pref - video direction desired on consult call
   134            @return true or false
   135          */
   136         virtual bool conferenceStart (cc_sdp_direction_t video_pref) = 0;
   138         /**
   139            complete conference
   141            @param [in] otherCall - CC_CallPtr of the other leg
   142            @param [in] video_pref - video direction desired on consult call
   144            @return true or false
   145          */
   146         virtual bool conferenceComplete (CC_CallPtr otherLog, cc_sdp_direction_t video_pref) = 0;
   148         /**
   149            start transfer
   151            @param [in] video_pref - video direction desired on consult call
   153            @return true or false
   154          */
   155         virtual bool transferStart (cc_sdp_direction_t video_pref) = 0;
   157         /**
   158            complete transfer
   160            @param [in] otherLeg - CC_CallPtr of the other leg
   161            @param [in] video_pref - video direction desired on consult call
   163            @return true or false
   164          */
   165         virtual bool transferComplete (CC_CallPtr otherLeg,
   166                                        cc_sdp_direction_t video_pref) = 0;
   168         /**
   169            cancel conference or transfer
   171            @return true or false
   172          */
   173         virtual bool cancelTransferOrConferenceFeature() = 0;
   175         /**
   176            direct Transfer
   178            @param [in] target - call handle for transfer target call
   179            @return true or false
   180          */
   181         virtual bool directTransfer (CC_CallPtr target) = 0;
   183         /**
   184            Join Across line
   186            @param [in] target - join target
   187            @return true or false
   188          */
   189         virtual bool joinAcrossLine (CC_CallPtr target) = 0;
   191         /**
   192            BLF Call Pickup
   194            @param [in] video_pref - video direction preference
   195            @param [in] speed - speedDial Number
   196            @return true or false
   197          */
   198         virtual bool blfCallPickup (cc_sdp_direction_t video_pref, const std::string & speed) = 0;
   200         /**
   201            Select a call
   203            @return true or false
   204          */
   205         virtual bool select() = 0;
   207         /**
   208            Update Video Media Cap for the call
   210            @param [in] video_pref - video direction desired on call
   211            @return true or false
   212          */
   213         virtual bool updateVideoMediaCap (cc_sdp_direction_t video_pref) = 0;
   215         /**
   216            send INFO method for the call
   217            @param [in] handle - call handle
   218            @param [in] infopackage - Info-Package header value
   219            @param [in] infotype - Content-Type header val
   220            @param [in] infobody - Body of the INFO message
   221            @return true or false
   222          */
   223         virtual bool sendInfo (const std::string & infopackage, const std::string & infotype, const std::string & infobody) = 0;
   225         /**
   226            API to mute audio
   228            @return true if the operation succeeded
   230            NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   231          */
   232         virtual bool muteAudio(void) = 0;
   235         /**
   236            API to unmute audio
   238            @return true if the operation succeeded
   240            NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   241          */
   242         virtual bool unmuteAudio(void) = 0;
   243         /**
   244            API to mute video
   246            @return true if the operation succeeded
   248            NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   249          */
   250         virtual bool muteVideo(void) = 0;
   253         /**
   254            API to unmute video
   256            @return true if the operation succeeded
   258            NOTE: The mute state is persisted within the stack and shall be remembered across hold/resume.
   259          */
   260         virtual bool unmuteVideo(void) = 0;
   263         /**
   264         API to set the call volume, acceptable values are 0 - 100
   265         @return true if volume set successfully, false if value out of range or change failed
   266         */
   267         virtual bool setVolume(int volume) = 0;
   270         /**
   271            Originate P2P call - API to go offhook and dial specified digits\user on a given call
   273            @param [in] video_pref - video direction desired on call
   274            @param [in] digits - digits to be dialed. can be empty then this API simply goes offhook
   275            @param [in] ip address - the ip address of the peer to call
   277            @return void
   278           */
   279         virtual void originateP2PCall (cc_sdp_direction_t video_pref, const std::string & digits, const std::string & ip) = 0;
   281         virtual void createOffer (cc_media_constraints_t* constraints, Timecard *) = 0;
   283         virtual void createAnswer(cc_media_constraints_t* constraints, Timecard *) = 0;
   285         virtual void setLocalDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *) = 0;
   287         virtual void setRemoteDescription(cc_jsep_action_t action, const std::string & sdp, Timecard *) = 0;
   289         virtual void setPeerConnection(const std::string& handle) = 0;
   291         virtual void addStream(cc_media_stream_id_t stream_id,
   292                                cc_media_track_id_t track_id,
   293                                cc_media_type_t media_type,
   294                                cc_media_constraints_t *constraints) = 0;
   296         virtual void removeStream(cc_media_stream_id_t stream_id, cc_media_track_id_t track_id, cc_media_type_t media_type) = 0;
   298         virtual const std::string& getPeerConnection() const = 0;
   300         virtual void addICECandidate(const std::string & candidate, const std::string & mid, unsigned short level, Timecard *) = 0;
   302     };
   303 }

mercurial