#ifndef AVIFILE_STREAMINFO_H
#define AVIFILE_STREAMINFO_H

#include <default.h>
#include <ostream.h>

class IMediaReadStream;
class AviMediaReadStream;
class ASFReadStream;

class StreamInfo
{
    friend class IMediaReadStream;
    friend class AviMediaReadStream;
    friend class ASFReadStream;

    double m_dLengthTime;		// time in seconds for all packets
    unsigned int m_uiMaxKfFrameSize;	// biggest keyframe chunk size
    unsigned int m_uiMinKfFrameSize;	// smallest keyframe chunk size
    unsigned int m_uiKfFrames;		// keyframe chunks
    int64_t m_uiKfFramesSize;		// total keyframe chunk size

    unsigned int m_uiMaxFrameSize;	// biggest non-keyframe chunk size
    unsigned int m_uiMinFrameSize;	// smallest non-keyframe chunk size
    unsigned int m_uiFrames;		// non-keyframe chunks
    int64_t m_uiFramesSize;		// total non-keyframe chunk size

    fourcc_t m_Type;			// fourcc type of stream
public:
    StreamInfo();
    ~StreamInfo();

    double GetBps() const;              // calculated Bps
    double GetFps() const;              // calculated Bps

    double GetLengthTime() const;
    int64_t GetStreamSize() const;
    unsigned int GetStreamFrames() const;

    unsigned int GetMaxKfFrameSize() const;
    unsigned int GetMinKfFrameSize() const;
    unsigned int GetAvgKfFrameSize() const;
    unsigned int GetKfFrames() const;
    int64_t GetKfFramesSize() const;

    unsigned int GetMaxFrameSize() const;
    unsigned int GetMinFrameSize() const;
    unsigned int GetAvgFrameSize() const;
    unsigned int GetFrames() const;
    int64_t GetFramesSize() const;

    fourcc_t GetType() const;

    friend ostream & operator << (ostream&, StreamInfo &);
    friend ostream & operator << (ostream&, StreamInfo *);
};

#endif // AVIFILE_STREAMSTATS_H
