commit ed85a4073c95e3bed55beb2d2b1b7a9beff62e51
parent 114678fae14c075ec765088ec284fcc9de7e56c4
Author: blackfalcon <blackfalcon.ru@gmail.com>
Date: Fri, 31 May 2024 04:09:33 -0300
scte35: add more constants for segmentation descriptor
Diffstat:
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/scte35/codec_test.go b/scte35/codec_test.go
@@ -53,7 +53,7 @@ func ExampleEncode() {
Type: scte35.UPIDTI,
Value: []byte{0x00, 0x00, 0x00, 0x00, 0x2c, 0xa0, 0xa1, 0x8a},
},
- Type: ProviderPlacementOppStart,
+ Type: scte35.ProviderPlacementOppStart,
Number: 2,
Expected: 0,
},
diff --git a/scte35/scte35_test.go b/scte35/scte35_test.go
@@ -82,7 +82,7 @@ var samples = []sample{
Type: UPIDTI,
Value: []byte{0x00, 0x00, 0x00, 0x00, 0x2c, 0xa0, 0xa1, 0x8a},
},
- Type: 0x35,
+ Type: ProviderPlacementOppEnd,
Number: 2,
},
},
@@ -109,7 +109,7 @@ var samples = []sample{
Type: UPIDTI,
Value: []byte{0, 0, 0, 0, 0x2c, 0xcb, 0xc3, 0x44},
},
- Type: 0x11,
+ Type: ProgramEnd,
},
SegmentationDescriptor{
EventID: 0x48000019,
@@ -119,7 +119,7 @@ var samples = []sample{
Type: UPIDTI,
Value: []byte{0, 0, 0, 0, 0x2c, 0xa4, 0xdb, 0xa0},
},
- Type: 0x10,
+ Type: ProgramStart,
},
},
CRC32: 0x9972e343,
@@ -145,7 +145,7 @@ var samples = []sample{
Type: UPIDType(1),
Value: []byte{69, 80, 48, 49, 56, 48, 51, 56, 52, 48, 48, 54, 54, 54},
},
- Type: 33,
+ Type: ChapterEnd,
Number: 4,
Expected: 100,
},
@@ -158,7 +158,7 @@ var samples = []sample{
Type: UPIDType(1),
Value: []byte{67, 49, 52, 54, 52},
},
- Type: 48,
+ Type: ProviderAdStart,
Number: 1,
Expected: 1,
},
diff --git a/scte35/splice_descriptor.go b/scte35/splice_descriptor.go
@@ -18,10 +18,16 @@ const (
TagAudio
)
+// SCTE 35 section 10.3.3.1
const (
+ ProgramStart = 0x10
+ ProgramEnd = 0x11
+ ChapterStart = 0x20
+ ChapterEnd = 0x21
ProviderAdStart = 0x30
DistributorAdStart = 0x32
ProviderPlacementOppStart = 0x34
+ ProviderPlacementOppEnd = 0x35
DistributorPlacementOppStart = 0x36
ProviderOverlayPlacementOppStart = 0x38
DistributorOverlayPlacementOppStart = 0x3a