整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
66
video/core/AudioEncoder.h
Normal file
66
video/core/AudioEncoder.h
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#ifndef E7CCDC55_4323_4B0A_A08E_1C11B939AA61
|
||||
#define E7CCDC55_4323_4B0A_A08E_1C11B939AA61
|
||||
/*
|
||||
*******************************************************************************
|
||||
* INCLUDE
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "AudioAdaptablePipe.h"
|
||||
#include "CodecID.h"
|
||||
#include "util/FactoryManager.h"
|
||||
#include "util/Task.h"
|
||||
#include <Poco/SharedPtr.h>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
|
||||
namespace Video
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
/*
|
||||
*******************************************************************************
|
||||
* CLASS DECLARE
|
||||
*******************************************************************************
|
||||
*/
|
||||
class AudioEncoderSelector
|
||||
{
|
||||
public:
|
||||
static CodecID select(CodecID codecID)
|
||||
{
|
||||
return codecID;
|
||||
}
|
||||
};
|
||||
|
||||
class AudioEncoder: public AudioAdaptablePipe,
|
||||
public ::Util::FactoryManager<AudioEncoder, CodecID, AudioEncoderSelector, CodecID>
|
||||
{
|
||||
public:
|
||||
using Ptr = Poco::AutoPtr<AudioEncoder>;
|
||||
|
||||
public:
|
||||
AudioEncoder(const std::string& name, CodecID codecID);
|
||||
virtual ~AudioEncoder();
|
||||
|
||||
public:
|
||||
CONFIGURABLE_DECLARE_PARAMETER(CodecID, CodecID);
|
||||
CONFIGURABLE_DECLARE_PARAMETER(Bitrate, int);
|
||||
|
||||
protected:
|
||||
void start() override;
|
||||
void stop() override;
|
||||
Frame::Ptr readFrame(uint32_t timeout = 1000) override;
|
||||
void onConfigChanged(ParameterNames& names) override;
|
||||
|
||||
virtual Packet::Ptr encode() = 0;
|
||||
|
||||
protected:
|
||||
std::atomic<int64_t> _ptsOffsetUs{0};
|
||||
|
||||
private:
|
||||
Util::Task _task;
|
||||
AudioResample::Ptr _pResample;
|
||||
AudioFrameAdapter::Ptr _pFrameAdapter;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue