From 98231240ca053a494fc339b0dab78f93de8ecf0e Mon Sep 17 00:00:00 2001
From: xuxiuxi <xuxiuxi@454eff88-639b-444f-9e54-f578c98de674>
Date: 星期三, 22 三月 2017 18:43:01 +0800
Subject: [PATCH] 

---
 RtspFace/PL_Fork.h |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/RtspFace/PL_Fork.h b/RtspFace/PL_Fork.h
index 865044e..5eaaffe 100644
--- a/RtspFace/PL_Fork.h
+++ b/RtspFace/PL_Fork.h
@@ -3,8 +3,51 @@
 
 #include "PipeLine.h"
 
+// p1e1 p1e2<fork> p1e3 ... p1eN
+//                 p2e1  p2e2... p2eN
 class PL_Fork : public PipeLineElem
 {
+public:
+	enum ForkBy
+	{
+		// do nothing
+		FB_NONE,
+
+		// time 1: p1e1 p1e2 [p1e3 ... p1eN]
+		// time 2: p1e1 p1e2 [p2e1  p2e2... p2eN]
+		FB_TURNS,
+
+		// p1e1 p1e2 [p1e3 ... p1eN]|[p2e1  p2e2... p2eN]
+		FB_RANDOM,
+		
+		// supported now!
+		// p1e1 p1e2 TYPE1[p1e3 ... p1eN] TYPE2[p2e1  p2e2... p2eN]
+		// Sync behavior depends on ForkSync
+		FB_PM_TYPE,
+
+		// supported now!
+		FB_MB_TYPE,
+		
+		// FS_MAIN_PL_FIRST: p1e1 p1e2 [p1e3 p2e1] [p1e4 p2e2] ...
+		// FS_MAIN_PL_LAST : p1e1 p1e2 [p2e1 p1e3] [p2e2 p1e4] ...
+		FB_ALTERNATE
+	};
+	
+	enum ForkSync
+	{
+		// do nothing
+		FS_NONE,
+		
+		// supported now!
+		FS_PARALLEL,
+		
+		// Result of main pl will be paid to branch pl
+		FS_MAIN_PL_FIRST,
+		
+		// Result of branch pl will be paid to main pl
+		FS_BRANCH_PL_FIRST
+	};
+
 public:
 	PL_Fork();
 	virtual ~PL_Fork();
@@ -15,10 +58,26 @@
 	virtual bool pay(const PipeMaterial& pm);
 	virtual bool gain(PipeMaterial& pm);
 	
+	void attach_pipe_line(PipeLine* pl);
+	
 private:
 	void* internal;
+	PipeLine* pl;
 };
 
-PipeLineElem* create_PL_Paint();
+struct PL_Fork_Config
+{
+	PL_Fork::ForkBy forkBy;
+	PL_Fork::ForkSync forkSync;
+	
+	int mainPLType;
+	int branchPLType;
+	
+	PL_Fork_Config() : 
+		forkBy(PL_Fork::FB_NONE), forkSync(PL_Fork::FS_NONE), mainPLType(0), branchPLType(0)
+	{ }
+};
+
+PipeLineElem* create_PL_Fork();
 
 #endif

--
Gitblit v1.8.0