Commit f238a16b authored by Martin Finkel's avatar Martin Finkel

RendererDiscoverer: Fix service discovery name inference

parent 046aaadd
......@@ -151,11 +151,6 @@ namespace LibVLCSharp.Shared
#endif
internal const string CoreLibraryName = "libvlccore";
#if COCOA
internal const string ServiceDiscoveryProtocol = "Bonjour_renderer";
#else
internal const string ServiceDiscoveryProtocol = "microdns_renderer";
#endif
/// <summary>
/// The name of the folder that contains the per-architecture folders
/// </summary>
......
using LibVLCSharp.Shared.Helpers;
using System;
using System.Linq;
using System.Runtime.InteropServices;
namespace LibVLCSharp.Shared
......@@ -13,38 +14,33 @@ namespace LibVLCSharp.Shared
readonly struct Native
{
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_renderer_discoverer_new")]
internal static extern IntPtr LibVLCRendererDiscovererNew(IntPtr libvlc, string name);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_renderer_discoverer_release")]
internal static extern void LibVLCRendererDiscovererRelease(IntPtr rendererDiscoverer);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_renderer_discoverer_start")]
internal static extern int LibVLCRendererDiscovererStart(IntPtr rendererDiscoverer);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_renderer_discoverer_stop")]
internal static extern void LibVLCRendererDiscovererStop(IntPtr rendererDiscoverer);
[DllImport(Constants.LibraryName, CallingConvention = CallingConvention.Cdecl,
EntryPoint = "libvlc_renderer_discoverer_event_manager")]
internal static extern IntPtr LibVLCRendererDiscovererEventManager(IntPtr rendererDiscoverer);
}
/// <summary>
/// Renderer discoverer constructor
/// Create a new renderer discoverer with a LibVLC and protocol name depending on host platform
/// </summary>
/// <param name="libVLC">libvlc instance this will be connected to</param>
/// <param name="name">The service discovery protocol depending on platform (inferred)</param>
public RendererDiscoverer(LibVLC libVLC, string name = Constants.ServiceDiscoveryProtocol)
/// <param name="name">The service discovery protocol name depending on platform. Use LibVLC.RendererList to find the one for your platform</param>
public RendererDiscoverer(LibVLC libVLC, string name)
: base(() => Native.LibVLCRendererDiscovererNew(libVLC.NativeReference, name), Native.LibVLCRendererDiscovererRelease)
{
}
......
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