From 93d13b3bfa70309f4c2c5d15826a5ae737d3be81 Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 19 七月 2017 15:45:40 +0800
Subject: [PATCH]
---
RtspFace/PipeLine.h | 45 ++++++++++++++++++++++++++++++++++++++-------
1 files changed, 38 insertions(+), 7 deletions(-)
diff --git a/RtspFace/PipeLine.h b/RtspFace/PipeLine.h
index b208240..4848d69 100644
--- a/RtspFace/PipeLine.h
+++ b/RtspFace/PipeLine.h
@@ -8,12 +8,18 @@
#define PLGP_RTSP_SDP "RTSP_SDP"
#define PLGP_RTSP_FMTP "RTSP_FMTP"
+#define PLGP_RTSP_WIDTH "RTSP_WIDTH"
+#define PLGP_RTSP_HEIGHT "RTSP_HEIGHT"
+#define PLGP_RTSP_FPS "RTSP_FPS"
+
+#define ENABLE_PIPELINE_ELEM_TIMING_DEBUGGER
class PipeLineElem;
class PipeLine;
struct PipeMaterial;
-typedef void (* pm_deleter_func)(PipeMaterial* pm);
+typedef void (* pm_deleter_func)(PipeMaterial* pm, bool lastRet);
+typedef bool (* pm_breaker_func)(const PipeMaterial* pm, void* args); // return true if continue breaking up
// PipeMaterial instance should be unref when pay() finished
struct PipeMaterial
@@ -21,11 +27,12 @@
enum PipeMaterialBufferType
{
PMT__FIRST,
- PMT_NONE, // buffer = nullptr, buffSize = 0
- PMT_BYTES, // buffer = uint8_t[N], buffSize = N
- PMT_FRAME, // buffer = MB_Frame*, buffSize = 0
- PMT_PM_LIST, // buffer = PipeMaterial*[N], buffSize = N
- PMT_FRAME_LIST, // buffer = MB_Frame*[N], buffSize = N
+ PMT_NONE, // buffer = nullptr, buffSize = 0
+ PMT_BYTES, // buffer = uint8_t[N], buffSize = N
+ PMT_PTR, // buffer = void*, buffSize = 0
+ PMT_FRAME, // buffer = MB_Frame*, buffSize = 0
+ PMT_PM_LIST, // buffer = PipeMaterial*[N], buffSize = N
+ PMT_FRAME_LIST, // buffer = MB_Frame*[N], buffSize = N
PMT__LAST
};
@@ -38,7 +45,19 @@
PipeMaterial();
- void exec_deleter();
+ void exec_deleter(bool lastRet);
+
+ void reset()
+ {
+ PipeMaterial _temp;
+ *this = _temp;
+ }
+
+ int breake(PipeMaterialBufferType selectPmType, int _selectMbfType,
+ pm_breaker_func breaker, void* args = nullptr) const;
+
+ //#todo assemble pm/mbf into this pm
+ void assemble();
};
class PipeLineElem
@@ -83,6 +102,8 @@
void push_front_elem(PipeLineElem* elem);
bool remove_elem(PipeLineElem* elem);
+ 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);
@@ -107,4 +128,14 @@
params_map_t params_map;
};
+class PipeLineElemTimingDebugger
+{
+public:
+ PipeLineElemTimingDebugger(const PipeLineElem* _elem);
+ ~PipeLineElemTimingDebugger();
+
+ const PipeLineElem* elem;
+ uint64_t beginTime;
+};
+
#endif
--
Gitblit v1.8.0