整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
56
video/core/AbstractAudioInput.h
Normal file
56
video/core/AbstractAudioInput.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#ifndef E2E4239C_C93E_478C_AD4C_D74AC3D4ED3E
|
||||
#define E2E4239C_C93E_478C_AD4C_D74AC3D4ED3E
|
||||
/*
|
||||
*******************************************************************************
|
||||
* INCLUDE
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "AudioComponent.h"
|
||||
#include "Frame.h"
|
||||
#include "util/Task.h"
|
||||
#include "util/Broadcast.h"
|
||||
#include <atomic>
|
||||
|
||||
namespace Video
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
/*
|
||||
*******************************************************************************
|
||||
* CLASS DECLARE
|
||||
*******************************************************************************
|
||||
*/
|
||||
class AbstractAudioInput: public AudioComponent
|
||||
{
|
||||
public:
|
||||
AbstractAudioInput(const std::string& name);
|
||||
~AbstractAudioInput();
|
||||
void reset() override;
|
||||
|
||||
protected:
|
||||
virtual Frame::Ptr readFrame() = 0;
|
||||
void run();
|
||||
void cancel();
|
||||
void onConfigChanged(ParameterNames& names) override;
|
||||
void applyGain(Frame::Ptr pFrame, int gain);
|
||||
void applyPTSOffset(Frame::Ptr pFrame, int64_t ptsOffset);
|
||||
|
||||
private:
|
||||
Frame::Ptr tryReadFrame(bool shuldLog = false);
|
||||
Frame::Ptr readSilent(bool freezeChannel);
|
||||
void updateSilentFrame();
|
||||
|
||||
private:
|
||||
Util::Task _task;
|
||||
Frame::Ptr _pSilentFrame;
|
||||
Poco::SharedPtr<uint8_t> _pSilentData;
|
||||
SerialCode _silentDataCode;
|
||||
uint64_t _duration;
|
||||
uint32_t _audioChannelId;
|
||||
bool _isMute;
|
||||
std::atomic<int> _gain{0};
|
||||
std::atomic<int64_t> _ptsOffsetUs{0};
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue