render_multi.h
changeset 13 ee426f453cf5
parent 11 082bfaf38cf0
child 16 50995bbe442a
equal deleted inserted replaced
12:43297144f196 13:ee426f453cf5
     1 #ifndef RENDER_MULTI_H
     1 #ifndef RENDER_MULTI_H
     2 #define RENDER_MULTI_H
     2 #define RENDER_MULTI_H
     3 
     3 
       
     4 #include <event2/util.h>
       
     5 #include <event2/buffer.h>
       
     6 
       
     7 #include "render.h"
     4 #include "remote_pool.h"
     8 #include "remote_pool.h"
     5 
     9 
     6 /*
    10 /*
     7  * Execute a given render_t operate across multiple remote render nodes, and aggregate the results into a single PNG stream locally
    11  * Execute a given render_t operate across multiple remote render nodes, and aggregate the results into a single PNG stream locally
     8  */
    12  */
    16  * Execute the given render operation on multiple nodes from the given remote pool, streaming back the result in PNG format via the given callbacks
    20  * Execute the given render operation on multiple nodes from the given remote pool, streaming back the result in PNG format via the given callbacks
    17  *
    21  *
    18  * The behaviour of the callbacks is mostly the same as for render_remote.h
    22  * The behaviour of the callbacks is mostly the same as for render_remote.h
    19  */
    23  */
    20 struct render_multi *render_multi (
    24 struct render_multi *render_multi (
    21         render_t *render_ctx,               // what to render
    25         struct render *render_ctx,               // what to render
    22         struct remote_pool *render_pool,    // what render pool to use
    26         struct remote_pool *pool_info,    // what render pool to use
    23         void (*cb_sent)(void *arg),
    27         void (*cb_sent)(void *arg),
    24         void (*cb_data)(struct evbuffer *buf, void *arg),
    28         void (*cb_data)(struct evbuffer *buf, void *arg),
    25         void (*cb_done)(void *arg),
    29         void (*cb_done)(void *arg),
    26         void (*cb_fail)(void *arg),
    30         void (*cb_fail)(void *arg),
    27         void *cb_arg
    31         void *cb_arg
    28 );
    32 );
    29 
    33 
       
    34 /*
       
    35  * Cancel the given request. No more callbacks will be called, buffered data is
       
    36  * discarded and the remote render processes will cancel ASAP.
       
    37  */
       
    38 void render_multi_cancel (struct render_multi *ctx);
       
    39 
       
    40 /*
       
    41  * Doesn't actually do anything yet
       
    42  */
       
    43 int render_multi_set_recv (struct render_multi *ctx, size_t recv_threshold, size_t unread_buffer);
       
    44 
       
    45 /*
       
    46  * Call cb_data with the current set of buffered input data immediately,
       
    47  * regardless of whether or not the buffer contains any data, or any new
       
    48  * data has been received.
       
    49  *
       
    50  * Only call this after cb_sent and before cb_done/cb_fail.
       
    51  */
       
    52 int render_multi_shake (struct render_multi *ctx);
       
    53 
    30 #endif /* RENDER_MULTI_H */
    54 #endif /* RENDER_MULTI_H */