@@ -696,6 +696,38 @@ static inline void scte35_splice_desc_set_identifier(uint8_t *p_desc,
696696 p_desc [5 ] = identifier & 0xff ;
697697}
698698
699+ /*****************************************************************************
700+ * Splice Information Table - avail descriptor
701+ *****************************************************************************/
702+ #define SCTE35_AVAIL_DESC_HEADER_SIZE 4
703+
704+ static inline void scte35_avail_desc_init (uint8_t * p_desc )
705+ {
706+ scte35_splice_desc_set_tag (p_desc , SCTE35_SPLICE_DESC_TAG_AVAIL );
707+ scte35_splice_desc_set_length (p_desc ,
708+ SCTE35_SPLICE_DESC_HEADER_SIZE -
709+ DESC_HEADER_SIZE +
710+ SCTE35_AVAIL_DESC_HEADER_SIZE );
711+ scte35_splice_desc_set_identifier (p_desc , SCTE35_SPLICE_DESC_IDENTIFIER );
712+ p_desc [10 ] = 0x7f ;
713+ }
714+
715+ static inline uint32_t
716+ scte35_avail_desc_get_provider_avail_id (const uint8_t * p_desc )
717+ {
718+ return ((uint32_t )p_desc [6 ] << 24 ) | (p_desc [7 ] << 16 ) |
719+ (p_desc [8 ] << 8 ) | p_desc [9 ];
720+ }
721+
722+ static inline void scte35_avail_desc_set_provider_avail_id (uint8_t * p_desc ,
723+ uint32_t id )
724+ {
725+ p_desc [6 ] = (id >> 24 ) & 0xff ;
726+ p_desc [7 ] = (id >> 16 ) & 0xff ;
727+ p_desc [8 ] = (id >> 8 ) & 0xff ;
728+ p_desc [9 ] = id & 0xff ;
729+ }
730+
699731/*****************************************************************************
700732 * Splice Information Table - segmentation descriptor
701733 *****************************************************************************/
0 commit comments