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.
39 #include "draintarget.h"
50 static Demuxer* getInstance();
51 int init(Callback* callback);
56 void setVideoStream(int id);
57 void setAudioStream(int id);
59 int writeAudio(int fd);
60 int writeVideo(int fd);
62 int writeAudio(DrainTarget* dt);
63 int writeVideo(DrainTarget* dt);
66 int scan(UCHAR* buf, int len);
67 int findVideoPTS(UCHAR* buf, int len, ULLONG* dest);
68 int put(UCHAR* buf, int len);
70 int getHorizontalSize() { return horizontal_size; }
71 int getVerticalSize() { return vertical_size; }
72 int getAspectRatio() { return aspect_ratio; }
73 int getFrameRate() { return frame_rate; }
74 int getBitRate() { return bit_rate; }
75 ULLONG getVideoPTS() { return video_pts; }
84 static Demuxer* instance;
92 void setAspectRatio(enum AspectRatio);
95 int video_current, audio_current;
96 int state_frametype, state_framepos;
97 int state_stream_fill, state_vid_parsed;
99 int parse_find_frame(int len);
100 int parse_video_frame(int len, int* full);
101 int parse_audio_frame(int len, int* full);
102 int parse_private1_frame(int len, int* full);
103 void parse_video_details(UCHAR* buf, int len);
106 static const int demuxMemoryV = 2097152;
107 static const int demuxMemoryA = 524288;
108 static const int FrameRates[9];
112 FRAMETYPE_PRIVATE_1 = 0xbd,
114 FRAMETYPE_AUD0 = 0xc0,
146 FRAMETYPE_AUDMAX = FRAMETYPE_AUD31,
148 FRAMETYPE_VID0 = 0xe0,
164 FRAMETYPE_VIDMAX = FRAMETYPE_VID15
169 enum AspectRatio aspect_ratio;