private static unsafe void OnSinksImpl(cef_media_observer_t *self, UIntPtr sinksCount, cef_media_sink_t **sinks) { var instance = GetInstance((IntPtr)self) as CefMediaObserver; if (instance == null || ((ICefMediaObserverPrivate)instance).AvoidOnSinks()) { return; } CefMediaSink[] obj_sinks = new CefMediaSink[(int)sinksCount]; for (int i = 0; i < obj_sinks.Length; i++) { var item = *(sinks + i); item->@base.AddRef(); obj_sinks[i] = CefMediaSink.Wrap(CefMediaSink.Create, item); } instance.OnSinks(obj_sinks); }
/// <summary> /// Create a new route between |source| and |sink|. Source and sink must be /// valid, compatible (as reported by cef_media_sink_t::IsCompatibleWith), and /// a route between them must not already exist. |callback| will be executed on /// success or failure. If route creation succeeds it will also trigger an /// asynchronous call to cef_media_observer_t::OnRoutes on all registered /// observers. /// </summary> public unsafe virtual void CreateRoute(CefMediaSource source, CefMediaSink sink, CefMediaRouteCreateCallback callback) { NativeInstance->CreateRoute((source != null) ? source.GetNativeInstance() : null, (sink != null) ? sink.GetNativeInstance() : null, (callback != null) ? callback.GetNativeInstance() : null); GC.KeepAlive(this); }