2
parse/stores GOP (group of picture) information from a mpegVideoStream
3
Copyright (C) 2000 Martin Vogt
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU Library General Public License as published by
7
the Free Software Foundation.
9
For more information look at the file COPYRIGHT in this package
26
mpegExtension=new MpegExtension();
37
*--------------------------------------------------------------
41
* Parses of group of pictures header from bit stream
42
* associated with vid_stream.
45
* Values in gop header placed into video stream structure.
48
* Bit stream irreversibly parsed.
50
*--------------------------------------------------------------
52
int GOP::processGOP(MpegVideoStream* mpegVideoStream) {
55
/* Flush group of pictures start code. */
57
mpegVideoStream->flushBits(32);
59
/* Parse off drop frame flag. */
61
data=mpegVideoStream->getBits(1);
68
/* Parse off hour component of time code. */
70
tc_hours=mpegVideoStream->getBits(5);
72
/* Parse off minute component of time code. */
74
tc_minutes=mpegVideoStream->getBits(6);
77
/* Flush marker bit. */
79
mpegVideoStream->flushBits(1);
81
/* Parse off second component of time code. */
83
tc_seconds=mpegVideoStream->getBits(6);
85
/* Parse off picture count component of time code. */
87
tc_pictures=mpegVideoStream->getBits(6);
89
/* Parse off closed gop and broken link flags. */
90
data=mpegVideoStream->getBits(2);
107
* If next start code is extension/user start code,
108
* parse off extension data.
111
mpegExtension->processExtensionData(mpegVideoStream);
118
int GOP::substract(GOP* minus,GOP* dest) {
122
hours=getHour()-minus->getHour();
123
minutes=getMinutes()-minus->getMinutes();
124
seconds=getSeconds()-minus->getSeconds();
134
dest->tc_hours=hours;
135
dest->tc_minutes=minutes;
136
dest->tc_seconds=seconds;
144
void GOP::copyTo(GOP* dest) {
145
dest->tc_hours=getHour();
146
dest->tc_minutes=getMinutes();
147
dest->tc_seconds=getSeconds();
148
dest->drop_flag=getDropFlag();
149
dest->tc_pictures=getPictures();
150
dest->closed_gop=getClosedGOP();
151
dest->broken_link=getBrokenLink();
153
// currently do not copy ext/user data FIX ME
157
void GOP::print(const char* description) {
158
cout << "GOP [START]:"<<description<<endl;
159
cout << "tc_hours:"<<getHour()<<endl;
160
cout << "tc_minutes:"<<getMinutes()<<endl;
161
cout << "tc_seconds:"<<getSeconds()<<endl;
162
cout << "drop_flag:"<<getDropFlag()<<endl;
163
cout << "tc_pictures:"<<getPictures()<<endl;
164
cout << "closed_gop:"<<getClosedGOP()<<endl;
165
cout << "broken_link:"<<getBrokenLink()<<endl;
166
cout << "GOP [END]"<<endl;