LCOV - code coverage report
Current view: top level - eq - channel.h (source / functions) Hit Total Coverage
Test: Equalizer Lines: 1 3 33.3 %
Date: 2017-12-16 05:07:20 Functions: 2 4 50.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2005-2016, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                          Cedric Stalder <cedric.stalder@gmail.com>
       4             :  *                          Daniel Nachbaur <danielnachbaur@gmail.com>
       5             :  *
       6             :  * This library is free software; you can redistribute it and/or modify it under
       7             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       8             :  * by the Free Software Foundation.
       9             :  *
      10             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      11             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      12             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      13             :  * details.
      14             :  *
      15             :  * You should have received a copy of the GNU Lesser General Public License
      16             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      17             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      18             :  */
      19             : 
      20             : #ifndef EQ_CHANNEL_H
      21             : #define EQ_CHANNEL_H
      22             : 
      23             : #include <eq/api.h>
      24             : #include <eq/fabric/channel.h> // base class
      25             : #include <eq/types.h>
      26             : 
      27             : namespace eq
      28             : {
      29             : namespace detail
      30             : {
      31             : class Channel;
      32             : struct RBStat;
      33             : }
      34             : 
      35             : /**
      36             :  * A channel represents a two-dimensional viewport within a Window.
      37             :  *
      38             :  * The channel is the basic rendering entity. It represents a 2D rendering area
      39             :  * within a Window. It executes all rendering-relevant tasks, such as clear,
      40             :  * draw, assemble and readback. Each rendering task is using its own
      41             :  * RenderContext, which is computed by the server based on the rendering
      42             :  * description of the current configuration.
      43             :  *
      44             :  * @sa fabric::Channel
      45             :  */
      46             : class Channel : public fabric::Channel<Window, Channel>
      47             : {
      48             : public:
      49             :     /** Construct a new channel. @version 1.0 */
      50             :     EQ_API explicit Channel(Window* parent);
      51             : 
      52             :     /** Destruct the channel. @version 1.0 */
      53             :     EQ_API virtual ~Channel();
      54             : 
      55             :     /** @name Data Access */
      56             :     //@{
      57             :     EQ_API co::CommandQueue* getPipeThreadQueue();    //!< @internal
      58             :     EQ_API co::CommandQueue* getCommandThreadQueue(); //!< @internal
      59             :     EQ_API uint32_t getCurrentFrame() const; //!< @internal render thr only
      60             : 
      61             :     /** @internal */
      62             :     bool waitFrameFinished(uint32_t frame, uint32_t timeout) const;
      63             : 
      64             :     /**
      65             :      * @return true if this channel is stopped, false otherwise.
      66             :      * @version 1.0
      67             :      */
      68             :     EQ_API bool isStopped() const;
      69             : 
      70             :     /** @return the parent pipe. @version 1.0 */
      71             :     EQ_API Pipe* getPipe();
      72             : 
      73             :     /** @return the parent pipe. @version 1.0 */
      74             :     EQ_API const Pipe* getPipe() const;
      75             : 
      76             :     /** @return the parent node. @version 1.0 */
      77             :     EQ_API Node* getNode();
      78             : 
      79             :     /** @return the parent node. @version 1.0 */
      80             :     EQ_API const Node* getNode() const;
      81             : 
      82             :     /** @return the parent config. @version 1.0 */
      83             :     EQ_API Config* getConfig();
      84             : 
      85             :     /** @return the parent config. @version 1.0 */
      86             :     EQ_API const Config* getConfig() const;
      87             : 
      88             :     /** @return the parent server. @version 1.0 */
      89             :     EQ_API ServerPtr getServer();
      90             : 
      91             :     /**
      92             :      * Get the GLEW context for this channel.
      93             :      *
      94             :      * The GLEW context is initialized during window initialization, and
      95             :      * provides access to OpenGL extensions. This function does not follow the
      96             :      * Equalizer naming conventions, since GLEW uses a function of this name to
      97             :      * automatically resolve OpenGL function entry points. Therefore, any
      98             :      * supported GL function can be called directly from an initialized Channel.
      99             :      *
     100             :      * @return the extended OpenGL function table for the channel's OpenGL
     101             :      *         context.
     102             :      * @version 1.0
     103             :      */
     104             :     EQ_API const GLEWContext* glewGetContext() const;
     105             : 
     106             :     /** @return the window's object manager instance. @version 1.0 */
     107             :     EQ_API util::ObjectManager& getObjectManager();
     108             : 
     109             :     /** @return the channel's drawable config. @version 1.0 */
     110             :     EQ_API const DrawableConfig& getDrawableConfig() const;
     111             : 
     112             :     /**
     113             :      * Get the channel's native view.
     114             :      *
     115             :      * This function always returns the channel's native view, no matter in
     116             :      * which context it is called. Only destination channels have a native view.
     117             :      *
     118             :      * @return the channel's native view, or 0 if it does not have one.
     119             :      * @sa getView()
     120             :      * @version 1.0
     121             :      */
     122             :     EQ_API View* getNativeView();
     123             : 
     124             :     /** const-version of getNativeView() @version 1.0 */
     125             :     EQ_API const View* getNativeView() const;
     126             : 
     127             :     /** @return a fixed unique color for this channel. @version 1.0 */
     128             :     EQ_API const Vector3ub& getUniqueColor() const;
     129             : 
     130             :     /** @internal Add a new statistics event for the current frame. */
     131             :     EQ_API void addStatistic(Statistic& event);
     132             :     //@}
     133             : 
     134             :     /**
     135             :      * @name Context-specific data access.
     136             :      *
     137             :      * The data returned by these methods depends on the context (callback) they
     138             :      * are called from, typically the data for the current rendering task. If
     139             :      * they are called outside of a frame task method, they return the channel's
     140             :      * native parameter or a placeholder value for the task decomposition
     141             :      * parameters.
     142             :      */
     143             :     //@{
     144             :     /**
     145             :      * @return the jitter vector for the current subpixel decomposition.
     146             :      * @version 1.0
     147             :      */
     148             :     EQ_API virtual Vector2f getJitter() const;
     149             : 
     150             :     /**
     151             :      * Get the channel's current View.
     152             :      *
     153             :      * During a frame task method, i.e., in one of the frameFoo functions, the
     154             :      * view is set to the view of the destination channel, that is, the channel
     155             :      * for which this channel is executing the rendering task. Outside of a
     156             :      * frame task method the native view of the channel, or 0, is returned.
     157             :      *
     158             :      * @return the channel's view, or 0 if it does not have a view.
     159             :      * @sa getNativeView()
     160             :      * @version 1.0
     161             :      */
     162             :     EQ_API View* getView();
     163             : 
     164             :     /** Const version of getView(). @version 1.0 */
     165             :     EQ_API const View* getView() const;
     166             : 
     167             :     /**
     168             :      * Returns an orthographic frustum for 2D operations on the view.
     169             :      *
     170             :      * One unit of the frustum covers one pixel on screen. The frustum is
     171             :      * positioned relative to the view.
     172             :      *
     173             :      * @return the 2D orthographic frustum.
     174             :      * @version 1.0
     175             :      */
     176             :     EQ_API Frustumf getScreenFrustum() const;
     177             :     //@}
     178             : 
     179             :     /**
     180             :      * @name Operations
     181             :      *
     182             :      * Operations are only meaningful from within certain callbacks. They are
     183             :      * just convenience wrappers applying context-specific data to the OpenGL
     184             :      * state using the context-specific data access above.
     185             :      */
     186             :     //@{
     187             :     /**
     188             :      * Apply the current rendering buffer, including the color mask.
     189             :      * @sa getReadBuffer() , getDrawBuffer(), getDrawBufferMask()
     190             :      * @version 1.0
     191             :      */
     192             :     EQ_API virtual void applyBuffer();
     193             : 
     194             :     /**
     195             :      * Apply the current color mask.
     196             :      * @sa applyBuffer(), getDrawBufferMask()
     197             :      * @version 1.0
     198             :      */
     199             :     EQ_API virtual void applyColorMask() const;
     200             : 
     201             :     /**
     202             :      * Apply the OpenGL viewport for the current rendering task.
     203             :      * @sa getViewport()
     204             :      * @version 1.0
     205             :      */
     206             :     EQ_API virtual void applyViewport() const;
     207             : 
     208             :     /**
     209             :      * Apply the frustum matrix for the current rendering task.
     210             :      *
     211             :      * If a sub-pixel decomposition is defined, the frustum is jittered by the
     212             :      * amount given by getJitter() to implement software
     213             :      * anti-aliasing. Applications which want to implement a different
     214             :      * multi-sampling algorithm, e.g., depth-of-field, have to re-implement
     215             :      * getJitter() or applyFrustum() accordingly.
     216             :      *
     217             :      * @sa useOrtho(), getJitter(), getSubPixel()
     218             :      * @version 1.0
     219             :      */
     220             :     EQ_API virtual void applyFrustum() const;
     221             : 
     222             :     /**
     223             :      * Apply the perspective frustum matrix for the current rendering task.
     224             :      * @version 1.0
     225             :      */
     226             :     EQ_API virtual void applyPerspective() const;
     227             : 
     228             :     /**
     229             :      * Apply the orthographic frustum matrix for the current rendering task.
     230             :      * @version 1.0
     231             :      */
     232             :     EQ_API virtual void applyOrtho() const;
     233             : 
     234             :     /**
     235             :      * Apply an orthographic frustum for pixel-based 2D operations.
     236             :      *
     237             :      * One unit of the frustum covers one pixel on screen. The frustum is
     238             :      * positioned relative to the view.
     239             :      * @version 1.0
     240             :      */
     241             :     EQ_API void applyScreenFrustum() const;
     242             : 
     243             :     /**
     244             :      * Apply the transformation to position the view frustum.
     245             :      * @version 1.0
     246             :      * @sa useOrtho()
     247             :      */
     248             :     EQ_API virtual void applyHeadTransform() const;
     249             : 
     250             :     /**
     251             :      * Apply the transformation to position the perspective view frustum.
     252             :      * @version 1.0
     253             :      */
     254             :     EQ_API virtual void applyPerspectiveTransform() const;
     255             : 
     256             :     /**
     257             :      * Apply the transformation to position the orthographic view frustum.
     258             :      * @version 1.0
     259             :      */
     260             :     EQ_API virtual void applyOrthoTransform() const;
     261             : 
     262             :     /**
     263             :      * Apply the state for pixel-based 2D overlay rendering operations.
     264             :      * @version 1.11
     265             :      */
     266             :     EQ_API void applyOverlayState();
     267             : 
     268             :     /**
     269             :      * Reset the overlay state setup by applyOverlayState()
     270             :      * @version 1.11
     271             :      */
     272             :     EQ_API void resetOverlayState();
     273             : 
     274             :     /**
     275             :      * Rebind the window frame buffer.
     276             :      * @version 1.0
     277             :      */
     278             :     EQ_API void bindFrameBuffer();
     279             : 
     280             :     /**
     281             :      * Rebind the window draw buffer.
     282             :      * @version 1.9
     283             :      */
     284             :     EQ_API void bindDrawFrameBuffer();
     285             :     //@}
     286             : 
     287             :     /** @name Region of Interest. */
     288             :     //@{
     289             :     /**
     290             :      * Reset the declared regions of interest.
     291             :      *
     292             :      * Called from frameStart and frameClear to reset the area to be used to
     293             :      * optimize compositing and load balancing for each frame.
     294             :      * @version 1.3
     295             :      */
     296             :     EQ_API virtual void resetRegions();
     297             : 
     298             :     /**
     299             :      * Declare a region covered by the current draw or assemble operation.
     300             :      *
     301             :      * The region is relative to the current pixel viewport. It is clipped
     302             :      * against the current pixel viewport of the channel. Called with the full
     303             :      * pixel viewport after frameDraw if no region has been declared.
     304             :      *
     305             :      * Declaring a single, empty region causes this channel to not read back any
     306             :      * pixel data, i.e., if it did not draw anything.
     307             :      *
     308             :      * The implementation might merge or split the declared regions.
     309             :      *
     310             :      * @version 1.3
     311             :      */
     312             :     EQ_API virtual void declareRegion(const eq::PixelViewport& region);
     313             : 
     314             :     /**
     315             :      * Convenience method to declare a region in relative coordinates.
     316             :      *
     317             :      * The given viewport is relative to the current pixel viewport.
     318             :      * @version 1.3
     319             :      */
     320             :     EQ_API void declareRegion(const eq::Viewport& vp);
     321             : 
     322             :     /** @return a region covering all declared regions. @version 1.3 */
     323             :     EQ_API PixelViewport getRegion() const;
     324             : 
     325             :     /**
     326             :      * Get the current regions of interest.
     327             :      *
     328             :      * The returned regions are guaranteed not to overlap with each
     329             :      * other. Therefore they may differ in number and size from the declared
     330             :      * regions. The actual algorithm to create the non-overlapping regions is
     331             :      * unspecified and may change in the future.
     332             :      *
     333             :      * @return current regions of interest.
     334             :      * @version 1.3
     335             :      */
     336             :     EQ_API const PixelViewports& getRegions() const;
     337             :     //@}
     338             : 
     339             :     /** @name Events */
     340             :     //@{
     341             :     /**
     342             :      * Send a channel error event to the application node.
     343             :      *
     344             :      * @param error the error code.
     345             :      * @version 1.7.1
     346             :      */
     347             :     EQ_API EventOCommand sendError(const uint32_t error);
     348             : 
     349             :     /**
     350             :      * Process a received event.
     351             :      *
     352             :      * The task of this method is to update the channel and event as necessary,
     353             :      * and send it to the application using Config::sendEvent().
     354             :      *
     355             :      * @param type the pointer event type.
     356             :      * @param event the received event.
     357             :      * @return true when the event was handled, false if not.
     358             :      * @version 1.0
     359             :      */
     360             :     EQ_API virtual bool processEvent(EventType type, SizeEvent& event);
     361             :     EQ_API virtual bool processEvent(EventType type, PointerEvent& event);
     362             :     EQ_API virtual bool processEvent(EventType type, KeyEvent& event);
     363             :     EQ_API virtual bool processEvent(Statistic& event);
     364             :     //@}
     365             : 
     366             :     /** Draw a statistics overlay. @version 1.0 */
     367             :     EQ_API virtual void drawStatistics();
     368             : 
     369             :     /** Outline the current pixel viewport. @version 1.0 */
     370             :     EQ_API virtual void outlineViewport();
     371             : 
     372             :     /**
     373             :      * @internal
     374             :      * Change the latency.
     375             :      *
     376             :      * @param latency the new latency.
     377             :      */
     378             :     void changeLatency(const uint32_t latency);
     379             : 
     380             :     /**
     381             :      * Add a listener that gets notified everytime a new frame was rendered for
     382             :      * a destination channel.
     383             :      *
     384             :      * The channel does not take ownership of the listener. The notification
     385             :      * always happens in the render thread.
     386             :      *
     387             :      * @param listener the new listener to add
     388             :      * @version 1.9
     389             :      */
     390             :     EQ_API void addResultImageListener(ResultImageListener* listener);
     391             : 
     392             :     /**
     393             :      * Remove a result image listener to stop receival of notifications on new
     394             :      * images.
     395             :      *
     396             :      * @param listener the new listener to remove
     397             :      * @version 1.9
     398             :      */
     399             :     EQ_API void removeResultImageListener(ResultImageListener* listener);
     400             : 
     401             :     /**
     402             :      * @return filename for image if SATTR_DUMP_IMAGE,
     403             :      *         default "getCurrentFrame().rgb"
     404             :      * @version 1.9
     405             :      */
     406             :     EQ_API virtual std::string getDumpImageFileName() const;
     407             : 
     408             : protected:
     409             :     /** @internal */
     410             :     EQ_API void attach(const uint128_t& id, const uint32_t instanceID);
     411             : 
     412             :     /** @name Actions */
     413             :     //@{
     414             :     /**
     415             :      * Start a frame by unlocking all child resources.
     416             :      *
     417             :      * @param frameNumber the frame to start.
     418             :      * @version 1.0
     419             :      */
     420             :     EQ_API void startFrame(const uint32_t frameNumber);
     421             : 
     422             :     /**
     423             :      * Signal the completion of a frame to the parent.
     424             :      *
     425             :      * @param frameNumber the frame to end.
     426             :      * @version 1.0
     427             :      */
     428             :     EQ_API void releaseFrame(const uint32_t frameNumber);
     429             : 
     430             :     /**
     431             :      * Release the local synchronization of the parent for a frame.
     432             :      *
     433             :      * @param frameNumber the frame to release.
     434             :      * @version 1.0
     435             :      */
     436             :     EQ_API void releaseFrameLocal(const uint32_t frameNumber);
     437             : 
     438             :     /**
     439             :      * Setup the OpenGL state for a readback or assemble operation.
     440             :      *
     441             :      * The default implementation is very conservative and saves any state
     442             :      * which is potentially changed by the assembly routines. Applications
     443             :      * may overwrite this and resetAssemblyState() to optimize performance
     444             :      * in accordance with their rendering code.
     445             :      *
     446             :      * @version 1.0
     447             :      */
     448             :     EQ_API virtual void setupAssemblyState();
     449             : 
     450             :     /** Reset the OpenGL state after an assembly operation. @version 1.0 */
     451             :     EQ_API virtual void resetAssemblyState();
     452             :     //@}
     453             : 
     454             :     /**
     455             :      * @name Task Methods
     456             :      *
     457             :      * The task methods (callbacks) are called by Equalizer during rendering
     458             :      * to execute various rendering tasks. Each task method has a useful
     459             :      * default implementation, but at least frameDraw() is implemented by an
     460             :      * application.
     461             :      */
     462             :     //@{
     463             :     /**
     464             :      * Initialize this channel.
     465             :      *
     466             :      * @param initID the init identifier.
     467             :      * @version 1.0
     468             :      */
     469             :     EQ_API virtual bool configInit(const uint128_t& initID);
     470             : 
     471             :     /** Exit this channel. @version 1.0 */
     472             :     EQ_API virtual bool configExit();
     473             : 
     474             :     /**
     475             :      * Start rendering a frame.
     476             :      *
     477             :      * Called once at the beginning of each frame, to do per-frame updates
     478             :      * of channel-specific data. This method has to call startFrame().
     479             :      *
     480             :      * @param frameID the per-frame identifier.
     481             :      * @param frameNumber the frame to start.
     482             :      * @sa Config::startFrame()
     483             :      * @version 1.0
     484             :      */
     485             :     EQ_API virtual void frameStart(const uint128_t& frameID,
     486             :                                    const uint32_t frameNumber);
     487             : 
     488             :     /**
     489             :      * Finish rendering a frame.
     490             :      *
     491             :      * Called once at the end of each frame, to do per-frame updates of
     492             :      * channel-specific data.  This method has to call releaseFrame().
     493             :      *
     494             :      * @param frameID the per-frame identifier.
     495             :      * @param frameNumber the frame to finish.
     496             :      * @version 1.0
     497             :      */
     498             :     EQ_API virtual void frameFinish(const uint128_t& frameID,
     499             :                                     const uint32_t frameNumber);
     500             : 
     501             :     /**
     502             :      * Finish drawing.
     503             :      *
     504             :      * Called once per frame after the last draw operation. Typically
     505             :      * releases the local node thread synchronization for this frame.
     506             :      *
     507             :      * @param frameID the per-frame identifier.
     508             :      * @param frameNumber the frame to finished with draw.
     509             :      * @version 1.0
     510             :      */
     511             :     EQ_API virtual void frameDrawFinish(const uint128_t& frameID,
     512             :                                         const uint32_t frameNumber);
     513             : 
     514             :     /**
     515             :      * Clear the frame buffer.
     516             :      *
     517             :      * Called 0 to n times during one frame.
     518             :      *
     519             :      * @param frameID the per-frame identifier.
     520             :      * @version 1.0
     521             :      */
     522             :     EQ_API virtual void frameClear(const uint128_t& frameID);
     523             : 
     524             :     /**
     525             :      * Draw the scene.
     526             :      *
     527             :      * Called 0 to n times during one frame.
     528             :      *
     529             :      * @param frameID the per-frame identifier.
     530             :      * @version 1.0
     531             :      */
     532             :     EQ_API virtual void frameDraw(const uint128_t& frameID);
     533             : 
     534             :     /**
     535             :      * Assemble all input frames.
     536             :      *
     537             :      * Called 0 to n times during one frame.
     538             :      *
     539             :      * @param frameID the per-frame identifier.
     540             :      * @param frames the input frames.
     541             :      * @version 1.7.3
     542             :      */
     543             :     EQ_API virtual void frameAssemble(const uint128_t& frameID,
     544             :                                       const Frames& frames);
     545             : 
     546             :     /**
     547             :      * Read back the rendered frame buffer into the output frames.
     548             :      *
     549             :      * Called 0 to n times during one frame.
     550             :      *
     551             :      * @param frameID the per-frame identifier.
     552             :      * @param frames the output frames.
     553             :      * @version 1.7.3
     554             :      * @version 1.0
     555             :      */
     556             :     EQ_API virtual void frameReadback(const uint128_t& frameID,
     557             :                                       const Frames& frames);
     558             : 
     559             :     /**
     560             :      * Start updating a destination channel.
     561             :      *
     562             :      * Called once for each destination channel's eye pass, after frameStart()
     563             :      * to update a part of a display. Destination channels are the final display
     564             :      * channels, e.g., channels which are defined by a view/segment
     565             :      * intersection.
     566             :      *
     567             :      * @param frameID the per-frame identifier.
     568             :      * @version 1.0
     569             :      */
     570             :     EQ_API virtual void frameViewStart(const uint128_t& frameID);
     571             : 
     572             :     /**
     573             :      * Finish updating a destination channel.
     574             :      *
     575             :      * Called once for each destination channel's eye pass, before frameFinish()
     576             :      * to update a part of a display. Destination channels are the final display
     577             :      * channels, e.g., channels which are defined by a view/segment
     578             :      * intersection.
     579             :      *
     580             :      * This is typically used to do operations on the output channel after
     581             :      * it has been fully updated, e.g., to draw a 2D overlay or to perform
     582             :      * post-processing on the rendered image.
     583             :      *
     584             :      * @param frameID the per-frame identifier.
     585             :      * @version 1.0
     586             :      */
     587             :     EQ_API virtual void frameViewFinish(const uint128_t& frameID);
     588             : 
     589             :     /**
     590             :      * Draw 2D overlay content on a destination channel.
     591             :      *
     592             :      * This is called by frameViewFinish().
     593             :      *
     594             :      * @param frameID the per-frame identifier.
     595             :      * @version 1.11
     596             :      */
     597             :     EQ_API virtual void frameDrawOverlay(const uint128_t& frameID);
     598             :     //@}
     599             : 
     600             :     /** Start a batch of tile rendering operations. @version 1.1.6 */
     601           0 :     virtual void frameTilesStart(const uint128_t& /*frameID*/) {}
     602             :     /** Finish a batch of tile rendering operations. @version 1.1.6 */
     603           0 :     virtual void frameTilesFinish(const uint128_t& /*frameID*/) {}
     604             :     /** Notification that parameters influencing the vp/pvp have changed.*/
     605             :     EQ_API virtual void notifyViewportChanged();
     606             : 
     607             :     /**
     608             :      * Notify interruption of the rendering.
     609             :      *
     610             :      * This method is called from the Client command thread, as opposed to the
     611             :      * rendering thread. Its purpose is to cause the rendering thread to stop
     612             :      * its operations as soon as possible. Normal rendering shall recommence
     613             :      * after the given frame.
     614             :      *
     615             :      * @param lastFrameNumber stop rendering until this frame has been
     616             :      *        processed.
     617             :      * @version 1.0
     618             :      */
     619             :     EQ_API virtual void notifyStopFrame(const uint32_t lastFrameNumber);
     620             : 
     621             : private:
     622             :     detail::Channel* const _impl;
     623             :     friend class fabric::Window<Pipe, Window, Channel, WindowSettings>;
     624             : 
     625             :     //-------------------- Methods --------------------
     626             :     /** Setup the current rendering context. */
     627             :     void _overrideContext(RenderContext& context);
     628             : 
     629             :     /** Initialize the channel's drawable config. */
     630             :     void _initDrawableConfig();
     631             : 
     632             :     /** Tile render loop. */
     633             :     void _frameTiles(RenderContext& context, const bool isLocal,
     634             :                      const uint128_t& queueID, const uint32_t tasks,
     635             :                      const co::ObjectVersions& frames);
     636             : 
     637             :     /** Reference the frame for an async operation. */
     638             :     void _refFrame(const uint32_t frameNumber);
     639             : 
     640             :     /** Check for and send frame finish reply. */
     641             :     void _unrefFrame(const uint32_t frameNumber);
     642             : 
     643             :     /** Transmit one image of a frame to one node. */
     644             :     void _transmitImage(const co::ObjectVersion& frameDataVersion,
     645             :                         const uint128_t& nodeID, const co::NodeID& netNodeID,
     646             :                         const uint64_t imageIndex, const uint32_t frameNumber,
     647             :                         const uint32_t taskID);
     648             : 
     649             :     void _frameReadback(const uint128_t& frameID,
     650             :                         const co::ObjectVersions& frames);
     651             :     void _finishReadback(const co::ObjectVersion& frameDataVersion,
     652             :                          const uint64_t imageIndex, const uint32_t frameNumber,
     653             :                          const uint32_t taskID,
     654             :                          const std::vector<uint128_t>& nodes,
     655             :                          const co::NodeIDs& netNodes);
     656             : 
     657             :     bool _asyncFinishReadback(const std::vector<size_t>& imagePos,
     658             :                               const Frames& frames);
     659             : 
     660             :     void _asyncTransmit(FrameDataPtr frame, const uint32_t frameNumber,
     661             :                         const uint64_t image,
     662             :                         const std::vector<uint128_t>& nodes,
     663             :                         const co::NodeIDs& netNodes, const uint32_t taskID);
     664             : 
     665             :     void _setReady(const bool async, detail::RBStat* stat,
     666             :                    const Frames& frames);
     667             :     void _asyncSetReady(const FrameDataPtr frame, detail::RBStat* stat,
     668             :                         const std::vector<uint128_t>& nodes,
     669             :                         const co::NodeIDs& netNodes);
     670             : 
     671             :     void _setReady(FrameDataPtr frame, detail::RBStat* stat,
     672             :                    const std::vector<uint128_t>& nodes,
     673             :                    const co::NodeIDs& netNodes);
     674             : 
     675             :     /** Getsthe channel's current input queue. */
     676             :     co::QueueSlave* _getQueue(const uint128_t& queueID);
     677             : 
     678             :     Frames _getFrames(const co::ObjectVersions& frameIDs, const bool isOutput);
     679             : 
     680             :     void _createTransferWindow();
     681             :     void _deleteTransferWindow();
     682             : 
     683             :     /* The command handler functions. */
     684             :     bool _cmdConfigInit(co::ICommand& command);
     685             :     bool _cmdConfigExit(co::ICommand& command);
     686             :     bool _cmdFrameStart(co::ICommand& command);
     687             :     bool _cmdFrameFinish(co::ICommand& command);
     688             :     bool _cmdFrameClear(co::ICommand& command);
     689             :     bool _cmdFrameDraw(co::ICommand& command);
     690             :     bool _cmdFrameDrawFinish(co::ICommand& command);
     691             :     bool _cmdFrameAssemble(co::ICommand& command);
     692             :     bool _cmdFrameReadback(co::ICommand& command);
     693             :     bool _cmdFinishReadback(co::ICommand& command);
     694             :     bool _cmdFrameSetReady(co::ICommand& command);
     695             :     bool _cmdFrameTransmitImage(co::ICommand& command);
     696             :     bool _cmdFrameSetReadyNode(co::ICommand& command);
     697             :     bool _cmdFrameViewStart(co::ICommand& command);
     698             :     bool _cmdFrameViewFinish(co::ICommand& command);
     699             :     bool _cmdStopFrame(co::ICommand& command);
     700             :     bool _cmdFrameTiles(co::ICommand& command);
     701             :     bool _cmdDeleteTransferWindow(co::ICommand& command);
     702             : 
     703           4 :     LB_TS_VAR(_pipeThread);
     704             : };
     705             : }
     706             : 
     707             : #endif // EQ_CHANNEL_H

Generated by: LCOV version 1.11