From 14f6a6d91ada1d7740e1c49c7484a111b1971ea8 Mon Sep 17 00:00:00 2001 From: Kamran Rauf Date: Mon, 22 Jan 2024 12:35:45 +0100 Subject: [PATCH] Add Interface for Descriptor Data - The purpose of the change is to allow the application to add support for other descriptors (without need to modify/update the library) --- psi/pmtdescriptor.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/psi/pmtdescriptor.go b/psi/pmtdescriptor.go index a573faa..70cf79d 100644 --- a/psi/pmtdescriptor.go +++ b/psi/pmtdescriptor.go @@ -80,6 +80,7 @@ const ( // PmtDescriptor represents operations currently necessary on descriptors found in the PMT type PmtDescriptor interface { Tag() uint8 + Data() []byte Format() string IsIso639LanguageDescriptor() bool IsMaximumBitrateDescriptor() bool @@ -114,6 +115,10 @@ func (descriptor *pmtDescriptor) Tag() uint8 { return descriptor.tag } +func (descriptor *pmtDescriptor) Data() []byte { + return descriptor.data +} + func (descriptor *pmtDescriptor) String() string { return descriptor.decode() }