public class MediaServiceImpl extends org.jitsi.utils.event.PropertyChangeNotifier implements MediaService
| Modifier and Type | Field and Description |
|---|---|
static String |
DISABLE_AUDIO_SUPPORT_PNAME
The name of the boolean ConfigurationService property
which indicates whether the detection of audio CaptureDevices is
to be disabled.
|
static String |
DISABLE_SET_AUDIO_SYSTEM_PNAME
The name of the boolean ConfigurationService property
which indicates whether the method
DeviceConfiguration.setAudioSystem(AudioSystem, boolean) is to be
considered disabled for the user i.e. |
static String |
DISABLE_VIDEO_SUPPORT_PNAME
The name of the boolean ConfigurationService property
which indicates whether the detection of video CaptureDevices is
to be disabled.
|
DEFAULT_DEVICE, ENABLE_FFMPEG_CODECS_PNAME, ENABLE_H264_FORMAT_PNAME| Constructor and Description |
|---|
MediaServiceImpl()
Initializes a new MediaServiceImpl instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addRecorderListener(Recorder.Listener listener)
Those interested in Recorder events add listener through MediaService.
|
EncodingConfiguration |
createEmptyEncodingConfiguration()
Returns a new
EncodingConfiguration instance that can be
used by other bundles. |
MediaStream |
createMediaStream(MediaDevice device)
Create a MediaStream which will use a specific
MediaDevice for capture and playback of media.
|
MediaStream |
createMediaStream(org.jitsi.utils.MediaType mediaType)
Initializes a new MediaStream of a specific MediaType.
|
MediaStream |
createMediaStream(StreamConnector connector,
MediaDevice device)
Creates a new MediaStream instance which will use the specified
MediaDevice for both capture and playback of media exchanged
via the specified StreamConnector.
|
MediaStream |
createMediaStream(StreamConnector connector,
MediaDevice device,
SrtpControl srtpControl)
Creates a new MediaStream instance which will use the specified
MediaDevice for both capture and playback of media exchanged
via the specified StreamConnector.
|
MediaStream |
createMediaStream(StreamConnector connector,
org.jitsi.utils.MediaType mediaType)
Initializes a new MediaStream instance which is to exchange
media of a specific MediaType via a specific
StreamConnector.
|
MediaStream |
createMediaStream(StreamConnector connector,
org.jitsi.utils.MediaType mediaType,
SrtpControl srtpControl)
Initializes a new MediaStream instance which is to exchange
media of a specific MediaType via a specific
StreamConnector.
|
MediaDevice |
createMixer(MediaDevice device)
Creates a new MediaDevice which uses a specific
MediaDevice to capture and play back media and performs mixing
of the captured media and the media played back by any other users of the
returned MediaDevice.
|
Recorder |
createRecorder(MediaDevice device)
Creates a new Recorder instance that can be used to record a
call which captures and plays back media using a specific
MediaDevice.
|
Recorder |
createRecorder(RTPTranslator translator)
Creates a new Recorder instance that can be used to record media
from a specific RTPTranslator.
|
RecorderEventHandler |
createRecorderEventHandlerJson(String filename)
Creates a RecorderEventHandler instance that saves received
events in JSON format.
|
RTPTranslator |
createRTPTranslator()
Initializes a new RTPTranslator which is to forward RTP and RTCP
traffic between multiple MediaStreams.
|
SrtpControl |
createSrtpControl(SrtpControlType srtpControlType)
Initializes a new SrtpControl instance with a specific
SrtpControlType.
|
List<ScreenDevice> |
getAvailableScreenDevices()
Get available screens.
|
EncodingConfiguration |
getCurrentEncodingConfiguration()
Returns the current encoding configuration -- the instance that contains
the global settings.
|
MediaDevice |
getDefaultDevice(org.jitsi.utils.MediaType mediaType,
MediaUseCase useCase)
Gets the default MediaDevice for the specified
MediaType.
|
ScreenDevice |
getDefaultScreenDevice()
Get default screen device.
|
DeviceConfiguration |
getDeviceConfiguration()
Gets the CaptureDevice user choices such as the default audio
and video capture devices.
|
List<MediaDevice> |
getDevices(org.jitsi.utils.MediaType mediaType,
MediaUseCase useCase)
Gets a list of the MediaDevices known to this
MediaService and handling the specified MediaType.
|
Map<MediaFormat,Byte> |
getDynamicPayloadTypePreferences()
Returns a
Map that binds indicates whatever preferences this
media service implementation may have for the RTP payload type numbers
that get dynamically assigned to MediaFormats with no static
payload type. |
MediaFormatFactory |
getFormatFactory()
Gets the MediaFormatFactory through which MediaFormat
instances may be created for the purposes of working with the
MediaStreams created by this MediaService.
|
VolumeControl |
getInputVolumeControl()
Gets the VolumeControl which controls the volume level of audio
input/capture.
|
MediaDevice |
getMediaDeviceForPartialDesktopStreaming(int width,
int height,
int x,
int y)
Get a MediaDevice for a part of desktop streaming/sharing.
|
Point |
getOriginForDesktopStreamingDevice(MediaDevice mediaDevice)
Gets the origin of a specific desktop streaming device.
|
VolumeControl |
getOutputVolumeControl()
Gets the VolumeControl which controls the volume level of audio
output/playback.
|
Iterator<Recorder.Listener> |
getRecorderListeners()
Gives access to currently registered Recorder.Listeners.
|
String |
getRtpCname()
Returns the value which will be used for the canonical end-point
identifier (CNAME) in RTCP packets sent by this running instance of
libjitsi.
|
ScreenDevice |
getScreenForPoint(Point p)
Find the screen device that contains specified point.
|
Object |
getVideoPreviewComponent(MediaDevice device,
int preferredWidth,
int preferredHeight)
Creates a preview component for the specified device(video device) used
to show video preview from that device.
|
static boolean |
isJmfRegistryDisableLoad()
Gets the indicator which determines whether the loading of the JMF/FMJ
Registry has been disabled.
|
static boolean |
isMediaTypeSupportEnabled(org.jitsi.utils.MediaType mediaType)
Determines whether the support for a specific MediaType is
enabled.
|
boolean |
isPartialStreaming(MediaDevice mediaDevice)
If the MediaDevice corresponds to partial desktop streaming
device.
|
void |
removeRecorderListener(Recorder.Listener listener)
Removes an existing Recorder.Listener from the list of listeners
interested in notifications from Recorders.
|
addPropertyChangeListener, firePropertyChange, getPropertyChangeSource, removePropertyChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddPropertyChangeListener, removePropertyChangeListenerpublic static final String DISABLE_AUDIO_SUPPORT_PNAME
public static final String DISABLE_SET_AUDIO_SYSTEM_PNAME
DeviceConfiguration.setAudioSystem(AudioSystem, boolean) is to be
considered disabled for the user i.e. the user is not presented with user
interface which allows selecting a particular AudioSystem.public static final String DISABLE_VIDEO_SUPPORT_PNAME
public MediaServiceImpl()
public MediaStream createMediaStream(MediaDevice device)
createMediaStream in interface MediaServicedevice - the MediaDevice to be used by the new instance for
capture and playback of mediaMediaService.createMediaStream(MediaDevice)public MediaStream createMediaStream(org.jitsi.utils.MediaType mediaType)
MediaDevice.getMediaType() equals
mediaType.
Implements MediaService.createMediaStream(MediaType). Initializes
a new AudioMediaStreamImpl or VideoMediaStreamImpl in
accord with mediaTypecreateMediaStream in interface MediaServicemediaType - the MediaType of the new instance to be
initializedpublic MediaStream createMediaStream(StreamConnector connector, MediaDevice device)
createMediaStream in interface MediaServiceconnector - the StreamConnector that the new
MediaStream instance is to use for sending and receiving mediadevice - the MediaDevice that the new MediaStream
instance is to use for both capture and playback of media exchanged via
the specified connectorMediaService.createMediaStream(StreamConnector, MediaDevice)public MediaStream createMediaStream(StreamConnector connector, org.jitsi.utils.MediaType mediaType)
createMediaStream in interface MediaServiceconnector - the StreamConnector the stream should use for
sending and receiving media or null if the stream is to not have
a StreamConnector configured at initialization time and a
StreamConnector is to be specified later onmediaType - the MediaType of the media to be exchanged by
the new instance via the specified connectorpublic MediaStream createMediaStream(StreamConnector connector, MediaDevice device, SrtpControl srtpControl)
createMediaStream in interface MediaServiceconnector - the StreamConnector that the new
MediaStream instance is to use for sending and receiving mediadevice - the MediaDevice that the new MediaStream
instance is to use for both capture and playback of media exchanged via
the specified connectorsrtpControl - a control which is already created, used to control
the SRTP operations.MediaService.createMediaStream(StreamConnector, MediaDevice)public MediaStream createMediaStream(StreamConnector connector, org.jitsi.utils.MediaType mediaType, SrtpControl srtpControl)
createMediaStream in interface MediaServiceconnector - the StreamConnector the stream should use for
sending and receiving media or null if the stream is to not have
a StreamConnector configured at initialization time and a
StreamConnector is to be specified later onmediaType - the MediaType of the media to be exchanged by
the new instance via the specified connectorsrtpControl - the SrtpControl to control the security of
the media exchangepublic MediaDevice createMixer(MediaDevice device)
createMixer in interface MediaServicedevice - the MediaDevice which is to be used by the
returned MediaDevice to actually capture and play back mediaMediaService.createMixer(MediaDevice)public MediaDevice getDefaultDevice(org.jitsi.utils.MediaType mediaType, MediaUseCase useCase)
getDefaultDevice in interface MediaServicemediaType - a MediaType value indicating the type of media
to be handled by the MediaDevice to be obtaineduseCase - the MediaUseCase to obtain the
MediaDevice list forMediaService.getDefaultDevice(MediaType, MediaUseCase)public DeviceConfiguration getDeviceConfiguration()
public List<MediaDevice> getDevices(org.jitsi.utils.MediaType mediaType, MediaUseCase useCase)
getDevices in interface MediaServicemediaType - the MediaType to obtain the
MediaDevice list foruseCase - the MediaUseCase to obtain the
MediaDevice list forMediaService.getDevices(MediaType, MediaUseCase)public EncodingConfiguration getCurrentEncodingConfiguration()
getCurrentEncodingConfiguration in interface MediaServicepublic MediaFormatFactory getFormatFactory()
getFormatFactory in interface MediaServiceMediaService.getFormatFactory()public SrtpControl createSrtpControl(SrtpControlType srtpControlType)
createSrtpControl in interface MediaServicesrtpControlType - the SrtpControlType of the new instancepublic VolumeControl getOutputVolumeControl()
getOutputVolumeControl in interface MediaServiceMediaService.getOutputVolumeControl()public VolumeControl getInputVolumeControl()
getInputVolumeControl in interface MediaServiceMediaService.getInputVolumeControl()public List<ScreenDevice> getAvailableScreenDevices()
getAvailableScreenDevices in interface MediaServicepublic ScreenDevice getDefaultScreenDevice()
getDefaultScreenDevice in interface MediaServicepublic Recorder createRecorder(MediaDevice device)
createRecorder in interface MediaServicedevice - the MediaDevice which is used for media capture
and playback by the call to be recordedMediaService.createRecorder(MediaDevice)public Recorder createRecorder(RTPTranslator translator)
createRecorder in interface MediaServicetranslator - the RTPTranslator for which to create a
Recorderpublic Map<MediaFormat,Byte> getDynamicPayloadTypePreferences()
Map that binds indicates whatever preferences this
media service implementation may have for the RTP payload type numbers
that get dynamically assigned to MediaFormats with no static
payload type. The method is useful for formats such as "telephone-event"
for example that is statically assigned the 101 payload type by some
legacy systems. Signaling protocol implementations such as SIP and XMPP
should make sure that, whenever this is possible, they assign to formats
the dynamic payload type returned in this Map.getDynamicPayloadTypePreferences in interface MediaServiceMap binding some formats to a preferred dynamic RTP
payload type number.public Object getVideoPreviewComponent(MediaDevice device, int preferredWidth, int preferredHeight)
getVideoPreviewComponent in interface MediaServicedevice - the video devicepreferredWidth - the width we prefer for the componentpreferredHeight - the height we prefer for the componentpublic MediaDevice getMediaDeviceForPartialDesktopStreaming(int width, int height, int x, int y)
getMediaDeviceForPartialDesktopStreaming in interface MediaServicewidth - width of the partheight - height of the partx - origin of the x coordinate (relative to the full desktop)y - origin of the y coordinate (relative to the full desktop)public boolean isPartialStreaming(MediaDevice mediaDevice)
isPartialStreaming in interface MediaServicemediaDevice - MediaDevicepublic ScreenDevice getScreenForPoint(Point p)
p - point coordinatespublic Point getOriginForDesktopStreamingDevice(MediaDevice mediaDevice)
getOriginForDesktopStreamingDevice in interface MediaServicemediaDevice - the desktop streaming device to get the origin onpublic void addRecorderListener(Recorder.Listener listener)
addRecorderListener in interface MediaServicelistener - the new Recorder.Listener to be added to the
list of listeners interested in notifications from Recorders.public void removeRecorderListener(Recorder.Listener listener)
removeRecorderListener in interface MediaServicelistener - the existing Listener to be removed from the
list of listeners interested in notifications from Recorderspublic Iterator<Recorder.Listener> getRecorderListeners()
getRecorderListeners in interface MediaServicepublic RTPTranslator createRTPTranslator()
createRTPTranslator in interface MediaServiceMediaService.createRTPTranslator()public static boolean isJmfRegistryDisableLoad()
public EncodingConfiguration createEmptyEncodingConfiguration()
EncodingConfiguration instance that can be
used by other bundles.createEmptyEncodingConfiguration in interface MediaServiceEncodingConfiguration instance.public static boolean isMediaTypeSupportEnabled(org.jitsi.utils.MediaType mediaType)
DISABLE_AUDIO_SUPPORT_PNAME and
DISABLE_VIDEO_SUPPORT_PNAME allow disabling the support for,
respectively, MediaType.AUDIO and MediaType.VIDEO.mediaType - the MediaType to be determined whether the
support for it is enabledpublic String getRtpCname()
getRtpCname in interface MediaServicepublic RecorderEventHandler createRecorderEventHandlerJson(String filename) throws IOException
createRecorderEventHandlerJson in interface MediaServicefilename - the filename into which the created
RecorderEventHandler will save received events.IOException - if a RecorderEventHandler could not be
created for filename.Copyright © 2022 jitsi.org. All rights reserved.