整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
102
video/core/AudioMixer.h
Normal file
102
video/core/AudioMixer.h
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
#ifndef AC195091_8442_4268_B843_700AB594416A
|
||||
#define AC195091_8442_4268_B843_700AB594416A
|
||||
/*
|
||||
*******************************************************************************
|
||||
* INCLUDE
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "AudioAdaptablePipe.h"
|
||||
#include "AbstractAudioInput.h"
|
||||
#include "util/FactoryManager.h"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace Video
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
/*
|
||||
*******************************************************************************
|
||||
* CLASS DECLARE
|
||||
*******************************************************************************
|
||||
*/
|
||||
class AudioMixerSelector
|
||||
{
|
||||
public:
|
||||
static int select(const std::string&)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
class AudioMixer: public AbstractAudioInput,
|
||||
public ::Util::FactoryManager<AudioMixer, int, AudioMixerSelector, const std::string&>
|
||||
{
|
||||
public:
|
||||
using Ptr = Poco::AutoPtr<AudioMixer>;
|
||||
class Channel: public AudioAdaptablePipe
|
||||
{
|
||||
public:
|
||||
using Ptr = Poco::AutoPtr<Channel>;
|
||||
|
||||
protected:
|
||||
Channel(AudioMixer::Ptr, uint32_t id);
|
||||
|
||||
public:
|
||||
~Channel();
|
||||
|
||||
CONFIGURABLE_DECLARE_PARAMETER(Attach, bool)
|
||||
CONFIGURABLE_DECLARE_PARAMETER(Input, AudioComponent::Ptr)
|
||||
|
||||
uint32_t id() const;
|
||||
|
||||
protected:
|
||||
virtual void start() override;
|
||||
virtual void stop() override;
|
||||
void onConfigChanged(ParameterNames& names) override;
|
||||
|
||||
AudioMixer::Ptr mixer();
|
||||
|
||||
private:
|
||||
AudioMixer::Ptr _pMixer;
|
||||
uint32_t _id;
|
||||
|
||||
friend AudioMixer;
|
||||
};
|
||||
|
||||
public:
|
||||
AudioMixer(const std::string& name);
|
||||
~AudioMixer();
|
||||
|
||||
Channel::Ptr getChannel(uint32_t id);
|
||||
|
||||
void syncConfigToChannel(Channel::Ptr pChannel);
|
||||
|
||||
protected:
|
||||
void start() override;
|
||||
void stop() override;
|
||||
void onConfigChanged(ParameterNames& names) override;
|
||||
Frame::Ptr readFrame() override;
|
||||
|
||||
void refreshOutputParams();
|
||||
|
||||
PROPERTY_DECLARE(FrameDuration, uint32_t, 0, protected, protected)
|
||||
PROPERTY_DECLARE(Channels, uint32_t, 0, protected, protected)
|
||||
PROPERTY_DECLARE(LineSize, uint32_t, 0, protected, protected)
|
||||
|
||||
private:
|
||||
std::unordered_map<uint32_t, Channel::Ptr> _channels;
|
||||
Frame::Ptr _mixFrame;
|
||||
};
|
||||
|
||||
inline uint32_t AudioMixer::Channel::id() const
|
||||
{
|
||||
return _id;
|
||||
}
|
||||
|
||||
inline AudioMixer::Ptr AudioMixer::Channel::mixer()
|
||||
{
|
||||
return _pMixer;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue