CefMediaRouteCreateCallback.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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 CefMediaRouter::CreateRoute. The methods of this
  10. /// class will be called on the browser process UI thread.
  11. /// </summary>
  12. public abstract unsafe partial class CefMediaRouteCreateCallback
  13. {
  14. private void on_media_route_create_finished(cef_media_route_create_callback_t* self, CefMediaRouteCreateResult result, cef_string_t* error, cef_media_route_t* route)
  15. {
  16. CheckSelf(self);
  17. var mError = cef_string_t.ToString(error);
  18. var mRoute = CefMediaRoute.FromNativeOrNull(route);
  19. OnMediaRouteCreateFinished(result, mError, mRoute);
  20. }
  21. /// <summary>
  22. /// Method that will be executed when the route creation has finished. |result|
  23. /// will be CEF_MRCR_OK if the route creation succeeded. |error| will be a
  24. /// description of the error if the route creation failed. |route| is the
  25. /// resulting route, or empty if the route creation failed.
  26. /// </summary>
  27. protected abstract void OnMediaRouteCreateFinished(CefMediaRouteCreateResult result, string error, CefMediaRoute route);
  28. }
  29. }