2 Copyright 2005 Mark Calderbank
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 Thanks goes to Jon Gettler of the MVPMC project and Stephen Rice for
24 the demuxer in mvpmc. It was used in the creation of this Demuxer,
25 however, no code was copied verbatim.
44 static Demuxer* getInstance();
50 void setVideoStream(int id);
51 void setAudioStream(int id);
52 int writeAudio(int fd) { return audiostream.drain(fd); }
53 int writeVideo(int fd) { return videostream.drain(fd); }
54 int scan(UCHAR* buf, int len);
55 int put(UCHAR* buf, int len);
58 static Demuxer* instance;
66 int video_current, audio_current;
67 int state_frametype, state_framepos;
68 int state_stream_fill, state_vid_parsed;
70 int parse_find_frame(int len);
71 int parse_video_frame(int len, int* full);
72 int parse_audio_frame(int len, int* full);
73 int parse_private1_frame(int len, int* full);
74 void parse_video_details(UCHAR* buf, int len);
77 static const int demuxMemory = 2097152;
78 static const int Demuxer::FrameRates[9];
82 FRAMETYPE_PRIVATE_1 = 0xbd,
84 FRAMETYPE_AUD0 = 0xc0,
116 FRAMETYPE_AUDMAX = FRAMETYPE_AUD31,
118 FRAMETYPE_VID0 = 0xe0,
134 FRAMETYPE_VIDMAX = FRAMETYPE_VID15
145 enum AspectRatio aspect_ratio;