@ -53,35 +53,35 @@ public OperationSetVideoTelephonySipImpl(
}
/ *
* Delegates to the CallSession of the Call of the specified CallP articipant
* Delegates to the CallSession of the Call of the specified CallP eer
* because the video is provided by the CallSession in the SIP protocol
* implementation . Because other OperationSetVideoTelephony implementations
* may not provide their video through the CallSession , this implementation
* promotes itself as the provider of the video by replacing the CallSession
* in the VideoEvents it fires .
* /
public void addVideoListener ( CallPeer p articipant ,
public void addVideoListener ( CallPeer p eer ,
VideoListener listener )
{
if ( listener = = null )
throw new NullPointerException ( "listener" ) ;
( ( CallSipImpl ) p articipant . getCall ( ) ) . getMediaCallSession ( )
( ( CallSipImpl ) p eer . getCall ( ) ) . getMediaCallSession ( )
. addVideoListener (
new InternalVideoListener ( this , p articipant , listener ) ) ;
new InternalVideoListener ( this , p eer , listener ) ) ;
}
/ *
* Implements OperationSetVideoTelephony # createLocalVisualComponent (
* CallP articipant , VideoListener ) . Delegates to CallSession # createLocalVisualComponent (
* VideoListener ) of the Call of the specified CallP articipant because the
* CallP eer , VideoListener ) . Delegates to CallSession # createLocalVisualComponent (
* VideoListener ) of the Call of the specified CallP eer because the
* CallSession manages the visual components which represent local video .
* /
public Component createLocalVisualComponent ( CallPeer p articipant ,
public Component createLocalVisualComponent ( CallPeer p eer ,
VideoListener listener ) throws OperationFailedException
{
CallSession callSession =
( ( CallSipImpl ) p articipant . getCall ( ) ) . getMediaCallSession ( ) ;
( ( CallSipImpl ) p eer . getCall ( ) ) . getMediaCallSession ( ) ;
if ( callSession ! = null )
{
@ -101,50 +101,50 @@ public Component createLocalVisualComponent(CallPeer participant,
/ *
* Implements OperationSetVideoTelephony # disposeLocalVisualComponent (
* CallP articipant , Component ) . Delegates to CallSession # disposeLocalVisualComponent (
* Component ) of the Call of the specified CallP articipant because the
* CallP eer , Component ) . Delegates to CallSession # disposeLocalVisualComponent (
* Component ) of the Call of the specified CallP eer because the
* CallSession manages the visual components which represent local video .
* /
public void disposeLocalVisualComponent ( CallPeer p articipant ,
public void disposeLocalVisualComponent ( CallPeer p eer ,
Component component )
{
CallSession callSession =
( ( CallSipImpl ) p articipant . getCall ( ) ) . getMediaCallSession ( ) ;
( ( CallSipImpl ) p eer . getCall ( ) ) . getMediaCallSession ( ) ;
if ( callSession ! = null )
callSession . disposeLocalVisualComponent ( component ) ;
}
/ *
* Delegates to the CallSession of the Call of the specified CallP articipant
* Delegates to the CallSession of the Call of the specified CallP eer
* because the video is provided by the CallSession in the SIP protocol
* implementation .
* /
public Component [ ] getVisualComponents ( CallPeer p articipant )
public Component [ ] getVisualComponents ( CallPeer p eer )
{
CallSession callSession =
( ( CallSipImpl ) p articipant . getCall ( ) ) . getMediaCallSession ( ) ;
( ( CallSipImpl ) p eer . getCall ( ) ) . getMediaCallSession ( ) ;
return ( callSession ! = null ) ? callSession . getVisualComponents ( )
: new Component [ 0 ] ;
}
/ *
* Delegates to the CallSession of the Call of the specified CallP articipant
* Delegates to the CallSession of the Call of the specified CallP eer
* because the video is provided by the CallSession in the SIP protocol
* implementation . Because other OperationSetVideoTelephony implementations
* may not provide their video through the CallSession , this implementation
* promotes itself as the provider of the video by replacing the CallSession
* in the VideoEvents it fires .
* /
public void removeVideoListener ( CallPeer p articipant ,
public void removeVideoListener ( CallPeer p eer ,
VideoListener listener )
{
if ( listener ! = null )
{
( ( CallSipImpl ) p articipant . getCall ( ) ) . getMediaCallSession ( )
( ( CallSipImpl ) p eer . getCall ( ) ) . getMediaCallSession ( )
. removeVideoListener (
new InternalVideoListener ( this , p articipant , listener ) ) ;
new InternalVideoListener ( this , p eer , listener ) ) ;
}
}
@ -152,7 +152,7 @@ public void removeVideoListener(CallPeer participant,
* Implements OperationSetVideoTelephony # setLocalVideoAllowed ( Call ,
* boolean ) . Modifies the local media setup to reflect the requested setting
* for the streaming of the local video and then re - invites all
* CallP articipant s to re - negotiate the modified media setup .
* CallP eer s to re - negotiate the modified media setup .
* /
public void setLocalVideoAllowed ( Call call , boolean allowed )
throws OperationFailedException
@ -178,31 +178,31 @@ public void setLocalVideoAllowed(Call call, boolean allowed)
/ *
* Once the local state has been modified , re - invite all
* CallP articipant s to re - negotiate the modified media setup .
* CallP eer s to re - negotiate the modified media setup .
* /
Iterator < CallPeer > p articipant s = call . getCallPeers ( ) ;
while ( p articipant s. hasNext ( ) )
Iterator < CallPeer > p eer s = call . getCallPeers ( ) ;
while ( p eer s. hasNext ( ) )
{
CallPeerSipImpl p articipant
= ( CallPeerSipImpl ) p articipant s. next ( ) ;
CallPeerSipImpl p eer
= ( CallPeerSipImpl ) p eer s. next ( ) ;
String sdpOffer = null ;
try
{
sdpOffer
= callSession . createSdpOffer (
p articipant . getSdpDescription ( ) ) ;
p eer . getSdpDescription ( ) ) ;
}
catch ( MediaException ex )
{
throw new OperationFailedException (
"Failed to create re-invite offer for p articipant "
+ p articipant ,
"Failed to create re-invite offer for p eer "
+ p eer ,
OperationFailedException . INTERNAL_ERROR ,
ex ) ;
}
basicTelephony . sendInviteRequest ( p articipant , sdpOffer ) ;
basicTelephony . sendInviteRequest ( p eer , sdpOffer ) ;
}
}
@ -270,10 +270,10 @@ private static class InternalVideoListener
private final VideoListener delegate ;
/ * *
* The < code > CallP articipant < / code > whose videos { @link # delegate } is
* The < code > CallP eer < / code > whose videos { @link # delegate } is
* interested in .
* /
private final CallPeer p articipant ;
private final CallPeer p eer ;
/ * *
* The < code > OperationSetVideoTelephony < / code > which is to be presented
@ -287,12 +287,12 @@ private static class InternalVideoListener
* impersonate the sources of < code > VideoEvents < / code > with a specific
* < code > OperationSetVideoTelephony < / code > for a specific
* < code > VideoListener < / code > interested in the videos of a specific
* < code > CallP articipant < / code > .
* < code > CallP eer < / code > .
*
* @param telephony the < code > OperationSetVideoTelephony < / code > which is
* to be stated as the source of the < code > VideoEvent < / code >
* sent to the specified delegate < code > VideoListener < / code >
* @param p articipant the < code > CallParticipant < / code > whose videos the
* @param p eer the < code > CallPeer < / code > whose videos the
* specified delegate < code > VideoListener < / code > is
* interested in
* @param delegate the < code > VideoListener < / code > which shouldn ' t know
@ -301,20 +301,20 @@ private static class InternalVideoListener
* < code > telephony < / code >
* /
public InternalVideoListener ( OperationSetVideoTelephony telephony ,
CallPeer p articipant , VideoListener delegate )
CallPeer p eer , VideoListener delegate )
{
if ( p articipant = = null )
throw new NullPointerException ( "p articipant ") ;
if ( p eer = = null )
throw new NullPointerException ( "p eer cannot be null ") ;
this . telephony = telephony ;
this . p articipant = participant ;
this . p eer = peer ;
this . delegate = delegate ;
}
/ *
* Two InternalVideoListeners are equal if they impersonate the sources
* of VideoEvents with equal OperationSetVideoTelephonies for equal
* delegate VideoListeners added to equal CallP articipant s.
* delegate VideoListeners added to equal CallP eer- s.
* /
public boolean equals ( Object other )
{
@ -326,7 +326,7 @@ public boolean equals(Object other)
InternalVideoListener otherListener = ( InternalVideoListener ) other ;
return otherListener . telephony . equals ( telephony )
& & otherListener . p articipant. equals ( participant )
& & otherListener . p eer. equals ( peer )
& & otherListener . delegate . equals ( delegate ) ;
}