48 using StreamAbortFunc = std::function<void(FrameWriter* source, TTV_ErrorCode ec)>;
142 , encoderOutputBits(0)
143 , elapsedSystemTime(0)
std::shared_ptr< IThread > mWriteFrameThread
The thread that does the writing.
Definition: framewriter.h:112
uint32_t GetQueueDelayInBytes() const
Definition: framewriter.h:70
void SetErrorDelayThresholdMilliseconds(uint64_t errorThreshold)
Definition: framewriter.h:79
Definition: framewriter.h:38
TTV_ErrorCode SetCustomMuxer(const std::shared_ptr< IMuxer > &muxer)
TTV_ErrorCode GetLastError()
std::mutex mMutex
Definition: framewriter.h:107
DelayStateChangedCallback mDelayStateChangedCallback
Definition: framewriter.h:125
Definition: iframewriter.h:26
BandwidthStatCallback mBandwidthStatCallback
Callback that is invoked when a new bandwidth stat is generated.
Definition: framewriter.h:154
DelayState mDelayState
Definition: framewriter.h:161
std::function< void(FrameWriter *source, TTV_ErrorCode ec)> StreamAbortFunc
Definition: framewriter.h:48
TTV_ErrorCode SendDataToMuxers()
std::atomic< uint64_t > mLastReceivedPacketTimestamp
Definition: framewriter.h:123
void UpdateRecommendedBitRate()
bool mAudioEnabled
Definition: framewriter.h:163
std::shared_ptr< FlvMuxer > mFlvMuxer
Definition: framewriter.h:113
FrameWriter(bool audioEnabled)
std::atomic< uint64_t > mEncodedBitCounter
The number of bytes output by the necoder since the last adjustment time.
Definition: framewriter.h:130
TrackedStatsRunningTotals mRunningTotals
Definition: framewriter.h:151
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
std::atomic< uint64_t > mLastSentPacketTimestamp
Definition: framewriter.h:122
std::function< void(FrameWriter *source, const BandwidthStat &stat)> BandwidthStatCallback
Definition: framewriter.h:50
DelayState
Definition: framewriter.h:41
uint64_t mWarningDelayThreshold
Definition: framewriter.h:126
std::function< void(FrameWriter *source, DelayState state)> DelayStateChangedCallback
Definition: framewriter.h:49
void SetStreamAbortCallback(StreamAbortFunc func)
Definition: framewriter.h:86
WaitForExpiry mBitrateIncreaseTimer
Timer that enforces the frequency at which we can increase the bit rate.
Definition: framewriter.h:157
bool mWriteFrameThreadProceed
Flag to indicate that the write thread should continue processing and will be true until the writer i...
Definition: framewriter.h:110
uint64_t recommendedBits
Definition: framewriter.h:147
TTV_ErrorCode mLastError
Definition: framewriter.h:160
uint32_t GetRecommendedBitRate() const
Definition: broadcasttypes.h:80
std::queue< std::unique_ptr< Packet > > mVideoPacketQueue
Definition: framewriter.h:118
uint64_t encoderOutputBits
Definition: framewriter.h:148
StreamAbortFunc mStreamAbortCallback
The function to call if the stream goes down.
Definition: framewriter.h:115
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
virtual TTV_ErrorCode WritePacket(std::unique_ptr< Packet > &&packet) override
std::queue< std::unique_ptr< Packet > > mAudioPacketQueue
Definition: framewriter.h:117
std::mutex mRunningTotalsMutex
Definition: framewriter.h:152
void SetBandwidthStatCallback(const BandwidthStatCallback &callback)
Definition: framewriter.h:88
void SetDelayStateChangedCallback(const DelayStateChangedCallback &callback)
Definition: framewriter.h:82
std::atomic< uint32_t > mNumQueuedBytes
The number of bytes that are in the audio and video packet queues.
Definition: framewriter.h:129
std::queue< std::unique_ptr< Packet > > mPacketQueue
Definition: framewriter.h:109
TTV_ErrorCode SetFlvMuxer(const std::shared_ptr< FlvMuxer > &flvMuxer)
DelayState GetDelayState() const
Definition: framewriter.h:81
std::shared_ptr< IMuxer > mCustomMuxer
Definition: framewriter.h:114
std::condition_variable mCondition
Definition: framewriter.h:108
uint64_t GetQueueDelayInMilliseconds() const
void TransferPacketToOutputQueues(std::unique_ptr< Packet > &&packet)
uint64_t mLastStatTime
The last time a bandwidth stat was emitted.
Definition: framewriter.h:132
uint64_t mStreamStartSystemTime
The system clock time at the start of the stream.
Definition: framewriter.h:131
Definition: framewriter.h:138
TTV_ErrorCode Start(const VideoParams &videoParams)
TTV_ErrorCode GatherTrackingStats(uint64_t &averageRecommendedKbps, uint64_t &averageEncodedKbps)
VideoParams mVideoParams
Definition: framewriter.h:120
uint64_t elapsedSystemTime
Definition: framewriter.h:149
WaitForExpiry mBitrateUpdateTimer
Timer for periodically updating the recommended bit rate.
Definition: framewriter.h:156
uint32_t mRecommendedBitRate
The last recommended bitrate in bits per second.
Definition: framewriter.h:158
uint64_t mErrorDelayThreshold
Definition: framewriter.h:127
void SetWarningDelayThresholdMilliseconds(uint64_t warningThreshHold)
Definition: framewriter.h:78
TrackedStatsRunningTotals()
Definition: framewriter.h:140