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 System.Runtime.InteropServices;
19 using Tizen.Multimedia.Remoting;
21 internal static partial class Interop
23 internal static partial class ScreenMirroring
25 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
26 internal delegate void StateChangedCallback(ScreenMirroringErrorCode error,
27 ScreenMirroringState state, IntPtr userData);
29 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_create")]
30 internal static extern ScreenMirroringErrorCode Create(out IntPtr handle);
32 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_state_changed_cb")]
33 internal static extern ScreenMirroringErrorCode SetStateChangedCb(IntPtr handle,
34 StateChangedCallback cb, IntPtr userData = default(IntPtr));
36 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_ip_and_port")]
37 internal static extern ScreenMirroringErrorCode SetIpAndPort(IntPtr handle, string ip, string port);
39 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display")]
40 internal static extern ScreenMirroringErrorCode SetDisplay(IntPtr handle, int type, IntPtr display);
42 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_resolution")]
43 internal static extern ScreenMirroringErrorCode SetResolution(IntPtr handle, ScreenMirroringResolutions resolution);
45 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_prepare")]
46 internal static extern ScreenMirroringErrorCode Prepare(IntPtr handle);
48 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_connect")]
49 internal static extern ScreenMirroringErrorCode Connect(IntPtr handle);
51 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_start")]
52 internal static extern ScreenMirroringErrorCode StartAsync(IntPtr handle);
54 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_pause")]
55 internal static extern ScreenMirroringErrorCode PauseAsync(IntPtr handle);
57 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_resume")]
58 internal static extern ScreenMirroringErrorCode ResumeAsync(IntPtr handle);
60 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_disconnect")]
61 internal static extern ScreenMirroringErrorCode Disconnect(IntPtr handle);
63 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unprepare")]
64 internal static extern ScreenMirroringErrorCode Unprepare(IntPtr handle);
66 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unset_state_changed_cb")]
67 internal static extern int UnsetStateChangedCb(IntPtr handle);
69 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_destroy")]
70 internal static extern int Destroy(IntPtr handle);
72 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_codec")]
73 internal static extern ScreenMirroringErrorCode GetNegotiatedVideoCodec(ref IntPtr handle,
74 out ScreenMirroringVideoCodec codec);
76 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_resolution")]
77 internal static extern ScreenMirroringErrorCode GetNegotiatedVideoResolution(ref IntPtr handle,
78 out int width, out int height);
80 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_frame_rate")]
81 internal static extern ScreenMirroringErrorCode GetNegotiatedVideoFrameRate(ref IntPtr handle,
84 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_codec")]
85 internal static extern ScreenMirroringErrorCode GetNegotiatedAudioCodec(ref IntPtr handle,
86 out ScreenMirroringAudioCodec codec);
88 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_channel")]
89 internal static extern ScreenMirroringErrorCode GetNegotiatedAudioChannel(ref IntPtr handle,
92 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_sample_rate")]
93 internal static extern ScreenMirroringErrorCode GetNegotiatedAudioSampleRate(ref IntPtr handle,
96 [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_bitwidth")]
97 internal static extern ScreenMirroringErrorCode GetNegotiatedAudioBitwidth(ref IntPtr handle,