Newer
Older
Import / research / pipeline / Modules / SplitterModule.cpp
@John Ryland John Ryland on 22 Dec 2020 771 bytes add new projects


class Splitter : public SimpleModule {
public:
    Splitter()
    {           
    }
  
    void init()
    {    
    }
   
    void process( const Frame &frame )
    {
        list<Module*>::iterator it = routes.begin();
        while( it != routes.end() ) {
            if ( it != routes.begin() )
                frame.ref();
            dispatch( (*it), Process, &frame );
            ++it;
        }
    }
    
    void connectTo( Module *next, const Frame &f )
    { 
        routes.push_back( next );
    }

    const char *name() { return "Splitter"; }
    Format inputFormat() { return "FRAME_ID_YUV_VIDEO_FRAME"; }
    Format outputFormat() { return "FRAME_ID_YUV_VIDEO_FRAME"; }
    bool isBlocking() { return true; }

private:
    list<Module*> routes;
};