2
* The contents of this file are subject to the Mozilla Public
3
* License Version 1.1 (the "License"); you may not use this file
4
* except in compliance with the License. You may obtain a copy of
5
* the License at http://www.mozilla.org/MPL/
7
* Software distributed under the License is distributed on an "AS
8
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
* implied. See the License for the specific language governing
10
* rights and limitations under the License.
12
* The Original Code is MPEG4IP.
14
* The Initial Developer of the Original Code is Cisco Systems Inc.
15
* Portions created by Cisco Systems Inc. are
16
* Copyright (C) Cisco Systems Inc. 2000, 2001. All Rights Reserved.
19
* Bill May wmay@cisco.com
22
* mp4_bytestream.h - provides bytestream access to quicktime files
25
#ifndef __MPEG2T_BYTESTREAM_H__
26
#define __MPEG2T_BYTESTREAM_H__
27
#include "our_bytestream.h"
28
#include "player_util.h"
29
#include "mpeg2t_private.h"
30
#include "mpeg2t/mpeg2_transport.h"
31
//#define OUTPUT_TO_FILE 1
34
* CMpeg2tByteStreamBase provides base class access to quicktime files.
35
* Most functions are shared between audio and video.
37
class CMpeg2tByteStream : public COurInByteStream
40
CMpeg2tByteStream(mpeg2t_es_t *es_pid,
46
virtual void reset(void);
47
int have_no_data(void);
48
bool start_next_frame(uint8_t **buffer,
50
frame_timestamp_t *ts,
52
void used_bytes_for_frame(uint32_t bytes);
53
int can_skip_frame(void) { return 1; };
54
bool skip_next_frame(frame_timestamp_t *ts, int *hasSyncFrame,
56
uint32_t *buflen, void **ud);
57
void check_for_end_of_frame(void);
58
double get_max_playtime(void);
60
void play(uint64_t start);
67
mpeg2t_es_t *m_es_pid;
68
virtual int get_timestamp_for_frame(mpeg2t_frame_t *,
69
frame_timestamp_t *ts) = 0;
70
mpeg2t_frame_t *m_frame;
71
int m_timestamp_loaded;
72
uint64_t m_last_timestamp;
73
uint32_t m_audio_last_freq_timestamp;
74
int m_frames_since_last_timestamp;
76
mpeg2t_stream_t *m_stream_ptr;
80
* CMp4VideoByteStream is for video streams. It is inherited from
81
* CMpeg2tByteStreamBase.
83
class CMpeg2tVideoByteStream : public CMpeg2tByteStream
86
CMpeg2tVideoByteStream(mpeg2t_es_t *es_pid, int ondemand) :
87
CMpeg2tByteStream(es_pid, "video", 1, ondemand) {
88
m_have_prev_frame_type = 0;
92
int get_timestamp_for_frame(mpeg2t_frame_t *, frame_timestamp_t *ts);
93
int m_have_prev_frame_type;
94
int m_prev_frame_type;
99
* CMp4AudioByteStream is for audio streams. It is inherited from
100
* CMpeg2tByteStreamBase.
102
class CMpeg2tAudioByteStream : public CMpeg2tByteStream
105
CMpeg2tAudioByteStream(mpeg2t_es_t *es_pid, int ondemand) :
106
CMpeg2tByteStream(es_pid, "audio", 0, ondemand) {};
109
int get_timestamp_for_frame(mpeg2t_frame_t *, frame_timestamp_t *ts);