Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Ts2ElementaryStream.h
Go to the documentation of this file.
1 /*****************************************************************
2 |
3 | MPEG2 Transport Stream - Elementary Streams
4 |
5 | $Id: Ts2ElementaryStream.h 310 2016-06-07 23:26:47Z hwa $
6 | Original author: Julien Boeuf
7 |
8 | This software is provided to you pursuant to your agreement
9 | with Intertrust Technologies Corporation ("Intertrust").
10 | This software may be used only in accordance with the terms
11 | of the agreement.
12 |
13 | Copyright (c) 2005-2014 by Intertrust. All rights reserved.
14 |
15 ****************************************************************/
16 
17 #ifndef _TS2_ELEMENTARY_STREAM_H_
18 #define _TS2_ELEMENTARY_STREAM_H_
19 
20 /*----------------------------------------------------------------------
21 | includes
22 +---------------------------------------------------------------------*/
23 #include "Atomix.h"
24 #include "Ts2Packet.h"
25 #include "Ts2Pes.h"
26 #include "Ts2Descriptors.h"
27 
28 /*----------------------------------------------------------------------
29 | constants
30 +---------------------------------------------------------------------*/
31 #define TS2_ES_MPEG1_VIDEO 0x01
32 #define TS2_ES_MPEG2_VIDEO 0x02
33 #define TS2_ES_MPEG1_AUDIO 0x03
34 #define TS2_ES_MPEG2_AUDIO 0x04
35 #define TS2_ES_PRIVATE_DATA 0x06
36 #define TS2_ES_MPEG4_VIDEO 0x10
37 #define TS2_ES_MPEG2_AAC 0x0F /* ADTS */
38 #define TS2_ES_MPEG4_AUDIO 0x11
39 #define TS2_ES_AVC 0x1B
40 #define TS2_ES_HEVC 0x24
41 #define TS2_ES_AC3 0x81
42 
43 /*----------------------------------------------------------------------
44 | types
45 +---------------------------------------------------------------------*/
48 
49 typedef enum {
54 
57  ATX_UInt8 type;
58  ATX_UInt16 pid; /* TS PID */
59  ATX_List* descs;
60  ATX_Any client_data;/* for OnPESPacketComplete callback */
61 
62  /* internal */
65  TS2_PesPacket* pes_packet,
66  ATX_Any client_data);
67 };
68 
71  ATX_Boolean is_sdr;
72  ATX_Boolean is_primary;
73  ATX_Boolean is_secondary;
74 };
75 
76 /*----------------------------------------------------------------------
77 | methods
78 +---------------------------------------------------------------------*/
79 #ifdef __cplusplus
80 extern "C" {
81 #endif /* __cplusplus */
82 
83 ATX_Result
84 TS2_ElementaryStream_Parse(const ATX_Byte* data,
85  ATX_Size* data_size, /* in/out */
87 
90  ATX_Byte desc_tag);
91 
92 ATX_Result
94  ATX_Byte* buffer);
95 
96 ATX_Size
98 
99 void
101 
102 ATX_Result
103 TS2_ElementaryStream_ProcessTsPacket(void* elementary_stream,
104  TS2_PacketDispatcher* dispatcher,
105  TS2_Packet* packet);
106 
107 ATX_Result
109  ATX_Result (*OnPesPacketComplete)(TS2_ElementaryStream*, TS2_PesPacket*, ATX_Any),
110  ATX_Any client_data);
111 
112 #ifdef __cplusplus
113 }
114 #endif /* __cplusplus */
115 
116 #endif /* _TS2_ELEMENTARY_STREAM_H_ */
Definition: Ts2ElementaryStream.h:50
TS2_ElementaryStream_Type es_type
Definition: Ts2ElementaryStream.h:56
Definition: Ts2ElementaryStream.h:52
Definition: Ts2ElementaryStream.h:51
ATX_Size TS2_ElementaryStream_GetSize(const TS2_ElementaryStream *self)
Definition: Ts2Pes.h:79
ATX_Result TS2_ElementaryStream_SetPESHandler(TS2_ElementaryStream *self, ATX_Result(*OnPesPacketComplete)(TS2_ElementaryStream *, TS2_PesPacket *, ATX_Any), ATX_Any client_data)
TS2_Descriptor * TS2_ElementaryStream_GetDescriptor(const TS2_ElementaryStream *self, ATX_Byte desc_tag)
ATX_UInt8 type
Definition: Ts2ElementaryStream.h:57
TS2_PesPacketAssembler packet_assembler
Definition: Ts2ElementaryStream.h:63
ATX_UInt16 pid
Definition: Ts2ElementaryStream.h:58
TS2_ElementaryStream_Type
Definition: Ts2ElementaryStream.h:49
ATX_Result TS2_ElementaryStream_Parse(const ATX_Byte *data, ATX_Size *data_size, TS2_ElementaryStream **es)
ATX_Any client_data
Definition: Ts2ElementaryStream.h:60
Definition: Ts2ElementaryStream.h:69
ATX_Result(* OnPESPacketComplete)(TS2_ElementaryStream *self, TS2_PesPacket *pes_packet, ATX_Any client_data)
Definition: Ts2ElementaryStream.h:64
TS2_ElementaryStream base
Definition: Ts2ElementaryStream.h:70
Definition: Ts2Packet.h:91
ATX_Result TS2_ElementaryStream_ProcessTsPacket(void *elementary_stream, TS2_PacketDispatcher *dispatcher, TS2_Packet *packet)
struct TS2_PacketDispatcher TS2_PacketDispatcher
Definition: Ts2Packet.h:102
ATX_Boolean is_sdr
Definition: Ts2ElementaryStream.h:71
ATX_Result TS2_ElementaryStream_Serialize(const TS2_ElementaryStream *self, ATX_Byte *buffer)
Definition: Ts2ElementaryStream.h:55
Definition: Ts2Descriptors.h:51
Definition: Ts2Pes.h:86
ATX_Boolean is_primary
Definition: Ts2ElementaryStream.h:72
ATX_List * descs
Definition: Ts2ElementaryStream.h:59
void TS2_ElementaryStream_Destroy(TS2_ElementaryStream *self)
ATX_Boolean is_secondary
Definition: Ts2ElementaryStream.h:73