2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using static Tizen.Multimedia.Remoting.InteropHelper;
19 using Native = Interop.ScreenMirroring;
21 namespace Tizen.Multimedia.Remoting
24 /// Provides a means to retrieve the video information which is negotiated with the source device.
26 public class ScreenMirroringVideoInfo
28 private readonly ScreenMirroring _owner;
30 internal ScreenMirroringVideoInfo(ScreenMirroring owner)
36 /// Gets the negotiated video codec.
38 /// <exception cref="InvalidOperationException">
39 /// Not connected to a source.<br/>
41 /// An internal error occurs.
43 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
44 public ScreenMirroringVideoCodec Codec
48 _owner.ThrowIfNotConnected();
50 GetValue(Native.GetNegotiatedVideoCodec, _owner.Handle, out ScreenMirroringVideoCodec value).
51 ThrowIfError("Failed to get video codec.");
58 /// Gets the negotiated video resolution.
60 /// <exception cref="InvalidOperationException">
61 /// Not connected to a source.<br/>
63 /// An internal error occurs.
65 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
66 public Size Resolution
70 _owner.ThrowIfNotConnected();
72 var handle = _owner.Handle;
73 Native.GetNegotiatedVideoResolution(ref handle, out var width, out var height).
74 ThrowIfError("Failed to get resolution.");
76 return new Size(width, height);
81 /// Gets the negotiated video frame rate.
83 /// <exception cref="InvalidOperationException">
84 /// Not connected to a source.<br/>
86 /// An internal error occurs.
88 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
93 _owner.ThrowIfNotConnected();
95 GetValue(Native.GetNegotiatedVideoFrameRate, _owner.Handle, out int value).
96 ThrowIfError("Failed to get video frame rate.");