/// <summary> /// Rekonstruiert eine VideoText Beschreibung. /// </summary> /// <param name="buffer">Sammelt Detailbeschreibungen.</param> internal void CreatePayload(TableConstructor buffer) { // The language buffer.AddLanguage(ISOLanguage); // Code field buffer.Add((byte)((MagazineNumber & 0x7) | (((int)Type) << 3))); buffer.Add(PageNumberBCD); }
/// <summary> /// /// </summary> /// <param name="buffer"></param> protected override void CreatePayload(TableConstructor buffer) { // Collected flags byte flags = 0; // Load flags if (m_HasComponentType) { flags |= 0x80; } if (m_HasBSID) { flags |= 0x40; } if (m_HasMainID) { flags |= 0x20; } if (m_HasAssociatedService) { flags |= 0x10; } // Write flags buffer.Add(flags); // Write all if (m_HasComponentType) { buffer.Add(m_ComponentType); } if (m_HasBSID) { buffer.Add(m_BSID); } if (m_HasMainID) { buffer.Add(m_MainID); } if (m_HasAssociatedService) { buffer.Add(m_AssociatedService); } // Load the additional information buffer.Add(m_AdditionalInformation); }
/// <summary> /// /// </summary> /// <param name="buffer"></param> protected override void CreatePayload(TableConstructor buffer) { // Collected flags byte flags = 0; // Load flags if (m_HasComponentType) flags |= 0x80; if (m_HasBSID) flags |= 0x40; if (m_HasMainID) flags |= 0x20; if (m_HasAssociatedService) flags |= 0x10; // Write flags buffer.Add(flags); // Write all if (m_HasComponentType) buffer.Add(m_ComponentType); if (m_HasBSID) buffer.Add(m_BSID); if (m_HasMainID) buffer.Add(m_MainID); if (m_HasAssociatedService) buffer.Add(m_AssociatedService); // Load the additional information buffer.Add(m_AdditionalInformation); }
/// <summary> /// Create a PMT for the program. /// </summary> /// <remarks> /// There will be a lot of randomly choosen values just to make the transport /// stream valid. Each audio stream will be reported as <i>german</i> and /// similiar defaults are attached to a teletext stream. /// </remarks> /// <returns>The table describing the related program.</returns> protected override byte[] CreateTable() { // Create buffer TableConstructor buffer = new TableConstructor(); // Append to buffer buffer.Add((byte)(0xe0 | (PCRPID / 256))); buffer.Add((byte)(PCRPID & 0xff)); buffer.Add(0xf0, 0x00); // All entries for (int ip = 0; ip < m_Streams.Count;) { // Load short pid = m_Streams[ip++]; StreamTypes type = m_Type[pid]; // Is teletext or audio bool ttx = (StreamTypes.TeleText == type); bool sub = !ttx && (StreamTypes.SubTitles == type); bool ac3 = !ttx && !sub && (StreamTypes.Private == type); bool aud = ac3 || (!ttx && !sub && (StreamTypes.Audio == type)); // Append to buffer buffer.Add((ttx || sub) ? (byte)StreamTypes.Private : m_Encoding[pid]); buffer.Add((byte)(0xe0 | (pid / 256))); buffer.Add((byte)(pid & 0xff)); buffer.Add(0xf0); // Length int lengthPos = buffer.CreateDynamicLength(); // Create stream identifier buffer.Add(new StreamIdentifier((byte)ip)); // Check for additional data if (ttx) { // Create teletext descriptor buffer.Add(new Teletext()); } else if (sub) { // Load descriptor list SubtitleInfo[] subInfos = DVBSubtitles[pid]; // Create the descriptor Subtitle subDescr = new Subtitle(); // Check mode if ((null == subInfos) || (subInfos.Length < 1)) { // Create a brand new pseudo entry subDescr.Subtitles.Add(new SubtitleInfo("deu", EPG.SubtitleTypes.DVBNormal, 1, 1)); } else { // Use as is subDescr.Subtitles.AddRange(subInfos); } // Serialize to buffer buffer.Add(subDescr); } else if (aud) { // Load language string language; if (!m_AudioNames.TryGetValue(pid, out language)) { language = "deu"; } // Create language descriptor ISOLanguage audioDescriptor = new ISOLanguage(); // Append language item audioDescriptor.Languages.Add(new LanguageItem(language, ac3 ? EPG.AudioTypes.Undefined : EPG.AudioTypes.CleanEffects)); // Append to buffer buffer.Add(audioDescriptor); // Fill AC3 descriptor if (ac3) { buffer.Add(new AC3()); } } // Finish buffer.SetDynamicLength(lengthPos); } // Report return(buffer.ToArray()); }
/// <summary> /// /// </summary> /// <param name="buffer"></param> protected override void CreatePayload(TableConstructor buffer) { // Add buffer.Add(ComponentTag); }
/// <summary> /// Rekonstruiert eine VideoText Beschreibung. /// </summary> /// <param name="buffer">Sammelt Detailbeschreibungen.</param> internal void CreatePayload( TableConstructor buffer ) { // The language buffer.AddLanguage( ISOLanguage ); // Code field buffer.Add( (byte) ((MagazineNumber & 0x7) | (((int) Type) << 3)) ); buffer.Add( PageNumberBCD ); }