Skip to content
Snippets Groups Projects
Select Git revision
  • 2a6761236f06d8aa6f853e96538c70bb92ccacf0
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/201911
  • release/releaseWindowsTestOne
  • release/windowsReleaseTest
  • release/releaseTest
  • release/releaseWindowsTest
  • release/201910
  • release/qt/201910
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • 4.0.0
  • 2.2.0
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.0
  • 1.1.0
31 results

sipaccount.cpp

Blame
    • Mohamed Chibani's avatar
      2a676123
      ice: decouple instantiation and initialization of ICE transport · 2a676123
      Mohamed Chibani authored and Sébastien Blin's avatar Sébastien Blin committed
      Instantiation and initialization of ICE are done in a single
      stage (in the class constructor).
      To initialize the ICE instance, connection information must
      first be gathered asynchronously.
      However, when sharing ICE media instance between subcalls,
      it's better to have a valid ICE instance as soon as possible
      (even if not fully initialized) to proceed with the call
      initialization process, then wait for ICE initialization to start
      the call.
      Thus, the ICE instantiation will be performed synchronously as
      soon as the parent (main) call is created, then it will be
      initialized asynchronously when the connection info are ready.
      
      Gitlab: #619
      
      Change-Id: I9c97516238f1a690603975ec968c8c6733155d4a
      2a676123
      History
      ice: decouple instantiation and initialization of ICE transport
      Mohamed Chibani authored and Sébastien Blin's avatar Sébastien Blin committed
      Instantiation and initialization of ICE are done in a single
      stage (in the class constructor).
      To initialize the ICE instance, connection information must
      first be gathered asynchronously.
      However, when sharing ICE media instance between subcalls,
      it's better to have a valid ICE instance as soon as possible
      (even if not fully initialized) to proceed with the call
      initialization process, then wait for ICE initialization to start
      the call.
      Thus, the ICE instantiation will be performed synchronously as
      soon as the parent (main) call is created, then it will be
      initialized asynchronously when the connection info are ready.
      
      Gitlab: #619
      
      Change-Id: I9c97516238f1a690603975ec968c8c6733155d4a
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ringbuffer.cpp 4.54 KiB
    /*
     *  Copyright (C) 2004, 2005, 2006 Savoir-Faire Linux inc.
     *  Author: Yan Morin <yan.morin@savoirfairelinux.com>
     *  Author: Laurielle Lea <laurielle.lea@savoirfairelinux.com> 
     *
     *  Portions (c) Dominic Mazzoni (Audacity)
     *                                                                              
     *  This program is free software; you can redistribute it and/or modify
     *  it under the terms of the GNU General Public License as published by
     *  the Free Software Foundation; either version 2 of the License, or
     *  (at your option) any later version.
     *                                                                              
     *  This program is distributed in the hope that it will be useful,
     *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *  GNU General Public License for more details.
     *                                                                              
     *  You should have received a copy of the GNU General Public License
     *  along with this program; if not, write to the Free Software
     *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     */
    
    #include <assert.h>
    #include <stdlib.h> 
    #include <string.h>  
    
    #include "ringbuffer.h"
    #include "../global.h"
     
    #define MIN_BUFFER_SIZE	1280
    
    // Create  a ring buffer with 'size' bytes
    RingBuffer::RingBuffer(int size) {
       mBufferSize = (size > MIN_BUFFER_SIZE ? size : MIN_BUFFER_SIZE);
       mStart = 0;
       mEnd = 0;
       mBuffer = new unsigned char[mBufferSize];
       assert (mBuffer != NULL);
    }
    
    // Free memory on object deletion
    RingBuffer::~RingBuffer() {
       delete[] mBuffer;  mBuffer = NULL;
    }
     
    void
    RingBuffer::flush (void) {
    	mStart = 0; 
    	mEnd = 0;
    } 
    
    int 
    RingBuffer::Len() const { 
       return (mEnd + mBufferSize - mStart) % mBufferSize;
    }
    
    void 
    RingBuffer::debug() {
       _debug("Start=%d; End=%d; BufferSize=%d\n", mStart, mEnd, mBufferSize);
    }
     
    //
    // For the writer only:
    //
    int 
    RingBuffer::AvailForPut() const {
       // Always keep 4 bytes safe (?)
       return (mBufferSize-4) - Len();
    }