video file name does not display

This forum is about all development around libVLC.
scotthu
New Cone
New Cone
Posts: 2
Joined: 16 Jan 2014 05:30

video file name does not display

Postby scotthu » 16 Jan 2014 06:48

hello there
I am using libvlc 2.2 with c#. in my c# code I wrap libvlc as follows:

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern IntPtr libvlc_new(int argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr)] string[] argv);

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern IntPtr libvlc_media_new_path(IntPtr libvlc_instance, [MarshalAs(UnmanagedType.LPStr)] string path);

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern void libvlc_media_release(IntPtr libvlc_media_inst);

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern IntPtr libvlc_media_player_new(IntPtr libvlc_instance);

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern void libvlc_media_player_set_media(IntPtr libvlc_media_player, IntPtr libvlc_media);

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern void libvlc_media_player_set_hwnd(IntPtr libvlc_mediaplayer, Int32 drawable);

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern void libvlc_media_player_play(IntPtr libvlc_mediaplayer);

[DllImport("libvlc", CallingConvention = CallingConvention.StdCall, ExactSpelling = true)]
public static extern void libvlc_media_parse(IntPtr libvlc_media);

then I want to play a video file as follows :
string[] arguments = {
"--video-title-show"
};

IntPtr libvlc_instance_ = VLC2.libvlc_new(arguments.Length, arguments);
IntPtr libvlc_media_player_ = VLC2.libvlc_media_player_new(libvlc_instance_);
IntPtr libvlc_media = VLC2.libvlc_media_new_path(libvlc_instance_, filePath);
if (libvlc_media != IntPtr.Zero)
{
libvlc_media_parse(libvlc_media);
libvlc_media_player_set_media(libvlc_media_player_, libvlc_media);
libvlc_media_release(libvlc_media);
libvlc_media_player_play(libvlc_media_player_);
}

the video does play,but the file name of the video does not show. what i am missing? thanks.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: video file name does not display

Postby sherington » 16 Jan 2014 09:25

Those command-line switches are not officially supported for such use, you are supposed to use API functions instead (if available).

This function was recently added to libvlc:

Code: Select all

libvlc_media_player_set_video_title_display
A side-effect of adding that function was that when using LibVLC the title is no longer shown by default.

scotthu
New Cone
New Cone
Posts: 2
Joined: 16 Jan 2014 05:30

Re: video file name does not display

Postby scotthu » 17 Jan 2014 02:37

hi sherington:
Thank you very much. I just followed your instruction,and it works! Thanks again for your help and your quick reply!


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 20 guests