1use crate::descriptors::{AitDescriptorLoop, DescriptorLoop};
7use crate::error::{Error, Result};
8use alloc::vec::Vec;
9use dvb_common::{Parse, Serialize};
10
11pub const TABLE_ID: u8 = 0x74;
13pub const PID: u16 = 0x0000;
15
16const MIN_HEADER_LEN: usize = 3;
17const EXTENSION_HEADER_LEN: usize = 5;
18const COMMON_DESC_LEN_BYTES: usize = 2;
19const APP_LOOP_LEN_BYTES: usize = 2;
20const CRC_LEN: usize = 4;
21const APP_HEADER_LEN: usize = 9;
22const MIN_SECTION_LEN: usize =
23 MIN_HEADER_LEN + EXTENSION_HEADER_LEN + COMMON_DESC_LEN_BYTES + APP_LOOP_LEN_BYTES + CRC_LEN;
24
25#[derive(Debug, Clone, Copy, PartialEq, Eq)]
27#[cfg_attr(feature = "serde", derive(serde::Serialize))]
28#[non_exhaustive]
29pub enum ControlCode {
30 Reserved,
32 Autostart,
34 Present,
36 Destroy,
38 Kill,
40 Prefetch,
42 Remote,
44 Disabled,
46 PlaybackAutostart,
48 Unallocated(u8),
50}
51
52impl ControlCode {
53 #[must_use]
54 pub fn from_u8(v: u8) -> Self {
56 match v {
57 0x00 => Self::Reserved,
58 0x01 => Self::Autostart,
59 0x02 => Self::Present,
60 0x03 => Self::Destroy,
61 0x04 => Self::Kill,
62 0x05 => Self::Prefetch,
63 0x06 => Self::Remote,
64 0x07 => Self::Disabled,
65 0x08 => Self::PlaybackAutostart,
66 _ => Self::Unallocated(v),
67 }
68 }
69
70 #[must_use]
71 pub const fn to_u8(self) -> u8 {
73 match self {
74 Self::Reserved => 0x00,
75 Self::Autostart => 0x01,
76 Self::Present => 0x02,
77 Self::Destroy => 0x03,
78 Self::Kill => 0x04,
79 Self::Prefetch => 0x05,
80 Self::Remote => 0x06,
81 Self::Disabled => 0x07,
82 Self::PlaybackAutostart => 0x08,
83 Self::Unallocated(v) => v,
84 }
85 }
86
87 #[must_use]
88 pub fn name(self) -> &'static str {
90 match self {
91 Self::Reserved => "Reserved",
92 Self::Autostart => "AUTOSTART",
93 Self::Present => "PRESENT",
94 Self::Destroy => "DESTROY",
95 Self::Kill => "KILL",
96 Self::Prefetch => "PREFETCH",
97 Self::Remote => "REMOTE",
98 Self::Disabled => "DISABLED",
99 Self::PlaybackAutostart => "PLAYBACK_AUTOSTART",
100 Self::Unallocated(_) => "Unallocated",
101 }
102 }
103}
104dvb_common::impl_spec_display!(ControlCode, Unallocated);
105
106#[derive(Debug, Clone, Copy, PartialEq, Eq)]
111#[cfg_attr(feature = "serde", derive(serde::Serialize))]
112#[non_exhaustive]
113pub enum ApplicationType {
114 DvbJ,
116 DvbHtml,
118 HbbTv,
120 OipfDae,
122 Reserved(u16),
124 UserDefined(u16),
126}
127
128impl ApplicationType {
129 #[must_use]
130 pub fn from_u16(v: u16) -> Self {
132 match v {
133 0x0001 => Self::DvbJ,
134 0x0002 => Self::DvbHtml,
135 0x0010 => Self::HbbTv,
136 0x0011 => Self::OipfDae,
137 v @ 0x0000..0x8000 => Self::Reserved(v),
138 _ => Self::UserDefined(v),
139 }
140 }
141
142 #[must_use]
143 pub const fn to_u16(self) -> u16 {
145 match self {
146 Self::DvbJ => 0x0001,
147 Self::DvbHtml => 0x0002,
148 Self::HbbTv => 0x0010,
149 Self::OipfDae => 0x0011,
150 Self::Reserved(v) | Self::UserDefined(v) => v,
151 }
152 }
153
154 #[must_use]
155 pub fn name(self) -> &'static str {
157 match self {
158 Self::DvbJ => "DVB-J",
159 Self::DvbHtml => "DVB-HTML",
160 Self::HbbTv => "HbbTV",
161 Self::OipfDae => "OIPF DAE",
162 Self::Reserved(_) => "Reserved",
163 Self::UserDefined(_) => "User Defined",
164 }
165 }
166}
167dvb_common::impl_spec_display!(ApplicationType, Reserved, UserDefined);
168
169#[derive(Debug, Clone, PartialEq, Eq)]
171#[cfg_attr(feature = "serde", derive(serde::Serialize))]
172pub struct ApplicationIdentifier {
173 pub organisation_id: u32,
175 pub application_id: u16,
177}
178
179#[derive(Debug, Clone, PartialEq, Eq)]
181#[cfg_attr(feature = "serde", derive(serde::Serialize))]
182#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))]
183pub struct AitApplication<'a> {
184 pub identifier: ApplicationIdentifier,
186 pub control_code: ControlCode,
188 pub descriptors: DescriptorLoop<'a>,
192}
193
194impl<'a> AitApplication<'a> {
195 #[must_use]
200 pub fn ait_descriptors(&self) -> AitDescriptorLoop<'a> {
201 AitDescriptorLoop::new(self.descriptors.raw())
202 }
203}
204
205#[derive(Debug, Clone, PartialEq, Eq)]
207#[cfg_attr(feature = "serde", derive(serde::Serialize))]
208#[cfg_attr(feature = "yoke", derive(yoke::Yokeable))]
209pub struct AitSection<'a> {
210 pub application_type: ApplicationType,
212 pub test_application_flag: bool,
214 pub version_number: u8,
216 pub current_next_indicator: bool,
218 pub section_number: u8,
220 pub last_section_number: u8,
222 pub common_descriptors: DescriptorLoop<'a>,
226 pub applications: Vec<AitApplication<'a>>,
228}
229
230impl<'a> AitSection<'a> {
231 #[must_use]
236 pub fn common_ait_descriptors(&self) -> AitDescriptorLoop<'a> {
237 AitDescriptorLoop::new(self.common_descriptors.raw())
238 }
239}
240
241impl<'a> Parse<'a> for AitSection<'a> {
242 type Error = crate::error::Error;
243 fn parse(bytes: &'a [u8]) -> Result<Self> {
244 let min_len = MIN_HEADER_LEN
245 + EXTENSION_HEADER_LEN
246 + COMMON_DESC_LEN_BYTES
247 + APP_LOOP_LEN_BYTES
248 + CRC_LEN;
249 if bytes.len() < min_len {
250 return Err(Error::BufferTooShort {
251 need: min_len,
252 have: bytes.len(),
253 what: "AitSection",
254 });
255 }
256
257 if bytes[0] != TABLE_ID {
258 return Err(Error::UnexpectedTableId {
259 table_id: bytes[0],
260 what: "AitSection",
261 expected: &[TABLE_ID],
262 });
263 }
264
265 let section_length = ((bytes[1] & 0x0F) as u16) << 8 | bytes[2] as u16;
266 let total = super::check_section_length(
267 bytes.len(),
268 MIN_HEADER_LEN,
269 section_length as usize,
270 MIN_SECTION_LEN,
271 )?;
272
273 let test_application_flag = (bytes[3] & 0x80) != 0;
274 let application_type_raw = (((bytes[3] & 0x7F) as u16) << 8) | (bytes[4] as u16);
275 let application_type = ApplicationType::from_u16(application_type_raw);
276 let version_number = (bytes[5] >> 1) & 0x1F;
277 let current_next_indicator = (bytes[5] & 0x01) != 0;
278 let section_number = bytes[6];
279 let last_section_number = bytes[7];
280
281 let common_descriptors_length = (((bytes[8] & 0x0F) as usize) << 8) | bytes[9] as usize;
282 let common_desc_start = MIN_HEADER_LEN + EXTENSION_HEADER_LEN + COMMON_DESC_LEN_BYTES;
283 let common_desc_end = common_desc_start + common_descriptors_length;
284 let app_loop_end = total - CRC_LEN;
285 if common_desc_end > app_loop_end {
286 return Err(Error::SectionLengthOverflow {
287 declared: common_descriptors_length,
288 available: app_loop_end.saturating_sub(common_desc_start),
289 });
290 }
291 let common_descriptors = DescriptorLoop::new(&bytes[common_desc_start..common_desc_end]);
292
293 let app_loop_length =
294 (((bytes[common_desc_end] & 0x0F) as usize) << 8) | bytes[common_desc_end + 1] as usize;
295 let app_loop_start = common_desc_end + APP_LOOP_LEN_BYTES;
296 let app_loop_actual_end = app_loop_start + app_loop_length;
297 if app_loop_actual_end > app_loop_end {
298 return Err(Error::SectionLengthOverflow {
299 declared: app_loop_length,
300 available: app_loop_end.saturating_sub(app_loop_start),
301 });
302 }
303
304 let mut applications = Vec::new();
305 let mut pos = app_loop_start;
306 while pos + APP_HEADER_LEN <= app_loop_actual_end {
307 let organisation_id = ((bytes[pos] as u32) << 24)
308 | ((bytes[pos + 1] as u32) << 16)
309 | ((bytes[pos + 2] as u32) << 8)
310 | (bytes[pos + 3] as u32);
311 let application_id = u16::from_be_bytes(*bytes[pos + 4..].first_chunk::<2>().unwrap());
312 let control_code = ControlCode::from_u8(bytes[pos + 6]);
313 let app_desc_length =
314 (((bytes[pos + 7] & 0x0F) as usize) << 8) | bytes[pos + 8] as usize;
315 let app_desc_start = pos + APP_HEADER_LEN;
316 let app_desc_end = app_desc_start + app_desc_length;
317 if app_desc_end > app_loop_actual_end {
318 return Err(Error::SectionLengthOverflow {
319 declared: app_desc_length,
320 available: app_loop_actual_end.saturating_sub(app_desc_start),
321 });
322 }
323 applications.push(AitApplication {
324 identifier: ApplicationIdentifier {
325 organisation_id,
326 application_id,
327 },
328 control_code,
329 descriptors: DescriptorLoop::new(&bytes[app_desc_start..app_desc_end]),
330 });
331 pos = app_desc_end;
332 }
333
334 Ok(AitSection {
335 application_type,
336 test_application_flag,
337 version_number,
338 current_next_indicator,
339 section_number,
340 last_section_number,
341 common_descriptors,
342 applications,
343 })
344 }
345}
346
347impl Serialize for AitSection<'_> {
348 type Error = crate::error::Error;
349 fn serialized_len(&self) -> usize {
350 let app_bytes: usize = self
351 .applications
352 .iter()
353 .map(|a| APP_HEADER_LEN + a.descriptors.len())
354 .sum();
355 MIN_HEADER_LEN
356 + EXTENSION_HEADER_LEN
357 + COMMON_DESC_LEN_BYTES
358 + self.common_descriptors.len()
359 + APP_LOOP_LEN_BYTES
360 + app_bytes
361 + CRC_LEN
362 }
363
364 fn serialize_into(&self, buf: &mut [u8]) -> Result<usize> {
365 let len = self.serialized_len();
366 if buf.len() < len {
367 return Err(Error::OutputBufferTooSmall {
368 need: len,
369 have: buf.len(),
370 });
371 }
372
373 let section_length: u16 = (len - MIN_HEADER_LEN) as u16;
374 let app_type_raw = self.application_type.to_u16();
375 buf[0] = TABLE_ID;
376 buf[1] = super::SECTION_B1_FLAGS_DVB | ((section_length >> 8) as u8 & 0x0F);
377 buf[2] = (section_length & 0xFF) as u8;
378 buf[3] = (u8::from(self.test_application_flag) << 7) | ((app_type_raw >> 8) as u8 & 0x7F);
379 buf[4] = (app_type_raw & 0xFF) as u8;
380 buf[5] = 0xC0 | ((self.version_number & 0x1F) << 1) | u8::from(self.current_next_indicator);
381 buf[6] = self.section_number;
382 buf[7] = self.last_section_number;
383
384 let cdl = self.common_descriptors.len() as u16;
385 buf[8] = 0xF0 | ((cdl >> 8) as u8 & 0x0F);
386 buf[9] = (cdl & 0xFF) as u8;
387
388 let common_desc_start = MIN_HEADER_LEN + EXTENSION_HEADER_LEN + COMMON_DESC_LEN_BYTES;
389 buf[common_desc_start..common_desc_start + self.common_descriptors.len()]
390 .copy_from_slice(self.common_descriptors.raw());
391
392 let app_loop_start = common_desc_start + self.common_descriptors.len();
393 let app_bytes: usize = self
394 .applications
395 .iter()
396 .map(|a| APP_HEADER_LEN + a.descriptors.len())
397 .sum();
398 let apl = app_bytes as u16;
399 buf[app_loop_start] = 0xF0 | ((apl >> 8) as u8 & 0x0F);
400 buf[app_loop_start + 1] = (apl & 0xFF) as u8;
401
402 let mut pos = app_loop_start + APP_LOOP_LEN_BYTES;
403 for app in &self.applications {
404 buf[pos..pos + 4].copy_from_slice(&app.identifier.organisation_id.to_be_bytes());
405 buf[pos + 4..pos + 6].copy_from_slice(&app.identifier.application_id.to_be_bytes());
406 buf[pos + 6] = app.control_code.to_u8();
407 let adl = app.descriptors.len() as u16;
408 buf[pos + 7] = 0xF0 | ((adl >> 8) as u8 & 0x0F);
409 buf[pos + 8] = (adl & 0xFF) as u8;
410 let desc_start = pos + APP_HEADER_LEN;
411 buf[desc_start..desc_start + app.descriptors.len()]
412 .copy_from_slice(app.descriptors.raw());
413 pos = desc_start + app.descriptors.len();
414 }
415
416 let crc_pos = len - CRC_LEN;
417 let crc = dvb_common::crc32_mpeg2::compute(&buf[..crc_pos]);
418 buf[crc_pos..len].copy_from_slice(&crc.to_be_bytes());
419 Ok(len)
420 }
421}
422impl<'a> crate::traits::TableDef<'a> for AitSection<'a> {
423 const TABLE_ID_RANGES: &'static [(u8, u8)] = &[(TABLE_ID, TABLE_ID)];
424 const NAME: &'static str = "APPLICATION_INFORMATION";
425}
426
427#[cfg(test)]
428mod tests {
429 use super::*;
430
431 fn build_ait(
432 application_type: u16,
433 test_flag: bool,
434 version: u8,
435 common_descriptors: &[u8],
436 applications: &[(u32, u16, u8, Vec<u8>)],
437 ) -> Vec<u8> {
438 let app_bytes: usize = applications
439 .iter()
440 .map(|(_, _, _, d)| APP_HEADER_LEN + d.len())
441 .sum();
442 let section_length: u16 = (EXTENSION_HEADER_LEN
443 + COMMON_DESC_LEN_BYTES
444 + common_descriptors.len()
445 + APP_LOOP_LEN_BYTES
446 + app_bytes
447 + CRC_LEN) as u16;
448 let mut v = vec![
449 TABLE_ID,
450 super::super::SECTION_B1_FLAGS_DVB | ((section_length >> 8) as u8 & 0x0F),
451 (section_length & 0xFF) as u8,
452 (u8::from(test_flag) << 7) | ((application_type >> 8) as u8 & 0x7F),
453 (application_type & 0xFF) as u8,
454 0xC0 | ((version & 0x1F) << 1) | 0x01,
455 0,
456 0,
457 ];
458 let cdl = common_descriptors.len() as u16;
459 v.push(0xF0 | ((cdl >> 8) as u8 & 0x0F));
460 v.push((cdl & 0xFF) as u8);
461 v.extend_from_slice(common_descriptors);
462 let apl = app_bytes as u16;
463 v.push(0xF0 | ((apl >> 8) as u8 & 0x0F));
464 v.push((apl & 0xFF) as u8);
465 for &(org_id, app_id, cc, ref desc) in applications {
466 v.extend_from_slice(&org_id.to_be_bytes());
467 v.extend_from_slice(&app_id.to_be_bytes());
468 v.push(cc);
469 let adl = desc.len() as u16;
470 v.push(0xF0 | ((adl >> 8) as u8 & 0x0F));
471 v.push((adl & 0xFF) as u8);
472 v.extend_from_slice(desc);
473 }
474 v.extend_from_slice(&[0, 0, 0, 0]);
475 v
476 }
477
478 #[test]
479 fn parse_rejects_wrong_table_id() {
480 let mut bytes = build_ait(0x0010, false, 0, &[], &[]);
481 bytes[0] = 0x00;
482 let err = AitSection::parse(&bytes).unwrap_err();
483 assert!(matches!(
484 err,
485 Error::UnexpectedTableId { table_id: 0x00, .. }
486 ));
487 }
488
489 #[test]
490 fn parse_rejects_short_buffer() {
491 let err = AitSection::parse(&[0x74, 0x00]).unwrap_err();
492 assert!(matches!(err, Error::BufferTooShort { .. }));
493 }
494
495 #[test]
496 fn parse_empty_ait_no_applications() {
497 let bytes = build_ait(0x0010, false, 5, &[], &[]);
498 let ait = AitSection::parse(&bytes).expect("parse");
499 assert_eq!(ait.application_type, ApplicationType::HbbTv);
500 assert!(!ait.test_application_flag);
501 assert_eq!(ait.version_number, 5);
502 assert!(ait.current_next_indicator);
503 assert_eq!(ait.section_number, 0);
504 assert_eq!(ait.last_section_number, 0);
505 assert_eq!(ait.common_descriptors.len(), 0);
506 assert_eq!(ait.applications.len(), 0);
507 }
508
509 #[test]
510 fn parse_test_application_flag_extracted() {
511 let bytes = build_ait(0x0010, true, 0, &[], &[]);
512 let ait = AitSection::parse(&bytes).unwrap();
513 assert!(ait.test_application_flag);
514 }
515
516 #[test]
517 fn parse_common_descriptors_preserved() {
518 let desc = vec![0x00, 0x02, 0xAA, 0xBB];
519 let bytes = build_ait(0x0010, false, 0, &desc, &[]);
520 let ait = AitSection::parse(&bytes).unwrap();
521 assert_eq!(ait.common_descriptors.raw(), &desc[..]);
522 }
523
524 #[test]
525 fn parse_single_application() {
526 let desc = vec![0x02, 0x03, 0xCC, 0xDD, 0xEE];
527 let bytes = build_ait(
528 0x0010,
529 false,
530 0,
531 &[],
532 &[(0x12345678, 0xABCD, 0x01, desc.clone())],
533 );
534 let ait = AitSection::parse(&bytes).unwrap();
535 assert_eq!(ait.applications.len(), 1);
536 assert_eq!(ait.applications[0].identifier.organisation_id, 0x12345678);
537 assert_eq!(ait.applications[0].identifier.application_id, 0xABCD);
538 assert_eq!(ait.applications[0].control_code, ControlCode::Autostart);
539 assert_eq!(ait.applications[0].descriptors.raw(), &desc[..]);
540 }
541
542 #[test]
543 fn parse_multiple_applications_preserve_order() {
544 let bytes = build_ait(
545 0x0010,
546 false,
547 0,
548 &[],
549 &[
550 (0x00000001, 0x0001, 0x01, vec![]),
551 (0x00000002, 0x0002, 0x02, vec![0x01]),
552 (0x00000003, 0x0003, 0x03, vec![0x02, 0x03]),
553 ],
554 );
555 let ait = AitSection::parse(&bytes).unwrap();
556 assert_eq!(ait.applications.len(), 3);
557 assert_eq!(ait.applications[0].identifier.organisation_id, 1);
558 assert_eq!(ait.applications[1].identifier.organisation_id, 2);
559 assert_eq!(ait.applications[2].identifier.organisation_id, 3);
560 }
561
562 #[test]
563 fn serialize_round_trip_empty() {
564 let ait = AitSection {
565 application_type: ApplicationType::HbbTv,
566 test_application_flag: false,
567 version_number: 3,
568 current_next_indicator: true,
569 section_number: 0,
570 last_section_number: 0,
571 common_descriptors: DescriptorLoop::new(&[]),
572 applications: vec![],
573 };
574 let mut buf = vec![0u8; ait.serialized_len()];
575 ait.serialize_into(&mut buf).unwrap();
576 let reparsed = AitSection::parse(&buf).unwrap();
577 assert_eq!(ait, reparsed);
578 }
579
580 #[test]
581 fn serialize_round_trip_with_applications() {
582 let desc1: [u8; 2] = [0xAA, 0xBB];
583 let ait = AitSection {
584 application_type: ApplicationType::HbbTv,
585 test_application_flag: true,
586 version_number: 7,
587 current_next_indicator: true,
588 section_number: 1,
589 last_section_number: 2,
590 common_descriptors: DescriptorLoop::new(&[0x01, 0x00]),
591 applications: vec![
592 AitApplication {
593 identifier: ApplicationIdentifier {
594 organisation_id: 0x12345678,
595 application_id: 0xABCD,
596 },
597 control_code: ControlCode::Autostart,
598 descriptors: DescriptorLoop::new(&desc1),
599 },
600 AitApplication {
601 identifier: ApplicationIdentifier {
602 organisation_id: 0x87654321,
603 application_id: 0x00EF,
604 },
605 control_code: ControlCode::Present,
606 descriptors: DescriptorLoop::new(&[]),
607 },
608 ],
609 };
610 let mut buf = vec![0u8; ait.serialized_len()];
611 ait.serialize_into(&mut buf).unwrap();
612 let reparsed = AitSection::parse(&buf).unwrap();
613 assert_eq!(ait, reparsed);
614 }
615
616 #[test]
617 fn parse_rejects_zero_section_length() {
618 let mut buf = vec![0u8; 64];
619 buf[0] = TABLE_ID;
620 buf[1] = 0xF0;
621 buf[2] = 0x00;
622 for b in &mut buf[3..] {
623 *b = 0xFF;
624 }
625 assert!(matches!(
626 AitSection::parse(&buf).unwrap_err(),
627 Error::SectionLengthOverflow { .. }
628 ));
629 }
630
631 #[test]
632 fn control_code_full_range_round_trip() {
633 for byte in 0u8..=0xFF {
634 let cc = ControlCode::from_u8(byte);
635 assert_eq!(
636 cc.to_u8(),
637 byte,
638 "ControlCode round-trip failed for {byte:#04x}"
639 );
640 }
641 }
642
643 #[test]
644 fn control_code_named_values() {
645 assert_eq!(ControlCode::Autostart.to_u8(), 0x01);
646 assert_eq!(ControlCode::Kill.to_u8(), 0x04);
647 assert_eq!(ControlCode::Prefetch.to_u8(), 0x05);
648 assert_eq!(ControlCode::PlaybackAutostart.to_u8(), 0x08);
649 }
650
651 #[test]
652 fn control_code_wire_to_name() {
653 assert_eq!(ControlCode::from_u8(0x01).name(), "AUTOSTART");
654 assert_eq!(ControlCode::from_u8(0x04).name(), "KILL");
655 assert_eq!(ControlCode::from_u8(0x08).name(), "PLAYBACK_AUTOSTART");
656 assert_eq!(ControlCode::from_u8(0x00).name(), "Reserved");
657 }
658
659 #[test]
660 fn application_type_full_range_round_trip() {
661 for at in 0u16..=0xFFFF {
662 let app = ApplicationType::from_u16(at);
663 assert_eq!(
664 app.to_u16(),
665 at,
666 "ApplicationType round-trip failed for {at:#06x}"
667 );
668 }
669 }
670
671 #[test]
672 fn ait_descriptors_accessor_decodes_ait_namespace() {
673 let app_desc: Vec<u8> = vec![
676 0x01, 0x09, b'e', b'n', b'g', 0x05, b'H', b'b', b'b', b'T', b'V', ];
681 let buf = build_ait(
682 0x0010,
683 false,
684 0,
685 &[],
686 &[(0x12345678, 0xABCD, 0x01, app_desc)],
687 );
688 let ait = AitSection::parse(&buf).unwrap();
689 assert_eq!(ait.applications.len(), 1);
690
691 let app = &ait.applications[0];
692 let items: Vec<_> = app.ait_descriptors().iter().collect();
693 assert_eq!(items.len(), 1, "expected one AIT descriptor");
694
695 match items[0].as_ref().unwrap() {
696 crate::descriptors::ait::AnyAitDescriptor::ApplicationName(name) => {
697 assert_eq!(name.entries.len(), 1);
698 assert_eq!(
699 name.entries[0].language_code,
700 crate::text::LangCode(*b"eng")
701 );
702 assert_eq!(&*name.entries[0].application_name.decode(), "HbbTV");
703 }
704 other => panic!("expected ApplicationName, got {other:?}"),
705 }
706
707 let common_items: Vec<_> = ait.common_ait_descriptors().iter().collect();
709 assert_eq!(common_items.len(), 0);
710 }
711}