Commit fb221646 authored by Martin Finkel's avatar Martin Finkel

Add MediaLibrary

parent 178712a6
using System;
using System.Runtime.InteropServices;
using System.Security;
namespace VideoLAN.LibVLC.Manual
{
public class MediaLibrary : Internal
{
struct Native
{
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_library_new")]
internal static extern IntPtr LibVLCMediaLibraryNew(IntPtr instance);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_library_release")]
internal static extern void LibVLCMediaLibraryRelease(IntPtr mediaLibrary);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_library_load")]
internal static extern int LibVLCMediaLibraryLoad(IntPtr mediaLibrary);
}
public MediaLibrary(Instance instance)
: base(() => Native.LibVLCMediaLibraryNew(instance.NativeReference), Native.LibVLCMediaLibraryRelease)
{
}
/// <summary>
/// Load media library.
/// </summary>
/// <returns>true on success</returns>
public bool Load() => Native.LibVLCMediaLibraryLoad(NativeReference) == 0;
}
}
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