整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
72
video/core/Muxer.h
Normal file
72
video/core/Muxer.h
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
#ifndef B61EDCD6_1C1C_4355_AD2C_4A09C55099D0
|
||||
#define B61EDCD6_1C1C_4355_AD2C_4A09C55099D0
|
||||
/*
|
||||
*******************************************************************************
|
||||
* INCLUDE
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "Component.h"
|
||||
#include "util/FactoryManager.h"
|
||||
#include "util/Task.h"
|
||||
#include <Poco/URI.h>
|
||||
|
||||
namespace Video
|
||||
{
|
||||
namespace Core
|
||||
{
|
||||
/*
|
||||
*******************************************************************************
|
||||
* CLASS DECLARE
|
||||
*******************************************************************************
|
||||
*/
|
||||
class MuxerSelector
|
||||
{
|
||||
public:
|
||||
static const std::string select(const std::string& url)
|
||||
{
|
||||
return Poco::URI(url).getScheme();
|
||||
}
|
||||
};
|
||||
|
||||
class Muxer: public Component,
|
||||
public ::Util::FactoryManager<Muxer, const std::string, MuxerSelector, const std::string&>
|
||||
{
|
||||
public:
|
||||
using Ptr = Poco::AutoPtr<Muxer>;
|
||||
|
||||
public:
|
||||
Muxer(const std::string& name, const std::string& url);
|
||||
virtual ~Muxer();
|
||||
|
||||
public:
|
||||
const std::string& url() const;
|
||||
std::string scheme() const;
|
||||
|
||||
protected:
|
||||
void start() override;
|
||||
void stop() override;
|
||||
void onLink(Component::Ptr pPrevious) override;
|
||||
void onUnlink(Component::Ptr pPrevious) override;
|
||||
void onConfigChanged(ParameterNames& names) override;
|
||||
|
||||
virtual void connect() = 0;
|
||||
virtual void mux() = 0;
|
||||
virtual void disconnect() = 0;
|
||||
|
||||
private:
|
||||
std::string _url;
|
||||
Util::Task _task;
|
||||
};
|
||||
|
||||
inline const std::string& Muxer::url() const
|
||||
{
|
||||
return _url;
|
||||
}
|
||||
|
||||
inline std::string Muxer::scheme() const
|
||||
{
|
||||
return Poco::URI(url()).getScheme();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue