| | |
| | | class PipeLineElem; |
| | | class PipeLine; |
| | | |
| | | enum PipeMaterialBufferType |
| | | { |
| | | PMT__FIRST, |
| | | PMT_BYTES, |
| | | PMT_TEXT, |
| | | PMT_IMAGE, |
| | | PMT_PM_LIST, |
| | | PMT_PTR_AVFRAME, |
| | | PMT__LAST |
| | | }; |
| | | |
| | | struct PipeMaterial; |
| | | typedef void (* pm_deleter_func)(PipeMaterial* pm); |
| | | |
| | | struct PipeMaterial |
| | | { |
| | | PipeMaterialBufferType type; |
| | | uint8_t* buffer; |
| | | size_t buffSize; |
| | | PipeLineElem* former; |
| | | pm_deleter_func deleter; |
| | | void* args; |
| | | |
| | | PipeMaterial(); |
| | | |
| | | void exec_deleter(); |
| | | }; |
| | | |
| | | class PipeLineElem |
| | |
| | | typedef PipeLineElem* (*elem_create_func_t)(); |
| | | |
| | | // 0 (there is no elem). do nothing |
| | | // 1 (there is one elem). gain |
| | | // 2 (there is two elems). gain --> pay |
| | | // 3 (there is more than two elems). gain --> pay gain --> pay gain --> ... --> pay |
| | | // 1 (there is one elem). gain --> pm.deleter |
| | | // 2 (there is two elems). gain --> pay --> pm.deleter |
| | | // 3 (there is more than two elems). |
| | | // gain --> [pay --> pm.deleter --> gain -->] [pay --> pm.deleter --> gain -->] ... --> pay --> pm.deleter |
| | | class PipeLine |
| | | { |
| | | public: |