Exemple #1
0
        /// <summary>
        /// Create a new video stream and add it to this transport stream.
        /// </summary>
        /// <param name="encoding">Encoding of the video stream.</param>
        /// <param name="noPCR">Set to disable PCR generation.</param>
        /// <returns>The newly created video stream instance.</returns>
        public VideoStream AddVideo( byte encoding, bool noPCR )
        {
            // Check mode
            var isH264 = (encoding == (byte) EPG.StreamTypes.H264);
            var forbidPCR = (m_NoHDTVPCR && isH264) || (m_NoSDTVPCR && !isH264);

            // Run
            bool isPCR;
            short pid = AddStream( StreamTypes.Video, encoding, noPCR || forbidPCR, false, null, out isPCR );

            // Create the correct type of stream
            VideoStream video;
            if (isH264)
            {
                // Remember
                m_IsHDTV = true;

                // H.264
                video = new HDTVStream( this, pid, isPCR );
            }
            else
            {
                // MPEG-2
                video = new VideoStream( this, pid, isPCR );
            }

            // Remember
            m_Streams.Add( video );

            // Report
            return video;
        }
		/// <summary>
		/// Erzeugt eine neue Instanz und bindet sie an einen <i>Transport
		/// Stream</i>.
		/// </summary>
		/// <param name="tsFile">Der <i>Transport Stream</i>, zu dem noch keine
		/// <param name="audioName">Der ISO Name der Sprache.</param>
		/// Datenströme hinzugefügt wurden.</param>
		public PVASplitter(Manager tsFile, string audioName)
		{
			// Remember
			TransportStream = tsFile;

			// Open streams
			m_Video = TransportStream.AddVideo(255);
			m_Audio = TransportStream.AddAudio(audioName);

			// Register self for PTS guidance
			TransportStream.PVASplitter = this;

			// Create reader
			m_Worker = new Thread(new ThreadStart(Worker));

			// Configure
			m_Worker.SetApartmentState(ApartmentState.MTA);

			// Run it
			m_Worker.Start();
		}