public class VideoMediaStreamImpl extends MediaStreamImpl implements VideoMediaStream
PROPERTY_NAME_RECEIVE_BUFFER_LENGTH, sendStreamsAreCreated
rtpTranslator
REQUEST_RETRANSMISSIONS_PNAME
PNAME_LOCAL_SSRC, PNAME_REMOTE_SSRC
Constructor and Description |
---|
VideoMediaStreamImpl(StreamConnector connector,
MediaDevice device,
SrtpControl srtpControl)
Initializes a new VideoMediaStreamImpl instance which will use
the specified MediaDevice for both capture and playback of video
exchanged via the specified StreamConnector.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addRemoteSourceID(long ssrc)
Set remote SSRC.
|
void |
addVideoListener(VideoListener listener)
Adds a specific VideoListener to this VideoMediaStream
in order to receive notifications when visual/video Components
are being added and removed.
|
void |
close()
Releases the resources allocated by this instance in the course of its
execution and prepares it to be garbage collected.
|
protected void |
configureDataOutputStream(RTPConnectorOutputStream dataOutputStream)
Performs any optional configuration on a specific
RTPConnectorOuputStream of an RTPManager to be used by
this MediaStreamImpl.
|
protected void |
configureRTPManagerBufferControl(StreamRTPManager rtpManager,
javax.media.control.BufferControl bufferControl)
Performs any optional configuration on the BufferControl of the
specified RTPManager which is to be used as the
RTPManager of this MediaStreamImpl.
|
protected CachingTransformer |
createCachingTransformer()
Creates the
CachingTransformer for this MediaStream . |
protected RetransmissionRequesterImpl |
createRetransmissionRequester()
Creates the
RetransmissionRequesterImpl for this
MediaStream . |
protected void |
deviceSessionChanged(MediaDeviceSession oldValue,
MediaDeviceSession newValue)
Notifies this MediaStream that the MediaDevice (and
respectively the MediaDeviceSession with it) which this instance
uses for capture and playback of media has been changed.
|
protected boolean |
fireVideoEvent(int type,
java.awt.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.
|
protected void |
fireVideoEvent(VideoEvent event,
boolean wait)
Notifies the VideoListeners registered with this instance about
a specific VideoEvent.
|
protected TransformEngineWrapper<FECTransformEngine> |
getFecTransformEngine()
Creates the FECTransformEngine for this MediaStream.
|
KeyFrameControl |
getKeyFrameControl()
Implements
VideoMediaStream.getKeyFrameControl() . |
java.awt.Component |
getLocalVisualComponent()
Gets the visual Component, if any, depicting the video streamed
from the local peer to the remote peer.
|
MediaStreamTrackReceiver |
getMediaStreamTrackReceiver()
Gets the
MediaStreamTrackReceiver of this MediaStream . |
BandwidthEstimator |
getOrCreateBandwidthEstimator()
Creates an instance of
BandwidthEstimator for this
MediaStream if one doesn't already exist. |
protected PaddingTermination |
getPaddingTermination()
Gets the
PaddingTermination for this MediaStreamImpl . |
protected int |
getPriority()
The priority of the video is 5, which is meant to be higher than
other threads and lower than the audio one.
|
QualityControl |
getQualityControl()
Gets the QualityControl of this VideoMediaStream.
|
RemoteBitrateEstimatorWrapper |
getRemoteBitrateEstimator()
Gets the RemoteBitrateEstimator of this
VideoMediaStream.
|
protected TransformEngine |
getRTCPTermination()
Gets the RTCP termination for this
MediaStreamImpl . |
RtxTransformer |
getRtxTransformer()
Gets the
RtxTransformer , if any, used by the MediaStream . |
java.awt.Component |
getVisualComponent()
Deprecated.
|
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 a list of the visual Components where video from the remote
peer is being rendered.
|
protected void |
handleAttributes(MediaFormat format,
java.util.Map<java.lang.String,java.lang.String> attrs)
Handles attributes contained in MediaFormat.
|
void |
movePartialDesktopStreaming(int x,
int y)
Move origin of a partial desktop streaming MediaDevice.
|
static java.awt.Dimension[] |
parseSendRecvResolution(java.lang.String imgattr)
Extracts and returns maximum resolution can receive from the image
attribute.
|
void |
removeVideoListener(VideoListener listener)
Removes a specific VideoListener from this
VideoMediaStream in order to have to no longer receive
notifications when visual/video Components are being added and
removed.
|
protected void |
rtpConnectorChanged(AbstractRTPConnector oldValue,
AbstractRTPConnector newValue)
Notifies this MediaStream implementation that its
RTPConnector instance has changed from a specific old value to a
specific new value.
|
static java.awt.Dimension |
selectVideoSize(javax.media.protocol.DataSource videoDS,
int preferredWidth,
int preferredHeight)
Selects the VideoFormat from the list of supported formats of a
specific video DataSource which has a size as close as possible
to a specific size and sets it as the format of the specified video
DataSource.
|
protected void |
setFecTransformEngine(FECTransformEngine fecTransformEngine)
Sets the
FECTransformEngine for this MediaStream
By default, nothing is done with the passed engine, allowing extenders
to implement it |
protected void |
setLocalSourceID(long localSourceID)
Sets the local SSRC identifier and fires the corresponding
PropertyChangeEvent.
|
void |
setSupportsFir(boolean supportsFir)
Sets the value of the flag which indicates whether the remote end
supports RTCP FIR or not.
|
void |
setSupportsPli(boolean supportsPli)
Sets the value of the flag which indicates whether the remote end
supports RTCP PLI or not.
|
void |
setSupportsRemb(boolean supportsRemb)
Sets the value of the flag which indicates whether the remote end
supports RTCP REMB or not.
|
boolean |
supportsFir() |
boolean |
supportsPli() |
void |
updateQualityControl(java.util.Map<java.lang.String,java.lang.String> advancedParams)
Updates the QualityControl of this VideoMediaStream.
|
addDynamicRTPPayloadType, addDynamicRTPPayloadTypeOverride, addRTPExtension, clearDynamicRTPPayloadTypes, clearRTPExtensions, configureDataInputStream, createAbsSendTimeEngine, createDiscardEngine, createDtmfTransformEngine, createSendStreams, createSsrcTransformEngine, getActiveRTPExtensionID, getActiveRTPExtensions, getCachingTransformer, getCsrcEngine, getDevice, getDeviceSession, getDiagnosticContext, getDirection, getDynamicRTPPayloadType, getDynamicRTPPayloadTypes, getFormat, getFormat, getLocalContributingSourceIDs, getLocalControlAddress, getLocalDataAddress, getLocalSourceID, getMediaStreamStats, getMediaType, getPrimaryREDBlock, getPrimaryREDBlock, getReceiveStream, getReceiveStreams, getRedTransformEngine, getRemoteContributingSourceIDs, getRemoteControlAddress, getRemoteDataAddress, getRemoteSourceID, getRemoteSourceIDs, getRetransmissionRequester, getRTPConnector, getRTPManager, getSpatialID, getSrtpControl, getStatisticsEngine, getStreamRTPManager, getTarget, getTemporalID, getTransformEngineChain, getTransportCCEngine, getTransportProtocol, injectPacket, isEndOfFrame, isKeyFrame, isKeyFrame, isMute, isStarted, isStartOfFrame, queryRTPManager, recreateSendStreams, registerCustomCodecFormats, removeReceiveStreamForSsrc, setConnector, setDevice, setDirection, setExternalTransformer, setFormat, setMute, setSSRCFactory, setTarget, setTransportCCEngine, start, stop, supportsFrameBoundaries, toString, update, update, update, update
addPropertyChangeListener, assertDirection, firePropertyChange, getName, getProperty, getRTPTranslator, injectPacket, removePropertyChangeListener, setName, setProperty, setRTPTranslator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addDynamicRTPPayloadType, addDynamicRTPPayloadTypeOverride, addPropertyChangeListener, addRTPExtension, clearDynamicRTPPayloadTypes, clearRTPExtensions, getActiveRTPExtensions, getDevice, getDirection, getDynamicRTPPayloadType, getDynamicRTPPayloadTypes, getFormat, getFormat, getLocalSourceID, getMediaStreamStats, getName, getPrimaryREDBlock, getPrimaryREDBlock, getProperty, getRemoteControlAddress, getRemoteDataAddress, getRemoteSourceID, getRemoteSourceIDs, getRetransmissionRequester, getRTPTranslator, getSrtpControl, getStreamRTPManager, getTarget, getTransformEngineChain, getTransportProtocol, injectPacket, isKeyFrame, isKeyFrame, isMute, isStarted, removePropertyChangeListener, removeReceiveStreamForSsrc, setConnector, setDevice, setDirection, setExternalTransformer, setFormat, setMute, setName, setProperty, setRTPTranslator, setSSRCFactory, setTarget, setTransportCCEngine, start, stop
public VideoMediaStreamImpl(StreamConnector connector, MediaDevice device, SrtpControl srtpControl)
connector
- the StreamConnector the new instance is to use
for sending and receiving videodevice
- the MediaDevice the new instance is to use for
both capture and playback of video exchanged via the specified
StreamConnectorsrtpControl
- a control which is already created, used to control
the srtp operations.public static java.awt.Dimension[] parseSendRecvResolution(java.lang.String imgattr)
imgattr
- send/recv resolution stringpublic static java.awt.Dimension selectVideoSize(javax.media.protocol.DataSource videoDS, int preferredWidth, int preferredHeight)
videoDS
- the video DataSource which is to have its
supported formats examined and its format changed to the
VideoFormat which is as close as possible to the specified
preferredWidth and preferredHeightpreferredWidth
- the width of the VideoFormat to be
selectedpreferredHeight
- the height of the VideoFormat to be
selectedpublic RtxTransformer getRtxTransformer()
RtxTransformer
, if any, used by the MediaStream
.getRtxTransformer
in class MediaStreamImpl
RtxTransformer
used by the MediaStream
or
null
protected TransformEngineWrapper<FECTransformEngine> getFecTransformEngine()
getFecTransformEngine
in class MediaStreamImpl
FECTransformEngine
in timeprotected void setFecTransformEngine(FECTransformEngine fecTransformEngine)
FECTransformEngine
for this MediaStream
By default, nothing is done with the passed engine, allowing extenders
to implement itsetFecTransformEngine
in class MediaStreamImpl
fecTransformEngine
- public void setSupportsFir(boolean supportsFir)
supportsFir
- the value to set.public void setSupportsPli(boolean supportsPli)
supportsPli
- the value to set.public void setSupportsRemb(boolean supportsRemb)
supportsRemb
- the value to set.public boolean supportsFir()
true
iff the remote end supports RTCP FIR.public boolean supportsPli()
true
iff the remote end supports RTCP PLI.protected void addRemoteSourceID(long ssrc)
addRemoteSourceID
in class MediaStreamImpl
ssrc
- remote SSRCpublic 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.
addVideoListener
in interface VideoMediaStream
listener
- the VideoListener to be notified when
visual/video Components are being added or removed in this
VideoMediaStreampublic void close()
close
in interface MediaStream
close
in class MediaStreamImpl
MediaStream.close()
protected void configureDataOutputStream(RTPConnectorOutputStream dataOutputStream)
configureDataOutputStream
in class MediaStreamImpl
dataOutputStream
- the RTPConnectorOutputStream to be used
by an RTPManager of this MediaStreamImpl and to be
configuredprotected void configureRTPManagerBufferControl(StreamRTPManager rtpManager, javax.media.control.BufferControl bufferControl)
configureRTPManagerBufferControl
in class MediaStreamImpl
rtpManager
- the RTPManager which is to be used by this
MediaStreamImplbufferControl
- the BufferControl of rtpManager on
which any optional configuration is to be performedpublic MediaStreamTrackReceiver getMediaStreamTrackReceiver()
MediaStreamTrackReceiver
of this MediaStream
.getMediaStreamTrackReceiver
in interface MediaStream
getMediaStreamTrackReceiver
in class AbstractMediaStream
MediaStreamTrackReceiver
of this MediaStream
,
or null.protected void deviceSessionChanged(MediaDeviceSession oldValue, MediaDeviceSession newValue)
deviceSessionChanged
in class MediaStreamImpl
oldValue
- the MediaDeviceSession with the
MediaDevice this instance used work withnewValue
- the MediaDeviceSession with the
MediaDevice this instance is to work withMediaStreamImpl.deviceSessionChanged(MediaDeviceSession,
MediaDeviceSession)
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 VideoMediaStreamorigin
- 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 event, boolean wait)
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, falsepublic KeyFrameControl getKeyFrameControl()
VideoMediaStream.getKeyFrameControl()
.
Gets the KeyFrameControl of this VideoMediaStream.getKeyFrameControl
in interface VideoMediaStream
VideoMediaStream.getKeyFrameControl()
public java.awt.Component getLocalVisualComponent()
getLocalVisualComponent
in interface VideoMediaStream
protected int getPriority()
getPriority
in class MediaStreamImpl
public QualityControl getQualityControl()
getQualityControl
in interface VideoMediaStream
public RemoteBitrateEstimatorWrapper getRemoteBitrateEstimator()
getRemoteBitrateEstimator
in class MediaStreamImpl
@Deprecated public java.awt.Component getVisualComponent()
getVisualComponent
in interface VideoMediaStream
VideoMediaStream.getVisualComponent()
public java.awt.Component getVisualComponent(long ssrc)
getVisualComponent
in interface VideoMediaStream
ssrc
- the src-id of the receive stream, which visual
Component we're looking forpublic java.util.List<java.awt.Component> getVisualComponents()
getVisualComponents
in interface VideoMediaStream
VideoMediaStream.getVisualComponents()
protected void handleAttributes(MediaFormat format, java.util.Map<java.lang.String,java.lang.String> attrs)
handleAttributes
in class AbstractMediaStream
format
- the MediaFormat to handle the attributes ofattrs
- the attributes Map to handlepublic void movePartialDesktopStreaming(int x, int y)
movePartialDesktopStreaming
in interface VideoMediaStream
x
- new x coordinate originy
- new y coordinate originpublic void removeVideoListener(VideoListener listener)
removeVideoListener
in interface VideoMediaStream
listener
- the VideoListener to no longer be notified when
visual/video Components are being added or removed in this
VideoMediaStreamprotected void rtpConnectorChanged(AbstractRTPConnector oldValue, AbstractRTPConnector newValue)
rtpConnectorChanged
in class MediaStreamImpl
oldValue
- the RTPConnector of this MediaStream
implementation before it got changed to newValuenewValue
- the current RTPConnector of this
MediaStream which replaced oldValueMediaStreamImpl.rtpConnectorChanged(AbstractRTPConnector,
AbstractRTPConnector)
protected void setLocalSourceID(long localSourceID)
setLocalSourceID
in class MediaStreamImpl
localSourceID
- the SSRC identifier that this stream will be using
in outgoing RTP packets from now onpublic void updateQualityControl(java.util.Map<java.lang.String,java.lang.String> advancedParams)
updateQualityControl
in interface VideoMediaStream
advancedParams
- parameters of advanced attributes that may affect
quality controlprotected CachingTransformer createCachingTransformer()
CachingTransformer
for this MediaStream
.createCachingTransformer
in class MediaStreamImpl
CachingTransformer
.protected RetransmissionRequesterImpl createRetransmissionRequester()
RetransmissionRequesterImpl
for this
MediaStream
.createRetransmissionRequester
in class MediaStreamImpl
RetransmissionRequesterImpl
.protected TransformEngine getRTCPTermination()
MediaStreamImpl
.getRTCPTermination
in class MediaStreamImpl
protected PaddingTermination getPaddingTermination()
PaddingTermination
for this MediaStreamImpl
.getPaddingTermination
in class MediaStreamImpl
public BandwidthEstimator getOrCreateBandwidthEstimator()
BandwidthEstimator
for this
MediaStream
if one doesn't already exist. Returns the instance.getOrCreateBandwidthEstimator
in interface VideoMediaStream
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.