登录 注册
当前位置:主页 > 资源下载 > 49 > 在C#中,利用Libvlc库可以实现录制/录像功能的源代码

在C#中,利用Libvlc库可以实现录制/录像功能的源代码

  • 更新:2024-08-08 13:56:50
  • 大小:43.51MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:C# - 后端
  • 格式:RAR

资源介绍

/// /// 创建VLC播放器 /// /// VLC 全局变量 /// VLC MediaPlayer需要绑定显示的窗体句柄 /// public static libvlc_media_player_t Create_MediaPlayer(libvlc_instance_t libvlc_instance, IntPtr handle) { libvlc_media_player_t libvlc_media_player = IntPtr.Zero; try { if (libvlc_instance == IntPtr.Zero || libvlc_instance == null || handle == IntPtr.Zero || handle == null) { return IntPtr.Zero; } //创建播放器 libvlc_media_player = SafeNativeMethods.libvlc_media_player_new(libvlc_instance); if (libvlc_media_player == null || libvlc_media_player == IntPtr.Zero) { return IntPtr.Zero; } //设置播放窗口 SafeNativeMethods.libvlc_media_player_set_hwnd(libvlc_media_player, (int)handle); return libvlc_media_player; } catch { SafeNativeMethods.libvlc_media_player_release(libvlc_media_player); return IntPtr.Zero; } }