[DllImport ("libvlc.dll", EntryPoint="libvlc_media_get_mrl")]
public static extern
- void MediaGetMRL (MediaHandle media);
+ MemoryHandle MediaGetMRL (MediaHandle media, NativeException ex);
[DllImport ("libvlc.dll", EntryPoint="libvlc_media_duplicate")]
public static extern
* arrays (as used by the native LibVLC) and managed strings.
*/
[StructLayout (LayoutKind.Sequential)]
- public struct U8String
+ internal struct U8String
{
public byte[] mb_str; /**< nul-terminated UTF-8 bytes array */
return new U8String (ptr).ToString ();
}
};
+
+ /**
+ * @brief MemoryHandle: heap allocation by the C run-time
+ * @ingroup Internals
+ */
+ internal sealed class MemoryHandle : NonNullHandle
+ {
+ [DllImport ("libvlc.dll", EntryPoint="libvlc_free")]
+ private static extern void Free (IntPtr ptr);
+
+ /**
+ * NonNullHandle.Destroy
+ */
+ protected override void Destroy ()
+ {
+ Free (handle);
+ }
+
+ public override string ToString ()
+ {
+ return U8String.FromNative (handle);
+ }
+
+ public string Transform ()
+ {
+ string value = ToString ();
+ Close ();
+ return value;
+ }
+ };
};