Commit 3742e056 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptive: add support for group meta

parent d8b99984
......@@ -26,6 +26,7 @@
#include "FakeESOut.hpp"
#include <vlc_es_out.h>
#include <vlc_block.h>
#include <vlc_meta.h>
#include <algorithm>
using namespace adaptive;
......@@ -156,6 +157,24 @@ void EsOutControlResetPCRCommand::Execute( es_out_t * )
{
}
EsOutMetaCommand::EsOutMetaCommand( int i_group, vlc_meta_t *p_meta ) :
AbstractCommand( ES_OUT_SET_GROUP_META )
{
group = i_group;
this->p_meta = p_meta;
}
EsOutMetaCommand::~EsOutMetaCommand()
{
if( p_meta )
vlc_meta_Delete( p_meta );
}
void EsOutMetaCommand::Execute( es_out_t *out )
{
es_out_Control( out, ES_OUT_SET_GROUP_META, group, p_meta );
}
/*
* Commands Default Factory
*/
......@@ -190,6 +209,17 @@ EsOutControlResetPCRCommand * CommandsFactory::creatEsOutControlResetPCRCommand(
return new (std::nothrow) EsOutControlResetPCRCommand();
}
EsOutMetaCommand * CommandsFactory::createEsOutMetaCommand( int group, const vlc_meta_t *p_meta ) const
{
vlc_meta_t *p_dup = vlc_meta_New();
if( p_dup )
{
vlc_meta_Merge( p_dup, p_meta );
return new (std::nothrow) EsOutMetaCommand( group, p_dup );
}
return NULL;
}
/*
* Commands Queue management
*/
......
......@@ -119,6 +119,19 @@ namespace adaptive
EsOutControlResetPCRCommand();
};
class EsOutMetaCommand : public AbstractCommand
{
friend class CommandsFactory;
public:
virtual void Execute( es_out_t *out );
protected:
EsOutMetaCommand( int, vlc_meta_t * );
virtual ~EsOutMetaCommand();
int group;
vlc_meta_t *p_meta;
};
/* Factory so we can alter behaviour and filter on execution */
class CommandsFactory
{
......@@ -130,6 +143,7 @@ namespace adaptive
virtual EsOutControlPCRCommand * createEsOutControlPCRCommand( int, mtime_t ) const;
virtual EsOutControlResetPCRCommand * creatEsOutControlResetPCRCommand() const;
virtual EsOutDestroyCommand * createEsOutDestroyCommand() const;
virtual EsOutMetaCommand * createEsOutMetaCommand( int, const vlc_meta_t * ) const;
};
/* Queuing for doing all the stuff in order */
......
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