[vlc-commits] demux: adaptive: add support for group meta
Francois Cartegnie
git at videolan.org
Sat Oct 15 23:16:13 CEST 2016
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Oct 14 22:13:30 2016 +0200| [3742e056b1dd21479edb8b8ea4d56a34afa2903b] | committer: Francois Cartegnie
demux: adaptive: add support for group meta
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3742e056b1dd21479edb8b8ea4d56a34afa2903b
---
modules/demux/adaptive/plumbing/CommandsQueue.cpp | 30 +++++++++++++++++++++++
modules/demux/adaptive/plumbing/CommandsQueue.hpp | 14 +++++++++++
2 files changed, 44 insertions(+)
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.cpp b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
index 140bc6a..26ac9aa 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.cpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.cpp
@@ -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
*/
diff --git a/modules/demux/adaptive/plumbing/CommandsQueue.hpp b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
index d459978..f1b7811 100644
--- a/modules/demux/adaptive/plumbing/CommandsQueue.hpp
+++ b/modules/demux/adaptive/plumbing/CommandsQueue.hpp
@@ -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 */
More information about the vlc-commits
mailing list