Пример #1
0
 public AudioOutputDevice[] AudioOutputDevices(string audioOutputName)
 {
     return(MarshalUtils.Retrieve(() => Native.LibVLCAudioOutputDeviceListGet(NativeReference, audioOutputName),
                                  Marshal.PtrToStructure <AudioOutputDevice.Internal>,
                                  s => AudioOutputDevice.__CreateInstance(s),
                                  device => device.Next, Native.LibVLCAudioOutputDeviceListRelease));
 }
Пример #2
0
 /// <summary>Gets a list of audio output devices for a given audio output module,</summary>
 /// <param name="audioOutputName">
 /// <para>audio output name</para>
 /// <para>(as returned by libvlc_audio_output_list_get())</para>
 /// </param>
 /// <returns>
 /// <para>A NULL-terminated linked list of potential audio output devices.</para>
 /// <para>It must be freed with libvlc_audio_output_device_list_release()</para>
 /// </returns>
 /// <remarks>
 /// <para>libvlc_audio_output_device_set().</para>
 /// <para>Not all audio outputs support this. In particular, an empty (NULL)</para>
 /// <para>list of devices doesnotimply that the specified audio output does</para>
 /// <para>not work.</para>
 /// <para>The list might not be exhaustive.</para>
 /// <para>Some audio output devices in the list might not actually work in</para>
 /// <para>some circumstances. By default, it is recommended to not specify any</para>
 /// <para>explicit audio device.</para>
 /// <para>LibVLC 2.1.0 or later.</para>
 /// </remarks>
 public AudioOutputDevice[] AudioOutputDevices(string audioOutputName) =>
 MarshalUtils.Retrieve(() =>
 {
     var audioOutputNameUtf8 = audioOutputName.ToUtf8();
     return(MarshalUtils.PerformInteropAndFree(() =>
                                               Native.LibVLCAudioOutputDeviceListGet(NativeReference, audioOutputNameUtf8), audioOutputNameUtf8));
 },
                       MarshalUtils.PtrToStructure <AudioOutputDeviceStructure>,
                       s => s.Build(),
                       device => device.Next,
                       Native.LibVLCAudioOutputDeviceListRelease);
Пример #3
0
 /// <summary>Get media discoverer services by category</summary>
 /// <param name="discovererCategory">category of services to fetch</param>
 /// <returns>the number of media discoverer services (0 on error)</returns>
 /// <remarks>LibVLC 3.0.0 and later.</remarks>
 public MediaDiscovererDescription[] MediaDiscoverers(MediaDiscovererCategory discovererCategory) =>
 MarshalUtils.Retrieve(NativeReference, discovererCategory,
                       (IntPtr nativeRef, MediaDiscovererCategory enumType, out IntPtr array) => Native.LibVLCMediaDiscovererListGet(nativeRef, enumType, out array),
                       MarshalUtils.PtrToStructure <MediaDiscovererDescriptionStructure>,
                       m => m.Build(),
                       Native.LibVLCMediaDiscovererListRelease);
Пример #4
0
 /// <summary>Gets a list of audio output devices for a given audio output module,</summary>
 /// <param name="audioOutputName">
 /// <para>audio output name</para>
 /// <para>(as returned by libvlc_audio_output_list_get())</para>
 /// </param>
 /// <returns>
 /// <para>A NULL-terminated linked list of potential audio output devices.</para>
 /// <para>It must be freed with libvlc_audio_output_device_list_release()</para>
 /// </returns>
 /// <remarks>
 /// <para>libvlc_audio_output_device_set().</para>
 /// <para>Not all audio outputs support this. In particular, an empty (NULL)</para>
 /// <para>list of devices doesnotimply that the specified audio output does</para>
 /// <para>not work.</para>
 /// <para>The list might not be exhaustive.</para>
 /// <para>Some audio output devices in the list might not actually work in</para>
 /// <para>some circumstances. By default, it is recommended to not specify any</para>
 /// <para>explicit audio device.</para>
 /// <para>LibVLC 2.1.0 or later.</para>
 /// </remarks>
 public AudioOutputDevice[] AudioOutputDevices(string audioOutputName) =>
 MarshalUtils.Retrieve(() => Native.LibVLCAudioOutputDeviceListGet(NativeReference, Utf8StringMarshaler.GetInstance().MarshalManagedToNative(audioOutputName)),
                       MarshalUtils.PtrToStructure <AudioOutputDeviceStructure>,
                       s => s.Build(),
                       device => device.Next,
                       Native.LibVLCAudioOutputDeviceListRelease);