[vlc-commits] demux: adaptative: refactor a bit commands

Francois Cartegnie git at videolan.org
Tue Sep 22 00:38:49 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Sep 15 12:26:28 2015 +0200| [d1ee36b8884d5aa1af49475ee2400534df504136] | committer: Francois Cartegnie

demux: adaptative: refactor a bit commands

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d1ee36b8884d5aa1af49475ee2400534df504136
---

 modules/demux/adaptative/plumbing/CommandsQueue.cpp |   15 +++++++++------
 modules/demux/adaptative/plumbing/CommandsQueue.hpp |   15 ++++++++++-----
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/modules/demux/adaptative/plumbing/CommandsQueue.cpp b/modules/demux/adaptative/plumbing/CommandsQueue.cpp
index 86ee2b3..551c537 100644
--- a/modules/demux/adaptative/plumbing/CommandsQueue.cpp
+++ b/modules/demux/adaptative/plumbing/CommandsQueue.cpp
@@ -53,10 +53,15 @@ int AbstractCommand::getType() const
     return type;
 }
 
-EsOutSendCommand::EsOutSendCommand( FakeESOutID *p_es, block_t *p_block_ ) :
-    AbstractCommand( ES_OUT_PRIVATE_COMMAND_SEND )
+AbstractFakeEsCommand::AbstractFakeEsCommand( int type, FakeESOutID *p_es ) :
+    AbstractCommand( type )
 {
     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_;
 }
 
@@ -85,9 +90,8 @@ mtime_t EsOutSendCommand::getTime() const
 }
 
 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 * )
@@ -96,11 +100,10 @@ void EsOutDelCommand::Execute( es_out_t * )
 }
 
 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 );
     fmt.i_group = 0; /* Always ignore group for adaptative */
-    type = ES_OUT_PRIVATE_COMMAND_ADD;
 }
 
 EsOutAddCommand::~EsOutAddCommand()
diff --git a/modules/demux/adaptative/plumbing/CommandsQueue.hpp b/modules/demux/adaptative/plumbing/CommandsQueue.hpp
index 09f981b..3d44e3e 100644
--- a/modules/demux/adaptative/plumbing/CommandsQueue.hpp
+++ b/modules/demux/adaptative/plumbing/CommandsQueue.hpp
@@ -48,7 +48,14 @@ namespace adaptative
             int type;
     };
 
-    class EsOutSendCommand : public AbstractCommand
+    class AbstractFakeEsCommand : public AbstractCommand
+    {
+        protected:
+            AbstractFakeEsCommand( int, FakeESOutID * );
+            FakeESOutID *p_fakeid;
+    };
+
+    class EsOutSendCommand : public AbstractFakeEsCommand
     {
         friend class CommandsFactory;
         public:
@@ -58,11 +65,10 @@ namespace adaptative
 
         protected:
             EsOutSendCommand( FakeESOutID *, block_t * );
-            FakeESOutID *p_fakeid;
             block_t *p_block;
     };
 
-    class EsOutDelCommand : public AbstractCommand
+    class EsOutDelCommand : public AbstractFakeEsCommand
     {
         friend class CommandsFactory;
         public:
@@ -70,10 +76,9 @@ namespace adaptative
 
         protected:
             EsOutDelCommand( FakeESOutID * );
-            FakeESOutID *p_fakeid;
     };
 
-    class EsOutAddCommand : public EsOutDelCommand
+    class EsOutAddCommand : public AbstractFakeEsCommand
     {
         friend class CommandsFactory;
         public:



More information about the vlc-commits mailing list