Inheritance: PSILongSection
Exemple #1
0
        public static PSISection ParseTable(int tableId, byte[] data)
        {
            PSISection table;

            switch ((TABLE_IDS)tableId)
            {
            case TABLE_IDS.PAT:
                table = new PSIPAT(); break;

            case TABLE_IDS.SDT_ACTUAL:
                table = new PSISDT(); break;

            case TABLE_IDS.PMT:
                table = new PSIPMT(); break;

            case TABLE_IDS.NIT_ACTUAL:
                table = new PSINIT(); break;

            default:
                table = new PSISection();
                break;
            }
            table.Parse(data);
            return(table);
        }
Exemple #2
0
 public static PSISection ParseTable(int tableId, byte[] data)
 {
     PSISection table;
     switch ((TABLE_IDS)tableId)
     {
         case TABLE_IDS.PAT:
             table = new PSIPAT(); break;
         case TABLE_IDS.SDT_ACTUAL:
             table = new PSISDT(); break;
         case TABLE_IDS.PMT:
             table = new PSIPMT(); break;
         case TABLE_IDS.NIT_ACTUAL:
             table = new PSINIT();break;
         default:
             table = new PSISection();
             break;
     }
     table.Parse(data);
     return table;
 }
Exemple #3
0
        private void BuildMosaicGraph(ITuningSpace tuningSpace, ArrayList programs)
        {
            this.graphBuilder = (IFilterGraph2) new FilterGraph();
            rot = new DsROTEntry(this.graphBuilder);

            // Method names should be self explanatory
            AddNetworkProviderFilter(tuningSpace);
            AddMPEG2DemuxFilter();

            AddAndConnectBDABoardFilters();
            AddTransportStreamFiltersToGraph();
            AddRenderers();

            //unsafe
            //{
            IntPtr formatPtr = Marshal.AllocHGlobal(g_Mpeg2ProgramVideo.Length);

            Marshal.Copy(g_Mpeg2ProgramVideo, 0, formatPtr, g_Mpeg2ProgramVideo.Length);

            IMpeg2Demultiplexer mpeg2Demultiplexer = this.mpeg2Demux as IMpeg2Demultiplexer;

            for (int p = 1; p < programs.Count; p++)
            {
                PSI.PSIPMT      pmt    = (PSI.PSIPMT)programs[p];
                PSI.PSIPMT.Data stream = (PSI.PSIPMT.Data)pmt.GetStreamByType(CodeTV.PSI.STREAM_TYPES.STREAMTYPE_13818_VIDEO);

                AMMediaType mediaType = new AMMediaType();
                mediaType.majorType           = MediaType.Video;
                mediaType.subType             = MediaSubType.Mpeg2Video;
                mediaType.fixedSizeSamples    = false;
                mediaType.temporalCompression = false;
                mediaType.sampleSize          = 0;
                mediaType.formatType          = FormatType.Mpeg2Video;
                mediaType.unkPtr = IntPtr.Zero;

                mediaType.formatSize = g_Mpeg2ProgramVideo.Length;
                mediaType.formatPtr  = formatPtr;

                //mediaType.formatType = FormatType.Mpeg2Video;
                //mediaType.formatSize = 0;
                //mediaType.formatPtr = IntPtr.Zero;

                string pinName = "video" + p;
                IPin   outputPin;
                int    hr = mpeg2Demultiplexer.CreateOutputPin(mediaType, pinName, out outputPin);
                if (outputPin != null)
                {
                    IMPEG2PIDMap mpeg2PIDMap = outputPin as IMPEG2PIDMap;
                    if (mpeg2PIDMap != null)
                    {
                        hr = mpeg2PIDMap.MapPID(1, new int[] { stream.Pid }, MediaSampleContent.ElementaryStream);
                    }
                    Marshal.ReleaseComObject(outputPin);
                }
            }
            Marshal.FreeHGlobal(formatPtr);
            //}

            ConfigureVMR9InWindowlessMode(programs.Count);
            ConnectAllOutputFilters();

            int   numberColumn  = 4;
            int   numberRow     = 4;
            float widthPadding  = 0.01f;
            float heightPadding = 0.01f;

            float width  = (1.0f / numberColumn) - 2.0f * widthPadding;
            float height = (1.0f / numberRow) - 2.0f * heightPadding;

            IVMRMixerControl9 vmrMixerControl9 = this.videoRenderer as IVMRMixerControl9;

            for (int p = 1; p < programs.Count; p++)
            {
                int            column, row = Math.DivRem(p - 1, numberColumn, out column);
                NormalizedRect rect = new NormalizedRect();
                rect.left   = (float)column / (float)numberColumn + widthPadding;
                rect.top    = (float)row / (float)numberRow + heightPadding;
                rect.right  = rect.left + width;
                rect.bottom = rect.top + height;
                vmrMixerControl9.SetOutputRect(p, ref rect);
            }
        }