Commit d1ee36b8 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: refactor a bit commands

parent ebcae016
...@@ -53,10 +53,15 @@ int AbstractCommand::getType() const ...@@ -53,10 +53,15 @@ int AbstractCommand::getType() const
return type; return type;
} }
EsOutSendCommand::EsOutSendCommand( FakeESOutID *p_es, block_t *p_block_ ) : AbstractFakeEsCommand::AbstractFakeEsCommand( int type, FakeESOutID *p_es ) :
AbstractCommand( ES_OUT_PRIVATE_COMMAND_SEND ) AbstractCommand( type )
{ {
p_fakeid = p_es; p_fakeid = p_es;
}
EsOutSendCommand::EsOutSendCommand( FakeESOutID *p_es, block_t *p_block_ ) :
AbstractFakeEsCommand( ES_OUT_PRIVATE_COMMAND_SEND, p_es )
{
p_block = p_block_; p_block = p_block_;
} }
...@@ -85,9 +90,8 @@ mtime_t EsOutSendCommand::getTime() const ...@@ -85,9 +90,8 @@ mtime_t EsOutSendCommand::getTime() const
} }
EsOutDelCommand::EsOutDelCommand( FakeESOutID *p_es ) : EsOutDelCommand::EsOutDelCommand( FakeESOutID *p_es ) :
AbstractCommand( ES_OUT_PRIVATE_COMMAND_DEL ) AbstractFakeEsCommand( ES_OUT_PRIVATE_COMMAND_DEL, p_es )
{ {
p_fakeid = p_es;
} }
void EsOutDelCommand::Execute( es_out_t * ) void EsOutDelCommand::Execute( es_out_t * )
...@@ -96,11 +100,10 @@ void EsOutDelCommand::Execute( es_out_t * ) ...@@ -96,11 +100,10 @@ void EsOutDelCommand::Execute( es_out_t * )
} }
EsOutAddCommand::EsOutAddCommand( FakeESOutID *p_es, const es_format_t *p_fmt ) : EsOutAddCommand::EsOutAddCommand( FakeESOutID *p_es, const es_format_t *p_fmt ) :
EsOutDelCommand( p_es ) AbstractFakeEsCommand( ES_OUT_PRIVATE_COMMAND_ADD, p_es )
{ {
es_format_Copy( &fmt, p_fmt ); es_format_Copy( &fmt, p_fmt );
fmt.i_group = 0; /* Always ignore group for adaptative */ fmt.i_group = 0; /* Always ignore group for adaptative */
type = ES_OUT_PRIVATE_COMMAND_ADD;
} }
EsOutAddCommand::~EsOutAddCommand() EsOutAddCommand::~EsOutAddCommand()
......
...@@ -48,7 +48,14 @@ namespace adaptative ...@@ -48,7 +48,14 @@ namespace adaptative
int type; int type;
}; };
class EsOutSendCommand : public AbstractCommand class AbstractFakeEsCommand : public AbstractCommand
{
protected:
AbstractFakeEsCommand( int, FakeESOutID * );
FakeESOutID *p_fakeid;
};
class EsOutSendCommand : public AbstractFakeEsCommand
{ {
friend class CommandsFactory; friend class CommandsFactory;
public: public:
...@@ -58,11 +65,10 @@ namespace adaptative ...@@ -58,11 +65,10 @@ namespace adaptative
protected: protected:
EsOutSendCommand( FakeESOutID *, block_t * ); EsOutSendCommand( FakeESOutID *, block_t * );
FakeESOutID *p_fakeid;
block_t *p_block; block_t *p_block;
}; };
class EsOutDelCommand : public AbstractCommand class EsOutDelCommand : public AbstractFakeEsCommand
{ {
friend class CommandsFactory; friend class CommandsFactory;
public: public:
...@@ -70,10 +76,9 @@ namespace adaptative ...@@ -70,10 +76,9 @@ namespace adaptative
protected: protected:
EsOutDelCommand( FakeESOutID * ); EsOutDelCommand( FakeESOutID * );
FakeESOutID *p_fakeid;
}; };
class EsOutAddCommand : public EsOutDelCommand class EsOutAddCommand : public AbstractFakeEsCommand
{ {
friend class CommandsFactory; friend class CommandsFactory;
public: public:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment