private void TestGetTDT() { int hr = 0; int[] pids = { 0x14 }; IDVB_TDT tdt; // Route PID 0x14 to the filter hr = pidMapper.MapPID(pids.Length, pids, MediaSampleContent.Mpeg2PSI); DsError.ThrowExceptionForHR(hr); hr = parser.GetTDT(out tdt); Debug.Assert((hr == 0) && (tdt != null), "IDvbSiParser.GetTDT failed (" + hr + ")"); if (tdt != null) { Marshal.ReleaseComObject(tdt); } }
private void TestMap() { int hr; int [] arr = new int[2]; arr[0] = 0xc0; arr[1] = 0xc1; hr = m_ipid.MapPID(arr.Length, arr, MediaSampleContent.ElementaryStream); DsError.ThrowExceptionForHR(hr); }
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); } }