Class ScreenMirroring

Definition

Namespace:
Tizen.Multimedia.Remoting
Assembly:
Tizen.Multimedia.Remoting.dll
API Level:
4

Provides the ability to connect to and disconnect from a screen mirroring source, start, pause, and resume the screen mirroring as a sink.

C#
Copy
public class ScreenMirroring : IDisposable
Inheritance
System.Object
ScreenMirroring
Implements
System.IDisposable

Constructors

View Source

ScreenMirroring()

Initializes a new instance of the ScreenMirroring class.

Declaration
C#
Copy
public ScreenMirroring()
Exceptions
Type Condition
System.NotSupportedException

The feature is not supported.

API Level: 4
Feature: http://tizen.org/feature/network.wifi.direct.display

Properties

View Source

AudioInfo

Gets the negotiated audio info.

Declaration
C#
Copy
public ScreenMirroringAudioInfo AudioInfo { get; }
Property Value
Type Description
ScreenMirroringAudioInfo
API Level: 4
View Source

VideoInfo

Gets the negotiated video info.

Declaration
C#
Copy
public ScreenMirroringVideoInfo VideoInfo { get; }
Property Value
Type Description
ScreenMirroringVideoInfo
API Level: 4

Methods

View Source

ConnectAsync(String)

Creates the connection and ready for receiving data from a mirroring source.

Declaration
C#
Copy
public Task ConnectAsync(string sourceIp)
Parameters
Type Name Description
System.String sourceIp

The source ip address to connect.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Remarks

The state must be Prepared state by Prepare(Display, ScreenMirroringResolutions).
The default port number is 2022.
If you want to connect using different port number, please use ConnectAsync(String, UInt32).

Exceptions
Type Condition
System.ArgumentException

sourceIp is a zero-length string, contains only white space.

System.ArgumentNullException

sourceIp is null.

System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

UnauthorizedAccessException

Caller does not have required permission.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/internet
View Source

ConnectAsync(String, UInt32)

Creates the connection and ready for receiving data from a mirroring source with the given port.

Declaration
C#
Copy
public Task ConnectAsync(string sourceIp, uint port)
Parameters
Type Name Description
System.String sourceIp

The source ip address to connect.

System.UInt32 port

The port number to connect. The max value is 65535.

Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Remarks
Exceptions
Type Condition
System.ArgumentException

sourceIp is a zero-length string, contains only white space.

System.ArgumentNullException

sourceIp is null.

System.ArgumentOutOfRangeException

port is greater than port max value(65535).

System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

UnauthorizedAccessException

Caller does not have required permission.

API Level: 9
Privilege Level: public
Privilege: http://tizen.org/privilege/internet
View Source

Disconnect()

Disconnects from the source.

Declaration
C#
Copy
public void Disconnect()
Remarks

The state must be Connected, Playing or Paused.

Exceptions
Type Condition
System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

UnauthorizedAccessException

Caller does not have required permission.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/internet
View Source

Dispose()

Releases all resource used by the ScreenMirroring object.

Declaration
C#
Copy
public void Dispose()
Remarks

Call Dispose() when you are finished using the ScreenMirroring. The Dispose() method leaves the ScreenMirroring in an unusable state. After calling Dispose(), you must release all references to the ScreenMirroring so the garbage collector can reclaim the memory that the ScreenMirroring was occupying.

API Level: 4
View Source

Dispose(Boolean)

Releases the resources used by the ScreenMirroring.

Declaration
C#
Copy
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

true to release both managed and unmanaged resources; false to release only unmanaged resources.

API Level: 4
View Source

Finalize()

Finalizes an instance of the ScreenMirroring class.

Declaration
C#
Copy
protected void Finalize()
View Source

PauseAsync()

Pauses mirroring from the source.

Declaration
C#
Copy
public Task PauseAsync()
Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Remarks

The state must be Playing state by StartAsync().

Exceptions
Type Condition
System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

UnauthorizedAccessException

Caller does not have required permission.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/internet
View Source

Prepare(Display)

Prepares the screen mirroring with the specified display.

Declaration
C#
Copy
public void Prepare(Display display)
Parameters
Type Name Description
Display display

The display where the mirroring will be played on.

Remarks

The state must be Idle.

All supported resolutions will be candidates.

Exceptions
Type Condition
System.ArgumentException

display has already been assigned to another.

System.ArgumentNullException

display is null.

System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

API Level: 4
View Source

Prepare(Display, ScreenMirroringResolutions)

Prepares the screen mirroring with the specified display and resolutions.

Declaration
C#
Copy
public void Prepare(Display display, ScreenMirroringResolutions resolutions)
Parameters
Type Name Description
Display display

The display where the mirroring will be played on.

ScreenMirroringResolutions resolutions

The desired resolutions.

Remarks

The state must be Idle.

Exceptions
Type Condition
System.ArgumentException

resolutions contain invalid flags.
-or-
display has already been assigned to another.

System.ArgumentNullException

display is null.

System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

API Level: 4
View Source

ResumeAsync()

Resumes mirroring from the source.

Declaration
C#
Copy
public Task ResumeAsync()
Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Remarks

The state must be Paused state by PauseAsync().

Exceptions
Type Condition
System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

UnauthorizedAccessException

Caller does not have required permission.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/internet
View Source

StartAsync()

Starts mirroring from the source.

Declaration
C#
Copy
public Task StartAsync()
Returns
Type Description
System.Threading.Tasks.Task

A task that represents the asynchronous operation.

Remarks

The state must be Connected state by ConnectAsync(String).

Exceptions
Type Condition
System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

UnauthorizedAccessException

Caller does not have required permission.

API Level: 4
Privilege Level: public
Privilege: http://tizen.org/privilege/internet
View Source

Unprepare()

Unprepares the screen mirroring.

Declaration
C#
Copy
public void Unprepare()
Remarks

The state must be Prepared, or Disconnected.

Exceptions
Type Condition
System.InvalidOperationException

The current state is not in the valid.
-or-
An internal error occurs.

ObjectDisposedException

The ScreenMirroring has already been disposed.

API Level: 4

Events

View Source

ErrorOccurred

Occurs when an error occurs.

Declaration
C#
Copy
public event EventHandler<ScreenMirroringErrorOccurredEventArgs> ErrorOccurred
Event Type
Type Description
System.EventHandler<ScreenMirroringErrorOccurredEventArgs>
API Level: 4
View Source

StateChanged

Occurs when the state is changed.

Declaration
C#
Copy
public event EventHandler<ScreenMirroringStateChangedEventArgs> StateChanged
Event Type
Type Description
System.EventHandler<ScreenMirroringStateChangedEventArgs>
API Level: 4

Implements

System.IDisposable