1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! # scte104 — ANSI/SCTE 104 2023 Automation↔Compression DPI signalling
//!
//! SCTE 104 is the message protocol an automation system uses to tell a
//! compression/injection system to insert SCTE 35 (DPI) cueing into the outgoing
//! Transport Stream. This crate parses + builds the SCTE 104 messages:
//! `single_operation_message` and `multiple_operation_message` and the DPI
//! operations they carry (splice, time_signal, insert-descriptor, segmentation,
//! …).
//!
//! ANSI/SCTE 104 2023 — Automation System to Compression System Communications
//! Applications Program Interface (API).
//!
//! Depends only on `broadcast-common` and is `#![no_std]` (+ `alloc`).
//!
//! ## Coverage
//!
//! - [`SingleOperationMessage`] — single-operation framing (§8.2.2, Table 8-1)
//! with basic request/response operations.
//! - [`MultipleOperationMessage`] — multi-operation framing (§8.2.3, Table 8-2)
//! with Normal, Supplemental, and Control operations.
//! - All operations from Tables 8-3 and 8-4: splice, time_signal, splice_null,
//! descriptor inserts, segmentation, encryption, schedule, control words,
//! proprietary commands, and more.
//! - [`Timestamp`](time::Timestamp) (§12.5): variable-length (none/UTC/VITC/GPI)
//! with typed payloads.
//! - [`Time`](time::Time) (§12.4): 8-byte GPS-epoch timestamp used in
//! alive_request/response.
//! - [`AnyOperation`](operations::AnyOperation): unified dispatch enum with
//! a drift test pinning opID literals to type constants.
//!
//! ## Quick start
//!
//! ```
//! use scte104::{SingleOperationMessage, MultipleOperationMessage, operations::{AnyOperation, Operation, splice_request::{SpliceRequest, SpliceInsertType}}};
//! use broadcast_common::{Parse, Serialize};
//!
//! // Build a splice_request single_operation_message (basic response wrap).
//! let msg = SingleOperationMessage::new_request(
//! 0x0101, 0, 1, 42, 0,
//! scte104::operations::AnySingleOperation::Unknown { op_id: 0x0101, body: &[] },
//! );
//! let bytes = msg.to_bytes();
//!
//! // Build a multiple_operation_message with splice + insert_descriptor
//! let ops = vec![
//! Operation {
//! op_id: 0x0101,
//! data: AnyOperation::SpliceRequest(SpliceRequest {
//! splice_insert_type: SpliceInsertType::SpliceStartNormal,
//! splice_event_id: 42,
//! unique_program_id: 1,
//! pre_roll_time: 5000,
//! break_duration: 300,
//! avail_num: 0,
//! avails_expected: 0,
//! auto_return_flag: 1,
//! not_an_entry_flag: 0,
//! }),
//! },
//! ];
//! let mom = MultipleOperationMessage::new(
//! 0, 1, 42, 0, 0,
//! scte104::time::Timestamp::None,
//! ops,
//! );
//! let bytes = mom.to_bytes();
//! ```
//!
//! ## Examples
//!
//! Two runnable examples ship with this crate (`cargo run -p scte104 --example <name>`).
//!
//! ```rust,ignore
//! ```
//!
//! ```rust,ignore
//! ```
extern crate alloc;
pub use ;
pub use MultipleOperationMessage;
pub use SingleOperationMessage;