/// <summary> /// Wird zur eigentlichen Steuerung der Entschlüsselung aufgerufen. /// </summary> /// <param name="pmt">Die Informationen zur Quelle.</param> /// <param name="reset">Gesetzt, um einen Neustart der Entschlüsselung zu erzwingen.</param> private void Decrypt(EPG.Tables.PMT pmt, bool reset) { // Check the interface var setPtr = ComIdentity.QueryInterface(m_DataGraph.TunerFilter.Interface, typeof(KsPropertySetFireDTV.Interface)); if (setPtr == IntPtr.Zero) { return; } // Process using (var propertySet = new KsPropertySetFireDTV(setPtr)) try { // Load property identifier var propSetId = PropertySetId; var supported = propertySet.QuerySupported(ref propSetId, BDAProperties.SendCA); if ((PropertySetSupportedTypes.Set & supported) != PropertySetSupportedTypes.Set) { return; } // Process reset if (reset) { propertySet.Send(CACommand.CreateReset()); } else if (pmt == null) { propertySet.Send(CACommand.StopDecryption()); } else { propertySet.Send(CACommand.CreateDecrypt(pmt)); } } catch { // Forward if not resetting if (pmt != null) { throw; } } }
/// <summary> /// Wird zur eigentlichen Steuerung der Entschlüsselung aufgerufen. /// </summary> /// <param name="pmt">Die Informationen zur Quelle.</param> private void Decrypt(EPG.Tables.PMT pmt) { // Connect once Open(m_DataGraph.TunerFilter); // Just wait a bit if (m_TuneDelay > 0) { Thread.Sleep(m_TuneDelay); } // Create full section and process var table = pmt.Section.CreateSITable().Skip(1).ToArray(); var error = bdaapiCIReadPSIFastWithPMT(Device, table, (ushort)table.Length); if (error != APIErrorCodes.Success) { throw new DVBException(error.ToString()); } }
/// <summary> /// Wertet eine PMT aus. /// </summary> /// <param name="pmt">Die angeforderte PMT.</param> private void ProcessPMT(EPG.Tables.PMT pmt) { // Skip if (pmt == null) { return; } if (!pmt.IsValid) { return; } // Load receiver var sink = Interlocked.Exchange(ref m_PMTSink, null); if (sink != null) { try { // Process sink(pmt); } catch (Exception e) { // Maybe log does not yet exist try { // Report and ignore EventLog.WriteEntry("DVB.NET", e.ToString(), EventLogEntryType.Error); } catch { // At least trace it Trace.WriteLine(e.ToString()); } } } }