pans
2017-08-18 5cf652629fb40796cd2e0ab17c3617ed52365473
RtspFace/PipeLine.h
@@ -11,6 +11,10 @@
#define PLGP_RTSP_WIDTH "RTSP_WIDTH"
#define PLGP_RTSP_HEIGHT "RTSP_HEIGHT"
#define PLGP_RTSP_FPS "RTSP_FPS"
#define PLGP_DEC_SPS_B64 "DEC_SPS_B64"
#define PLGP_DEC_PPS_B64 "DEC_PPS_B64"
#define PLGP_ENC_SPS_B64 "ENC_SPS_B64"
#define PLGP_ENC_PPS_B64 "ENC_PPS_B64"
#define ENABLE_PIPELINE_ELEM_TIMING_DEBUGGER
@@ -53,8 +57,8 @@
      *this = _temp;
   }
   int breake(PipeMaterialBufferType selectPmType, int _selectMbfType,
      pm_breaker_func breaker, void* args = nullptr) const;
   int breake(PipeMaterialBufferType selectPmType, int _selectMbfType, pm_breaker_func breaker, void* args = nullptr) const;
   int breake(int _selectMbfUsage, pm_breaker_func breaker, void* args = nullptr) const;
   //#todo assemble pm/mbf into this pm
   void assemble();
@@ -78,6 +82,7 @@
};
typedef PipeLineElem* (*elem_create_func_t)();
typedef void (*elem_destory_func_t)(PipeLineElem* elem);
// 0 (there is no elem). do nothing
// 1 (there is one elem). gain --> pm.deleter
@@ -96,22 +101,20 @@
   
   bool register_elem_creator(const std::string& type, elem_create_func_t func);
   static bool register_global_elem_creator(const std::string& type, elem_create_func_t func);
   void push_elem(PipeLineElem* elem);
   PipeLineElem* push_elem(const std::string& type);
   void push_front_elem(PipeLineElem* elem);
   bool remove_elem(PipeLineElem* elem);
    PipeLineElem* at(int idx);
   void finit(elem_destory_func_t elem_destory_func);
   bool check_pipe_complete(PipeLineElem* lastRetElem) const;
   
   // do pipe sync. returns the element who returns false, or the last one.
   // if false return, the element should deal with pm, clean up.
   PipeLineElem* pipe(PipeMaterial* pm = nullptr);
   // do pipe async
   void pipe_start();
   void pipe_notify(PipeLineElem*);
   void pipe_stop();
   
   void set_param(const std::string& name, const std::string& value);
   std::string get_param(const std::string& name) const;
@@ -131,7 +134,7 @@
class PipeLineElemTimingDebugger
{
public:
   PipeLineElemTimingDebugger(const PipeLineElem* _elem);
   PipeLineElemTimingDebugger(const PipeLineElem* _elem = nullptr);
   ~PipeLineElemTimingDebugger();
   
   const PipeLineElem* elem;