public class VideoMediaDeviceSession extends MediaDeviceSession implements RTCPFeedbackMessageCreateListener
OUTPUT_DATA_SOURCE, outputSizeChanged, SSRC_LIST
Constructor and Description |
---|
VideoMediaDeviceSession(AbstractMediaDevice device)
Initializes a new VideoMediaDeviceSession instance which is to
represent the work of a MediaStream with a specific video
MediaDevice.
|
Modifier and Type | Method and Description |
---|---|
void |
addRTCPFeedbackMessageCreateListner(RTCPFeedbackMessageCreateListener listener)
Adds RTCPFeedbackMessageCreateListener.
|
void |
addVideoListener(VideoListener listener)
Adds a specific VideoListener to this instance in order to
receive notifications when visual/video Components are being
added and removed.
|
protected void |
checkDevice(AbstractMediaDevice device)
Asserts that a specific MediaDevice is acceptable to be set as
the MediaDevice of this instance.
|
protected javax.media.protocol.DataSource |
createCaptureDevice()
Creates the DataSource that this instance is to read captured
media from.
|
protected javax.media.Player |
createLocalPlayer(javax.media.protocol.DataSource captureDevice)
Initializes a new Player instance which is to provide the local
visual/video Component.
|
protected java.awt.Component |
createLocalVisualComponent()
Creates the visual Component depicting the video being streamed
from the local peer to the remote peer.
|
protected void |
disposeLocalPlayer(javax.media.Player player)
Releases the resources allocated by a specific local Player in
the course of its execution and prepares it to be garbage collected.
|
protected void |
disposeLocalVisualComponent(java.awt.Component component)
Disposes of the local visual Component of the local peer.
|
protected void |
disposePlayer(javax.media.Player player)
Releases the resources allocated by a specific Player in the
course of its execution and prepares it to be garbage collected.
|
protected boolean |
fireVideoEvent(int type,
java.awt.Component visualComponent,
int origin,
boolean wait)
Notifies the VideoListeners registered with this instance about
a specific type of change in the availability of a specific visual
Component depicting video.
|
protected void |
fireVideoEvent(VideoEvent videoEvent,
boolean wait)
Notifies the VideoListeners registered with this instance about
a specific VideoEvent.
|
protected javax.media.Player |
getLocalPlayer()
Return the Player instance which provides the local visual/video
Component.
|
java.awt.Component |
getLocalVisualComponent()
Gets the visual Component, if any, depicting the video streamed
from the local peer to the remote peer.
|
javax.media.format.VideoFormat |
getReceivedVideoFormat()
Returns the FMJ Format of the video we are receiving from the
remote peer.
|
javax.media.format.VideoFormat |
getSentVideoFormat()
Returns the format of the video we are streaming to the remote peer.
|
java.awt.Component |
getVisualComponent(long ssrc)
Gets the visual Components rendering the ReceiveStream
corresponding to the given ssrc.
|
java.util.List<java.awt.Component> |
getVisualComponents()
Gets the visual Components where video from the remote peer is
being rendered.
|
void |
onRTCPFeedbackMessageCreate(RTCPFeedbackMessageListener rtcpFeedbackMessageListener)
Notifies this VideoMediaDeviceSession of a new
RTCPFeedbackListener
|
protected void |
playerConfigureComplete(javax.media.Processor player)
Notifies this instance that a specific Player of remote content
has generated a ConfigureCompleteEvent.
|
protected void |
playerControllerUpdate(javax.media.ControllerEvent ev)
Gets notified about ControllerEvents generated by a specific
Player of remote content.
|
protected void |
playerRealizeComplete(javax.media.Processor player)
Notifies this instance that a specific Player of remote content
has generated a RealizeCompleteEvent.
|
protected void |
playerSizeChange(javax.media.Controller sourceController,
int origin,
int width,
int height)
Notifies this instance that a specific Player of local or remote
content/video has generated a SizeChangeEvent.
|
void |
removeRTCPFeedbackMessageCreateListner(RTCPFeedbackMessageCreateListener listener)
Removes RTCPFeedbackMessageCreateListener.
|
void |
removeVideoListener(VideoListener listener)
Removes a specific VideoListener from this instance in order to
have to no longer receive notifications when visual/video
Components are being added and removed.
|
void |
setConnector(AbstractRTPConnector rtpConnector)
Sets the RTPConnector that will be used to
initialize some codec for RTCP feedback.
|
void |
setFormat(MediaFormat format)
Sets the MediaFormat in which this MediaDeviceSession
outputs the media captured by its MediaDevice.
|
void |
setKeyFrameControl(KeyFrameControl keyFrameControl)
Sets the KeyFrameControl to be used by this
VideoMediaDeviceSession as a means of control over its
key frame-related logic.
|
void |
setLocalSSRC(long localSSRC)
Set the local SSRC.
|
void |
setOutputSize(java.awt.Dimension size)
Sets the size of the output video.
|
protected void |
setProcessorFormat(javax.media.Processor processor,
MediaFormatImpl<? extends javax.media.Format> mediaFormat)
Sets the MediaFormatImpl in which a specific Processor
producing media to be streamed to the remote peer is to output.
|
protected javax.media.Format |
setProcessorFormat(javax.media.control.TrackControl trackControl,
MediaFormatImpl<? extends javax.media.Format> mediaFormat,
javax.media.Format format)
Sets the MediaFormatImpl of a specific TrackControl of
the Processor which produces the media to be streamed by this
MediaDeviceSession to the remote peer.
|
void |
setRemoteSSRC(long remoteSSRC)
Set the remote SSRC.
|
void |
setRTCPFeedbackPLI(boolean useRTCPFeedbackPLI)
Sets the indicator which determines whether RTCP feedback Picture Loss
Indication (PLI) is to be used to request keyframes.
|
protected void |
startedDirectionChanged(MediaDirection oldValue,
MediaDirection newValue)
Notifies this instance that the value of its startedDirection
property has changed from a specific oldValue to a specific
newValue.
|
addDTMF, addPlaybackDataSource, addReceiveStream, addSSRC, close, copyPlayback, createPlayer, createProcessor, createProcessorContentDescriptor, createRenderer, getCaptureDevice, getConnectedCaptureDevice, getDecoderControls, getDevice, getEncoderControls, getFormat, getOutputDataSource, getPlayer, getPlayers, getProcessorFormat, getReceiveStreams, getRemoteSSRCList, getStartedDirection, getSupportedFormats, getTranscodingDataSource, isMute, playbackDataSourceAdded, playbackDataSourceChanged, playbackDataSourceRemoved, playbackDataSourceUpdated, processorControllerUpdate, receiveStreamAdded, receiveStreamRemoved, removePlaybackDataSource, removeReceiveStream, removeSSRC, setCaptureDeviceFormat, setContentDescriptor, setDisposePlayerOnClose, setMute, start, startProcessorInAccordWithDirection, stop
addPropertyChangeListener, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener
public VideoMediaDeviceSession(AbstractMediaDevice device)
device
- the video MediaDevice the use of which by a
MediaStream is to be represented by the new instancepublic void addRTCPFeedbackMessageCreateListner(RTCPFeedbackMessageCreateListener listener)
listener
- the listener to addpublic void addVideoListener(VideoListener listener)
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.
listener
- the VideoListener to be notified when
visual/video Components are being added or removed in this
instanceprotected void checkDevice(AbstractMediaDevice device)
MediaType.VIDEO
.checkDevice
in class MediaDeviceSession
device
- the MediaDevice to be checked for suitability to
become the MediaDevice of this instanceMediaDeviceSession.checkDevice(AbstractMediaDevice)
protected javax.media.protocol.DataSource createCaptureDevice()
createCaptureDevice
in class MediaDeviceSession
protected javax.media.Player createLocalPlayer(javax.media.protocol.DataSource captureDevice)
captureDevice
- the DataSource which is to have its media
rendered by the new instance as the local visual/video Componentprotected java.awt.Component createLocalVisualComponent()
VideoEvent.VIDEO_ADDED
and origin
VideoEvent.LOCAL
protected void disposeLocalPlayer(javax.media.Player player)
VideoEvent.VIDEO_REMOVED
VideoEvent.player
- the Player to dispose ofMediaDeviceSession.disposePlayer(Player)
protected void disposeLocalVisualComponent(java.awt.Component component)
component
- the local visual Component of the local peer to
dispose ofprotected void disposePlayer(javax.media.Player player)
VideoEvent.VIDEO_REMOVED
VideoEvent.disposePlayer
in class MediaDeviceSession
player
- the Player to dispose ofMediaDeviceSession.disposePlayer(Player)
protected boolean fireVideoEvent(int type, java.awt.Component visualComponent, int origin, boolean wait)
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 removed in this instanceorigin
- VideoEvent.LOCAL
if the origin of the video is
local (e.g. it is being locally captured); VideoEvent.REMOTE
if
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, falseprotected void fireVideoEvent(VideoEvent videoEvent, boolean wait)
videoEvent
- 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, falsepublic java.awt.Component getLocalVisualComponent()
public javax.media.format.VideoFormat getReceivedVideoFormat()
public javax.media.format.VideoFormat getSentVideoFormat()
public java.awt.Component getVisualComponent(long ssrc)
ssrc
- the src-id of the receive stream, which visual
Component we're looking forpublic java.util.List<java.awt.Component> getVisualComponents()
public void onRTCPFeedbackMessageCreate(RTCPFeedbackMessageListener rtcpFeedbackMessageListener)
onRTCPFeedbackMessageCreate
in interface RTCPFeedbackMessageCreateListener
rtcpFeedbackMessageListener
- the listener to be added.protected void playerConfigureComplete(javax.media.Processor player)
playerConfigureComplete
in class MediaDeviceSession
player
- the Player which is the source of a
ConfigureCompleteEventMediaDeviceSession.playerConfigureComplete(Processor)
protected void playerControllerUpdate(javax.media.ControllerEvent ev)
playerControllerUpdate
in class MediaDeviceSession
ev
- the ControllerEvent specifying the
Controller which is the source of the event and the very type of
the eventMediaDeviceSession.playerControllerUpdate(ControllerEvent)
protected void playerRealizeComplete(javax.media.Processor player)
playerRealizeComplete
in class MediaDeviceSession
player
- the Player which is the source of a
RealizeCompleteEvent.MediaDeviceSession.playerRealizeComplete(Processor)
protected void playerSizeChange(javax.media.Controller sourceController, int origin, int width, int height)
sourceController
- the Player which is the source of the
eventorigin
- VideoEvent.LOCAL
or VideoEvent.REMOTE
which
specifies the origin of the visual Component displaying video
which is concernedwidth
- the width reported in the eventheight
- the height reported in the eventSizeChangeEvent
public void removeRTCPFeedbackMessageCreateListner(RTCPFeedbackMessageCreateListener listener)
listener
- the listener to removepublic void removeVideoListener(VideoListener listener)
listener
- the VideoListener to no longer be notified when
visual/video Components are being added or removed in this
instancepublic void setConnector(AbstractRTPConnector rtpConnector)
rtpConnector
- the RTP connectorpublic void setFormat(MediaFormat format)
setFormat
in class MediaDeviceSession
format
- the MediaFormat in which this
MediaDeviceSession is to output the media captured by its
MediaDevicepublic void setKeyFrameControl(KeyFrameControl keyFrameControl)
keyFrameControl
- the KeyFrameControl to be used by this
VideoMediaDeviceSession as a means of control over its
key frame-related logicpublic void setLocalSSRC(long localSSRC)
localSSRC
- local SSRCpublic void setOutputSize(java.awt.Dimension size)
size
- the size of the output videoprotected void setProcessorFormat(javax.media.Processor processor, MediaFormatImpl<? extends javax.media.Format> mediaFormat)
setProcessorFormat
in class MediaDeviceSession
processor
- the Processor to set the output
MediaFormatImpl ofmediaFormat
- the MediaFormatImpl to set on
processorMediaDeviceSession.setProcessorFormat(Processor, MediaFormatImpl)
protected javax.media.Format setProcessorFormat(javax.media.control.TrackControl trackControl, MediaFormatImpl<? extends javax.media.Format> mediaFormat, javax.media.Format format)
setProcessorFormat
in class MediaDeviceSession
trackControl
- the TrackControl to set the JMF
Format ofmediaFormat
- the MediaFormatImpl to be set on the
specified TrackControl. Though mediaFormat encapsulates
a JMF Format, format is to be set on the specified
trackControl because it may be more specific. In any case, the
two JMF Formats match. The MediaFormatImpl is provided
anyway because it carries additional information such as format
parameters.format
- the JMF Format to be set on the specified
TrackControl. Though mediaFormat encapsulates a JMF
Format, the specified format is to be set on the
specified trackControl because it may be more specific than the
JMF Format of the mediaFormatMediaDeviceSession.setProcessorFormat(TrackControl, MediaFormatImpl,
Format)
public void setRemoteSSRC(long remoteSSRC)
remoteSSRC
- remote SSRCpublic void setRTCPFeedbackPLI(boolean useRTCPFeedbackPLI)
useRTCPFeedbackPLI
- true to use PLI; otherwise,
falseprotected void startedDirectionChanged(MediaDirection oldValue, MediaDirection newValue)
startedDirectionChanged
in class MediaDeviceSession
oldValue
- the MediaDirection which used to be the value of
the startedDirection property of this instancenewValue
- the MediaDirection which is the value of the
startedDirection property of this instanceprotected javax.media.Player getLocalPlayer()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.