idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
37,300
public void bind ( boolean isLocal , boolean rtcpMux ) throws IOException , IllegalStateException { this . rtpChannel . bind ( isLocal , rtcpMux ) ; if ( ! rtcpMux ) { this . rtcpChannel . bind ( isLocal , this . rtpChannel . getLocalPort ( ) + 1 ) ; } this . rtcpMux = rtcpMux ; if ( logger . isDebugEnabled ( ) ) { log...
Binds the RTP and RTCP components to a suitable address and port .
37,301
public void connectRtp ( SocketAddress address ) { this . rtpChannel . setRemotePeer ( address ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( this . mediaType + " RTP channel " + this . ssrc + " connected to remote peer " + address . toString ( ) ) ; } }
Connected the RTP component to the remote peer .
37,302
public void bindRtcp ( boolean isLocal , int port ) throws IOException , IllegalStateException { if ( this . ice ) { throw new IllegalStateException ( "Cannot bind when ICE is enabled" ) ; } this . rtcpChannel . bind ( isLocal , port ) ; this . rtcpMux = ( port == this . rtpChannel . getLocalPort ( ) ) ; }
Binds the RTCP component to a suitable address and port .
37,303
public void connectRtcp ( SocketAddress remoteAddress ) { this . rtcpChannel . setRemotePeer ( remoteAddress ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( this . mediaType + " RTCP channel " + this . ssrc + " has connected to remote peer " + remoteAddress . toString ( ) ) ; } }
Connects the RTCP component to the remote peer .
37,304
protected RTPFormats buildRTPMap ( RTPFormats profile ) { RTPFormats list = new RTPFormats ( ) ; Formats fmts = new Formats ( ) ; if ( this . rtpChannel . getOutputDsp ( ) != null ) { Codec [ ] currCodecs = this . rtpChannel . getOutputDsp ( ) . getCodecs ( ) ; for ( int i = 0 ; i < currCodecs . length ; i ++ ) { if ( ...
Constructs RTP payloads for given channel .
37,305
public void negotiateFormats ( MediaDescriptionField media ) { this . offeredFormats . clean ( ) ; for ( String payloadType : media . getPayloadTypes ( ) ) { RTPFormat format ; try { int payloadTypeInt = Integer . parseInt ( payloadType ) ; if ( payloadTypeInt < AVProfile . DYNAMIC_PT_MIN || payloadTypeInt > AVProfile ...
Negotiates the list of supported codecs with the remote peer over SDP .
37,306
public void enableICE ( String externalAddress , boolean rtcpMux ) { if ( ! this . ice ) { this . ice = true ; this . rtcpMux = rtcpMux ; this . iceAuthenticator . generateIceCredentials ( ) ; this . rtpChannel . enableIce ( this . iceAuthenticator ) ; if ( ! rtcpMux ) { this . rtcpChannel . enableIce ( this . iceAuthe...
Enables ICE on the channel .
37,307
public void disableICE ( ) { if ( this . ice ) { this . ice = false ; this . iceAuthenticator . reset ( ) ; this . rtpChannel . disableIce ( ) ; if ( ! rtcpMux ) { this . rtcpChannel . disableIce ( ) ; } if ( logger . isDebugEnabled ( ) ) { logger . debug ( this . mediaType + " channel " + this . ssrc + " disabled ICE"...
Disables ICE and closes ICE - related resources
37,308
public void disableDTLS ( ) { if ( this . dtls ) { this . rtpChannel . disableSRTP ( ) ; if ( ! this . rtcpMux ) { this . rtcpChannel . disableSRTCP ( ) ; } this . dtls = false ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( this . mediaType + " channel " + this . ssrc + " disabled DTLS" ) ; } } }
Disables DTLS and closes related resources .
37,309
public static long calculateLastSrTimestamp ( long ntp1 , long ntp2 ) { byte [ ] high = uIntLongToByteWord ( ntp1 ) ; byte [ ] low = uIntLongToByteWord ( ntp2 ) ; low [ 3 ] = low [ 1 ] ; low [ 2 ] = low [ 0 ] ; low [ 1 ] = high [ 3 ] ; low [ 0 ] = high [ 2 ] ; return bytesToUIntLong ( low , 0 ) ; }
Calculates the time stamp of the last received SR .
37,310
private static byte [ ] uIntLongToByteWord ( long j ) { int i = ( int ) j ; byte [ ] byteWord = new byte [ 4 ] ; byteWord [ 0 ] = ( byte ) ( ( i >>> 24 ) & 0x000000FF ) ; byteWord [ 1 ] = ( byte ) ( ( i >> 16 ) & 0x000000FF ) ; byteWord [ 2 ] = ( byte ) ( ( i >> 8 ) & 0x000000FF ) ; byteWord [ 3 ] = ( byte ) ( i & 0x00...
Converts an unsigned 32 bit integer stored in a long into an array of bytes .
37,311
public void commit ( ) throws IOException { if ( open . compareAndSet ( true , false ) ) { fout . force ( true ) ; fout . close ( ) ; boolean exists = Files . exists ( target ) ; if ( logger . isInfoEnabled ( ) ) { logger . info ( "Finishing recording ...... append: " + append + " exists: " + exists + " target:" + targ...
Commit this sink . Causes to prevent any further write operations and commits temporary file to target . When this returns Sink is done and cannot be used again .
37,312
protected void release ( ) { stack . getLocalTransactions ( ) . remove ( Integer . valueOf ( localTID ) ) ; stack . getRemoteTxToLocalTxMap ( ) . remove ( Integer . valueOf ( remoteTID ) ) ; cancelTHISTTimerTask ( ) ; cancelLongtranTimer ( ) ; cancelReTransmissionTimer ( ) ; if ( originalPacket != null ) stack . releas...
Release this transaction and frees all allocated resources .
37,313
private void send ( JainMgcpCommandEvent event ) { sent = true ; String host = "" ; int port = 0 ; switch ( event . getObjectIdentifier ( ) ) { case Constants . CMD_NOTIFY : Notify notifyCommand = ( Notify ) event ; NotifiedEntity notifiedEntity = notifyCommand . getNotifiedEntity ( ) ; if ( notifiedEntity == null ) { ...
Sends MGCP command from the application to the endpoint specified in the message .
37,314
private void send ( JainMgcpResponseEvent event ) { cancelLongtranTimer ( ) ; if ( remoteAddress == null ) { throw new IllegalArgumentException ( "Unknown orinator address" ) ; } event . setTransactionHandle ( remoteTID ) ; if ( originalPacket == null ) originalPacket = stack . allocatePacket ( ) ; originalPacket . set...
Sends MGCP response message from the application to the host from wich origination command was received .
37,315
public void receiveResponse ( byte [ ] data , SplitDetails [ ] msg , Integer txID , ReturnCode returnCode ) { cancelReTransmissionTimer ( ) ; cancelLongtranTimer ( ) ; JainMgcpResponseEvent event = null ; try { event = decodeResponse ( data , msg , txID , returnCode ) ; } catch ( Exception e ) { logger . error ( "Could...
Used by stack for relaying received MGCP response messages to the application .
37,316
private void fireEvent ( RecorderEventImpl event ) { eventSender . event = event ; scheduler . submit ( eventSender , PriorityQueueScheduler . INPUT_QUEUE ) ; }
Fires specified event
37,317
public void accept ( Task task ) { if ( ( activeIndex + 1 ) % 2 == 0 ) { if ( ! task . isInQueue0 ( ) ) { taskList [ 0 ] . offer ( task ) ; task . storedInQueue0 ( ) ; } } else { if ( ! task . isInQueue1 ( ) ) { taskList [ 1 ] . offer ( task ) ; task . storedInQueue1 ( ) ; } } }
Queues specified task using tasks dead line time .
37,318
public boolean reverseTransformPacket ( RawPacket pkt ) { boolean decrypt = false ; int tagLength = policy . getAuthTagLength ( ) ; int indexEflag = pkt . getSRTCPIndex ( tagLength ) ; if ( ( indexEflag & 0x80000000 ) == 0x80000000 ) { decrypt = true ; } int index = indexEflag & ~ 0x80000000 ; if ( ! checkReplay ( inde...
Transform a SRTCP packet into a RTCP packet . This method is called when a SRTCP packet was received .
37,319
private void computeIv ( byte label ) { for ( int i = 0 ; i < 14 ; i ++ ) { ivStore [ i ] = masterSalt [ i ] ; } ivStore [ 7 ] ^= label ; ivStore [ 14 ] = ivStore [ 15 ] = 0 ; }
Compute the initialization vector used later by encryption algorithms based on the label .
37,320
public void deriveSrtcpKeys ( ) { byte label = 3 ; computeIv ( label ) ; KeyParameter encryptionKey = new KeyParameter ( masterKey ) ; cipher . init ( true , encryptionKey ) ; Arrays . fill ( masterKey , ( byte ) 0 ) ; cipherCtr . getCipherStream ( cipher , encKey , policy . getEncKeyLength ( ) , ivStore ) ; if ( authK...
Derives the srtcp session keys from the master key .
37,321
public static TransportAddress applyXor ( TransportAddress address , byte [ ] transactionID ) { byte [ ] addressBytes = address . getAddressBytes ( ) ; char port = ( char ) address . getPort ( ) ; char portModifier = ( char ) ( ( transactionID [ 0 ] << 8 & 0x0000FF00 ) | ( transactionID [ 1 ] & 0x000000FF ) ) ; port ^=...
Returns the result of applying XOR on the specified attribute s address . The method may be used for both encoding and decoding XorMappedAddresses .
37,322
public TransportAddress getAddress ( byte [ ] transactionID ) { byte [ ] xorMask = new byte [ 16 ] ; System . arraycopy ( StunMessage . MAGIC_COOKIE , 0 , xorMask , 0 , 4 ) ; System . arraycopy ( transactionID , 0 , xorMask , 4 , 12 ) ; return applyXor ( xorMask ) ; }
Returns the result of applying XOR on this attribute s address using the specified transaction ID when converting IPv6 addresses .
37,323
public void setAddress ( TransportAddress address , byte [ ] transactionID ) { byte [ ] xorMask = new byte [ 16 ] ; System . arraycopy ( StunMessage . MAGIC_COOKIE , 0 , xorMask , 0 , 4 ) ; System . arraycopy ( transactionID , 0 , xorMask , 4 , 12 ) ; TransportAddress xorAddress = applyXor ( address , xorMask ) ; super...
Applies a XOR mask to the specified address and then sets it as the value transported by this attribute .
37,324
public void setErrorClass ( byte errorClass ) throws IllegalArgumentException { if ( errorClass < 0 || errorClass > 99 ) { throw new IllegalArgumentException ( errorClass + "Only error classes between 0 and 99 are valid. Current class: " + errorClass ) ; } this . errorClass = errorClass ; }
Sets the class of the error .
37,325
public static String getDefaultReasonPhrase ( char errorCode ) { switch ( errorCode ) { case BAD_REQUEST : return "(Bad Request): The request was malformed. The client should not " + "retry the request without modification from the previous attempt." ; case UNAUTHORIZED : return "(Unauthorized): The Binding Request di...
Returns a default reason phrase corresponding to the specified error code as described by rfc 3489 .
37,326
public void write ( RtpPacket packet , RTPFormat format ) { if ( format == null ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "No format specified. Packet dropped!" ) ; } return ; } boolean locked = false ; try { locked = this . lock . tryLock ( ) || this . lock . tryLock ( 5 , TimeUnit . MILLISECONDS ) ; i...
Accepts specified packet
37,327
public Frame read ( long timestamp ) { Frame frame = null ; boolean locked = false ; try { locked = this . lock . tryLock ( ) || this . lock . tryLock ( 5 , TimeUnit . MILLISECONDS ) ; if ( locked ) { frame = safeRead ( ) ; } else { this . ready . set ( false ) ; } } catch ( InterruptedException e ) { if ( logger . isT...
Polls packet from buffer s head .
37,328
public void reset ( ) { boolean locked = false ; try { locked = lock . tryLock ( ) || lock . tryLock ( 5 , TimeUnit . MILLISECONDS ) ; if ( locked ) { while ( queue . size ( ) > 0 ) { queue . remove ( 0 ) . recycle ( ) ; } } } catch ( InterruptedException e ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Cou...
Resets buffer .
37,329
public void addFieldParser ( char type , SdpParser < ? extends SdpField > parser ) { synchronized ( this . fieldParsers ) { this . fieldParsers . put ( type , parser ) ; } }
Adds a parser to the pipeline .
37,330
public void addAttributeParser ( String type , SdpParser < ? extends AttributeField > parser ) { synchronized ( this . attributeParsers ) { this . attributeParsers . put ( type , parser ) ; } }
Adds an attribute parser to the pipeline .
37,331
private Transition find ( String name ) { for ( Transition t : transitions ) { if ( t . getName ( ) . matches ( name ) ) { return t ; } } return null ; }
Searches transition with specified name .
37,332
public void joinRtpSession ( ) { if ( ! this . joined . get ( ) ) { long t = this . statistics . rtcpInterval ( this . initial . get ( ) ) ; this . tn = this . statistics . getCurrentTime ( ) + t ; scheduleRtcp ( this . tn , RtcpPacketType . RTCP_REPORT ) ; this . ssrcTaskFuture = this . scheduler . scheduleWithFixedDe...
Upon joining the session the participant initializes tp to 0 tc to 0 senders to 0 pmembers to 1 members to 1 we_sent to false rtcp_bw to the specified fraction of the session bandwidth initial to true and avg_rtcp_size to the probable size of the first RTCP packet that the application will later construct .
37,333
private void scheduleRtcp ( long timestamp , RtcpPacketType packetType ) { long interval = resolveInterval ( timestamp ) ; this . scheduledTask = new TxTask ( packetType ) ; try { this . reportTaskFuture = this . scheduler . schedule ( this . scheduledTask , interval , TimeUnit . MILLISECONDS ) ; this . statistics . se...
Schedules an event to occur at a certain time .
37,334
private void rescheduleRtcp ( TxTask task , long timestamp ) { this . reportTaskFuture . cancel ( true ) ; long interval = resolveInterval ( timestamp ) ; try { this . reportTaskFuture = this . scheduler . schedule ( task , interval , TimeUnit . MILLISECONDS ) ; } catch ( IllegalStateException e ) { logger . warn ( "RT...
Re - schedules a previously scheduled event .
37,335
private void closeChannel ( ) { if ( this . channel != null ) { if ( this . channel . isConnected ( ) ) { try { this . channel . disconnect ( ) ; } catch ( IOException e ) { logger . warn ( e . getMessage ( ) , e ) ; } } if ( this . channel . isOpen ( ) ) { try { this . channel . close ( ) ; } catch ( IOException e ) {...
Disconnects and closes the datagram channel used to send and receive RTCP traffic .
37,336
private boolean decode_WSP ( ) { boolean decoded = false ; if ( index < totalChars && ( chars [ index ] == 0x20 || chars [ index ] == 0x09 ) ) { index ++ ; decoded = true ; } return decoded ; }
Decode Space or HTAB
37,337
public double [ ] perform ( double [ ] buffer , int len ) { int size = ( int ) ( ( double ) F / f * len ) ; double signal [ ] = new double [ size ] ; double dx = 1. / ( double ) f ; double dX = 1. / ( double ) F ; signal [ 0 ] = buffer [ 0 ] ; double k = 0 ; for ( int i = 1 ; i < size - 1 ; i ++ ) { double X = i * dX ;...
Performs resampling of the given signal .
37,338
public void strain ( byte [ ] data , int pos , int len ) { this . chars = data ; this . pos = pos ; this . len = len ; this . linePointer = 0 ; }
Strains this object into the memory area .
37,339
public void duplicate ( Text destination ) { System . arraycopy ( chars , pos , destination . chars , destination . pos , len ) ; destination . len = len ; }
Copies data from this buffer to another buffer .
37,340
public int divide ( char separator , Text [ ] parts ) { int pointer = pos ; int limit = pos + len ; int mark = pointer ; int count = 0 ; while ( pointer < limit ) { if ( chars [ pointer ] == separator ) { parts [ count ] . strain ( chars , mark , pointer - mark ) ; mark = pointer + 1 ; count ++ ; if ( count == parts . ...
Divides text into parts using given separator and writes results into the parts array .
37,341
public void trim ( ) { try { while ( len > 0 && chars [ pos ] == ' ' ) { pos ++ ; len -- ; } while ( len > 0 && ( chars [ pos + len - 1 ] == ' ' || chars [ pos + len - 1 ] == '\n' || chars [ pos + len - 1 ] == '\r' ) ) { len -- ; } } catch ( Exception e ) { System . out . println ( "len:" + len + ",pos:" + pos ) ; } }
Removes whitespace from the head and tail of the string .
37,342
public Text nextLine ( ) { if ( linePointer == 0 ) { linePointer = pos ; } else { linePointer ++ ; } int mark = linePointer ; int limit = pos + len ; while ( linePointer < limit && chars [ linePointer ] != '\n' ) { linePointer ++ ; } return new Text ( chars , mark , linePointer - mark ) ; }
Extracts next line from this text .
37,343
private boolean compareChars ( byte [ ] chars , int pos ) { for ( int i = 0 ; i < len ; i ++ ) { if ( differentChars ( ( char ) this . chars [ i + this . pos ] , ( char ) chars [ i + pos ] ) ) return false ; } return true ; }
Compares specified character string with current string . The upper and lower case characters are considered as equals .
37,344
public boolean startsWith ( Text pattern ) { if ( pattern == null ) { return false ; } return this . subSequence ( 0 , pattern . len ) . equals ( pattern ) ; }
Indicates whether the text starts with a certain pattern .
37,345
private boolean differentChars ( char c1 , char c2 ) { if ( 65 <= c1 && c1 < 97 ) { c1 += 32 ; } if ( 65 <= c2 && c2 < 97 ) { c2 += 32 ; } return c1 != c2 ; }
Compares two chars .
37,346
public int toInteger ( ) throws NumberFormatException { int res = 0 ; byte currChar ; int i = 1 ; currChar = chars [ pos ] ; boolean isMinus = false ; if ( currChar == minus_byte ) isMinus = true ; else if ( currChar >= zero_byte && currChar <= nine_byte ) res += currChar - zero_byte ; else throw new NumberFormatExcept...
Converts string value to integer
37,347
public void copyRemainder ( Text other ) { other . chars = this . chars ; other . pos = this . linePointer + 1 ; other . len = this . len - this . linePointer - 1 ; }
Copies substring from the current line upto the end to the specified destination .
37,348
public boolean contains ( char c ) { for ( int k = pos ; k < len ; k ++ ) { if ( chars [ k ] == c ) return true ; } return false ; }
Checks does specified symbol is present in this text .
37,349
public void attach ( RequestIdentifier reqID , JainMgcpListener listener ) { this . requestListeners . put ( reqID . toString ( ) . trim ( ) , listener ) ; }
Attaches listener to the specific request .
37,350
public void deattach ( JainMgcpListener listener ) { int identifier = - 1 ; Set < Integer > IDs = txListeners . keySet ( ) ; for ( Integer id : IDs ) { if ( txListeners . get ( id ) == listener ) { identifier = id ; break ; } } if ( identifier != - 1 ) { txListeners . remove ( identifier ) ; } }
Deattaches transaction listener upon user request .
37,351
public boolean isSenderTimeout ( ) { long t = rtcpReceiverInterval ( false ) ; long minTime = getCurrentTime ( ) - ( 2 * t ) ; if ( this . rtpSentOn < minTime ) { removeSender ( this . ssrc ) ; } return this . weSent ; }
Checks whether this SSRC is still a sender .
37,352
public void strain ( Text line ) throws ParseException { try { Iterator < Text > it = line . split ( '=' ) . iterator ( ) ; it . next ( ) ; Text token = it . next ( ) ; it = token . split ( ' ' ) . iterator ( ) ; name = it . next ( ) ; name . trim ( ) ; sessionID = it . next ( ) ; sessionID . trim ( ) ; sessionVersion ...
Reads attribute from text .
37,353
private void setupAudioChannelInbound ( MediaDescriptionField remoteAudio ) throws IOException { this . audioChannel . negotiateFormats ( remoteAudio ) ; if ( ! this . audioChannel . containsNegotiatedFormats ( ) ) { throw new IOException ( "Audio codecs were not supported" ) ; } this . audioChannel . bind ( false , re...
Reads the remote SDP offer and sets up the available resources according to the call type .
37,354
private void setupAudioChannelOutbound ( MediaDescriptionField remoteAudio ) throws IOException { this . audioChannel . negotiateFormats ( remoteAudio ) ; if ( ! this . audioChannel . containsNegotiatedFormats ( ) ) { throw new IOException ( "Audio codecs were not supported" ) ; } String remoteRtpAddress = remoteAudio ...
Reads the remote SDP answer and sets up the proper media channels .
37,355
public boolean removeHandler ( PacketHandler handler ) { synchronized ( this . handlers ) { boolean removed = this . handlers . remove ( handler ) ; if ( removed ) { this . count . decrementAndGet ( ) ; } return removed ; } }
Removes an existing packet handler from the pipeline .
37,356
public PacketHandler getHandler ( byte [ ] packet ) { synchronized ( this . handlers ) { for ( PacketHandler protocolHandler : this . handlers ) { if ( protocolHandler . canHandle ( packet ) ) { return protocolHandler ; } } return null ; } }
Gets the protocol handler capable of processing the packet .
37,357
public void close ( ) { stopped = true ; try { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Closing socket" ) ; } socket . close ( ) ; if ( this . channel != null ) { this . channel . close ( ) ; } for ( int i = 0 ; i < decodingThreads . length ; i ++ ) { decodingThreads [ i ] . shutdown ( ) ; } } catch ( Exc...
Closes the stack and it s underlying resources .
37,358
public boolean reverseTransformPacket ( RawPacket pkt ) { int seqNo = pkt . getSequenceNumber ( ) ; if ( ! seqNumSet ) { seqNumSet = true ; seqNum = seqNo ; } long guessedIndex = guessIndex ( seqNo ) ; if ( ! checkReplay ( seqNo , guessedIndex ) ) { return false ; } if ( policy . getAuthType ( ) != SRTPPolicy . NULL_AU...
Transform a SRTP packet into a RTP packet . This method is called when a SRTP packet is received .
37,359
private void authenticatePacketHMCSHA1 ( RawPacket pkt , int rocIn ) { ByteBuffer buf = pkt . getBuffer ( ) ; buf . rewind ( ) ; int len = buf . remaining ( ) ; buf . get ( tempBuffer , 0 , len ) ; mac . update ( tempBuffer , 0 , len ) ; rbStore [ 0 ] = ( byte ) ( rocIn >> 24 ) ; rbStore [ 1 ] = ( byte ) ( rocIn >> 16 ...
Authenticate a packet . Calculated authentication tag is returned .
37,360
private void computeIv ( long label , long index ) { long key_id ; if ( keyDerivationRate == 0 ) { key_id = label << 48 ; } else { key_id = ( ( label << 48 ) | ( index / keyDerivationRate ) ) ; } for ( int i = 0 ; i < 7 ; i ++ ) { ivStore [ i ] = masterSalt [ i ] ; } for ( int i = 7 ; i < 14 ; i ++ ) { ivStore [ i ] = ...
Compute the initialization vector used later by encryption algorithms based on the lable the packet index key derivation rate and master salt key .
37,361
public Dsp newProcessor ( ) throws InstantiationException , ClassNotFoundException , IllegalAccessException { int numClasses = this . classes . size ( ) ; Codec [ ] codecs = new Codec [ numClasses ] ; for ( int i = 0 ; i < numClasses ; i ++ ) { String fqn = this . classes . get ( i ) ; Class < ? > codecClass = DspFacto...
Creates new DSP .
37,362
private Node < E > extract ( ) { Node < E > current = head ; head = head . next ; current . item = head . item ; head . item = null ; return current ; }
Removes a node from head of queue
37,363
private void estimateJitter ( RtpPacket packet ) { long transit = rtpClock . getLocalRtpTime ( ) - packet . getTimestamp ( ) ; long d = transit - this . currentTransit ; this . currentTransit = transit ; if ( d < 0 ) { d = - d ; } this . jitter += d - ( ( this . jitter + 8 ) >> 4 ) ; }
Calculates interarrival jitter interval .
37,364
public static AudioFormat createAudioFormat ( EncodingName name ) { if ( name . equals ( DTMF ) ) { return new DTMFFormat ( ) ; } return new AudioFormat ( name ) ; }
Creates new audio format descriptor .
37,365
public static ChangeRequestAttribute createChangeRequestAttribute ( boolean changeIP , boolean changePort ) { ChangeRequestAttribute attribute = new ChangeRequestAttribute ( ) ; attribute . setAddressChanging ( changeIP ) ; attribute . setPortChanging ( changePort ) ; return attribute ; }
Creates a ChangeRequestAttribute with the specified flag values .
37,366
public static ChangedAddressAttribute createChangedAddressAttribute ( TransportAddress address ) { ChangedAddressAttribute attribute = new ChangedAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; }
Creates a changedAddressAttribute of the specified type and with the specified address and port
37,367
public static ErrorCodeAttribute createErrorCodeAttribute ( byte errorClass , byte errorNumber , String reasonPhrase ) throws StunException { ErrorCodeAttribute attribute = new ErrorCodeAttribute ( ) ; attribute . setErrorClass ( errorClass ) ; attribute . setErrorNumber ( errorNumber ) ; attribute . setReasonPhrase ( ...
Creates an ErrorCodeAttribute with the specified error class number and reason phrase .
37,368
public static ErrorCodeAttribute createErrorCodeAttribute ( char errorCode , String reasonPhrase ) throws IllegalArgumentException { ErrorCodeAttribute attribute = new ErrorCodeAttribute ( ) ; attribute . setErrorCode ( errorCode ) ; attribute . setReasonPhrase ( reasonPhrase == null ? ErrorCodeAttribute . getDefaultRe...
Creates an ErrorCodeAttribute with the specified error code and reason phrase .
37,369
public static MappedAddressAttribute createMappedAddressAttribute ( TransportAddress address ) { MappedAddressAttribute attribute = new MappedAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; }
Creates a MappedAddressAttribute of the specified type and with the specified address and port
37,370
public static ReflectedFromAttribute createReflectedFromAttribute ( TransportAddress address ) { ReflectedFromAttribute attribute = new ReflectedFromAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; }
Creates a ReflectedFromAddressAttribute of the specified type and with the specified address and port
37,371
public static ResponseAddressAttribute createResponseAddressAttribute ( TransportAddress address ) { ResponseAddressAttribute attribute = new ResponseAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; }
Creates a ResponseFromAddressAttribute of the specified type and with the specified address and port
37,372
public static SourceAddressAttribute createSourceAddressAttribute ( TransportAddress address ) { SourceAddressAttribute attribute = new SourceAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; }
Creates a SourceFromAddressAttribute of the specified type and with the specified address and port
37,373
public static XorRelayedAddressAttribute createXorRelayedAddressAttribute ( TransportAddress address , byte [ ] tranID ) { XorRelayedAddressAttribute attribute = new XorRelayedAddressAttribute ( ) ; attribute . setAddress ( address , tranID ) ; return attribute ; }
Creates a XorRelayedAddressAttribute of the specified type and with the specified address and port .
37,374
public static XorPeerAddressAttribute createXorPeerAddressAttribute ( TransportAddress address , byte [ ] tranID ) { XorPeerAddressAttribute attribute = new XorPeerAddressAttribute ( ) ; attribute . setAddress ( address , tranID ) ; return attribute ; }
Creates a XorPeerAddressAttribute of the specified type and with the specified address and port
37,375
public static UsernameAttribute createUsernameAttribute ( byte username [ ] ) { UsernameAttribute attribute = new UsernameAttribute ( ) ; attribute . setUsername ( username ) ; return attribute ; }
Create a UsernameAttribute .
37,376
public static ChannelNumberAttribute createChannelNumberAttribute ( char channelNumber ) { ChannelNumberAttribute attribute = new ChannelNumberAttribute ( ) ; attribute . setChannelNumber ( channelNumber ) ; return attribute ; }
Create a ChannelNumberAttribute .
37,377
public static RealmAttribute createRealmAttribute ( byte realm [ ] ) { RealmAttribute attribute = new RealmAttribute ( ) ; attribute . setRealm ( realm ) ; return attribute ; }
Create a RealmAttribute .
37,378
public static NonceAttribute createNonceAttribute ( byte nonce [ ] ) { NonceAttribute attribute = new NonceAttribute ( ) ; attribute . setNonce ( nonce ) ; return attribute ; }
Create a NonceAttribute .
37,379
public static SoftwareAttribute createSoftwareAttribute ( byte software [ ] ) { SoftwareAttribute attribute = new SoftwareAttribute ( ) ; attribute . setSoftware ( software ) ; return attribute ; }
Create a SoftwareAttribute .
37,380
public static EvenPortAttribute createEvenPortAttribute ( boolean rFlag ) { EvenPortAttribute attribute = new EvenPortAttribute ( ) ; attribute . setRFlag ( rFlag ) ; return attribute ; }
Create a EventAttribute .
37,381
public static LifetimeAttribute createLifetimeAttribute ( int lifetime ) { LifetimeAttribute attribute = new LifetimeAttribute ( ) ; attribute . setLifetime ( lifetime ) ; return attribute ; }
Create a LifetimeAttribute .
37,382
public static RequestedTransportAttribute createRequestedTransportAttribute ( byte protocol ) { RequestedTransportAttribute attribute = new RequestedTransportAttribute ( ) ; attribute . setRequestedTransport ( protocol ) ; return attribute ; }
Create a RequestedTransportAttribute .
37,383
public static ReservationTokenAttribute createReservationTokenAttribute ( byte token [ ] ) { ReservationTokenAttribute attribute = new ReservationTokenAttribute ( ) ; attribute . setReservationToken ( token ) ; return attribute ; }
Create a ReservationTokenAttribute .
37,384
public static ControlledAttribute createIceControlledAttribute ( long tieBreaker ) { ControlledAttribute attribute = new ControlledAttribute ( ) ; attribute . setTieBreaker ( tieBreaker ) ; return attribute ; }
Creates an Controlled Attribute object with the specified tie - breaker value
37,385
public static PriorityAttribute createPriorityAttribute ( long priority ) throws IllegalArgumentException { PriorityAttribute attribute = new PriorityAttribute ( ) ; attribute . setPriority ( priority ) ; return attribute ; }
Creates a Priority attribute with the specified priority value
37,386
public static ControllingAttribute createIceControllingAttribute ( long tieBreaker ) { ControllingAttribute attribute = new ControllingAttribute ( ) ; attribute . setTieBreaker ( tieBreaker ) ; return attribute ; }
Creates an Controlling Attribute with the specified tie - breaker value
37,387
public static DestinationAddressAttribute createDestinationAddressAttribute ( TransportAddress address ) { DestinationAddressAttribute attribute = new DestinationAddressAttribute ( ) ; attribute . setAddress ( address ) ; return attribute ; }
Creates a DestinationFromAddressAttribute of the specified type and with the specified address and port
37,388
public void bind ( boolean isLocal , int port ) throws IOException { try { this . selectionKey = udpManager . open ( this ) ; this . dataChannel = ( DatagramChannel ) this . selectionKey . channel ( ) ; } catch ( IOException e ) { throw new SocketException ( e . getMessage ( ) ) ; } onBinding ( ) ; this . udpManager . ...
Binds the channel to an address and port
37,389
public void parse ( byte [ ] data ) throws ParseException { Text text = new Text ( ) ; text . strain ( data , 0 , data . length ) ; init ( text ) ; }
Reads descriptor from binary data
37,390
public Set < Integer > getConnections ( String endpointId ) { return Collections . unmodifiableSet ( this . entries . get ( endpointId ) ) ; }
Gets the list of currently registered connections in the Call .
37,391
public boolean addConnection ( String endpointId , int connectionId ) { boolean added = this . entries . put ( endpointId , connectionId ) ; if ( added && log . isDebugEnabled ( ) ) { int left = this . entries . get ( endpointId ) . size ( ) ; log . debug ( "Call " + getCallIdHex ( ) + " registered connection " + Integ...
Registers a connection in the call .
37,392
public boolean removeConnection ( String endpointId , int connectionId ) { boolean removed = this . entries . remove ( endpointId , connectionId ) ; if ( removed && log . isDebugEnabled ( ) ) { int left = this . entries . get ( endpointId ) . size ( ) ; log . debug ( "Call " + getCallIdHex ( ) + " unregistered connecti...
Unregisters a connection from the call .
37,393
public Set < Integer > removeConnections ( String endpointId ) { Set < Integer > removed = this . entries . removeAll ( endpointId ) ; if ( ! removed . isEmpty ( ) && log . isDebugEnabled ( ) ) { log . debug ( "Call " + getCallIdHex ( ) + " unregistered connections " + Arrays . toString ( convertToHex ( removed ) ) + "...
Unregisters all connections that belong to an endpoint .
37,394
private MgcpConnection createRemoteConnection ( int callId , ConnectionMode mode , MgcpEndpoint endpoint , CrcxContext context ) throws MgcpConnectionException { MgcpConnection connection = endpoint . createConnection ( callId , false ) ; String localDescription = connection . halfOpen ( context . getLocalConnectionOpt...
Creates a new Remote Connection .
37,395
private MgcpConnection createLocalConnection ( int callId , MgcpEndpoint endpoint ) throws MgcpConnectionException { MgcpConnection connection = endpoint . createConnection ( callId , true ) ; connection . open ( null ) ; return connection ; }
Creates a new Local Connection .
37,396
public RTPFormats negotiateAudio ( SessionDescription sdp , RTPFormats formats ) { this . audio . clean ( ) ; MediaDescriptorField descriptor = sdp . getAudioDescriptor ( ) ; descriptor . getFormats ( ) . intersection ( formats , this . audio ) ; return this . audio ; }
Negotiates the audio formats to be used in the call .
37,397
public RTPFormats negotiateVideo ( SessionDescription sdp , RTPFormats formats ) { this . video . clean ( ) ; MediaDescriptorField descriptor = sdp . getVideoDescriptor ( ) ; descriptor . getFormats ( ) . intersection ( formats , this . video ) ; return this . video ; }
Negotiates the video formats to be used in the call .
37,398
public RTPFormats negotiateApplication ( SessionDescription sdp , RTPFormats formats ) { this . application . clean ( ) ; MediaDescriptorField descriptor = sdp . getApplicationDescriptor ( ) ; descriptor . getFormats ( ) . intersection ( formats , this . application ) ; return this . application ; }
Negotiates the application formats to be used in the call .
37,399
private static RtcpSenderReport buildSenderReport ( RtpStatistics statistics , boolean padding ) { long ssrc = statistics . getSsrc ( ) ; long currentTime = statistics . getCurrentTime ( ) ; TimeStamp ntpTs = new TimeStamp ( new Date ( currentTime ) ) ; long ntpSec = ntpTs . getSeconds ( ) ; long ntpFrac = ntpTs . getF...
Builds a packet containing an RTCP Sender Report .