Пример #1
0
        //To process data notified from ChannelDataStore.
        private void HandleDataFromDemux(UInt16 pid, byte[] data, Int64 dataOffset, Int64 dataLength, List <TsPacketMetadata> packetMetadataList)
        {
            DataStore section = new DataStore(data, dataOffset, dataLength);

            section.SetPacketMedataList(packetMetadataList);

            //We will need to perform some filtering in order to reduce the messages to the form, so that we can improve GUI performance.
            if ((searchRequest.SearchType == DataType.SECTION) && (searchRequest.ShowDuplicateSection == false))
            {
                bool isNew = sectionManager.AddSection(0, section);

                if (isNew)//New one and we don't want to show duplicate sections.
                {
                    if (receivedCount >= searchRequest.CountOfSkipFound)
                    {
                        if (searchRequest.DumpToFile)
                        {
                            //Dump the HEX data into the file directly.
                            DumpDataToFile(section);
                        }
                        else
                        {
                            messageCallback(MessageId.MESSAGE_SEARCHED_DATA, section);//Pass to the form.
                        }

                        receivedCount++;
                    }
                }
            }
            else
            {
                if (receivedCount >= searchRequest.CountOfSkipFound)
                {
                    if (searchRequest.DumpToFile)
                    {
                        //Dump the HEX data into the file directly.
                        DumpDataToFile(section);
                    }
                    else
                    {
                        messageCallback(MessageId.MESSAGE_SEARCHED_DATA, section);//Pass to the form.
                    }
                }

                receivedCount++;
            }

            if (searchRequest.SearchCount != -1)
            {
                //We are not going to search ALL sections.
                if (receivedCount >= (searchRequest.SearchCount + searchRequest.CountOfSkipFound))
                {
                    StopWorking();
                }
            }
        }//HandleDataFromDemux
Пример #2
0
        void ProcessFilteredData(UInt16 pid, byte[] data, Int64 dataOffset, Int64 dataLength, List <TsPacketMetadata> packetMetadataList)
        {
            DataStore section = new DataStore(data, dataOffset, dataLength);

            section.SetPacketMedataList(packetMetadataList);

            //Try to add the dataStore into the section manager.
            if (sectionManager.AddSection(pid, section))
            {
                //!!!!!!!!!!!!!!!!Important point. We will need to process some special sections in order to filter out all necessary sections.
                ProcessSection(section);

                //Return value of AddSection is true(it means that this is a new section), we will notify this dataFound to the form.
                messageCallback(MessageId.MESSAGE_STANDARD_SECTION, section);
            }
            else
            {
                //Duplicate sections.
            }
        }