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.Vision;
24 internal static partial class Interop
27 /// Interop for Media Vision APIs.
29 internal static partial class MediaVision
32 /// Interop for Surveillance APIs.
34 internal static partial class Surveillance
36 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_event_trigger_create")]
37 internal static extern MediaVisionError EventTriggerCreate(string eventType, out IntPtr trigger);
39 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_event_trigger_destroy")]
40 internal static extern int EventTriggerDestroy(IntPtr trigger);
42 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_event_trigger_type")]
43 internal static extern int GetEventTriggerType(IntPtr trigger, out string eventType);
45 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_set_event_trigger_roi")]
46 internal static extern MediaVisionError SetEventTriggerRoi(IntPtr trigger, int numberOfPoints, Point[] roi);
48 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_event_trigger_roi")]
49 internal static extern MediaVisionError GetEventTriggerRoi(IntPtr trigger, out int numberOfPoints, out IntPtr roi);
51 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_subscribe_event_trigger")]
52 internal static extern MediaVisionError SubscribeEventTrigger(IntPtr trigger, int videoStreamId,
53 IntPtr engineCfg, EventOccurredCallback callback, IntPtr userData = default(IntPtr));
55 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_unsubscribe_event_trigger")]
56 internal static extern MediaVisionError UnsubscribeEventTrigger(IntPtr trigger, int videoStreamId);
58 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_push_source")]
59 internal static extern MediaVisionError PushSource(IntPtr source, int videoStreamId);
61 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_foreach_supported_event_type")]
62 internal static extern int ForeachSupportedEventType(EventTypeCallback callback, IntPtr userData);
64 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_foreach_event_result_name")]
65 internal static extern int ForeachEventResultName(string eventType, EventResultNameCallback callback,
68 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")]
69 internal static extern MediaVisionError GetResultValue(IntPtr result, string name, out int value);
71 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")]
72 internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] int[] value);
74 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")]
75 internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] double[] value);
77 [DllImport(Libraries.MediaVisionSurveillance, EntryPoint = "mv_surveillance_get_result_value")]
78 internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] Rectangle[] value);
80 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
81 internal delegate void EventOccurredCallback(IntPtr trigger, IntPtr source,
82 int videoStreamId, IntPtr eventResult, IntPtr userData);
84 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
85 internal delegate bool EventTypeCallback(string eventType, IntPtr userData);
87 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
88 internal delegate bool EventResultNameCallback(string name, IntPtr userData);