p26001-store-acs-soc-fw-app/video/core/AudioFrameAdapter.h
2026-09-28 21:33:04 +08:00

58 lines
1.3 KiB
C++

#ifndef B0BCC994_AC90_4B90_9CD2_10586E958794
#define B0BCC994_AC90_4B90_9CD2_10586E958794
/*
*******************************************************************************
* INCLUDE
*******************************************************************************
*/
#include "Frame.h"
#include "SampleFormat.h"
#include "ChannelLayout.h"
#include <Poco/SharedPtr.h>
namespace Video
{
namespace Core
{
/*
*******************************************************************************
* CLASS DECLARE
*******************************************************************************
*/
class AudioFrameAdapter
{
public:
using Ptr = Poco::SharedPtr<AudioFrameAdapter>;
public:
AudioFrameAdapter(ChannelLayout layout, SampleFormat format, int frameSize, int sampleRate);
public:
void put(Frame::Ptr pFrame);
Frame::Ptr get();
protected:
int remainOfReadFrame();
int spaceOfOutFrame();
uint64_t getInFrameTimestamp();
private:
int _linesize;
int _lines;
int _sampleSize;
Frame::Ptr _pInFrame;
Frame::Ptr _pOutFrame;
uint32_t _readIndex;
uint32_t _writeIndex;
uint32_t _sampleDuration;
int _sampleRate;
uint32_t _frameSize;
uint64_t _encodeClock;
};
}
}
#endif