Merge remote-tracking branch 'security/tizen'
[platform/core/csapi/tizenfx.git] / src / Tizen.Multimedia.Remoting / Interop / Interop.ScreenMirroring.cs
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 using System;
18 using System.Runtime.InteropServices;
19 using Tizen.Multimedia;
20
21 internal static partial class Interop
22 {
23     internal static partial class ScreenMirroring
24     {
25         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
26         internal delegate void StateChangedCallback(IntPtr userData,
27             ScreenMirroringState state, ScreenMirroringErrorCode error);
28
29         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_create")]
30         internal static extern ScreenMirroringErrorCode Create(out IntPtr handle);
31
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));
35
36         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_ip_and_port")]
37         internal static extern ScreenMirroringErrorCode SetIpAndPort(IntPtr handle, string ip, string port);
38
39         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display")]
40         internal static extern ScreenMirroringErrorCode SetDisplay(IntPtr handle, int type, IntPtr display);
41
42         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_resolution")]
43         internal static extern ScreenMirroringErrorCode SetResolution(IntPtr handle, ScreenMirroringResolutions resolution);
44
45         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_prepare")]
46         internal static extern ScreenMirroringErrorCode Prepare(IntPtr handle);
47
48         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_connect")]
49         internal static extern ScreenMirroringErrorCode Connect(IntPtr handle);
50
51         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_start")]
52         internal static extern ScreenMirroringErrorCode StartAsync(IntPtr handle);
53
54         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_pause")]
55         internal static extern ScreenMirroringErrorCode PauseAsync(IntPtr handle);
56
57         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_resume")]
58         internal static extern ScreenMirroringErrorCode ResumeAsync(IntPtr handle);
59
60         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_disconnect")]
61         internal static extern ScreenMirroringErrorCode Disconnect(IntPtr handle);
62
63         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unprepare")]
64         internal static extern ScreenMirroringErrorCode Unprepare(IntPtr handle);
65
66         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unset_state_changed_cb")]
67         internal static extern int UnsetStateChangedCb(IntPtr handle);
68
69         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_destroy")]
70         internal static extern int Destroy(IntPtr handle);
71
72         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_codec")]
73         internal static extern ScreenMirroringErrorCode GetNegotiatedVideoCodec(ref IntPtr handle,
74             out ScreenMirroringVideoCodec codec);
75
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);
79
80         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_frame_rate")]
81         internal static extern ScreenMirroringErrorCode GetNegotiatedVideoFrameRate(ref IntPtr handle,
82             out int frameRate);
83
84         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_codec")]
85         internal static extern ScreenMirroringErrorCode GetNegotiatedAudioCodec(ref IntPtr handle,
86             out ScreenMirroringAudioCodec codec);
87
88         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_channel")]
89         internal static extern ScreenMirroringErrorCode GetNegotiatedAudioChannel(ref IntPtr handle,
90             out int channel);
91
92         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_sample_rate")]
93         internal static extern ScreenMirroringErrorCode GetNegotiatedAudioSampleRate(ref IntPtr handle,
94             out int sampleRate);
95
96         [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_bitwidth")]
97         internal static extern ScreenMirroringErrorCode GetNegotiatedAudioBitwidth(ref IntPtr handle,
98             out int bitwidth);
99     }
100 }