Commit 8abd6afd authored by Martin Finkel's avatar Martin Finkel

Add exit callback

parent e8b3f3f7
......@@ -94,5 +94,23 @@ namespace Bindings.Tests
var md2 = instance.MediaDiscoverers(MediaDiscovererCategory.Lan);
var md3 = instance.MediaDiscoverers(MediaDiscovererCategory.Localdirs);
}
[Test]
public void SetExitHandler()
{
var instance = new Instance(0, null);
var called = false;
var exitCb = new Instance.ExitCallback(() =>
{
called = true;
});
instance.SetExitHandler(exitCb, IntPtr.Zero);
instance.Dispose();
Assert.IsTrue(called);
}
}
}
\ No newline at end of file
......@@ -100,8 +100,12 @@ namespace libvlcsharp
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_discoverer_list_release")]
internal static extern void LibVLCMediaDiscovererListRelease(IntPtr ppServices, ulong count);
}
[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ExitCallback();
public IntPtr NativeReference { get; protected set; }
internal static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, Instance> NativeToManagedMap
......@@ -233,7 +237,7 @@ namespace libvlcsharp
/// <para>be raised before the handler is registered.</para>
/// <para>This function and libvlc_wait() cannot be used at the same time.</para>
/// </remarks>
public void SetExitHandler(Delegates.Action_IntPtr cb, IntPtr opaque)
public void SetExitHandler(ExitCallback cb, IntPtr opaque)
{
var cbFunctionPointer = cb == null ? IntPtr.Zero : Marshal.GetFunctionPointerForDelegate(cb);
Internal.LibVLCSetExitHandler(NativeReference, cbFunctionPointer, opaque);
......@@ -431,10 +435,5 @@ namespace libvlcsharp
public void SetDialogHandlers()
{
}
public void SetExistHandler(Action cb)
{
//Internal.LibVLCSetExitHandler();
}
}
}
\ No newline at end of file
......@@ -21,17 +21,25 @@ namespace libvlcsharp
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogIterator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogIterator>();
internal static readonly
global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogIterator>
NativeToManagedMap =
new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogIterator
>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::libvlcsharp.LogIterator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::libvlcsharp.LogIterator __CreateInstance(global::System.IntPtr native,
bool skipVTables = false)
{
return new global::libvlcsharp.LogIterator(native.ToPointer(), skipVTables);
}
internal static global::libvlcsharp.LogIterator __CreateInstance(global::libvlcsharp.LogIterator.__Internal native, bool skipVTables = false)
internal static global::libvlcsharp.LogIterator __CreateInstance(
global::libvlcsharp.LogIterator.__Internal native, bool skipVTables = false)
{
return new global::libvlcsharp.LogIterator(native, skipVTables);
}
......@@ -63,41 +71,45 @@ namespace libvlcsharp
[StructLayout(LayoutKind.Explicit, Size = 40)]
public partial struct __Internal
{
[FieldOffset(0)]
internal int i_severity;
[FieldOffset(0)] internal int i_severity;
[FieldOffset(8)]
internal global::System.IntPtr psz_type;
[FieldOffset(8)] internal global::System.IntPtr psz_type;
[FieldOffset(16)]
internal global::System.IntPtr psz_name;
[FieldOffset(16)] internal global::System.IntPtr psz_name;
[FieldOffset(24)]
internal global::System.IntPtr psz_header;
[FieldOffset(24)] internal global::System.IntPtr psz_header;
[FieldOffset(32)]
internal global::System.IntPtr psz_message;
[FieldOffset(32)] internal global::System.IntPtr psz_message;
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="??0libvlc_log_message_t@@QEAA@AEBU0@@Z")]
internal static extern global::System.IntPtr cctor(global::System.IntPtr instance, global::System.IntPtr _0);
EntryPoint = "??0libvlc_log_message_t@@QEAA@AEBU0@@Z")]
internal static extern global::System.IntPtr
cctor(global::System.IntPtr instance, global::System.IntPtr _0);
}
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogMessage> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogMessage>();
internal static readonly
global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogMessage>
NativeToManagedMap =
new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::libvlcsharp.LogMessage>()
;
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::libvlcsharp.LogMessage __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::libvlcsharp.LogMessage __CreateInstance(global::System.IntPtr native,
bool skipVTables = false)
{
return new global::libvlcsharp.LogMessage(native.ToPointer(), skipVTables);
}
internal static global::libvlcsharp.LogMessage __CreateInstance(global::libvlcsharp.LogMessage.__Internal native, bool skipVTables = false)
internal static global::libvlcsharp.LogMessage __CreateInstance(
global::libvlcsharp.LogMessage.__Internal native, bool skipVTables = false)
{
return new global::libvlcsharp.LogMessage(native, skipVTables);
}
......@@ -135,7 +147,8 @@ namespace libvlcsharp
__Instance = Marshal.AllocHGlobal(sizeof(global::libvlcsharp.LogMessage.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((global::libvlcsharp.LogMessage.__Internal*) __Instance) = *((global::libvlcsharp.LogMessage.__Internal*) _0.__Instance);
*((global::libvlcsharp.LogMessage.__Internal*) __Instance) =
*((global::libvlcsharp.LogMessage.__Internal*) _0.__Instance);
}
public void Dispose()
......@@ -156,40 +169,30 @@ namespace libvlcsharp
public int ISeverity
{
get
{
return ((global::libvlcsharp.LogMessage.__Internal*) __Instance)->i_severity;
}
get { return ((global::libvlcsharp.LogMessage.__Internal*) __Instance)->i_severity; }
set
{
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->i_severity = value;
}
set { ((global::libvlcsharp.LogMessage.__Internal*) __Instance)->i_severity = value; }
}
public string PszType
{
get
{
return Marshal.PtrToStringAnsi(((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_type);
}
get { return Marshal.PtrToStringAnsi(((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_type); }
set
{
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_type = Marshal.StringToHGlobalAnsi(value);
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_type =
Marshal.StringToHGlobalAnsi(value);
}
}
public string PszName
{
get
{
return Marshal.PtrToStringAnsi(((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_name);
}
get { return Marshal.PtrToStringAnsi(((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_name); }
set
{
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_name = Marshal.StringToHGlobalAnsi(value);
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_name =
Marshal.StringToHGlobalAnsi(value);
}
}
......@@ -202,7 +205,8 @@ namespace libvlcsharp
set
{
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_header = Marshal.StringToHGlobalAnsi(value);
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_header =
Marshal.StringToHGlobalAnsi(value);
}
}
......@@ -215,7 +219,8 @@ namespace libvlcsharp
set
{
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_message = Marshal.StringToHGlobalAnsi(value);
((global::libvlcsharp.LogMessage.__Internal*) __Instance)->psz_message =
Marshal.StringToHGlobalAnsi(value);
}
}
}
......@@ -226,178 +231,189 @@ namespace libvlcsharp
{
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_player_get_fps")]
EntryPoint = "libvlc_media_player_get_fps")]
internal static extern float LibvlcMediaPlayerGetFps(global::System.IntPtr p_mi);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_player_set_agl")]
EntryPoint = "libvlc_media_player_set_agl")]
internal static extern void LibvlcMediaPlayerSetAgl(global::System.IntPtr p_mi, uint drawable);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_player_get_agl")]
EntryPoint = "libvlc_media_player_get_agl")]
internal static extern uint LibvlcMediaPlayerGetAgl(global::System.IntPtr p_mi);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_track_description_release")]
EntryPoint = "libvlc_track_description_release")]
internal static extern void LibvlcTrackDescriptionRelease(global::System.IntPtr p_track_description);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_video_get_height")]
EntryPoint = "libvlc_video_get_height")]
internal static extern int LibvlcVideoGetHeight(global::System.IntPtr p_mi);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_video_get_width")]
EntryPoint = "libvlc_video_get_width")]
internal static extern int LibvlcVideoGetWidth(global::System.IntPtr p_mi);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_video_get_title_description")]
EntryPoint = "libvlc_video_get_title_description")]
internal static extern global::System.IntPtr LibvlcVideoGetTitleDescription(global::System.IntPtr p_mi);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_video_get_chapter_description")]
internal static extern global::System.IntPtr LibvlcVideoGetChapterDescription(global::System.IntPtr p_mi, int i_title);
EntryPoint = "libvlc_video_get_chapter_description")]
internal static extern global::System.IntPtr LibvlcVideoGetChapterDescription(global::System.IntPtr p_mi,
int i_title);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_video_set_subtitle_file")]
internal static extern int LibvlcVideoSetSubtitleFile(global::System.IntPtr p_mi, [MarshalAs(UnmanagedType.LPStr)] string psz_subtitle);
EntryPoint = "libvlc_video_set_subtitle_file")]
internal static extern int LibvlcVideoSetSubtitleFile(global::System.IntPtr p_mi,
[MarshalAs(UnmanagedType.LPStr)] string psz_subtitle);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_toggle_teletext")]
EntryPoint = "libvlc_toggle_teletext")]
internal static extern void LibvlcToggleTeletext(global::System.IntPtr p_mi);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_audio_output_device_count")]
internal static extern int LibvlcAudioOutputDeviceCount(global::System.IntPtr p_instance, [MarshalAs(UnmanagedType.LPStr)] string psz_audio_output);
EntryPoint = "libvlc_audio_output_device_count")]
internal static extern int LibvlcAudioOutputDeviceCount(global::System.IntPtr p_instance,
[MarshalAs(UnmanagedType.LPStr)] string psz_audio_output);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_audio_output_device_longname")]
internal static extern sbyte* LibvlcAudioOutputDeviceLongname(global::System.IntPtr p_instance, [MarshalAs(UnmanagedType.LPStr)] string psz_output, int i_device);
EntryPoint = "libvlc_audio_output_device_longname")]
internal static extern sbyte* LibvlcAudioOutputDeviceLongname(global::System.IntPtr p_instance,
[MarshalAs(UnmanagedType.LPStr)] string psz_output, int i_device);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_audio_output_device_id")]
internal static extern sbyte* LibvlcAudioOutputDeviceId(global::System.IntPtr p_instance, [MarshalAs(UnmanagedType.LPStr)] string psz_audio_output, int i_device);
EntryPoint = "libvlc_audio_output_device_id")]
internal static extern sbyte* LibvlcAudioOutputDeviceId(global::System.IntPtr p_instance,
[MarshalAs(UnmanagedType.LPStr)] string psz_audio_output, int i_device);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_audio_output_get_device_type")]
EntryPoint = "libvlc_audio_output_get_device_type")]
internal static extern int LibvlcAudioOutputGetDeviceType(global::System.IntPtr p_mi);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_audio_output_set_device_type")]
EntryPoint = "libvlc_audio_output_set_device_type")]
internal static extern void LibvlcAudioOutputSetDeviceType(global::System.IntPtr p_mp, int device_type);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_parse")]
EntryPoint = "libvlc_media_parse")]
internal static extern void LibvlcMediaParse(global::System.IntPtr p_md);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_parse_async")]
EntryPoint = "libvlc_media_parse_async")]
internal static extern void LibvlcMediaParseAsync(global::System.IntPtr p_md);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_is_parsed")]
EntryPoint = "libvlc_media_is_parsed")]
internal static extern int LibvlcMediaIsParsed(global::System.IntPtr p_md);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_get_tracks_info")]
internal static extern int LibvlcMediaGetTracksInfo(global::System.IntPtr p_md, global::System.IntPtr tracks);
EntryPoint = "libvlc_media_get_tracks_info")]
internal static extern int LibvlcMediaGetTracksInfo(global::System.IntPtr p_md,
global::System.IntPtr tracks);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_list_add_file_content")]
internal static extern int LibvlcMediaListAddFileContent(global::System.IntPtr p_ml, [MarshalAs(UnmanagedType.LPStr)] string psz_uri);
EntryPoint = "libvlc_media_list_add_file_content")]
internal static extern int LibvlcMediaListAddFileContent(global::System.IntPtr p_ml,
[MarshalAs(UnmanagedType.LPStr)] string psz_uri);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_discoverer_new_from_name")]
internal static extern global::System.IntPtr LibvlcMediaDiscovererNewFromName(global::System.IntPtr p_inst, [MarshalAs(UnmanagedType.LPStr)] string psz_name);
EntryPoint = "libvlc_media_discoverer_new_from_name")]
internal static extern global::System.IntPtr LibvlcMediaDiscovererNewFromName(global::System.IntPtr p_inst,
[MarshalAs(UnmanagedType.LPStr)] string psz_name);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_discoverer_localized_name")]
EntryPoint = "libvlc_media_discoverer_localized_name")]
internal static extern sbyte* LibvlcMediaDiscovererLocalizedName(global::System.IntPtr p_mdis);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_media_discoverer_event_manager")]
internal static extern global::System.IntPtr LibvlcMediaDiscovererEventManager(global::System.IntPtr p_mdis);
EntryPoint = "libvlc_media_discoverer_event_manager")]
internal static extern global::System.IntPtr
LibvlcMediaDiscovererEventManager(global::System.IntPtr p_mdis);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_wait")]
EntryPoint = "libvlc_wait")]
internal static extern void LibvlcWait(global::System.IntPtr p_instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_get_log_verbosity")]
EntryPoint = "libvlc_get_log_verbosity")]
internal static extern uint LibvlcGetLogVerbosity(global::System.IntPtr p_instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_set_log_verbosity")]
EntryPoint = "libvlc_set_log_verbosity")]
internal static extern void LibvlcSetLogVerbosity(global::System.IntPtr p_instance, uint level);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_open")]
EntryPoint = "libvlc_log_open")]
internal static extern global::System.IntPtr LibvlcLogOpen(global::System.IntPtr p_instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_close")]
EntryPoint = "libvlc_log_close")]
internal static extern void LibvlcLogClose(global::System.IntPtr p_log);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_count")]
EntryPoint = "libvlc_log_count")]
internal static extern uint LibvlcLogCount(global::System.IntPtr p_log);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_clear")]
EntryPoint = "libvlc_log_clear")]
internal static extern void LibvlcLogClear(global::System.IntPtr p_log);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_get_iterator")]
EntryPoint = "libvlc_log_get_iterator")]
internal static extern global::System.IntPtr LibvlcLogGetIterator(global::System.IntPtr p_log);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_iterator_free")]
EntryPoint = "libvlc_log_iterator_free")]
internal static extern void LibvlcLogIteratorFree(global::System.IntPtr p_iter);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_iterator_has_next")]
EntryPoint = "libvlc_log_iterator_has_next")]
internal static extern int LibvlcLogIteratorHasNext(global::System.IntPtr p_iter);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_log_iterator_next")]
internal static extern global::System.IntPtr LibvlcLogIteratorNext(global::System.IntPtr p_iter, global::System.IntPtr p_buf);
EntryPoint = "libvlc_log_iterator_next")]
internal static extern global::System.IntPtr LibvlcLogIteratorNext(global::System.IntPtr p_iter,
global::System.IntPtr p_buf);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.Cdecl,
EntryPoint="libvlc_playlist_play")]
internal static extern void LibvlcPlaylistPlay(global::System.IntPtr p_instance, int i_id, int i_options, sbyte** ppsz_options);
EntryPoint = "libvlc_playlist_play")]
internal static extern void LibvlcPlaylistPlay(global::System.IntPtr p_instance, int i_id, int i_options,
sbyte** ppsz_options);
}
/// <summary>Get movie fps rate</summary>
......@@ -434,7 +450,9 @@ namespace libvlcsharp
/// <remarks>Use libvlc_track_description_list_release() instead</remarks>
public static void LibvlcTrackDescriptionRelease(global::libvlcsharp.TrackDescription p_track_description)
{
var __arg0 = ReferenceEquals(p_track_description, null) ? global::System.IntPtr.Zero : p_track_description.__Instance;
var __arg0 = ReferenceEquals(p_track_description, null)
? global::System.IntPtr.Zero
: p_track_description.__Instance;
__Internal.LibvlcTrackDescriptionRelease(__arg0);
}
......@@ -466,14 +484,16 @@ namespace libvlcsharp
/// <para>list containing description of available titles.</para>
/// <para>It must be freed with libvlc_track_description_list_release()</para>
/// </returns>
public static global::libvlcsharp.TrackDescription LibvlcVideoGetTitleDescription(global::libvlcsharp.MediaPlayer p_mi)
public static global::libvlcsharp.TrackDescription LibvlcVideoGetTitleDescription(
global::libvlcsharp.MediaPlayer p_mi)
{
var __arg0 = ReferenceEquals(p_mi, null) ? global::System.IntPtr.Zero : p_mi.__Instance;
var __ret = __Internal.LibvlcVideoGetTitleDescription(__arg0);
global::libvlcsharp.TrackDescription __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::libvlcsharp.TrackDescription.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::libvlcsharp.TrackDescription) global::libvlcsharp.TrackDescription.NativeToManagedMap[__ret];
__result0 = (global::libvlcsharp.TrackDescription) global::libvlcsharp.TrackDescription
.NativeToManagedMap[__ret];
else __result0 = global::libvlcsharp.TrackDescription.__CreateInstance(__ret);
return __result0;
}
......@@ -485,14 +505,16 @@ namespace libvlcsharp
/// <para>list containing description of available chapter for title i_title.</para>
/// <para>It must be freed with libvlc_track_description_list_release()</para>
/// </returns>
public static global::libvlcsharp.TrackDescription LibvlcVideoGetChapterDescription(global::libvlcsharp.MediaPlayer p_mi, int i_title)
public static global::libvlcsharp.TrackDescription LibvlcVideoGetChapterDescription(
global::libvlcsharp.MediaPlayer p_mi, int i_title)
{
var __arg0 = ReferenceEquals(p_mi, null) ? global::System.IntPtr.Zero : p_mi.__Instance;
var __ret = __Internal.LibvlcVideoGetChapterDescription(__arg0, i_title);
global::libvlcsharp.TrackDescription __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::libvlcsharp.TrackDescription.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::libvlcsharp.TrackDescription) global::libvlcsharp.TrackDescription.NativeToManagedMap[__ret];
__result0 = (global::libvlcsharp.TrackDescription) global::libvlcsharp.TrackDescription
.NativeToManagedMap[__ret];
else __result0 = global::libvlcsharp.TrackDescription.__CreateInstance(__ret);
return __result0;
}
......@@ -531,7 +553,8 @@ namespace libvlcsharp
/// <summary>Backward compatibility stub. Do not use in new code.</summary>
/// <returns>always NULL.</returns>
/// <remarks>Use libvlc_audio_output_device_list_get() instead.</remarks>
public static sbyte* LibvlcAudioOutputDeviceLongname(global::libvlcsharp.Instance p_instance, string psz_output, int i_device)
public static sbyte* LibvlcAudioOutputDeviceLongname(global::libvlcsharp.Instance p_instance, string psz_output,
int i_device)
{
var __arg0 = ReferenceEquals(p_instance, null) ? global::System.IntPtr.Zero : p_instance.NativeReference;
var __ret = __Internal.LibvlcAudioOutputDeviceLongname(__arg0, psz_output, i_device);
......@@ -541,7 +564,8 @@ namespace libvlcsharp
/// <summary>Backward compatibility stub. Do not use in new code.</summary>
/// <returns>always NULL.</returns>
/// <remarks>Use libvlc_audio_output_device_list_get() instead.</remarks>
public static sbyte* LibvlcAudioOutputDeviceId(global::libvlcsharp.Instance p_instance, string psz_audio_output, int i_device)
public static sbyte* LibvlcAudioOutputDeviceId(global::libvlcsharp.Instance p_instance, string psz_audio_output,
int i_device)
{
var __arg0 = ReferenceEquals(p_instance, null) ? global::System.IntPtr.Zero : p_instance.NativeReference;
var __ret = __Internal.LibvlcAudioOutputDeviceId(__arg0, psz_audio_output, i_device);
......@@ -631,7 +655,8 @@ namespace libvlcsharp
/// <para>Not doing this will result in an empty array.</para>
/// <para>Use libvlc_media_tracks_get() instead</para>
/// </remarks>
public static int LibvlcMediaGetTracksInfo(global::libvlcsharp.Media p_md, global::libvlcsharp.MediaTrackInfo tracks)
public static int LibvlcMediaGetTracksInfo(global::libvlcsharp.Media p_md,
global::libvlcsharp.MediaTrackInfo tracks)
{
var __arg0 = ReferenceEquals(p_md, null) ? global::System.IntPtr.Zero : p_md.__Instance;
var __arg1 = ReferenceEquals(tracks, null) ? global::System.IntPtr.Zero : tracks.__Instance;
......@@ -648,14 +673,16 @@ namespace libvlcsharp
}
/// <remarks>Use libvlc_media_discoverer_new() and libvlc_media_discoverer_start().</remarks>
public static global::libvlcsharp.MediaDiscoverer LibvlcMediaDiscovererNewFromName(global::libvlcsharp.Instance p_inst, string psz_name)
public static global::libvlcsharp.MediaDiscoverer LibvlcMediaDiscovererNewFromName(
global::libvlcsharp.Instance p_inst, string psz_name)
{
var __arg0 = ReferenceEquals(p_inst, null) ? global::System.IntPtr.Zero : p_inst.NativeReference;
var __ret = __Internal.LibvlcMediaDiscovererNewFromName(__arg0, psz_name);
global::libvlcsharp.MediaDiscoverer __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::libvlcsharp.MediaDiscoverer.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::libvlcsharp.MediaDiscoverer) global::libvlcsharp.MediaDiscoverer.NativeToManagedMap[__ret];
__result0 =
(global::libvlcsharp.MediaDiscoverer) global::libvlcsharp.MediaDiscoverer.NativeToManagedMap[__ret];
else __result0 = global::libvlcsharp.MediaDiscoverer.__CreateInstance(__ret);
return __result0;
}
......@@ -681,14 +708,16 @@ namespace libvlcsharp
/// <para>Useless, media_discoverer events are only triggered when calling</para>
/// <para>libvlc_media_discoverer_start() and libvlc_media_discoverer_stop().</para>
/// </remarks>
public static global::libvlcsharp.EventManager LibvlcMediaDiscovererEventManager(global::libvlcsharp.MediaDiscoverer p_mdis)
public static global::libvlcsharp.EventManager LibvlcMediaDiscovererEventManager(
global::libvlcsharp.MediaDiscoverer p_mdis)
{
var __arg0 = ReferenceEquals(p_mdis, null) ? global::System.IntPtr.Zero : p_mdis.__Instance;
var __ret = __Internal.LibvlcMediaDiscovererEventManager(__arg0);
global::libvlcsharp.EventManager __result0;
if (__ret == IntPtr.Zero) __result0 = null;
else if (global::libvlcsharp.EventManager.NativeToManagedMap.ContainsKey(__ret))
__result0 = (global::libvlcsharp.EventManager) global::libvlcsharp.EventManager.NativeToManagedMap[__ret];
__result0 =
(global::libvlcsharp.EventManager) global::libvlcsharp.EventManager.NativeToManagedMap[__ret];
else __result0 = global::libvlcsharp.EventManager.__CreateInstance(__ret);
return __result0;
}
......@@ -829,7 +858,8 @@ namespace libvlcsharp
/// <param name="p_iter">libvlc log iterator or NULL</param>
/// <param name="p_buf">ignored</param>
/// <returns>always NULL</returns>
public static global::libvlcsharp.LogMessage LibvlcLogIteratorNext(global::libvlcsharp.LogIterator p_iter, global::libvlcsharp.LogMessage p_buf)
public static global::libvlcsharp.LogMessage LibvlcLogIteratorNext(global::libvlcsharp.LogIterator p_iter,
global::libvlcsharp.LogMessage p_buf)
{
var __arg0 = ReferenceEquals(p_iter, null) ? global::System.IntPtr.Zero : p_iter.__Instance;
var __arg1 = ReferenceEquals(p_buf, null) ? global::System.IntPtr.Zero : p_buf.__Instance;
......@@ -855,16 +885,11 @@ namespace libvlcsharp
/// <para>Additionnal playlist item options can be specified for addition to the</para>
/// <para>item before it is played.</para>
/// </remarks>
public static void LibvlcPlaylistPlay(global::libvlcsharp.Instance p_instance, int i_id, int i_options, sbyte** ppsz_options)
public static void LibvlcPlaylistPlay(global::libvlcsharp.Instance p_instance, int i_id, int i_options,
sbyte** ppsz_options)
{
var __arg0 = ReferenceEquals(p_instance, null) ? global::System.IntPtr.Zero : p_instance.NativeReference;
__Internal.LibvlcPlaylistPlay(__arg0, i_id, i_options, ppsz_options);
}
}
namespace Delegates
{
[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(global::System.Runtime.InteropServices.CallingConvention.Cdecl)]
public unsafe delegate void Action_IntPtr();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment