Class ScreenMirroring
Definition
- Namespace:
- Tizen.Multimedia.Remoting
- Assembly:
- Tizen.Multimedia.Remoting.dll
Provides the ability to connect to and disconnect from a screen mirroring source, start, pause, and resume the screen mirroring as a sink.
public class ScreenMirroring : IDisposable
- Inheritance
-
objectScreenMirroring
- Implements
-
Tizen.Multimedia.IDisplayable<><ScreenMirroringErrorCode>
Constructors
View SourceScreenMirroring()
Initializes a new instance of the ScreenMirroring class.
Declaration
public ScreenMirroring()
Properties
View SourceAudioInfo
Gets the negotiated audio info.
Declaration
public ScreenMirroringAudioInfo AudioInfo { get; }
Property Value
| Type | Description |
|---|---|
| ScreenMirroringAudioInfo |
DisplayMode
Gets or sets the display mode.
Declaration
public ScreenMirroringDisplayMode DisplayMode { get; set; }
Property Value
| Type | Description |
|---|---|
| ScreenMirroringDisplayMode |
DisplayRoi
Gets or sets the display position and size of the receiver screen view.
Declaration
public Rectangle DisplayRoi { get; set; }
Property Value
| Type | Description |
|---|---|
| Rectangle |
Remarks
DisplayRoi will be applied when DisplayMode is CustomRoi.
See Also
View SourceDisplayRotation
Gets or sets the display rotation.
Declaration
public Rotation DisplayRotation { get; set; }
Property Value
| Type | Description |
|---|---|
| Rotation |
SourceDeviceType
Gets or sets the source device type.
Declaration
public ScreenMirroringDeviceType SourceDeviceType { get; set; }
Property Value
| Type | Description |
|---|---|
| ScreenMirroringDeviceType |
VideoInfo
Gets the negotiated video info.
Declaration
public ScreenMirroringVideoInfo VideoInfo { get; }
Property Value
| Type | Description |
|---|---|
| ScreenMirroringVideoInfo |
Methods
View SourceConnectAsync(string, uint)
Creates the connection and ready for receiving data from a mirroring source with the given port.
Declaration
public Task ConnectAsync(string sourceIp, uint port)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sourceIp | The source ip address to connect. |
| uint | port | The port number to connect. The max value is 65535. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Remarks
The state must be Prepared state by Prepare(Display, ScreenMirroringResolutions).
ConnectAsync(string)
Creates the connection and ready for receiving data from a mirroring source.
Declaration
public Task ConnectAsync(string sourceIp)
Parameters
| Type | Name | Description |
|---|---|---|
| string | sourceIp | The source ip address to connect. |
Returns
| Type | Description |
|---|---|
| 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, uint).
See Also
View SourceDisconnect()
Disconnects from the source.
Declaration
public void Disconnect()
Remarks
View SourceDispose()
Releases all resource used by the ScreenMirroring object.
Declaration
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.
Dispose(bool)
Releases the resources used by the ScreenMirroring.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
~ScreenMirroring()
Finalizes an instance of the ScreenMirroring class.
Declaration
protected ~ScreenMirroring()
PauseAsync()
Pauses mirroring from the source.
Declaration
public Task PauseAsync()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Remarks
The state must be Playing state by StartAsync().
Prepare(Display, ScreenMirroringResolutions)
Prepares the screen mirroring with the specified display and resolutions.
Declaration
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.
Prepare(Display)
Prepares the screen mirroring with the specified display.
Declaration
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.
ResumeAsync()
Resumes mirroring from the source.
Declaration
public Task ResumeAsync()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Remarks
The state must be Paused state by PauseAsync().
SendGenericKeyEvent(ScreenMirroringKeyEventType, ushort, ushort)
Sends key event for UIBC(User Input Back Channel).
Declaration
public void SendGenericKeyEvent(ScreenMirroringKeyEventType type, ushort keyCode1, ushort keyCode2)
Parameters
| Type | Name | Description |
|---|---|---|
| ScreenMirroringKeyEventType | type | |
| ushort | keyCode1 | |
| ushort | keyCode2 |
SendGenericMouseEvent(IEnumerable<UibcMouseInfo>, ScreenMirroringMouseEventType)
Sends mouse event for UIBC(User Input Back Channel).
Declaration
public void SendGenericMouseEvent(IEnumerable<UibcMouseInfo> uibcMouseInfos, ScreenMirroringMouseEventType type)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<><UibcMouseInfo> | uibcMouseInfos | |
| ScreenMirroringMouseEventType | type |
SetUibcInformation(Size, ScreenMirroringCaptureMode)
Sets the information for UIBC(User Input Back Channel).
Declaration
public void SetUibcInformation(Size windowSize, ScreenMirroringCaptureMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | windowSize | |
| ScreenMirroringCaptureMode | mode |
StartAsync()
Starts mirroring from the source.
Declaration
public Task StartAsync()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the asynchronous operation. |
Remarks
The state must be Connected state by ConnectAsync(string).
Unprepare()
Unprepares the screen mirroring.
Declaration
public void Unprepare()
Remarks
The state must be Prepared, or Disconnected.
Events
View SourceDisplayOrientationChanged
Occurs when the display orientation of source is changed.
Declaration
public event EventHandler<ScreenMirroringDisplayOrientationChangedEventArgs> DisplayOrientationChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<><ScreenMirroringDisplayOrientationChangedEventArgs> |
ErrorOccurred
Occurs when an error occurs.
Declaration
public event EventHandler<ScreenMirroringErrorOccurredEventArgs> ErrorOccurred
Event Type
| Type | Description |
|---|---|
| EventHandler<><ScreenMirroringErrorOccurredEventArgs> |
StateChanged
Occurs when the state is changed.
Declaration
public event EventHandler<ScreenMirroringStateChangedEventArgs> StateChanged
Event Type
| Type | Description |
|---|---|
| EventHandler<><ScreenMirroringStateChangedEventArgs> |
UibcInfoReceived
Occurs when the UIBC information is received from source.
Declaration
public event EventHandler<ScreenMirroringUibcInfoReceivedEventArgs> UibcInfoReceived
Event Type
| Type | Description |
|---|---|
| EventHandler<><ScreenMirroringUibcInfoReceivedEventArgs> |