scte35

package
v1.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package scte35 contains the structs for encoding and/or decoding SCTE-35 signal.

Index

Constants

View Source
const (
	// DeviceRestrictionsGroup0 is the device_restrictions for Restrict Group 0
	DeviceRestrictionsGroup0 = 0x00
	// DeviceRestrictionsGroup1 is the device_restrictions for Restrict Group 1
	DeviceRestrictionsGroup1 = 0x01
	// DeviceRestrictionsGroup2 is the device_restrictions for Restrict Group 2
	DeviceRestrictionsGroup2 = 0x02
	// DeviceRestrictionsNone is the device_restrictions for None
	DeviceRestrictionsNone = 0x03
)
View Source
const (
	// EncryptionAlgorithmNone is the encryption_algorithm for None.
	EncryptionAlgorithmNone = 0
	// EncryptionAlgorithmDESECB is the encryption_algorithm for DES - ECB Mode.
	EncryptionAlgorithmDESECB = 1
	// EncryptionAlgorithmDESCBC is the encryption_algorithm for DES - CBC Mode.
	EncryptionAlgorithmDESCBC = 2
	// EncryptionAlgorithmTripleDES is the encryption_algorithm for Triple DES
	// EDE3 - ECB Mode.
	EncryptionAlgorithmTripleDES = 3
)
View Source
const (
	// Reserved bits shall be set to 1
	Reserved = 0xFF
	// TicksPerSecond is the number of 90KHz ticks per second
	TicksPerSecond = 90000
)
View Source
const (
	// SegmentationDescriptorTag is the splice_descriptor_tag for
	// segmentation_descriptor
	SegmentationDescriptorTag = 0x02

	// SegmentationTypeNotIndicated is the segmentation_type_id for Not Indicated.
	SegmentationTypeNotIndicated = 0x00
	// SegmentationTypeContentIdentification is the segmentation_type_id for
	// Content Identification.
	SegmentationTypeContentIdentification = 0x01
	// SegmentationTypeProgramStart is the segmentation_type_id for Program Start.
	SegmentationTypeProgramStart = 0x10
	// SegmentationTypeProgramEnd is the segmentation_type_id for Program End.
	SegmentationTypeProgramEnd = 0x11
	// SegmentationTypeProgramEarlyTermination is the segmentation_type_id for
	// Program Early Termination.
	SegmentationTypeProgramEarlyTermination = 0x12
	// SegmentationTypeProgramBreakaway is the segmentation_type_id for
	// Program Breakaway.
	SegmentationTypeProgramBreakaway = 0x13
	// SegmentationTypeProgramResumption is the segmentation_type_id for Program
	// Resumption.
	SegmentationTypeProgramResumption = 0x14
	// SegmentationTypeProgramRunoverPlanned is the segmentation_type_id for
	// Program Runover Planned.
	SegmentationTypeProgramRunoverPlanned = 0x15
	// SegmentationTypeProgramRunoverUnplanned is the segmentation_type_id for
	// Program Runover Unplanned.
	SegmentationTypeProgramRunoverUnplanned = 0x16
	// SegmentationTypeProgramOverlapStart is the segmentation_type_id for Program
	// Overlap Start.
	SegmentationTypeProgramOverlapStart = 0x17
	// SegmentationTypeProgramBlackoutOverride is the segmentation_type_id for
	// Program Blackout Override.
	SegmentationTypeProgramBlackoutOverride = 0x18
	// SegmentationTypeProgramStartInProgress is the segmentation_type_id for
	// Program Start - In Progress.
	SegmentationTypeProgramStartInProgress = 0x19
	// SegmentationTypeChapterStart is the segmentation_type_id for Chapter Start.
	SegmentationTypeChapterStart = 0x20
	// SegmentationTypeChapterEnd is the segmentation_type_id for Chapter End.
	SegmentationTypeChapterEnd = 0x21
	// SegmentationTypeBreakStart is the segmentation_type_id for Break Start.
	// Added in ANSI/SCTE 2017.
	SegmentationTypeBreakStart = 0x22
	// SegmentationTypeBreakEnd is the segmentation_type_id for Break End.
	// Added in ANSI/SCTE 2017.
	SegmentationTypeBreakEnd = 0x23
	// SegmentationTypeOpeningCreditStart is the segmentation_type_id for
	// Opening Credit Start. Added in ANSI/SCTE 2020.
	SegmentationTypeOpeningCreditStart = 0x24
	// SegmentationTypeOpeningCreditEnd is the segmentation_type_id for
	// Opening Credit End. Added in ANSI/SCTE 2020.
	SegmentationTypeOpeningCreditEnd = 0x25
	// SegmentationTypeClosingCreditStart is the segmentation_type_id for
	// Closing Credit Start. Added in ANSI/SCTE 2020.
	SegmentationTypeClosingCreditStart = 0x26
	// SegmentationTypeClosingCreditEnd is the segmentation_type_id for
	// Closing Credit End. Added in ANSI/SCTE 2020.
	SegmentationTypeClosingCreditEnd = 0x27
	// SegmentationTypeProviderAdStart is the segmentation_type_id for Provider
	// Ad Start.
	SegmentationTypeProviderAdStart = 0x30
	// SegmentationTypeProviderAdEnd is the segmentation_type_id for Provider Ad
	// End.
	SegmentationTypeProviderAdEnd = 0x31
	// SegmentationTypeDistributorAdStart is the segmentation_type_id for
	// Distributor Ad Start.
	SegmentationTypeDistributorAdStart = 0x32
	// SegmentationTypeDistributorAdEnd is the segmentation_type_id for
	// Distributor Ad End.
	SegmentationTypeDistributorAdEnd = 0x33
	// SegmentationTypeProviderPOStart is the segmentation_type_id for Provider
	// PO Start.
	SegmentationTypeProviderPOStart = 0x34
	// SegmentationTypeProviderPOEnd is the segmentation_type_id for Provider PO
	// End.
	SegmentationTypeProviderPOEnd = 0x35
	// SegmentationTypeDistributorPOStart is the segmentation_type_id for
	// Distributor PO Start.
	SegmentationTypeDistributorPOStart = 0x36
	// SegmentationTypeDistributorPOEnd is the segmentation_type_id for
	// Distributor PO End.
	SegmentationTypeDistributorPOEnd = 0x37
	// SegmentationTypeProviderOverlayPOStart is the segmentation_type_id for
	// Provider Overlay Placement Opportunity Start.
	SegmentationTypeProviderOverlayPOStart = 0x38
	// SegmentationTypeProviderOverlayPOEnd is the segmentation_type_id for
	// Provider Overlay Placement Opportunity End.
	SegmentationTypeProviderOverlayPOEnd = 0x39
	// SegmentationTypeDistributorOverlayPOStart is the segmentation_type_id for
	// Distributor Overlay Placement Opportunity Start.
	SegmentationTypeDistributorOverlayPOStart = 0x3a
	// SegmentationTypeDistributorOverlayPOEnd is the segmentation_type_id for
	// Distributor Overlay Placement Opportunity End.
	SegmentationTypeDistributorOverlayPOEnd = 0x3b
	// SegmentationTypeProviderPromoStart is the segmentation_type_id for
	// Provider Promo Start. Added in ANSI/SCTE 2020.
	SegmentationTypeProviderPromoStart = 0x3c
	// SegmentationTypeProviderPromoEnd is the segmentation_type_id for
	// Provider Promo End. Added in ANSI/SCTE 2020.
	SegmentationTypeProviderPromoEnd = 0x3d
	// SegmentationTypeDistributorPromoStart is the segmentation_type_id for
	// Distributor Promo Start. Added in ANSI/SCTE 2020.
	SegmentationTypeDistributorPromoStart = 0x3e
	// SegmentationTypeDistributorPromoEnd is the segmentation_type_id for
	// Distributor Promo End. Added in ANSI/SCTE 2020.
	SegmentationTypeDistributorPromoEnd = 0x3f
	// SegmentationTypeUnscheduledEventStart is the segmentation_type_id for
	// Unscheduled Event Start.
	SegmentationTypeUnscheduledEventStart = 0x40
	// SegmentationTypeUnscheduledEventEnd is the segmentation_type_id for
	// Unscheduled Event End.
	SegmentationTypeUnscheduledEventEnd = 0x41
	// SegmentationTypeAltConOppStart is the segmentation_type_id for
	// Alternate Content Opportunity Start. Added in ANSI/SCTE 2020.
	SegmentationTypeAltConOppStart = 0x42
	// SegmentationTypeAltConOppEnd is the segmentation_type_id for
	// Alternate Content Opportunity End. Added in ANSI/SCTE 2020.
	SegmentationTypeAltConOppEnd = 0x43
	// SegmentationTypeProviderAdBlockStart is the segmentation_type_id for
	// Provider Ad Block Start. Added in ANSI/SCTE 2020.
	SegmentationTypeProviderAdBlockStart = 0x44
	// SegmentationTypeProviderAdBlockEnd is the segmentation_type_id for
	// Provider Ad Block End. Added in ANSI/SCTE 2020.
	SegmentationTypeProviderAdBlockEnd = 0x45
	// SegmentationTypeDistributorAdBlockStart is the segmentation_type_id for
	// Distributor Ad Block Start. Added in ANSI/SCTE 2020.
	SegmentationTypeDistributorAdBlockStart = 0x46
	// SegmentationTypeDistributorAdBlockEnd is the segmentation_type_id for
	// Distributor Ad Block End. Added in ANSI/SCTE 2020.
	SegmentationTypeDistributorAdBlockEnd = 0x47
	// SegmentationTypeNetworkStart is the segmentation_type_id for Network Start.
	SegmentationTypeNetworkStart = 0x50
	// SegmentationTypeNetworkEnd is the segmentation_type_id for Network End.
	SegmentationTypeNetworkEnd = 0x51
)
View Source
const (
	// SegmentationUPIDTypeNotUsed is the segmentation_upid_type for Not Used.
	SegmentationUPIDTypeNotUsed = 0x00
	// SegmentationUPIDTypeUserDefined is the segmentation_upid_type for User
	// Defined.
	SegmentationUPIDTypeUserDefined = 0x01
	// SegmentationUPIDTypeISCI is the segmentation_upid_type for ISCI
	SegmentationUPIDTypeISCI = 0x02
	// SegmentationUPIDTypeAdID is the segmentation_upid_type for Ad-ID
	SegmentationUPIDTypeAdID = 0x03
	// SegmentationUPIDTypeUMID is the segmentation_upid_type for UMID
	SegmentationUPIDTypeUMID = 0x04
	// SegmentationUPIDTypeISANDeprecated is the segmentation_upid_type for
	// ISAN Deprecated.
	SegmentationUPIDTypeISANDeprecated = 0x05
	// SegmentationUPIDTypeISAN is the segmentation_upid_type for ISAN.
	SegmentationUPIDTypeISAN = 0x06
	// SegmentationUPIDTypeTID is the segmentation_upid_type for TID.
	SegmentationUPIDTypeTID = 0x07
	// SegmentationUPIDTypeTI is the segmentation_upid_type for TI.
	SegmentationUPIDTypeTI = 0x08
	// SegmentationUPIDTypeADI is the segmentation_upid_type for ADI.
	SegmentationUPIDTypeADI = 0x09
	// SegmentationUPIDTypeEIDR is the segmentation_upid_type for EIDR.
	SegmentationUPIDTypeEIDR = 0x0a
	// SegmentationUPIDTypeATSC is the segmentation_upid_type for ATSC Content
	// Identifier.
	SegmentationUPIDTypeATSC = 0x0b
	// SegmentationUPIDTypeMPU is the segmentation_upid_type for MPU().
	SegmentationUPIDTypeMPU = 0x0c
	// SegmentationUPIDTypeMID is the segmentation_upid_type for MID().
	SegmentationUPIDTypeMID = 0x0d
	// SegmentationUPIDTypeADS is the segmentation_upid_type for ADS Information.
	SegmentationUPIDTypeADS = 0x0e
	// SegmentationUPIDTypeURI is the segmentation_upid_type for URI.
	SegmentationUPIDTypeURI = 0x0f
	// SegmentationUPIDTypeUUID is the segmentation_upid_type for UUID.
	SegmentationUPIDTypeUUID = 0x10
	// SegmentationUPIDTypeSCR is the segmentation_upid_type for SCR.
	SegmentationUPIDTypeSCR = 0x11
)
View Source
const (
	// CUEIdentifier is 32-bit number used to identify the owner of the
	// descriptor. The identifier shall have a value of 0x43554549 (ASCII “CUEI”).
	CUEIdentifier = 0x43554549
	// CUEIASCII is the CUEIIdentifier ASCII value
	CUEIASCII = "CUEI"
)
View Source
const (
	// TableID is an 8-bit field that shall be 0xFC.
	TableID = 0xFC
	// SectionSyntaxIndicator is a 1-bit field that should always be set to '0'.
	SectionSyntaxIndicator = false
	// PrivateIndicator is a 1-bit flag that shall be set to 0.
	PrivateIndicator = false

	// SAPType1 indicates closed GOP with no leading pictures.
	SAPType1 = uint32(0x0)
	// SAPType2 indicates closed GOP with leading pictures.
	SAPType2 = uint32(0x1)
	// SAPType3 indicates Open GOP.
	SAPType3 = uint32(0x2)
	// SAPTypeNotSpecified indicates the type of SAP, if any, is not signaled.
	SAPTypeNotSpecified = uint32(0x3)
)
View Source
const (
	// AudioDescriptorTag is the splice_descriptor_tag for a audio descriptor.
	AudioDescriptorTag = 0x04
)
View Source
const (
	// AvailDescriptorTag is the splice_descriptor_tag for an avail_descriptor
	AvailDescriptorTag = 0x00
)
View Source
const (
	// BandwidthReservationType is the splice_command_type for
	// bandwidth_reservation()
	BandwidthReservationType = 0x07
)
View Source
const (
	// DTMFDescriptorTag is the splice_descriptor_tag for a dtmf_descriptor
	DTMFDescriptorTag = 0x01
)
View Source
const (
	// PrivateCommandType is the splice_command_type for private_command()
	PrivateCommandType = 0xFF
)
View Source
const (
	// SpliceInsertType is the splice_command_type for splice_insert()
	SpliceInsertType = 0x05
)
View Source
const (
	// SpliceNullType is the splice_command_type for splice_null()
	SpliceNullType = 0x00
)
View Source
const (
	// SpliceScheduleType is the splice_command_type for the splice_schedule()
	// command
	SpliceScheduleType = 0x04
)
View Source
const (
	// TimeDescriptorTag is the splice_descriptor_tag for a time_descriptor.
	TimeDescriptorTag = 0x03
)
View Source
const (
	// TimeSignalType is the splice_command_type for a time_signal SpliceCommand.
	TimeSignalType = 0x06
)

Variables

View Source
var (
	// ErrBufferUnderflow is returned when decoding fails to fully consume the
	// provided byte array.
	ErrBufferUnderflow = errors.New("buffer underflow")
	// ErrBufferOverflow is returned when decoding requires more bytes than are
	// available.
	ErrBufferOverflow = errors.New("buffer overflow")
	// ErrUnsupportedEncoding is returned if the signal is not a base-64 encoded
	// string.
	ErrUnsupportedEncoding = errors.New("invalid or unsupported encoding")
)
View Source
var (
	// ErrCRC32Invalid indicates that a splice_info_sections CRC_32 is
	// invalid with respect to the binary payload.
	ErrCRC32Invalid = errors.New("CRC_32 not valid")
)
View Source
var Logger = log.New(io.Discard, "SCTE35 ", log.Ldate|log.Ltime|log.Llongfile)

Logger for emitting debug messages.

Functions

func DurationToTicks

func DurationToTicks(d time.Duration) uint64

DurationToTicks converts a duration to 90MhZ ticks.

func TicksToDuration

func TicksToDuration(ticks uint64) time.Duration

TicksToDuration converts 90MhZ ticks to a duration.

Types

type AudioChannel

type AudioChannel struct {
	ComponentTag  uint32 `xml:"componentTag,attr" json:"componentTag"`
	ISOCode       string `xml:"ISOCode,attr" json:"isoCode"`
	BitStreamMode uint32 `xml:"BitStreamMode,attr" json:"bitStreamMode"`
	NumChannels   uint32 `xml:"NumChannels,attr" json:"numChannels"`
	FullSrvcAudio bool   `xml:"FullSrvcAudio,attr" json:"fullSrvcAudio"`
}

AudioChannel collects the audio PID details.

type AudioDescriptor

type AudioDescriptor struct {
	XMLName       xml.Name       `xml:"http://www.scte.org/schemas/35 AudioDescriptor" json:"-"`
	JSONType      uint32         `xml:"-" json:"type"`
	AudioChannels []AudioChannel `xml:"http://www.scte.org/schemas/35 AudioChannel" json:"audioChannels"`
}

AudioDescriptor is an implementation of a audio_descriptor. The audio_descriptor() should be used when programmers and/or MVPDs do not support dynamic signaling (e.g., signaling of audio language changes) and with legacy audio formats that do not support dynamic signaling.

func (*AudioDescriptor) Tag

func (sd *AudioDescriptor) Tag() uint32

Tag returns the splice_descriptor_tag.

type AvailDescriptor

type AvailDescriptor struct {
	XMLName         xml.Name `xml:"http://www.scte.org/schemas/35 AvailDescriptor" json:"-"`
	JSONType        uint32   `xml:"-" json:"type"`
	ProviderAvailID uint32   `xml:"providerAvailId,attr" json:"providerAvailId"`
}

AvailDescriptor is an implementation of a splice_descriptor. It provides an optional extension to the splice_insert() command that allows an authorization identifier to be sent for an avail. Multiple copies of this descriptor may be included by using the loop mechanism provided. This identifier is intended to replicate the functionality of the cue tone system used in analog systems for ad insertion. This descriptor is intended only for use with a splice_insert() command, within a splice_info_section.

func (*AvailDescriptor) Tag

func (sd *AvailDescriptor) Tag() uint32

Tag returns the splice_descriptor_tag.

type BandwidthReservation

type BandwidthReservation struct {
	XMLName  xml.Name `xml:"http://www.scte.org/schemas/35 BandwidthReservation" json:"-"`
	JSONType uint32   `xml:"-" json:"type"`
}

BandwidthReservation command is provided for reserving bandwidth in a multiplex. A typical usage would be in a satellite delivery system that requires packets of a certain PID to always be present at the intended repetition rate to guarantee a certain bandwidth for that PID. This message differs from a splice_null() command so that it can easily be handled in a unique way by receiving equipment (i.e. removed from the multiplex by a satellite receiver). If a descriptor is sent with this command, it can not be expected that it will be carried through the entire transmission chain and it should be a private descriptor that is utilized only by the bandwidth reservation process.

func (*BandwidthReservation) Type

func (cmd *BandwidthReservation) Type() uint32

Type returns the splice_command_type.

type BreakDuration

type BreakDuration struct {
	AutoReturn bool   `xml:"autoReturn,attr" json:"autoReturn"`
	Duration   uint64 `xml:"duration,attr" json:"duration"`
}

BreakDuration specifies the duration of the commercial break(s). It may be used to give the splicer an indication of when the break will be over and when the network In Point will occur.

type Bytes

type Bytes []byte

Bytes is a byte array.

func (Bytes) MarshalText

func (bb Bytes) MarshalText() ([]byte, error)

MarshalText encodes Bytes to a hexadecimal string.

func (*Bytes) UnmarshalText

func (bb *Bytes) UnmarshalText(b []byte) error

UnmarshalText decodes a hexadecimal string.

type DTMFDescriptor

type DTMFDescriptor struct {
	XMLName   xml.Name `xml:"http://www.scte.org/schemas/35 DTMFDescriptor" json:"-"`
	JSONType  uint32   `xml:"-" json:"type"`
	Preroll   uint32   `xml:"preroll,attr" json:"preroll"`
	DTMFChars string   `xml:"chars,attr" json:"chars"`
}

DTMFDescriptor is an implementation of a splice_descriptor. It provides an optional extension to the splice_insert() command that allows a receiver device to generate a legacy analog DTMF sequence based on a splice_info_section being received.

func (*DTMFDescriptor) Tag

func (sd *DTMFDescriptor) Tag() uint32

Tag returns the splice_descriptor_tag.

type DeliveryRestrictions

type DeliveryRestrictions struct {
	ArchiveAllowedFlag     bool   `xml:"archiveAllowedFlag,attr" json:"archiveAllowedFlag"`
	WebDeliveryAllowedFlag bool   `xml:"webDeliveryAllowedFlag,attr" json:"webDeliveryAllowedFlag"`
	NoRegionalBlackoutFlag bool   `xml:"noRegionalBlackoutFlag,attr" json:"noRegionalBlackoutFlag"`
	DeviceRestrictions     uint32 `xml:"deviceRestrictions,attr" json:"deviceRestrictions"`
}

DeliveryRestrictions contains the specific delivery restriction flags as defined within the SegmentationDescriptorType XML schema definition.

type EncryptedPacket

type EncryptedPacket struct {
	EncryptionAlgorithm uint32 `xml:"encryptionAlgorithm,attr,omitempty" json:"encryptionAlgorithm,omitempty"`
	CWIndex             uint32 `xml:"cwIndex,attr,omitempty" json:"cwIndex,omitempty"`
}

EncryptedPacket contains the encryption details if this payload has been encrypted.

type Event

type Event struct {
	Program                    *EventProgram    `xml:"http://www.scte.org/schemas/35 Program" json:"program"`
	Components                 []EventComponent `xml:"http://www.scte.org/schemas/35 Component" json:"components"`
	BreakDuration              *BreakDuration   `xml:"http://www.scte.org/schemas/35 BreakDuration" json:"breakDuration"`
	SpliceEventID              uint32           `xml:"spliceEventId,attr" json:"spliceEventId"`
	SpliceEventCancelIndicator bool             `xml:"spliceEventCancelIndicator,attr" json:"spliceEventCancelIndicator"`
	OutOfNetworkIndicator      bool             `xml:"outOfNetworkIndicator,attr" json:"outOfNetworkIndicator,omitempty"`
	UniqueProgramID            uint32           `xml:"uniqueProgramId,attr" json:"uniqueProgramId,omitempty"`
	AvailNum                   uint32           `xml:"availNum,attr" json:"availNum,omitempty"`
	AvailsExpected             uint32           `xml:"availsExpected,attr" json:"availsExpected,omitempty"`
}

Event is a single event within a splice_schedule.

func (*Event) DurationFlag added in v1.2.0

func (e *Event) DurationFlag() bool

DurationFlag returns the duration_flag.

func (*Event) ProgramSpliceFlag added in v1.2.0

func (e *Event) ProgramSpliceFlag() bool

ProgramSpliceFlag returns the program_splice_flag.

type EventComponent

type EventComponent struct {
	Tag           uint32        `xml:"componentTag,attr" json:"componentTag"`
	UTCSpliceTime UTCSpliceTime `xml:"utcSpliceTime,attr" json:"utcSpliceTime"`
}

EventComponent contains the Splice Points in Component Splice Mode.

type EventProgram

type EventProgram struct {
	XMLName       xml.Name      `xml:"http://www.scte.org/schemas/35 Program" json:"-"`
	UTCSpliceTime UTCSpliceTime `xml:"utcSpliceTime,attr" json:"utcSpliceTime"`
}

EventProgram contains the Splice Point in Program Splice Mode

type PrivateCommand

type PrivateCommand struct {
	XMLName      xml.Name `xml:"http://www.scte.org/schemas/35 PrivateCommand" json:"-"`
	JSONType     uint32   `xml:"-" json:"type"`
	Identifier   uint32   `xml:"identifier,attr" json:"identifier"`
	PrivateBytes Bytes    `xml:",chardata" json:"privateBytes"`
}

PrivateCommand provides a means to distribute user-defined commands using the SCTE 35 protocol. The first bit field in each user-defined command is a 32-bit identifier, unique for each participating vendor. Receiving equipment should skip any splice_info_section() messages containing private_command() structures with unknown identifiers.

func (*PrivateCommand) IdentifierString

func (cmd *PrivateCommand) IdentifierString() string

IdentifierString returns the identifier as a string.

func (*PrivateCommand) Type

func (cmd *PrivateCommand) Type() uint32

Type returns the splice_command_type.

type PrivateDescriptor

type PrivateDescriptor struct {
	XMLName      xml.Name `xml:"http://www.scte.org/schemas/35 PrivateDescriptor" json:"-"`
	JSONType     uint32   `xml:"-" json:"type"`
	PrivateTag   uint32   `xml:"tag,attr" json:"tag"`
	Identifier   uint32   `xml:"identifier,attr" json:"identifier"`
	PrivateBytes Bytes    `xml:",chardata" json:"privateBytes"`
}

PrivateDescriptor encapsulates the contents of non-CUEI descriptors

func (*PrivateDescriptor) IdentifierString

func (sd *PrivateDescriptor) IdentifierString() string

IdentifierString returns the identifier as a string

func (*PrivateDescriptor) Tag

func (sd *PrivateDescriptor) Tag() uint32

Tag returns the splice_descriptor_tag.

type SegmentationDescriptor

type SegmentationDescriptor struct {
	XMLName                          xml.Name                          `xml:"http://www.scte.org/schemas/35 SegmentationDescriptor" json:"-"`
	JSONType                         uint32                            `xml:"-" json:"type"`
	DeliveryRestrictions             *DeliveryRestrictions             `xml:"http://www.scte.org/schemas/35 DeliveryRestrictions" json:"deliveryRestrictions,omitempty"`
	SegmentationUPIDs                []SegmentationUPID                `xml:"http://www.scte.org/schemas/35 SegmentationUpid" json:"segmentationUpids,omitempty"`
	Components                       []SegmentationDescriptorComponent `xml:"http://www.scte.org/schemas/35 Component" json:"components,omitempty"`
	SegmentationEventID              uint32                            `xml:"segmentationEventId,attr,omitempty" json:"segmentationEventId,omitempty"`
	SegmentationEventCancelIndicator bool                              `xml:"segmentationEventCancelIndicator,attr,omitempty" json:"segmentationEventCancelIndicator,omitempty"`
	SegmentationDuration             *uint64                           `xml:"segmentationDuration,attr" json:"segmentationDuration,omitempty"`
	SegmentationTypeID               uint32                            `xml:"segmentationTypeId,attr,omitempty" json:"segmentationTypeId,omitempty"`
	SegmentNum                       uint32                            `xml:"segmentNum,attr,omitempty" json:"segmentNum,omitempty"`
	SegmentsExpected                 uint32                            `xml:"segmentsExpected,attr,omitempty" json:"segmentsExpected,omitempty"`
	SubSegmentNum                    *uint32                           `xml:"subSegmentNum,attr" json:"subSegmentNum,omitempty"`
	SubSegmentsExpected              *uint32                           `xml:"subSegmentsExpected,attr" json:"subSegmentsExpected,omitempty"`
}

SegmentationDescriptor is an implementation of a splice_descriptor(). It provides an optional extension to the time_signal() and splice_insert() commands that allows for segmentation messages to be sent in a time/video accurate method. This descriptor shall only be used with the time_signal(), splice_insert() and the splice_null() commands. The time_signal() or splice_insert() message should be sent at least once a minimum of 4 seconds in advance of the signaled splice_time() to permit the insertion device to place the splice_info_section( ) accurately.

func (*SegmentationDescriptor) DeliveryNotRestrictedFlag added in v1.1.0

func (sd *SegmentationDescriptor) DeliveryNotRestrictedFlag() bool

DeliveryNotRestrictedFlag returns the delivery_not_restricted_flag.

func (*SegmentationDescriptor) Name

func (sd *SegmentationDescriptor) Name() string

Name returns the human-readable string for the segmentation_type_id.

func (*SegmentationDescriptor) ProgramSegmentationFlag added in v1.1.0

func (sd *SegmentationDescriptor) ProgramSegmentationFlag() bool

ProgramSegmentationFlag returns the program_segmentation_flag.

func (*SegmentationDescriptor) SegmentationDurationFlag added in v1.1.0

func (sd *SegmentationDescriptor) SegmentationDurationFlag() bool

SegmentationDurationFlag returns the segmentation_duration_flag.

func (*SegmentationDescriptor) SegmentationUpidLength added in v1.1.0

func (sd *SegmentationDescriptor) SegmentationUpidLength() int

SegmentationUpidLength return the segmentation_upid_length

func (*SegmentationDescriptor) Tag

func (sd *SegmentationDescriptor) Tag() uint32

Tag returns the splice_descriptor_tag.

type SegmentationDescriptorComponent

type SegmentationDescriptorComponent struct {
	Tag       uint32 `xml:"componentTag,attr" json:"componentTag"`
	PTSOffset uint64 `xml:"ptsOffset,attr" json:"ptsOffset"`
}

SegmentationDescriptorComponent describes the Component element contained within the SegmentationDescriptorType XML schema definition.

type SegmentationUPID

type SegmentationUPID struct {
	Type             uint32  `xml:"segmentationUpidType,attr" json:"segmentationUpidType"`
	FormatIdentifier *uint32 `xml:"formatIdentifier,attr,omitempty" json:"formatIdentifier,omitempty"`
	Value            string  `xml:",chardata" json:"value"`
	// Deprecated: no longer used and will be removed in a future release
	Format string `xml:"-" json:"-"`
}

SegmentationUPID is used to express a UPID in an XML document.

func NewSegmentationUPID

func NewSegmentationUPID(upidType uint32, buf []byte) SegmentationUPID

NewSegmentationUPID construct a new SegmentationUPID

func (*SegmentationUPID) ASCIIValue

func (upid *SegmentationUPID) ASCIIValue() string

ASCIIValue returns Value as an ASCII string. Characters outside the printable range are represented by a dot (".").

func (*SegmentationUPID) Name

func (upid *SegmentationUPID) Name() string

Name returns the name for the segmentation_upid_type.

type SpliceCommand

type SpliceCommand interface {
	Type() uint32
	// contains filtered or unexported methods
}

SpliceCommand is an interface for splice_command.

func NewSpliceCommand

func NewSpliceCommand(spliceCommandType uint32) SpliceCommand

NewSpliceCommand returns the splice command appropriate for the given type.

type SpliceDescriptor

type SpliceDescriptor interface {
	Tag() uint32
	// contains filtered or unexported methods
}

SpliceDescriptor is a prototype for adding new fields to the splice_info_section. All descriptors included use the same syntax for the first six bytes. In order to allow private information to be added we have included the ‘identifier’ code. This removes the need for a registration descriptor in the descriptor loop.

Any receiving equipment should skip any descriptors with unknown identifiers or unknown descriptor tags. For descriptors with known identifiers, the receiving equipment should skip descriptors with an unknown splice_descriptor_tag.

func NewSpliceDescriptor

func NewSpliceDescriptor(identifier uint32, tag uint32) SpliceDescriptor

NewSpliceDescriptor returns the appropriate splice_descriptor for the given identifier and tag

type SpliceDescriptors

type SpliceDescriptors []SpliceDescriptor

SpliceDescriptors is a slice of SpliceDescriptor.

func (*SpliceDescriptors) UnmarshalJSON

func (sds *SpliceDescriptors) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes a JSON array into a slice of SpliceDescriptors.

func (*SpliceDescriptors) UnmarshalXML

func (sds *SpliceDescriptors) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML decodes an XML payload into a slice of SpliceDescriptors.

Unlike UnmarshalJSON, this function is executed once per SpliceDescriptor rather than once per slice.

type SpliceInfoSection

type SpliceInfoSection struct {
	XMLName             xml.Name          `xml:"http://www.scte.org/schemas/35 SpliceInfoSection"`
	EncryptedPacket     EncryptedPacket   `xml:"http://www.scte.org/schemas/35 EncryptedPacket,omitempty"`
	SpliceCommand       SpliceCommand     `xml:""`
	SpliceDescriptors   SpliceDescriptors `xml:""`
	SAPType             uint32            `xml:"sapType,attr"`
	PreRollMilliSeconds uint32            `xml:"preRollMilliSeconds,attr,omitempty"` // no corresponding binary field
	PTSAdjustment       uint64            `xml:"ptsAdjustment,attr,omitempty"`
	ProtocolVersion     uint32            `xml:"protocolVersion,attr,omitempty"`
	Tier                uint32            `xml:"tier,attr"`
	// contains filtered or unexported fields
}

SpliceInfoSection shall be carried in transport packets whereby only one section or partial section may be in any transport packet. Splice_info_sections shall always start at the beginning of a transport packet payload. When a section begins in a transport packet and this is the first packet of the splice_info_section, the pointer_field shall be present and equal to 0x00 and the payload_unit_start_indicator bit shall be equal to one (per the requirements of section syntax usage per [MPEG Systems]).

func DecodeBase64

func DecodeBase64(s string) (*SpliceInfoSection, error)

DecodeBase64 is a convenience function for decoding a base-64 string into a SpliceInfoSection. If an error occurs, the returned SpliceInfoSection will contain the results of decoding up until the error condition was encountered.

func DecodeHex

func DecodeHex(s string) (*SpliceInfoSection, error)

DecodeHex is a convenience function for decoding a hexadecimal string into a SpliceInfoSection. If an error occurs, the returned SpliceInfoSection will contains the results of decoding up until the error condition was encountered.

func (*SpliceInfoSection) Base64

func (sis *SpliceInfoSection) Base64() string

Base64 returns the SpliceInfoSection as a base64 encoded string.

func (*SpliceInfoSection) Decode

func (sis *SpliceInfoSection) Decode(b []byte) (err error)

Decode the contents of a byte array into this SpliceInfoSection.

func (*SpliceInfoSection) Duration

func (sis *SpliceInfoSection) Duration() time.Duration

Duration attempts to return the duration of the signal.

func (*SpliceInfoSection) Encode

func (sis *SpliceInfoSection) Encode() ([]byte, error)

Encode returns the binary representation of this SpliceInfoSection as a byte array.

func (*SpliceInfoSection) EncryptedPacketFlag added in v1.1.0

func (sis *SpliceInfoSection) EncryptedPacketFlag() bool

EncryptedPacketFlag returns the value of encrypted_packet_flag

func (*SpliceInfoSection) Hex

func (sis *SpliceInfoSection) Hex() string

Hex returns the SpliceInfoSection as a hexadecimal encoded string.

func (*SpliceInfoSection) MarshalJSON

func (sis *SpliceInfoSection) MarshalJSON() ([]byte, error)

MarshalJSON encodes a SpliceInfoSection to JSON.

func (*SpliceInfoSection) SAPTypeName

func (sis *SpliceInfoSection) SAPTypeName() string

SAPTypeName returns the Stream Access Point type name.

func (*SpliceInfoSection) Table added in v1.1.0

func (sis *SpliceInfoSection) Table(prefix, indent string) string

Table returns the tabular description of this SpliceInfoSection as described in ANSI/SCTE 35 Table 5.

func (*SpliceInfoSection) UnmarshalJSON

func (sis *SpliceInfoSection) UnmarshalJSON(b []byte) error

UnmarshalJSON decodes a SpliceInfoSection from JSON.

func (*SpliceInfoSection) UnmarshalXML

func (sis *SpliceInfoSection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML decodes a SpliceInfoSection from XML.

type SpliceInsert

type SpliceInsert struct {
	XMLName                    xml.Name                `xml:"http://www.scte.org/schemas/35 SpliceInsert" json:"-"`
	JSONType                   uint32                  `xml:"-" json:"type"`
	Program                    *SpliceInsertProgram    `xml:"http://www.scte.org/schemas/35 Program" json:"program,omitempty"`
	Components                 []SpliceInsertComponent `xml:"http://www.scte.org/schemas/35 Component" json:"components,omitempty"`
	BreakDuration              *BreakDuration          `xml:"http://www.scte.org/schemas/35 BreakDuration" json:"breakDuration,omitempty"`
	SpliceEventID              uint32                  `xml:"spliceEventId,attr" json:"spliceEventId,omitempty"`
	SpliceEventCancelIndicator bool                    `xml:"spliceEventCancelIndicator,attr" json:"spliceEventCancelIndicator"`
	SpliceImmediateFlag        bool                    `xml:"spliceImmediateFlag,attr" json:"spliceImmediateFlag"`
	OutOfNetworkIndicator      bool                    `xml:"outOfNetworkIndicator,attr" json:"outOfNetworkIndicator"`
	UniqueProgramID            uint32                  `xml:"uniqueProgramId,attr" json:"uniqueProgramId,omitempty"`
	AvailNum                   uint32                  `xml:"availNum,attr" json:"availNum,omitempty"`
	AvailsExpected             uint32                  `xml:"availsExpected,attr" json:"availsExpected,omitempty"`
}

SpliceInsert is a command shall be sent at least once for every splice event.

func (*SpliceInsert) DurationFlag added in v1.1.0

func (cmd *SpliceInsert) DurationFlag() bool

DurationFlag returns the duration_flag.

func (*SpliceInsert) ProgramSpliceFlag added in v1.1.0

func (cmd *SpliceInsert) ProgramSpliceFlag() bool

ProgramSpliceFlag returns the program_splice_flag.

func (*SpliceInsert) TimeSpecifiedFlag added in v1.1.0

func (cmd *SpliceInsert) TimeSpecifiedFlag() bool

TimeSpecifiedFlag returns the time_specified_flag

func (*SpliceInsert) Type

func (cmd *SpliceInsert) Type() uint32

Type returns the splice_command_type.

type SpliceInsertComponent

type SpliceInsertComponent struct {
	Tag        uint32      `xml:"componentTag,attr" json:"componentTag,omitempty"`
	SpliceTime *SpliceTime `xml:"http://www.scte.org/schemas/35 SpliceTime" json:"spliceTime,omitempty"`
}

SpliceInsertComponent contains the Splice Point in Component Splice Mode.

func (*SpliceInsertComponent) TimeSpecifiedFlag added in v1.1.0

func (c *SpliceInsertComponent) TimeSpecifiedFlag() bool

TimeSpecifiedFlag returns the time_specified_flag.

type SpliceInsertProgram

type SpliceInsertProgram struct {
	SpliceTime SpliceTime `xml:"http://www.scte.org/schemas/35 SpliceTime" json:"spliceTime"`
}

SpliceInsertProgram contains the Splice Point in Program Splice Mode.

func NewSpliceInsertProgram

func NewSpliceInsertProgram(ptsTime uint64) *SpliceInsertProgram

NewSpliceInsertProgram returns a SpliceInsertProgram with the given ptsTime.

func (*SpliceInsertProgram) TimeSpecifiedFlag added in v1.2.0

func (p *SpliceInsertProgram) TimeSpecifiedFlag() bool

TimeSpecifiedFlag returns the time_specified_flag.

type SpliceNull

type SpliceNull struct {
	XMLName  xml.Name `xml:"http://www.scte.org/schemas/35 SpliceNull" json:"-"`
	JSONType uint32   `xml:"-" json:"type"`
}

SpliceNull is the command is provided for extensibility of the standard. The splice_null() command allows a splice_info_table to be sent that can carry descriptors without having to send one of the other defined commands. This command may also be used as a “heartbeat message” for monitoring cue injection equipment integrity and link integrity.

func (*SpliceNull) Type

func (cmd *SpliceNull) Type() uint32

Type returns the splice_command_type.

type SpliceSchedule

type SpliceSchedule struct {
	XMLName  xml.Name `xml:"http://www.scte.org/schemas/35 SpliceSchedule" json:"-"`
	JSONType uint32   `xml:"-" json:"type"`
	Events   []Event  `xml:"http://www.scte.org/schemas/35 Event" json:"events"`
}

SpliceSchedule is provided to allow a schedule of splice events to be conveyed in advance.

func (*SpliceSchedule) Type

func (cmd *SpliceSchedule) Type() uint32

Type returns the splice_command_type

type SpliceTime

type SpliceTime struct {
	PTSTime *uint64 `xml:"ptsTime,attr" json:"ptsTime,omitempty"`
}

SpliceTime specifies the time of the splice event.

func (*SpliceTime) TimeSpecifiedFlag added in v1.2.0

func (t *SpliceTime) TimeSpecifiedFlag() bool

TimeSpecifiedFlag returns true if PTSTime is not nil.

type TimeDescriptor

type TimeDescriptor struct {
	XMLName    xml.Name `xml:"TimeDescriptor" json:"-"`
	JSONType   uint32   `xml:"-" json:"type"`
	TAISeconds uint64   `xml:"taiSeconds,attr" json:"taiSeconds"`
	TAINS      uint32   `xml:"taiNs,attr" json:"taiNs"`
	UTCOffset  uint32   `xml:"utcOffset,attr" json:"utcOffset"`
}

TimeDescriptor is an implementation of a splice_descriptor. It provides an optional extension to the splice_insert(), splice_null() and time_signal() commands that allows a programmer’s wall clock time to be sent to a client. For the highest accuracy, this descriptor should be used with the time_signal() or splice_insert( ) command. This command may be inserted using SCTE 104 or by out of band provisioning on the device inserting this message.

func (*TimeDescriptor) Tag

func (sd *TimeDescriptor) Tag() uint32

Tag returns the splice_descriptor_tag.

type TimeSignal

type TimeSignal struct {
	XMLName    xml.Name   `xml:"http://www.scte.org/schemas/35 TimeSignal" json:"-"`
	JSONType   uint32     `xml:"-" json:"type"`
	SpliceTime SpliceTime `xml:"http://www.scte.org/schemas/35 SpliceTime" json:"spliceTime"`
}

TimeSignal provides a time synchronized data delivery mechanism. The syntax of the time_signal() allows for the synchronization of the information carried in this message with the System Time Clock (STC). The unique payload of the message is carried in the descriptor, however the syntax and transport capabilities afforded to splice_insert() messages are also afforded to the time_signal(). The carriage however can be in a different PID than that carrying the other cue messages used for signaling splice points.

func NewTimeSignal

func NewTimeSignal(ptsTime uint64) *TimeSignal

NewTimeSignal constructs a new time_signal command with the given pts_time value

func (*TimeSignal) Type

func (cmd *TimeSignal) Type() uint32

Type returns the splice_command_type.

type UTCSpliceTime

type UTCSpliceTime struct {
	time.Time
}

UTCSpliceTime is used to carry utc_splice_time values.

func NewUTCSpliceTime

func NewUTCSpliceTime(sec uint32) UTCSpliceTime

NewUTCSpliceTime creates a UTCSpliceTime representing the number of seconds from GPS Epoch (01 Jan 1980, 00:00:00 UTC)

func (UTCSpliceTime) GPSSeconds

func (t UTCSpliceTime) GPSSeconds() uint32

GPSSeconds returns the seconds since GPS Epoch

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL