src/net/java/sip/communicator/service/protocol/media/MediaHandler.java
/**
     * Closes the <tt>MediaStream</tt> that this instance uses for a specific
     * <tt>MediaType</tt> and prepares it for garbage collection.
     *
     * @param mediaType the <tt>MediaType</tt> that we'd like to stop a stream
     * for.
     */
Closes the MediaStream that this instance uses for a specific
MediaType and prepares it for garbage collection.

@param mediaType the MediaType that we'd like to stop a stream
for.
Closes the MediaStream that this instance uses for a specific MediaType and prepares it for garbage collection . @param mediaType the MediaType that we ' d like to stop a stream for .
protected void closeStream(
            CallPeerMediaHandler<?> callPeerMediaHandler,
            MediaType mediaType)
    {
        int index = mediaType.ordinal();
        int streamReferenceCount = streamReferenceCounts[index];
        /*
         * The streamReferenceCounts should not fall into an invalid state but
         * anyway...
         */
        if (streamReferenceCount <= 0)
            return;
        streamReferenceCount--;
        streamReferenceCounts[index] = streamReferenceCount;
        /*
         * The MediaStream of the specified mediaType is still referenced by
         * other CallPeerMediaHandlers so it is not to be closed yet.
         */
        if (streamReferenceCount > 0)
            return;
        switch (mediaType)
        {
        case AUDIO:
            setAudioStream(null);
            break;
        case VIDEO:
            setVideoStream(null);
            break;
        }
        callPeerMediaHandler.removeAndCleanupOtherSrtpControls(mediaType, null);
    }
protected void closeStream ( CallPeerMediaHandler < ? > callPeerMediaHandler , MediaType mediaType ) { int index = mediaType . ordinal ( ) ; int streamReferenceCount = streamReferenceCounts [ index ] ; /*
         * The streamReferenceCounts should not fall into an invalid state but
         * anyway...
         */ if ( streamReferenceCount <= 0 ) return ; streamReferenceCount -- ; streamReferenceCounts [ index ] = streamReferenceCount ; /*
         * The MediaStream of the specified mediaType is still referenced by
         * other CallPeerMediaHandlers so it is not to be closed yet.
         */ if ( streamReferenceCount > 0 ) return ; switch ( mediaType ) { case AUDIO : setAudioStream ( null ) ; break ; case VIDEO : setVideoStream ( null ) ; break ; } callPeerMediaHandler . removeAndCleanupOtherSrtpControls ( mediaType , null ) ; }
Closes the <tt>MediaStream</tt> that this instance uses for a specific
 <tt>MediaType</tt> and prepares it for garbage collection.
Closes the <tt > MediaStream< / tt > that this instance uses for a specific <tt > MediaType< / tt > and prepares it for garbage collection .
// Clean up the SRTP controls used for the associated Call.