Exemplo n.º 1
0
        private void processDataSection(Mpeg2Section section)
        {
            Mpeg2ExtendedHeader mpeg2Header = new Mpeg2ExtendedHeader();

            try
            {
                mpeg2Header.Process(section.Data);
                if (mpeg2Header.Current)
                {
                    DSMCCSection dsmccSection = new DSMCCSection();
                    dsmccSection.Process(section.Data, mpeg2Header);

                    if (dsmccSection.DSMCCMessage as DSMCCDownloadDataBlock != null)
                        addDDBMessage(dsmccSection.DSMCCMessage as DSMCCDownloadDataBlock);
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Error processing DSMCC data message: " + e.Message);
            }
        }
Exemplo n.º 2
0
        private void processControlSection(Mpeg2Section section)
        {
            Mpeg2ExtendedHeader mpeg2Header = new Mpeg2ExtendedHeader();

            try
            {
                mpeg2Header.Process(section.Data);
                if (mpeg2Header.Current)
                {
                    DSMCCSection dsmccSection = new DSMCCSection();
                    dsmccSection.Process(section.Data, mpeg2Header);

                    if (dsmccSection.DSMCCMessage as DSMCCDownloadServerInitiate != null)
                        addDSIMessage(dsmccSection.DSMCCMessage as DSMCCDownloadServerInitiate);
                    else
                    {
                        if (dsmccSection.DSMCCMessage as DSMCCDownloadInfoIndication != null)
                            addDIIMessage(dsmccSection.DSMCCMessage as DSMCCDownloadInfoIndication);
                        else
                        {
                            if (dsmccSection.DSMCCMessage as DSMCCDownloadCancel != null)
                            {
                                Logger.Instance.Write("DSMCC Cancel message received: reloading all data");
                                dsiMessage = null;
                                diiMessages = null;
                                modules = null;
                            }
                        }
                    }
                }
            }
            catch (ArgumentOutOfRangeException e)
            {
                Logger.Instance.Write("<e> Error processing DSMCC control message: " + e.Message);
            }
        }