Commit 735eff8b authored by Martin Finkel's avatar Martin Finkel

Merge branch 'feature/Instance'

# Conflicts:
#	Bindings.Tests/InstanceTests.cs
#	LibVlcSharp/Manual/Instance.cs
#	LibVlcSharp/Manual/deprecated.cs
#	LibVlcSharp/Manual/libvlc.cs
#	LibVlcSharp/Manual/libvlc_media_discoverer.cs
#	Sample/Sample.csproj
parents 2114d39f cb36a9f9
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using NUnit.Framework;
using VideoLAN.LibVLC;
......@@ -77,5 +79,66 @@ namespace Bindings.Tests
Debug.WriteLine(audioOutputDevice.Device);
}
}
[Test]
public void EqualityTests()
{
var instance1 = new Instance(0, null);
var instance2 = new Instance(0, null);
Assert.True(instance1 != instance2);
}
[Test]
public void Categories()
{
var instance = new Instance(0, null);
var md1 = instance.MediaDiscoverers(MediaDiscovererCategory.Devices);
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 ExitCallback(() =>
{
called = true;
});
instance.SetExitHandler(exitCb, IntPtr.Zero);
instance.Dispose();
Assert.IsTrue(called);
}
[Test]
public async Task SetLogCallback()
{
var instance = new Instance(0, null);
var logCallbackCalled = false;
void LogCallback(object sender, LogEventArgs args) => logCallbackCalled = true;
instance.Log += LogCallback;
await Task.Delay(1000);
instance.Log -= LogCallback;
Assert.IsTrue(logCallbackCalled);
}
[Test]
public void SetLogFile()
{
Assert.Inconclusive();
var instance = new Instance(0, null);
var path = Path.GetTempFileName();
instance.SetLogFile(new FileStream(path, FileMode.OpenOrCreate));
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using VideoLAN.LibVLC.Delegates;
using System.Threading.Tasks;
namespace VideoLAN.LibVLC
{
......@@ -22,6 +24,18 @@ namespace VideoLAN.LibVLC
if (obj.GetType() != this.GetType()) return false;
return Equals((Instance) obj);
}
LogCallback _logCallback;
readonly object _logLock = new object();
/// <summary>
/// The real log event handlers.
/// </summary>
EventHandler<LogEventArgs> _log;
/// <summary>
/// A boolean to make sure that we are calling SetLog only once
/// </summary>
bool _logAttached = false;
public override int GetHashCode()
{
......@@ -73,6 +87,16 @@ namespace VideoLAN.LibVLC
EntryPoint = "libvlc_log_set_file")]
internal static extern void LibVLCLogSetFile(IntPtr instance, IntPtr stream);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
CharSet = CharSet.Ansi, EntryPoint = "libvlc_log_get_context")]
internal static extern void LibVLCLogGetContext(IntPtr ctx, out IntPtr module, out IntPtr file, out UIntPtr line);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_log_set")]
internal static extern void LibVLCLogSet(IntPtr instance, LogCallback cb, IntPtr data);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_module_description_list_release")]
......@@ -106,9 +130,44 @@ namespace VideoLAN.LibVLC
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_audio_output_device_list_release")]
internal static extern void LibVLCAudioOutputDeviceListRelease(IntPtr list);
}
internal static extern void LibVLCAudioOutputDeviceListRelease(IntPtr list);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_discoverer_list_get")]
internal static extern ulong LibVLCMediaDiscovererListGet(IntPtr instance, MediaDiscovererCategory category, ref IntPtr pppServices);
[SuppressUnmanagedCodeSecurity]
[DllImport("libvlc", CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_media_discoverer_list_release")]
internal static extern void LibVLCMediaDiscovererListRelease(IntPtr ppServices, ulong count);
/// <summary>
/// Compute the size required by vsprintf to print the parameters.
/// </summary>
/// <param name="format"></param>
/// <param name="ptr"></param>
/// <returns></returns>
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern int _vscprintf(string format,IntPtr ptr);
/// <summary>
/// Format a string using printf style markers
/// </summary>
/// <remarks>
/// See https://stackoverflow.com/a/37629480/2663813
/// </remarks>
/// <param name="buffer">The output buffer (should be large enough, use _vscprintf)</param>
/// <param name="format">The message format</param>
/// <param name="args">The variable arguments list pointer. We do not know what it is, but the pointer must be given as-is from C back to sprintf.</param>
/// <returns>A negative value on failure, the number of characters written otherwise.</returns>
[DllImport("msvcrt.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern int vsprintf(
IntPtr buffer,
string format,
IntPtr args);
}
public IntPtr NativeReference { get; protected set; }
internal static readonly System.Collections.Concurrent.ConcurrentDictionary<IntPtr, Instance> NativeToManagedMap
......@@ -240,7 +299,7 @@ namespace VideoLAN.LibVLC
/// <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(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);
......@@ -280,22 +339,64 @@ namespace VideoLAN.LibVLC
/// <para>complete (causing a deadlock if called from within the callback).</para>
/// <para>LibVLC 2.1.0 or later</para>
/// </remarks>
public void UnsetLog()
public void UnsetLog()
{
Internal.LibVLCLogUnset(NativeReference);
}
//TODO: void logSet(LogCb&& logCb)
public void SetLog(LogCallback cb)
{
if (cb == null) throw new ArgumentException(nameof(cb));
_logCallback = cb;
Internal.LibVLCLogSet(NativeReference, cb, IntPtr.Zero);
}
/// <summary>
/// The event that is triggered when a log is emitted from libVLC.
/// Listening to this event will discard the default logger in libvlc.
/// </summary>
public event EventHandler<LogEventArgs> Log
{
add
{
lock (_logLock)
{
_log += value;
if (!_logAttached)
{
SetLog(OnLogInternal);
_logAttached = true;
}
}
}
remove
{
lock (_logLock)
{
_log -= value;
}
}
}
/// <summary>Sets up logging to a file.</summary>
/// <param name="stream">
/// <param name="fileStream">
/// <para>FILE pointer opened for writing</para>
/// <para>(the FILE pointer must remain valid until libvlc_log_unset())</para>
/// </param>
/// <remarks>LibVLC 2.1.0 or later</remarks>
public void SetLogFile(IntPtr stream)
public void SetLogFile(FileStream fileStream)
{
Internal.LibVLCLogSetFile(NativeReference, stream);
if(fileStream == null) throw new NullReferenceException(nameof(fileStream));
if(fileStream.SafeFileHandle == null) throw new NullReferenceException(nameof(fileStream.SafeFileHandle));
if(fileStream.SafeFileHandle.IsInvalid) throw new ArgumentException("invalid file handle", nameof(fileStream.SafeFileHandle));
if(!fileStream.CanWrite) throw new ArgumentException("cannot write", nameof(fileStream));
//https://stackoverflow.com/questions/34519564/dealing-with-file-handles-using-mono-and-p-invoke
Internal.LibVLCLogSetFile(NativeReference, fileStream.SafeFileHandle.DangerousGetHandle());
}
/// <summary>Returns a list of audio filters that are available.</summary>
......@@ -318,26 +419,6 @@ namespace VideoLAN.LibVLC
}
}
private IEnumerable<TU> Retrieve<T, TU>(Func<IntPtr> getRef, Func<IntPtr, T> retrieve,
Func<T, TU> create, Func<TU, TU> next, Action<IntPtr> releaseRef)
{
var nativeRef = getRef();
if (nativeRef == IntPtr.Zero) return Enumerable.Empty<TU>();
var structure = retrieve(nativeRef);
var obj = create(structure);
var resultList = new List<TU>();
while (obj != null)
{
resultList.Add(obj);
obj = next(obj);
}
releaseRef(nativeRef);
return resultList;
}
/// <summary>Returns a list of video filters that are available.</summary>
/// <returns>
/// <para>a list of module descriptions. It should be freed with libvlc_module_description_list_release().</para>
......@@ -404,9 +485,158 @@ namespace VideoLAN.LibVLC
s => AudioOutputDevice.__CreateInstance(s),
device => device.Next, Internal.LibVLCAudioOutputDeviceListRelease);
}
/// <summary>Get media discoverer services by category</summary>
/// <param name="category">category of services to fetch</param>
/// <returns>the number of media discoverer services (0 on error)</returns>
/// <remarks>LibVLC 3.0.0 and later.</remarks>
public IEnumerable<MediaDiscovererDescription> MediaDiscoverers(MediaDiscovererCategory category)
{
var arrayResultPtr = IntPtr.Zero;
var count = Internal.LibVLCMediaDiscovererListGet(NativeReference, category, ref arrayResultPtr);
if (count == 0) return Enumerable.Empty<MediaDiscovererDescription>();
var mediaDiscovererDescription = new MediaDiscovererDescription[(int)count];
for (var i = 0; i < (int)count; i++)
{
var ptr = Marshal.ReadIntPtr(arrayResultPtr, i * IntPtr.Size);
var managedStruct = (MediaDiscovererDescription.__Internal) Marshal.PtrToStructure(ptr, typeof(MediaDiscovererDescription.__Internal));
var mdd = MediaDiscovererDescription.__CreateInstance(managedStruct);
mediaDiscovererDescription[i] = mdd;
}
Internal.LibVLCMediaDiscovererListRelease(arrayResultPtr, count);
return mediaDiscovererDescription;
}
public void SetDialogHandlers()
{
}
IEnumerable<TU> Retrieve<T, TU>(Func<IntPtr> getRef, Func<IntPtr, T> retrieve,
Func<T, TU> create, Func<TU, TU> next, Action<IntPtr> releaseRef)
{
var nativeRef = getRef();
if (nativeRef == IntPtr.Zero) return Enumerable.Empty<TU>();
var structure = retrieve(nativeRef);
var obj = create(structure);
var resultList = new List<TU>();
while (obj != null)
{
resultList.Add(obj);
obj = next(obj);
}
releaseRef(nativeRef);
return resultList;
}
/// <summary>
/// Code taken from Vlc.DotNet
/// </summary>
/// <param name="data"></param>
/// <param name="level"></param>
/// <param name="ctx"></param>
/// <param name="format"></param>
/// <param name="args"></param>
void OnLogInternal(IntPtr data, LogLevel level, IntPtr ctx, string format, IntPtr args)
{
if (_log == null) return;
// Original source for va_list handling: https://stackoverflow.com/a/37629480/2663813
var byteLength = Internal._vscprintf(format, args) + 1;
var utf8Buffer = Marshal.AllocHGlobal(byteLength);
string formattedDecodedMessage;
try
{
Internal.vsprintf(utf8Buffer, format, args);
formattedDecodedMessage = (string)Utf8StringMarshaler.GetInstance().MarshalNativeToManaged(utf8Buffer);
}
finally
{
Marshal.FreeHGlobal(utf8Buffer);
}
GetLogContext(ctx, out var module, out var file, out var line);
// Do the notification on another thread, so that VLC is not interrupted by the logging
Task.Run(() => _log?.Invoke(NativeReference, new LogEventArgs(level, formattedDecodedMessage, module, file, line)));
}
/// <summary>
/// Gets log message debug infos.
///
/// This function retrieves self-debug information about a log message:
/// - the name of the VLC module emitting the message,
/// - the name of the source code module (i.e.file) and
/// - the line number within the source code module.
///
/// The returned module name and file name will be NULL if unknown.
/// The returned line number will similarly be zero if unknown.
/// </summary>
/// <param name="logContext">The log message context (as passed to the <see cref="LogCallback"/>)</param>
/// <param name="module">The module name storage.</param>
/// <param name="file">The source code file name storage.</param>
/// <param name="line">The source code file line number storage.</param>
void GetLogContext(IntPtr logContext, out string module, out string file, out uint? line)
{
Internal.LibVLCLogGetContext(logContext, out var modulePtr, out var filePtr, out var linePtr);
line = linePtr == UIntPtr.Zero ? null : (uint?)linePtr.ToUInt32();
module = Utf8StringMarshaler.GetInstance().MarshalNativeToManaged(modulePtr) as string;
file = Utf8StringMarshaler.GetInstance().MarshalNativeToManaged(filePtr) as string;
}
}
[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void ExitCallback();
[SuppressUnmanagedCodeSecurity, UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void LogCallback(IntPtr data, LogLevel logLevel, IntPtr logContext, [MarshalAs(UnmanagedType.LPStr)] string format, IntPtr args);
public sealed class LogEventArgs : EventArgs
{
public LogEventArgs(LogLevel level, string message, string module, string sourceFile, uint? sourceLine)
{
Level = level;
Message = message;
Module = module;
SourceFile = sourceFile;
SourceLine = sourceLine;
}
/// <summary>
/// The severity of the log message.
/// By default, you will only get error messages, but you can get all messages by specifying "-vv" in the options.
/// </summary>
public LogLevel Level { get; }
/// <summary>
/// The log message
/// </summary>
public string Message { get; }
/// <summary>
/// The name of the module that emitted the message
/// </summary>
public string Module { get; }
/// <summary>
/// The source file that emitted the message.
/// This may be <see langword="null"/> if that info is not available, i.e. always if you are using a release version of VLC.
/// </summary>
public string SourceFile { get; }
/// <summary>
/// The line in the <see cref="SourceFile"/> at which the message was emitted.
/// This may be <see langword="null"/> if that info is not available, i.e. always if you are using a release version of VLC.
/// </summary>
public uint? SourceLine { get; }
}
}
\ No newline at end of file
......@@ -4,7 +4,6 @@
// Do not edit this file or all your changes will be lost after re-generation.
// </auto-generated>
// ----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
using System.Security;
......@@ -22,17 +21,25 @@ namespace VideoLAN.LibVLC
public global::System.IntPtr __Instance { get; protected set; }
protected int __PointerAdjustment;
internal static readonly global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::VideoLAN.LibVLC.LogIterator> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::VideoLAN.LibVLC.LogIterator>();
internal static readonly
global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::VideoLAN.LibVLC.LogIterator>
NativeToManagedMap =
new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::VideoLAN.LibVLC.LogIterator
>();
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::VideoLAN.LibVLC.LogIterator __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::VideoLAN.LibVLC.LogIterator __CreateInstance(global::System.IntPtr native,
bool skipVTables = false)
{
return new global::VideoLAN.LibVLC.LogIterator(native.ToPointer(), skipVTables);
}
internal static global::VideoLAN.LibVLC.LogIterator __CreateInstance(global::VideoLAN.LibVLC.LogIterator.__Internal native, bool skipVTables = false)
internal static global::VideoLAN.LibVLC.LogIterator __CreateInstance(
global::VideoLAN.LibVLC.LogIterator.__Internal native, bool skipVTables = false)
{
return new global::VideoLAN.LibVLC.LogIterator(native, skipVTables);
}
......@@ -64,41 +71,45 @@ namespace VideoLAN.LibVLC
[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::VideoLAN.LibVLC.LogMessage> NativeToManagedMap = new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::VideoLAN.LibVLC.LogMessage>();
internal static readonly
global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::VideoLAN.LibVLC.LogMessage>
NativeToManagedMap =
new global::System.Collections.Concurrent.ConcurrentDictionary<IntPtr, global::VideoLAN.LibVLC.LogMessage>()
;
protected void*[] __OriginalVTables;
protected bool __ownsNativeInstance;
internal static global::VideoLAN.LibVLC.LogMessage __CreateInstance(global::System.IntPtr native, bool skipVTables = false)
internal static global::VideoLAN.LibVLC.LogMessage __CreateInstance(global::System.IntPtr native,
bool skipVTables = false)
{
return new global::VideoLAN.LibVLC.LogMessage(native.ToPointer(), skipVTables);
}
internal static global::VideoLAN.LibVLC.LogMessage __CreateInstance(global::VideoLAN.LibVLC.LogMessage.__Internal native, bool skipVTables = false)
internal static global::VideoLAN.LibVLC.LogMessage __CreateInstance(
global::VideoLAN.LibVLC.LogMessage.__Internal native, bool skipVTables = false)
{
return new global::VideoLAN.LibVLC.LogMessage(native, skipVTables);
}
......@@ -136,7 +147,8 @@ namespace VideoLAN.LibVLC
__Instance = Marshal.AllocHGlobal(sizeof(global::VideoLAN.LibVLC.LogMessage.__Internal));
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
*((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance) = *((global::VideoLAN.LibVLC.LogMessage.__Internal*) _0.__Instance);
*((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance) =
*((global::VideoLAN.LibVLC.LogMessage.__Internal*) _0.__Instance);
}
public void Dispose()
......@@ -157,40 +169,30 @@ namespace VideoLAN.LibVLC
public int ISeverity
{
get
{
return ((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->i_severity;
}
get { return ((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->i_severity; }
set
{
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->i_severity = value;
}
set { ((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->i_severity = value; }
}
public string PszType
{
get
{
return Marshal.PtrToStringAnsi(((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_type);
}
get { return Marshal.PtrToStringAnsi(((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_type); }
set
{
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_type = Marshal.StringToHGlobalAnsi(value);
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_type =
Marshal.StringToHGlobalAnsi(value);
}
}
public string PszName
{
get
{
return Marshal.PtrToStringAnsi(((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_name);
}
get { return Marshal.PtrToStringAnsi(((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_name); }
set
{
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_name = Marshal.StringToHGlobalAnsi(value);
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_name =
Marshal.StringToHGlobalAnsi(value);
}
}
......@@ -203,7 +205,8 @@ namespace VideoLAN.LibVLC
set
{
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_header = Marshal.StringToHGlobalAnsi(value);
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_header =
Marshal.StringToHGlobalAnsi(value);
}
}
......@@ -216,7 +219,8 @@ namespace VideoLAN.LibVLC
set
{
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_message = Marshal.StringToHGlobalAnsi(value);
((global::VideoLAN.LibVLC.LogMessage.__Internal*) __Instance)->psz_message =
Marshal.StringToHGlobalAnsi(value);
}
}
}
......@@ -227,178 +231,189 @@ namespace VideoLAN.LibVLC
{
[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