#include <ratectl.h>
Classes | |
struct | FrameInfo |
class | FrameInfoList |
Public Member Functions | |
OpalVideoRateController () | |
void | Open (unsigned targetBitRate, int outputFrameTime=-1, unsigned windowSizeInMs=500, unsigned maxConsecutiveFramesSkip=5) |
bool | SkipFrame () |
void | AddFrame (PInt64 sizeInBytes, int packetPacketCount) |
Protected Member Functions | |
bool | CheckFrameRate (bool reporting) |
bool | CheckBitRate (bool reporting) |
void | Reset () |
void | AddFrame (PInt64 sizeInBytes, int packetPacketCount, PInt64 now) |
Protected Attributes | |
unsigned | byteRate |
unsigned | bitRateHistorySizeInMs |
unsigned | maxConsecutiveFramesSkip |
int | targetOutputFrameTime |
PInt64 | targetBitRateHistorySize |
PInt64 | startTime |
PInt64 | inputFrameCount |
PInt64 | outputFrameCount |
unsigned | consecutiveFramesSkipped |
PInt64 | now |
PInt64 | lastReport |
FrameInfoList | bitRateHistory |
FrameInfoList | frameRateHistory |
OpalVideoRateController::OpalVideoRateController | ( | ) |
void OpalVideoRateController::AddFrame | ( | PInt64 | sizeInBytes, | |
int | packetPacketCount, | |||
PInt64 | now | |||
) | [protected] |
void OpalVideoRateController::AddFrame | ( | PInt64 | sizeInBytes, | |
int | packetPacketCount | |||
) |
Add information about an encoded frame
sizeInBytes | total payload size in bytes, including all RTP headers | |
packetPacketCount | total number of RTP packets sent |
bool OpalVideoRateController::CheckBitRate | ( | bool | reporting | ) | [protected] |
bool OpalVideoRateController::CheckFrameRate | ( | bool | reporting | ) | [protected] |
void OpalVideoRateController::Open | ( | unsigned | targetBitRate, | |
int | outputFrameTime = -1 , |
|||
unsigned | windowSizeInMs = 500 , |
|||
unsigned | maxConsecutiveFramesSkip = 5 | |||
) |
Open the rate controller with the specific parameters
targetBitRate | target bit rate to acheive | |
outputFrameTime | output frame time (90000 / rate), or -1 to not limit frame rate | |
windowSizeInMs | size of history used for calculating output bit rate | |
maxConsecutiveFramesSkip | maximum number of consecutive frames to skip |
void OpalVideoRateController::Reset | ( | ) | [protected] |
bool OpalVideoRateController::SkipFrame | ( | ) |
Determine if the next frame should be skipped
FrameInfoList OpalVideoRateController::bitRateHistory [protected] |
unsigned OpalVideoRateController::bitRateHistorySizeInMs [protected] |
unsigned OpalVideoRateController::byteRate [protected] |
unsigned OpalVideoRateController::consecutiveFramesSkipped [protected] |
PInt64 OpalVideoRateController::inputFrameCount [protected] |
PInt64 OpalVideoRateController::lastReport [protected] |
unsigned OpalVideoRateController::maxConsecutiveFramesSkip [protected] |
PInt64 OpalVideoRateController::now [protected] |
PInt64 OpalVideoRateController::outputFrameCount [protected] |
PInt64 OpalVideoRateController::startTime [protected] |
PInt64 OpalVideoRateController::targetBitRateHistorySize [protected] |
int OpalVideoRateController::targetOutputFrameTime [protected] |