Commit fec4fde4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Media meta data support

This seems to trigger a pseudo-random native failure. Most likely a
critical bug in the VLC meta support.
parent 45dbbcc4
......@@ -118,10 +118,10 @@ namespace VideoLAN.LibVLC
public static extern
MediaHandle MediaDuplicate (MediaHandle media);
/*[DllImport (lib, EntryPoint="libvlc_media_read_meta")]
[DllImport (lib, EntryPoint="libvlc_media_get_meta")]
public static extern
MediaHandle MediaDuplicate (MediaHandle media, int type,
NativeException ex);*/
StringHandle MediaGetMeta (MediaHandle media, MetaType type,
NativeException ex);
[DllImport (lib, EntryPoint="libvlc_media_get_state")]
public static extern
......
......@@ -225,6 +225,25 @@ namespace VideoLAN.LibVLC
return Location;
}
/**
* @param type meta data type
* @return the meta data value, or @a null if unknown
*/
public string GetMeta (MetaType type)
{
StringHandle str = LibVLC.MediaGetMeta (Handle, type, ex);
Raise ();
return str.Transform ();
}
public delegate void MetaChange (Media media, MetaType type);
public event MetaChange MetaChanged;
private void MetaCallback (MediaMetaEvent ev, IntPtr data)
{
if (MetaChanged != null)
MetaChanged (this, ev.metaType);
}
/**
* Current state of the media.
*/
......
......@@ -75,6 +75,13 @@ namespace VideoLAN.LibVLC.Test
DumpMedia ((Media)media.Clone ());
media.StateChanged += WriteMediaState;
/*foreach (MetaType type in Enum.GetValues (typeof (MetaType)))
{
string meta = media.GetMeta (type);
if (meta != null)
Console.WriteLine (" {0}: {1}", type, meta);
}*/
player.Play ();
do
{
......
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