Package org.jitsi.util.event
Class VideoEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.jitsi.util.event.VideoEvent
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SizeChangeVideoEvent
public class VideoEvent extends EventObject
Represents an event fired by providers of visual Components depicting video to notify about changes in the availability of such Components.- Author:
- Lyubomir Marinov
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intLOCALThe video origin of a VideoEvent which is local to the executing client such as a local video capture device.static intREMOTEThe video origin of a VideoEvent which is remote to the executing client such as a video being remotely streamed from a CallPeer.static intVIDEO_ADDEDThe type of a VideoEvent which notifies about a specific visual Component depicting video being made available by the firing provider.static intVIDEO_REMOVEDThe type of a VideoEvent which notifies about a specific visual Component depicting video no longer being made available by the firing provider.-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description VideoEvent(Object source, int type, Component visualComponent, int origin)Initializes a new VideoEvent which is to notify about a specific change in the availability of a specific visual Component depicting video and being provided by a specific source.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VideoEventclone(Object source)Initializes a new instance of the run-time type of this instance which has the same property values as this instance except for the source which is set on the new instance to a specific value.voidconsume()Consumes this event and, more specifically, marks the Component it describes as owned, referenced in order to let other potential consumers know about its current ownership status (which is important because Components belong to a single Container at a time).intgetOrigin()intgetType()Gets the type of availability change this VideoEvent notifies about which is one ofVIDEO_ADDEDandVIDEO_REMOVED.ComponentgetVisualComponent()Gets the visual Component depicting video which had its availability changed and which this VideoEvent notifies about.booleanisConsumed()Determines whether 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).static StringoriginToString(int origin)Returns a human-readable representation of a specific VideoEvent origin constant in the form of a String value.static StringtypeToString(int type)Returns a human-readable representation of a specific VideoEvent type constant in the form of a String value.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Field Detail
-
LOCAL
public static final int LOCAL
The video origin of a VideoEvent which is local to the executing client such as a local video capture device.- See Also:
- Constant Field Values
-
REMOTE
public static final int REMOTE
The video origin of a VideoEvent which is remote to the executing client such as a video being remotely streamed from a CallPeer.- See Also:
- Constant Field Values
-
VIDEO_ADDED
public static final int VIDEO_ADDED
The type of a VideoEvent which notifies about a specific visual Component depicting video being made available by the firing provider.- See Also:
- Constant Field Values
-
VIDEO_REMOVED
public static final int VIDEO_REMOVED
The type of a VideoEvent which notifies about a specific visual Component depicting video no longer being made available by the firing provider.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VideoEvent
public VideoEvent(Object source, int type, Component visualComponent, int origin)
Initializes a new VideoEvent which is to notify about a specific change in the availability of a specific visual Component depicting video and being provided by a specific source.- Parameters:
source- the source of the new VideoEvent and the provider of the visual Component depicting videotype- the type of the availability change which has caused the new VideoEvent to be firedvisualComponent- the visual Component depicting video which had its availability in the source provider changedorigin- the origin of the video the new VideoEvent is to notify about
-
-
Method Detail
-
clone
public VideoEvent clone(Object source)
Initializes a new instance of the run-time type of this instance which has the same property values as this instance except for the source which is set on the new instance to a specific value.- Parameters:
source- the Object which is to be reported as the source of the new instance- Returns:
- a new instance of the run-time type of this instance which has the same property values as this instance except for the source which is set on the new instance to the specified source
-
consume
public void consume()
Consumes this event and, more specifically, marks the Component it describes as owned, referenced in order to let other potential consumers know about its current ownership status (which is important because Components belong to a single Container at a time).
-
getOrigin
public int getOrigin()
-
getType
public int getType()
Gets the type of availability change this VideoEvent notifies about which is one ofVIDEO_ADDEDandVIDEO_REMOVED.- Returns:
- one of
VIDEO_ADDEDandVIDEO_REMOVEDwhich describes the type of availability change this VideoEvent notifies about
-
getVisualComponent
public Component getVisualComponent()
Gets the visual Component depicting video which had its availability changed and which this VideoEvent notifies about.- Returns:
- the visual Component depicting video which had its availability changed and which this VideoEvent notifies about
-
isConsumed
public boolean isConsumed()
Determines whether 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).- 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
-
originToString
public static String originToString(int origin)
Returns a human-readable representation of a specific VideoEvent origin constant in the form of a String value.
-
typeToString
public static String typeToString(int type)
Returns a human-readable representation of a specific VideoEvent type constant in the form of a String value.- Parameters:
type- one of the VideoEvent type constants such asVIDEO_ADDEDorVIDEO_REMOVED- Returns:
- a String value which gives a human-readable representation of the specified VideoEvent type constant
-
-