2 * Copyright (c) 2004-2007 Marcus Overhagen <marcus@overhagen.de>
4 * Permission is hereby granted, free of charge, to any person
5 * obtaining a copy of this software and associated documentation
6 * files (the "Software"), to deal in the Software without restriction,
7 * including without limitation the rights to use, copy, modify,
8 * merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be
13 * included in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef __TRANSPORT_STREAM_DEMUX_H
26 #define __TRANSPORT_STREAM_DEMUX_H
29 #include "mpeg_ts_packet.h"
34 class TransportStreamDemux
38 PacketQueue
*vid_queue
, PacketQueue
*aud_queue
,
39 PacketQueue
*vid_queue2
, PacketQueue
*aud_queue2
,
40 PacketQueue
*mpeg_ts_queue
);
41 virtual ~TransportStreamDemux();
43 void SetPIDs(int vid_pid
, int aud_pid
, int pcr_pid
);
45 void AddData(Packet
*packet
);
47 void TimesourceInfo(bigtime_t
*perf_time
, bigtime_t
*sys_time
);
50 void ProcessData(const void *data
, int size
, bigtime_t start_time
, bigtime_t delta
);
51 void ProcessPacket(const mpeg_ts_packet
*pkt
, bigtime_t start_time
);
54 virtual void ProcessPCR(const mpeg_ts_packet
*pkt
, bigtime_t start_time
);
55 virtual void ProcessPAT(const mpeg_ts_packet
*pkt
);
56 virtual void ProcessAUD(const mpeg_ts_packet
*pkt
);
57 virtual void ProcessVID(const mpeg_ts_packet
*pkt
);
61 bigtime_t fSystemTime
;
62 bigtime_t fPerformanceTime
;
63 bigtime_t fLastEndTime
;
67 PacketQueue
* fVidQueue
;
68 PacketQueue
* fVidQueue2
;
69 PacketQueue
* fAudQueue
;
70 PacketQueue
* fAudQueue2
;
71 PacketQueue
* fMpegTsQueue
;
76 BLocker fTimeSourceLocker
;
81 TransportStreamDemux::TimesourceInfo(bigtime_t
*perf_time
, bigtime_t
*sys_time
)
83 fTimeSourceLocker
.Lock();
84 *perf_time
= fPerformanceTime
;
85 *sys_time
= fSystemTime
;
86 fTimeSourceLocker
.Unlock();