| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2006-2007, 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: bdemux_pes.h $ |
|---|
| 11 | * $brcm_Revision: 2 $ |
|---|
| 12 | * $brcm_Date: 2/16/07 10:16a $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * MPEG-2 Demux library |
|---|
| 17 | * |
|---|
| 18 | * Revision History: |
|---|
| 19 | * |
|---|
| 20 | * $brcm_Log: /BSEAV/lib/utils/bdemux_pes.h $ |
|---|
| 21 | * |
|---|
| 22 | * 2 2/16/07 10:16a vsilyaev |
|---|
| 23 | * PR 27443: Added audio decoder status from various pipeline stages, TS, |
|---|
| 24 | * PES, AC3 and PCM counters |
|---|
| 25 | * |
|---|
| 26 | * 1 10/16/06 11:35a vsilyaev |
|---|
| 27 | * PR 24956 PR 24844: Software MPEG-2 TS and PES demultiplexor |
|---|
| 28 | * |
|---|
| 29 | * |
|---|
| 30 | *******************************************************************************/ |
|---|
| 31 | |
|---|
| 32 | #ifndef _BDEMUX_PES_H__ |
|---|
| 33 | #define _BDEMUX_PES_H__ |
|---|
| 34 | |
|---|
| 35 | #include "bdemux_ts.h" |
|---|
| 36 | |
|---|
| 37 | #define BDEMUX_PES_PTS (1<<8) |
|---|
| 38 | #define BDEMUX_PES_DATA_ALIGMENT (1<<9) |
|---|
| 39 | #define BDEMUX_PES_DISCONTINUITY (1<<10) |
|---|
| 40 | |
|---|
| 41 | #define BDEMUX_PES_PTS_UNITS 45000 |
|---|
| 42 | |
|---|
| 43 | #ifdef __cplusplus |
|---|
| 44 | extern "C" |
|---|
| 45 | { |
|---|
| 46 | #endif |
|---|
| 47 | |
|---|
| 48 | typedef struct bdemux_pes { |
|---|
| 49 | bdemux_ts ts; |
|---|
| 50 | enum {bdemux_pes_state_sync,bdemux_pes_state_hdr, bdemux_pes_state_data} state; |
|---|
| 51 | uint16_t pkt_offset; /* current offset in the PES packet */ |
|---|
| 52 | uint16_t pkt_data_offset; /* offset in the PES header where data starts */ |
|---|
| 53 | unsigned ts_flags; /* flags that are accumulated from the transport layer */ |
|---|
| 54 | uint16_t pkt_len; /* PES packet length */ |
|---|
| 55 | uint8_t id; /* stream ID */ |
|---|
| 56 | uint8_t hold_enable; /* consumer could set this bit to hold consumption of es data */ |
|---|
| 57 | uint16_t pes_packets; |
|---|
| 58 | uint8_t pes_header[14]; |
|---|
| 59 | BDBG_OBJECT(bdemux_pes) |
|---|
| 60 | } bdemux_pes; |
|---|
| 61 | |
|---|
| 62 | void bdemux_pes_init(bdemux_pes *pes, uint8_t id); |
|---|
| 63 | void bdemux_pes_data(bdemux_pes *pes, const uint8_t *data, size_t len, unsigned flags); |
|---|
| 64 | void bdemux_pes_header(bdemux_pes *pes, unsigned flags, uint32_t pts); |
|---|
| 65 | |
|---|
| 66 | #ifdef __cplusplus |
|---|
| 67 | } |
|---|
| 68 | #endif |
|---|
| 69 | |
|---|
| 70 | #endif /* _BDEMUX_PES_H__ */ |
|---|
| 71 | |
|---|