| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2008, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: $ |
|---|
| 11 | * $brcm_Revision: $ |
|---|
| 12 | * $brcm_Date: $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: $ |
|---|
| 19 | * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | #ifndef SCTE_18H__ |
|---|
| 22 | #define SCTE_18_H__ |
|---|
| 23 | |
|---|
| 24 | #include "bdispatch.h" |
|---|
| 25 | #include "ts_scte_18.h" |
|---|
| 26 | |
|---|
| 27 | #define SCTE_18_ALERT_PRIORITY 0 /* will use this for the priority level checking, 12 and up */ |
|---|
| 28 | #define SCTE_18_ALERT_NEED_AUDIO 15 /* only maximum level alert required audio, per SCTE 18 spec. */ |
|---|
| 29 | |
|---|
| 30 | #define SCTE_18_ACQ_AUDIO 0x01 |
|---|
| 31 | #define SCTE_18_ACQ_TEXT 0x02 |
|---|
| 32 | |
|---|
| 33 | typedef struct { |
|---|
| 34 | b_mutex_t mutex; /* mutex for list handling */ |
|---|
| 35 | |
|---|
| 36 | TS_SCTE_18_header header; /* header structure */ |
|---|
| 37 | TS_SCTE_18_exception exception; /* keep one execption header */ |
|---|
| 38 | uint8_t *pMsg; /* message buffer */ |
|---|
| 39 | |
|---|
| 40 | /* cache some important information for later use since we will reuse packet buffer */ |
|---|
| 41 | int enable; /* enable scte 18 process */ |
|---|
| 42 | int alert_in_progress; /* alert in progress */ |
|---|
| 43 | uint16_t original_source_ID; /* original source to switch back after alert timeout */ |
|---|
| 44 | uint16_t orignal_audio_source_ID;/* original audio source ID to switch back after alert timeout */ |
|---|
| 45 | |
|---|
| 46 | uint16_t sequence_number; /* sequence number (% 32) */ |
|---|
| 47 | uint16_t EAS_event_ID; /* event ID */ |
|---|
| 48 | uint16_t alert_message_time_remaining; /* for remaining, 0 - 120 in seconds, 0 for indefinite duration */ |
|---|
| 49 | int event_start_time; |
|---|
| 50 | uint16_t event_duration; /* 15 - 6000 in minutes */ |
|---|
| 51 | uint16_t alert_priority; /* 0 - 15, we will process only 12 and up */ |
|---|
| 52 | uint16_t details_OOB_source_ID; /* source ID to switch to */ |
|---|
| 53 | uint16_t audio_OOB_source_ID; /* audio source ID to switch to, only required for priority 15 */ |
|---|
| 54 | } scte_18_handle, *pscte_18_handle; |
|---|
| 55 | |
|---|
| 56 | pscte_18_handle scte_18_init(void); |
|---|
| 57 | void scte_18_deinit(pscte_18_handle pscte_18); |
|---|
| 58 | /* process scte 18 data */ |
|---|
| 59 | int scte_18_process(pscte_18_handle pscte_18, unsigned char *pkt, int size); |
|---|
| 60 | |
|---|
| 61 | #endif /* SCTE_18_H__ */ |
|---|