Page 1 of 1

How to get " input_item_t " in C#

Posted: 04 May 2009 06:09
by Khenatram
Hello,

I want to use following function of VLC 0.8.6.i

Code: Select all

VLC_EXPORT( char *, vlc_input_item_GetInfo, ( input_item_t *p_i, const char *psz_cat,const char *psz_name ) );
But the issue is I am not able to get the "input_item_t" object.

Can anyone help me in getting the input_item_t object in C#.

Thanks,
Ram

Re: How to get " input_item_t " in C#

Posted: 07 May 2009 09:47
by Khenatram
I have created the following structure for input_item_t.

Code: Select all

[StructLayout(LayoutKind.Sequential)] struct input_item_t { public IntPtr psz_name; public IntPtr psz_uri; public int i_options; /**< Number of input options */ public IntPtr ppsz_options; public mtime_t i_duration; /**< A hint about the duration of this * item, in milliseconds*/ public int i_id; /**< Identifier of the item */ public uint i_type; /**< Type (file, disc, ...) */ public int i_categories; /**< Number of info categories */ public IntPtr pp_categories; /**< Pointer to the first info category */ public IntPtr i_es; /**< Number of es format descriptions */ IntPtr es; /**< Pointer to an array of es formats */ public vlc_bool_t b_fixed_name; /**< Can the interface change the name ?*/ public IntPtr input_stats_t; /**< Statistics */ public vlc_mutex_t lockObj; /**< Item cannot be changed without this lock */ };

and I am creating its object as follows

Code: Select all

VlcObject vobj = new VlcObject(this.vlcHandle, ObjectType.VLC_OBJECT_VLC); input_item_t it = (input_item_t)Marshal.PtrToStructure(vobj.Vlc, typeof(input_item_t));
But I am getting "0" value for pp_categories. Am I missing anything here?