static void GetDiagnosticAsyncInternal(IntPtr instance, MediaStreamSourceDiagnosticKind diagnosticKind) { try { FromIntPtr(instance).GetDiagnosticAsyncInternal(diagnosticKind); } catch (Exception ex) { try { Console.WriteLine("Unhandled exception in MediaStreamSource.GetDiagnosticAsyncInternal: {0}", ex); } catch { } } }
protected void ReportGetDiagnosticCompleted(MediaStreamSourceDiagnosticKind diagnosticKind, long diagnosticValue) { // according to http://www.letstakeovertheworld.com/blog/index.cgi/MSSPrimer2_10252008.html // SL2 never calls GetDiagnosticAsync, // so user code should never call this method either if (closed || media_element == null || demuxer == IntPtr.Zero) { throw new InvalidOperationException(); } // NativeMethods.media_element_report_get_diagnostic_completed (media_element.native, diagnosticKind, diagnosticValue); }
/// <summary> /// Gathers the diagnostic information requested. /// </summary> /// <param name="diagnosticKind"></param> protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { try { _workQueue.Enqueue(new WorkQueueElement(WorkQueueElement.Command.Diagnostics, diagnosticKind)); } catch (Exception e) { RaiseError(e); throw; } }
protected override void GetDiagnosticAsync( MediaStreamSourceDiagnosticKind diagnosticKind) { System.Diagnostics.Debug.WriteLine("diag"); throw new NotImplementedException(); }
protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { ReportGetDiagnosticCompleted(diagnosticKind, 0); }
protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { Debug.WriteLine("GetDiagnosticAsync: " + diagnosticKind); this.ReportGetDiagnosticCompleted(diagnosticKind, 0); }
protected void ReportGetDiagnosticCompleted (MediaStreamSourceDiagnosticKind diagnosticKind, long diagnosticValue) { // according to http://www.letstakeovertheworld.com/blog/index.cgi/MSSPrimer2_10252008.html // SL2 never calls GetDiagnosticAsync, // so user code should never call this method either if (closed || media_element == null || demuxer == IntPtr.Zero) throw new InvalidOperationException (); // NativeMethods.media_element_report_get_diagnostic_completed (media_element.native, diagnosticKind, diagnosticValue); }
protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { }
/// <summary> /// Overrides MediaStreamSource.GetDiagnosticAsync /// </summary> /// <param name="diagnosticKind">describes the kind of information to get</param> protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { try { // Shuffle this command off to a worker thread m_workQueue.Enqueue(new WorkQueueElement(WorkQueueElement.Command.Diagnostics, diagnosticKind)); } catch (AdaptiveStreamingException e) { RaiseError(e); } catch (Exception e) { RaiseError(e); throw; } }
protected override void GetDiagnosticAsync (MediaStreamSourceDiagnosticKind diagnosticKind) { Log.Add (new LogEntry ("GetDiagnosticAsync", diagnosticKind)); }
protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { Log.Add(new LogEntry("GetDiagnosticAsync", diagnosticKind)); }
/// <summary> /// The <see cref="T:System.Windows.Controls.MediaElement" /> can call this method to request information about the /// <see /// cref="T:System.Windows.Media.MediaStreamSource" /> /// . Developers respond to this method by calling /// <see /// cref="M:System.Windows.Media.MediaStreamSource.ReportGetDiagnosticCompleted(System.Windows.Media.MediaStreamSourceDiagnosticKind,System.Int64)" /> /// . /// </summary> /// <param name="diagnosticKind"> /// A member of the <see cref="T:System.Windows.Media.MediaStreamSourceDiagnosticKind" /> enumeration describing what /// type of information is desired. /// </param> protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { Debug.WriteLine("TsMediaStreamSource.GetDiagnosticAsync({0})", diagnosticKind); throw new NotImplementedException(); }
protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { Debug.WriteLine("TsMediaStreamSource.GetDiagnosticAsync({0})", (object)diagnosticKind); throw new NotImplementedException(); }
static void GetDiagnosticAsyncInternal (IntPtr instance, MediaStreamSourceDiagnosticKind diagnosticKind) { try { FromIntPtr (instance).GetDiagnosticAsyncInternal (diagnosticKind); } catch (Exception ex) { try { Console.WriteLine ("Unhandled exception in MediaStreamSource.GetDiagnosticAsyncInternal: {0}", ex); } catch { } } }
/// <summary> /// Do a diagnostics command request /// </summary> /// <param name="diagnosticsKind">the kind of diagnostics to get</param> private void DoDiagnostics(MediaStreamSourceDiagnosticKind diagnosticsKind) { StreamInfo audioStreamInfo = m_manifestInfo.GetStreamInfoForStreamType(MediaStreamType.Audio); ulong result = 0; switch (diagnosticsKind) { case MediaStreamSourceDiagnosticKind.BufferLevelInBytes: result = m_manifestInfo.GetStreamInfoForStreamType(MediaStreamType.Video).Queue.BufferSize; if (audioStreamInfo != null) { result += audioStreamInfo.Queue.BufferSize; } break; case MediaStreamSourceDiagnosticKind.BufferLevelInMilliseconds: ulong video = m_manifestInfo.GetStreamInfoForStreamType(MediaStreamType.Video).Queue.BufferTime; ulong audio = 0; if (audioStreamInfo != null) { audio = audioStreamInfo.Queue.BufferTime; } result = (video > audio ? audio : video) / 10000; break; } ReportGetDiagnosticCompleted(diagnosticsKind, (long)result); }
internal void GetDiagnosticAsyncInternal (MediaStreamSourceDiagnosticKind diagnosticKind) { media_element.Dispatcher.BeginInvoke (delegate () { GetDiagnosticAsync (diagnosticKind); }); }
internal void GetDiagnosticAsyncInternal (MediaStreamSourceDiagnosticKind diagnosticKind) { GetDiagnosticAsync (diagnosticKind); }
protected abstract void GetDiagnosticAsync (MediaStreamSourceDiagnosticKind diagnosticKind);
// // Summary: // The System.Windows.Controls.MediaElement can call this method to request // information about the System.Windows.Media.MediaStreamSource. Developers // respond to this method by calling System.Windows.Media.MediaStreamSource.ReportGetDiagnosticCompleted(System.Windows.Media.MediaStreamSourceDiagnosticKind,System.Int64). // // Parameters: // diagnosticKind: // A member of the System.Windows.Media.MediaStreamSourceDiagnosticKind enumeration // describing what type of information is desired. public abstract void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind);
internal void GetDiagnosticAsyncInternal(MediaStreamSourceDiagnosticKind diagnosticKind) { media_element.Dispatcher.BeginInvoke(delegate() { GetDiagnosticAsync(diagnosticKind); }); }
// // Summary: // Developers call this method, in response to System.Windows.Media.MediaStreamSource.GetDiagnosticAsync(System.Windows.Media.MediaStreamSourceDiagnosticKind), // to pass the requested diagnostic information to the System.Windows.Controls.MediaElement. // // Parameters: // diagnosticKind: // The type of diagnostic that you are returning a value for. // // diagnosticValue: // The value associated with the diagnostics that was returned. protected void ReportGetDiagnosticCompleted(MediaStreamSourceDiagnosticKind diagnosticKind, long diagnosticValue) { // _service.ReportGetDiagnosticCompleted(diagnosticKind, diagnosticValue); }
protected abstract void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind);
// FIXME: should be implemented, but can be done later. protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { throw new System.NotImplementedException(); // ReportGetDiagnosticCompleted(diagnosticKind, diagnosticValue); }
/// <summary> /// Not implemented /// </summary> /// <param name="diagnosticKind">The diagnostic kind</param> protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { throw new NotImplementedException(); }
/// <summary> /// Handler for diagnostics command /// </summary> /// <param name="diagnosticKind"></param> private void DoGetDiagnostic(MediaStreamSourceDiagnosticKind diagnosticKind) { switch (diagnosticKind) { case MediaStreamSourceDiagnosticKind.BufferLevelInMilliseconds: ReportGetDiagnosticCompleted(diagnosticKind, (long)BufferLevel.TotalMilliseconds); break; case MediaStreamSourceDiagnosticKind.BufferLevelInBytes: ReportGetDiagnosticCompleted(diagnosticKind, BufferLevelInBytes); break; } }
protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind) { throw new NotImplementedException(); }