Example #1
0
 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 {
         }
     }
 }
Example #2
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);
        }
 /// <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);
 }
Example #6
0
        protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind)
        {
            Debug.WriteLine("GetDiagnosticAsync: " + diagnosticKind);

            this.ReportGetDiagnosticCompleted(diagnosticKind, 0);
        }
Example #7
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);
		}
Example #8
0
 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;
     }
 }
Example #10
0
			protected override void GetDiagnosticAsync (MediaStreamSourceDiagnosticKind diagnosticKind)
			{
				Log.Add (new LogEntry ("GetDiagnosticAsync", diagnosticKind));
			}
Example #11
0
 protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind)
 {
     Log.Add(new LogEntry("GetDiagnosticAsync", diagnosticKind));
 }
 protected override void GetDiagnosticAsync(
     MediaStreamSourceDiagnosticKind diagnosticKind)
 {
     System.Diagnostics.Debug.WriteLine("diag");
     throw new NotImplementedException();
 }
Example #13
0
        /// <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();
        }
Example #14
0
 protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind)
 {
     Debug.WriteLine("TsMediaStreamSource.GetDiagnosticAsync({0})", (object)diagnosticKind);
     throw new NotImplementedException();
 }
Example #15
0
		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);
        }
Example #17
0
		internal void GetDiagnosticAsyncInternal (MediaStreamSourceDiagnosticKind diagnosticKind)
		{
			media_element.Dispatcher.BeginInvoke (delegate () {
				GetDiagnosticAsync (diagnosticKind);
			});
		}
Example #18
0
		internal void GetDiagnosticAsyncInternal (MediaStreamSourceDiagnosticKind diagnosticKind)
		{
			GetDiagnosticAsync (diagnosticKind);
		}
Example #19
0
		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);
Example #21
0
 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);
 }
Example #23
0
 protected abstract void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind);
Example #24
0
 // 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;
            }
        }
Example #27
0
 protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind)
 {
     throw new NotImplementedException();
 }
Example #28
0
 protected override void GetDiagnosticAsync(MediaStreamSourceDiagnosticKind diagnosticKind)
 {
 }