| 1 |
#ifndef STREAMINFOPRIV_H |
| 2 |
#define STREAMINFOPRIV_H |
| 3 |
|
| 4 |
#include "infotypes.h" |
| 5 |
|
| 6 |
AVM_BEGIN_NAMESPACE; |
| 7 |
|
| 8 |
struct StreamInfo::StreamInfoPriv |
| 9 |
{ |
| 10 |
Type m_Type; |
| 11 |
uint32_t m_uiFormat; // stream format |
| 12 |
|
| 13 |
double m_dLengthTime; // time in seconds for all packets |
| 14 |
uint_t m_uiBps; // bits per second |
| 15 |
size_t m_uiMaxKfFrameSize; // biggest keyframe chunk size |
| 16 |
size_t m_uiMinKfFrameSize; // smallest keyframe chunk size |
| 17 |
uint_t m_uiKfFrames; // keyframe chunks |
| 18 |
int64_t m_uiKfFramesSize; // total keyframe chunk size |
| 19 |
|
| 20 |
// should make sence probably only for video stream |
| 21 |
size_t m_uiMaxFrameSize; // biggest non-keyframe chunk size |
| 22 |
size_t m_uiMinFrameSize; // smallest non-keyframe chunk size |
| 23 |
uint_t m_uiFrames; // non-keyframe chunks |
| 24 |
int64_t m_uiFramesSize; // total non-keyframe chunk size |
| 25 |
int m_iQuality; // quality of the stream (0..10000) |
| 26 |
int m_iSampleSize; // sample size |
| 27 |
|
| 28 |
union |
| 29 |
{ |
| 30 |
struct |
| 31 |
{ |
| 32 |
int m_iChannels; |
| 33 |
int m_iSamplesPerSec; |
| 34 |
int m_iBitsPerSample; |
| 35 |
bool m_bVbr; |
| 36 |
} aud; |
| 37 |
struct |
| 38 |
{ |
| 39 |
int m_iWidth; |
| 40 |
int m_iHeight; |
| 41 |
float m_fAspect; |
| 42 |
} vid; |
| 43 |
}; |
| 44 |
|
| 45 |
StreamInfoPriv(); |
| 46 |
void setKfFrames(size_t max, size_t min, uint_t chunks, int64_t size) |
| 47 |
{ |
| 48 |
m_uiMaxKfFrameSize = max; |
| 49 |
m_uiMinKfFrameSize = min; |
| 50 |
m_uiKfFrames = chunks; |
| 51 |
m_uiKfFramesSize = size; |
| 52 |
} |
| 53 |
void setFrames(size_t max, size_t min, uint_t chunks, int64_t size) |
| 54 |
{ |
| 55 |
m_uiMaxFrameSize = max; |
| 56 |
m_uiMinFrameSize = min; |
| 57 |
m_uiFrames = chunks; |
| 58 |
m_uiFramesSize = size; |
| 59 |
} |
| 60 |
void setVideo(int width, int height, int bps = 0, float aspect = 0.0) |
| 61 |
{ |
| 62 |
vid.m_iWidth = width; |
| 63 |
vid.m_iHeight = height; |
| 64 |
vid.m_fAspect = aspect; |
| 65 |
m_uiBps = bps; |
| 66 |
} |
| 67 |
void setAudio(int channels, int freq, int bits, int bps = 0) |
| 68 |
{ |
| 69 |
if (bits == 0) |
| 70 |
bits = 16; |
| 71 |
aud.m_iChannels = channels; |
| 72 |
aud.m_iSamplesPerSec = freq; |
| 73 |
aud.m_iBitsPerSample = bits; |
| 74 |
m_uiBps = bps; |
| 75 |
} |
| 76 |
}; |
| 77 |
|
| 78 |
AVM_END_NAMESPACE; |
| 79 |
|
| 80 |
#endif |