Class MediaSource

    Definition

    Namespace:
    Tizen.Multimedia.Remoting
    Assembly:
    Tizen.Multimedia.Remoting.dll

    MediaSource is a base class for WebRTC sources.

    public abstract class MediaSource
    Inheritance
    object
    MediaSource
    Derived
    MediaCameraSource
    MediaCameraSource
    MediaFileSource
    MediaFileSource
    MediaMicrophoneSource
    MediaMicrophoneSource
    MediaNullSource
    MediaNullSource
    MediaPacketSource
    MediaPacketSource
    MediaScreenSource
    MediaScreenSource
    MediaTestSource
    MediaTestSource

    Constructors

    View Source

    MediaSource()

    Initializes a new instance of the MediaSource class.

    Declaration
    protected MediaSource()
    View Source

    MediaSource(MediaType)

    Initializes a new instance of the MediaSource class.

    Declaration
    protected MediaSource(MediaType mediaType)
    Parameters
    Type Name Description
    MediaType mediaType

    Properties

    View Source

    EncoderBitrate

    Gets or sets the encoder bitrate of the current media source.

    Declaration
    public int EncoderBitrate { get; set; }
    Property Value
    Type Description
    int

    A value that specifies the encoder bitrate.

    Remarks

    This API is not supported in MediaFileSource, MediaPacketSource.

    Exceptions
    Type Condition
    System.ArgumentException

    EncoderBitrate is less than or equal to zero.

    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not Video. -or-
    This MediaSource is not supported type of MediaSource.

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    View Source

    MediaType

    Gets the type of MediaSource.

    Declaration
    protected MediaType MediaType { get; }
    Property Value
    Type Description
    MediaType

    MediaType

    View Source

    Mute

    Gets or sets the mute status of the current media source.

    Declaration
    public bool Mute { get; set; }
    Property Value
    Type Description
    bool

    A value that specifies the mute status.

    Remarks

    This API is not supported in MediaFileSource, MediaPacketSource, MediaNullSource. (Since API level 10)

    Exceptions
    Type Condition
    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not supported type of MediaSource. (Since API level 10)

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    View Source

    Pause

    Gets or sets the pause status of current media source.

    Declaration
    public bool Pause { get; set; }
    Property Value
    Type Description
    bool

    A value that specifies the pause status.

    Exceptions
    Type Condition
    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not supported type of MediaSource. (Since API level 10)

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    See Also
    GetPause(MediaType)
    SetPause(MediaType, bool)
    View Source

    SupportedTransceiverCodecs

    Retrieves the supported transceiver codecs.

    Declaration
    public ReadOnlyCollection<TransceiverCodec> SupportedTransceiverCodecs { get; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ReadOnlyCollection<T><TransceiverCodec>

    The transceiver codecs.

    Remarks

    This API is not supported in MediaFileSource, MediaPacketSource.
    If user want to get supported codecs for each audio or video in MediaNullSource, please use GetSupportedTransceiverCodecs(MediaType) instead.

    Exceptions
    Type Condition
    System.InvalidOperationException

    This MediaSource is not supported type of MediaSource.

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    See Also
    GetSupportedTransceiverCodecs(MediaType)
    View Source

    TransceiverCodec

    Gets or sets the transceiver codec of current media source.

    Declaration
    public TransceiverCodec TransceiverCodec { get; set; }
    Property Value
    Type Description
    TransceiverCodec

    The transceiver codec.

    Remarks

    This API is not supported in MediaFileSource, MediaPacketSource.
    If MediaNullSource, please use GetTransceiverCodec(MediaType) or SetTransceiverCodec(MediaType, TransceiverCodec) instead.
    The WebRTC must be in the Idle state when transceiver codec is set.

    Exceptions
    Type Condition
    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not supported type of MediaSource.
    -or-
    The WebRTC is not in the valid state.

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    See Also
    GetTransceiverCodec(MediaType)
    SetTransceiverCodec(MediaType, TransceiverCodec)
    View Source

    TransceiverDirection

    Gets or sets the transceiver direction of current media source.

    Declaration
    public TransceiverDirection TransceiverDirection { get; set; }
    Property Value
    Type Description
    TransceiverDirection

    A TransceiverDirection that specifies the transceiver direction.

    Remarks

    The default value is SendRecv except MediaNullSource.
    If user want to set each audio, video direction in MediaFileSource, please use SetTransceiverDirection(MediaType, TransceiverDirection). (Since API level 10)
    In MediaNullSource, only RecvOnly can be set.(Since API level 10)

    Exceptions
    Type Condition
    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    SendOnly or SendRecv is set for MediaNullSource. (Since API level 10)

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    See Also
    GetTransceiverDirection(MediaType)
    SetTransceiverDirection(MediaType, TransceiverDirection)
    View Source

    VideoFrameRate

    Gets or sets the video frame rate of the current media source.

    Declaration
    public int VideoFrameRate { get; set; }
    Property Value
    Type Description
    int

    A value that specifies the video frame rate.

    Remarks

    This API is only supported in video media source, especially MediaCameraSource, MediaScreenSource, MediaTestSource.

    Exceptions
    Type Condition
    System.ArgumentException

    VideoFrameRate is less than or equal to zero.

    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not Video. -or-
    This MediaSource is not supported type of MediaSource.

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    View Source

    VideoResolution

    Gets or sets the video resolution of the current media source.

    Declaration
    public Size VideoResolution { get; set; }
    Property Value
    Type Description
    Size

    A value that specifies the video resolution.

    Exceptions
    Type Condition
    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not Video. -or-
    This MediaSource is not supported type of MediaSource.

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    Methods

    View Source

    EnableAudioLoopback(AudioStreamPolicy)

    Enables the audio loopback. The local audio will be played with policy.

    Declaration
    public MediaStreamTrack EnableAudioLoopback(AudioStreamPolicy policy)
    Parameters
    Type Name Description
    AudioStreamPolicy policy

    The AudioStreamPolicy to apply.

    Returns
    Type Description
    MediaStreamTrack

    MediaStreamTrack

    Remarks

    MediaSource does not support all AudioStreamType.
    Supported types are Media, Voip, MediaExternalOnly.

    Exceptions
    Type Condition
    System.ArgumentNullException

    policy is null.

    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not Audio

    System.NotSupportedException

    AudioStreamType of policy is not supported on the current platform.

    System.ObjectDisposedException

    policy or WebRTC has already been disposed.

    View Source

    EnableVideoLoopback(Display)

    Enables the video loopback. The local video will be diaplayed in display.

    Declaration
    public MediaStreamTrack EnableVideoLoopback(Display display)
    Parameters
    Type Name Description
    Display display

    The Display to apply.

    Returns
    Type Description
    MediaStreamTrack

    MediaStreamTrack

    Exceptions
    Type Condition
    System.NotSupportedException

    The required feature is not supported.

    System.ArgumentException

    The display has already been assigned to another.

    System.ArgumentNullException

    display is null.

    System.InvalidOperationException

    MediaSource is not attached yet.
    -or-
    This MediaSource is not Video

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    View Source

    GetPayloadType(TransceiverCodec)

    Gets the RTP payload type of given codec.

    Declaration
    public uint GetPayloadType(TransceiverCodec codec)
    Parameters
    Type Name Description
    TransceiverCodec codec

    The transceiver codec.

    Returns
    Type Description
    uint

    The RTP payload type.

    Exceptions
    Type Condition
    System.InvalidOperationException

    MediaSource is not attached yet.

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    See Also
    SupportedTransceiverCodecs
    View Source

    SetPayloadType(TransceiverCodec, uint)

    Sets the RTP payload type of given codec.

    Declaration
    public void SetPayloadType(TransceiverCodec codec, uint payloadType)
    Parameters
    Type Name Description
    TransceiverCodec codec

    The transceiver codec.

    uint payloadType

    The RTP payload type.

    Remarks

    payloadType should be greater than or equal to 96 and less than or equal to 127.

    Exceptions
    Type Condition
    System.InvalidOperationException

    MediaSource is not attached yet.

    System.ObjectDisposedException

    The WebRTC has already been disposed.

    System.ArgumentOutOfRangeException

    payloadType is less than 96 or greater than 127.

    See Also
    SupportedTransceiverCodecs
    • View Source
    Back to top Copyright © 2016-2024 Samsung
    Generated by DocFX