Package org.jitsi.util.event
Class VideoNotifierSupport
- java.lang.Object
-
- org.jitsi.util.event.VideoNotifierSupport
-
public class VideoNotifierSupport extends Object
Represents a mechanism to easily add to a specific Object by means of composition support for firing VideoEvents to VideoListeners.- Author:
- Lyubomir Marinov
-
-
Constructor Summary
Constructors Constructor Description VideoNotifierSupport(Object source)Initializes a new VideoNotifierSupport instance which is to facilitate the management of VideoListeners and firing VideoEvents to them for a specific Object.VideoNotifierSupport(Object source, boolean synchronous)Initializes a new VideoNotifierSupport instance which is to facilitate the management of VideoListeners and firing VideoEvents to them for a specific Object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVideoListener(VideoListener listener)Adds a specific VideoListener to this VideoNotifierSupport in order to receive notifications when visual/video Components are being added and removed.protected voiddoFireVideoEvent(VideoEvent event)booleanfireVideoEvent(int type, Component visualComponent, int origin, boolean wait)Notifies the VideoListeners registered with this VideoMediaStream about a specific type of change in the availability of a specific visual Component depicting video.voidfireVideoEvent(VideoEvent event, boolean wait)Notifies the VideoListeners registered with this instance about a specific VideoEvent.voidremoveVideoListener(VideoListener listener)Removes a specific VideoListener from this VideoNotifierSupport in order to have to no longer receive notifications when visual/video Components are being added and removed.
-
-
-
Constructor Detail
-
VideoNotifierSupport
public VideoNotifierSupport(Object source)
Initializes a new VideoNotifierSupport instance which is to facilitate the management of VideoListeners and firing VideoEvents to them for a specific Object.- Parameters:
source- the Object which is to be reported as the source of the VideoEvents fired by the new instance
-
VideoNotifierSupport
public VideoNotifierSupport(Object source, boolean synchronous)
Initializes a new VideoNotifierSupport instance which is to facilitate the management of VideoListeners and firing VideoEvents to them for a specific Object.- Parameters:
source- the Object which is to be reported as the source of the VideoEvents fired by the new instancesynchronous- true if the new instance is to deliver the VideoEvents synchronously; otherwise, false
-
-
Method Detail
-
addVideoListener
public void addVideoListener(VideoListener listener)
Adds a specific VideoListener to this VideoNotifierSupport in order to receive notifications when visual/video Components are being added and removed.Adding a listener which has already been added does nothing i.e. it is not added more than once and thus does not receive one and the same VideoEvent multiple times.
- Parameters:
listener- the VideoListener to be notified when visual/video Components are being added or removed in this VideoNotifierSupport
-
doFireVideoEvent
protected void doFireVideoEvent(VideoEvent event)
-
fireVideoEvent
public boolean fireVideoEvent(int type, Component visualComponent, int origin, boolean wait)Notifies the VideoListeners registered with this VideoMediaStream about a specific type of change in the availability of a specific visual Component depicting video.- Parameters:
type- the type of change as defined by VideoEvent in the availability of the specified visual Component depicting videovisualComponent- the visual Component depicting video which has been added or removedorigin-VideoEvent.LOCALif the origin of the video is local (e.g. it is being locally captured);VideoEvent.REMOTEif the origin of the video is remote (e.g. a remote peer is streaming it)wait- true if the call is to wait till the specified VideoEvent has been delivered to the VideoListeners; otherwise, false- Returns:
- true if this event and, more specifically, the visual Component it describes have been consumed and should be considered owned, referenced (which is important because Components belong to a single Container at a time); otherwise, false
-
fireVideoEvent
public void fireVideoEvent(VideoEvent event, boolean wait)
Notifies the VideoListeners registered with this instance about a specific VideoEvent.- Parameters:
event- the VideoEvent to be fired to the VideoListeners registered with this instancewait- true if the call is to wait till the specified VideoEvent has been delivered to the VideoListeners; otherwise, false
-
removeVideoListener
public void removeVideoListener(VideoListener listener)
Removes a specific VideoListener from this VideoNotifierSupport in order to have to no longer receive notifications when visual/video Components are being added and removed.- Parameters:
listener- the VideoListener to no longer be notified when visual/video Components are being added or removed
-
-