CefMediaSinkDeviceInfoCallback.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. namespace Xilium.CefGlue
  2. {
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using System.Runtime.InteropServices;
  7. using Xilium.CefGlue.Interop;
  8. /// <summary>
  9. /// Callback interface for CefMediaSink::GetDeviceInfo. The methods of this
  10. /// class will be called on the browser process UI thread.
  11. /// </summary>
  12. public abstract unsafe partial class CefMediaSinkDeviceInfoCallback
  13. {
  14. private void on_media_sink_device_info(cef_media_sink_device_info_callback_t* self, cef_media_sink_device_info_t* device_info)
  15. {
  16. CheckSelf(self);
  17. var mIPAddress = cef_string_t.ToString(&device_info->ip_address);
  18. var mModelName = cef_string_t.ToString(&device_info->model_name);
  19. var mDeviceInfo = new CefMediaSinkDeviceInfo(
  20. ipAddress: mIPAddress,
  21. port: device_info->port,
  22. modelName: mModelName);
  23. OnMediaSinkDeviceInfo(in mDeviceInfo);
  24. }
  25. /// <summary>
  26. /// Method that will be executed asyncronously once device information has been
  27. /// retrieved.
  28. /// </summary>
  29. protected abstract void OnMediaSinkDeviceInfo(in CefMediaSinkDeviceInfo deviceInfo);
  30. }
  31. }