2
mpg I video/audio player plugin
3
Copyright (C) 1999 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
14
#ifndef __MPEGVIDEOLENGTH_H
15
#define __MPEGVIDEOLENGTH_H
17
#include "../input/inputPlugin.h"
25
This class calculates the length (in seconds) of an mpeg stream.
26
I do not know how to make it right, my approach
27
seeks at the beginning of the stream for the timecode in
28
the picture gop then jumps near the end and does the same.
29
then it substracts the values.
30
It has some limitations, it does not seek higher than 600 MB,
31
because it seems the kernel has some problems with this.
32
(It resets the scsi system, and sometimes hang/crash)
33
Thus it only seek near 600 and assumes linear relation
34
for the rest. (Means: it calculates the length of the rest
35
with the sec/mb value calculates from the 600 mb
36
should be exact enough.
39
class MpegVideoStream;
40
class MpegVideoHeader;
41
class MpegSystemStream;
42
class MpegSystemHeader;
45
class MpegVideoLength {
47
// these are used fo non system streams
48
MpegVideoHeader* mpegVideoHeader;
49
MpegVideoStream* mpegVideoStream;
51
// these for system streams
52
MpegSystemHeader* mpegSystemHeader;
53
MpegSystemStream* mpegSystemStream;
74
MpegVideoLength(InputStream* input);
77
int firstInitialize();
80
long getSeekPos(int seconds);
86
int seekValue(unsigned int code,long& endPos);
87
int parseToGOP(GOP* gop);
88
int parseToPTS(GOP* gop);