Get the codec name.
Posted: 24 Dec 2008 15:57
Hi,
I am using the following code snippet to get the name of the codec of currently playing video. I am using the following code but I am getting “demux” as result, am I doing something wrong here?
unsafe struct demux_t
{
//VLC_COMMON_MEMBERS;
/* Module properties */
IntPtr p_module;
/* eg informative but needed (we can have access+demux) */
char *psz_access;
//public char *psz_demux;
public IntPtr psz_demux;
char *psz_path;
/* input stream */
IntPtr s ; /* NULL in case of a access+demux in one */
/* es output */
IntPtr es_out_t ; /* our p_es_out */
/* set by demuxer */
IntPtr demux_t1; /* demux one frame only */
IntPtr pf_control;
/* Demux has to maintain them uptodate
* when it is responsible of seekpoint/title */
struct info
{
uint i_update; /* Demux sets them on change,
Input removes them once take into account*/
/* Seekpoint/Title at demux level */
int i_title; /* idem, start from 0 (could be menu) */
int i_seekpoint; /* idem, start from 0 */
} ;
IntPtr *p_sys;
};
public string GetMetaInfo()
{
string res = "";
using (VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_DEMUX))
{
if (vobj.SubObject != IntPtr.Zero)
{
demux_t demux = new demux_t();
demux = (demux_t)Marshal.PtrToStructure(vobj.SubObject, typeof(demux_t));
unsafe
{
res = Marshal.PtrToStringAnsi(demux.psz_demux);
}
}
}
return res;
}
Regards,
Ram
I am using the following code snippet to get the name of the codec of currently playing video. I am using the following code but I am getting “demux” as result, am I doing something wrong here?
unsafe struct demux_t
{
//VLC_COMMON_MEMBERS;
/* Module properties */
IntPtr p_module;
/* eg informative but needed (we can have access+demux) */
char *psz_access;
//public char *psz_demux;
public IntPtr psz_demux;
char *psz_path;
/* input stream */
IntPtr s ; /* NULL in case of a access+demux in one */
/* es output */
IntPtr es_out_t ; /* our p_es_out */
/* set by demuxer */
IntPtr demux_t1; /* demux one frame only */
IntPtr pf_control;
/* Demux has to maintain them uptodate
* when it is responsible of seekpoint/title */
struct info
{
uint i_update; /* Demux sets them on change,
Input removes them once take into account*/
/* Seekpoint/Title at demux level */
int i_title; /* idem, start from 0 (could be menu) */
int i_seekpoint; /* idem, start from 0 */
} ;
IntPtr *p_sys;
};
public string GetMetaInfo()
{
string res = "";
using (VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_DEMUX))
{
if (vobj.SubObject != IntPtr.Zero)
{
demux_t demux = new demux_t();
demux = (demux_t)Marshal.PtrToStructure(vobj.SubObject, typeof(demux_t));
unsafe
{
res = Marshal.PtrToStringAnsi(demux.psz_demux);
}
}
}
return res;
}
Regards,
Ram