コード例 #1
0
 private void OnStateVariableChanged(CpStateVariable stateVariable, object newValue)
 {
     if (stateVariable.Name == Consts.STATE_PENDING_SERVER_STATES)
     {
         //Calling GetStates on the callback thread seems to cause a timeout/possible deadlock
         //during startup in some cases so call on a different thread.
         ServiceRegistration.Get <IThreadPool>().Add(UpdateStates);
     }
 }
コード例 #2
0
        private void OnTableSection(CpStateVariable stateVariable, object newValue)
        {
            try
            {
                if (!stateVariable.Name.Equals("TableSection"))
                {
                    return;
                }
                byte[] section = (byte[])newValue;
                if (section == null || section.Length < 3)
                {
                    return;
                }
                int  pid     = (section[0] << 8) + section[1];
                byte tableId = section[2];
                Log.Log.Debug("DRI CC: scan stage = {0}, PID = 0x{1:x}, table ID = 0x{2:x}, size = {3}", _scanStage, pid, tableId, section.Length);
                //DVB_MMI.DumpBinary(section, 0, section.Length);
                switch (_scanStage)
                {
                case ScanStage.Mgt:
                    if (tableId == 0xc7)
                    {
                        _mgtParser.Decode(section);
                    }
                    break;

                case ScanStage.Nit:
                    if (tableId == 0xc2)
                    {
                        _nitParser.Decode(section);
                    }
                    break;

                case ScanStage.Ntt:
                    if (tableId == 0xc3)
                    {
                        _nttParser.Decode(section);
                    }
                    break;

                case ScanStage.Vct:
                    if (tableId == 0xc8 || tableId == 0xc9)
                    {
                        _lvctParser.Decode(section);
                    }
                    else if (tableId == 0xc4)
                    {
                        _svctParser.Decode(section);
                    }
                    break;
                }
            }
            catch (Exception ex)
            {
                Log.Log.Error("DRI CC: failed to handle table section\r\n{0}", ex);
            }
        }
コード例 #3
0
 private void OnStateVariableChanged(CpStateVariable statevariable, object newValue)
 {
   if (statevariable.Name == SV_PLAYLISTS_CHANGE_COUNTER)
     FirePlaylistsChanged();
   else if (statevariable.Name == SV_MIA_TYPE_REGISTRATIONS_CHANGE_COUNTER)
     FireMIATypeRegistrationsChanged();
   else if (statevariable.Name == SV_REGISTERED_SHARES_CHANGE_COUNTER)
     FireRegisteredSharesChangeCounterChanged();
 }
コード例 #4
0
 private void OnStateVariableChanged(CpStateVariable statevariable, object newValue)
 {
     if (statevariable.Name == SV_ATTACHED_CLIENTS_CHANGE_COUNTER)
     {
         FireAttachedClientsChanged();
     }
     else if (statevariable.Name == SV_CONNECTED_CLIENTS_CHANGE_COUNTER)
     {
         FireConnectedClientsChanged();
     }
 }
コード例 #5
0
 private void OnStateVariableChanged(CpStateVariable statevariable, object newValue)
 {
     if (statevariable.Name == SV_PLAYLISTS_CHANGE_COUNTER)
     {
         FirePlaylistsChanged();
     }
     else if (statevariable.Name == SV_MIA_TYPE_REGISTRATIONS_CHANGE_COUNTER)
     {
         FireMIATypeRegistrationsChanged();
     }
     else if (statevariable.Name == SV_REGISTERED_SHARES_CHANGE_COUNTER)
     {
         FireRegisteredSharesChangeCounterChanged();
     }
     else if (statevariable.Name == SV_CURRENTLY_IMPORTING_SHARES_CHANGE_COUNTER)
     {
         FireCurrentlyImportingSharesChanged();
     }
 }