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.InteropHelper;
19 using Native = Interop.ScreenMirroring;
21 namespace Tizen.Multimedia
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">An internal error occurs.</exception>
39 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
40 public ScreenMirroringVideoCodec Codec
44 GetValue(Native.GetNegotiatedVideoCodec, _owner.Handle, out ScreenMirroringVideoCodec value).
45 ThrowIfError("Failed to get video codec.");
52 /// Gets the negotiated video resolution.
54 /// <exception cref="InvalidOperationException">An internal error occurs.</exception>
55 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
56 public Size Resolution
60 var handle = _owner.Handle;
61 Native.GetNegotiatedVideoResolution(ref handle, out var width, out var height).
62 ThrowIfError("Failed to get resolution.");
64 return new Size(width, height);
69 /// Gets the negotiated video frame rate.
71 /// <exception cref="InvalidOperationException">An internal error occurs.</exception>
72 /// <exception cref="ObjectDisposedException">The <see cref="ScreenMirroring"/> has already been disposed.</exception>
77 GetValue(Native.GetNegotiatedVideoFrameRate, _owner.Handle, out int value).
78 ThrowIfError("Failed to get video frame rate.");