39 * Cancel the given request. No more callbacks will be called, buffered data is discarded and the remote render process will cancel asap. |
39 * Cancel the given request. No more callbacks will be called, buffered data is discarded and the remote render process will cancel asap. |
40 */ |
40 */ |
41 void render_remote_cancel (struct remote_render_ctx *ctx); |
41 void render_remote_cancel (struct remote_render_ctx *ctx); |
42 |
42 |
43 /* |
43 /* |
44 * If you don't want to receive the rendered data one byte at a time, you can set a minimum chunk size. |
44 * Controls the behaviour of when cb_data is called, and how remote data is read in. |
45 * |
45 * |
46 * cb_done will only be called when the buffer contains at least chunk_size bytes, or no more data is available (cb_done will be called next). |
46 * recv_threshold, sets a threshold for calling cb_data - cb_data will only be called |
|
47 * if the buffer contains at least recv_threshold, bytes. Note that cb_data is only |
|
48 * ever called when new data has been receieved from the remote end - never |
|
49 * otherwise. If cb_data doesn't drain the buffer, cb_data will be called again |
|
50 * once more data has been received from the remote end. |
47 * |
51 * |
48 * overflow_buffer is how many bytes will be buffered, at most, in addition to chunk_size (in case rendering is paused). After that, the render node will start to block. |
52 * overflow_size can be used to control the amount of unread data in cb_data. If |
|
53 * the buffer contains more than recv_threshold + unread_buffer bytes, we will stop |
|
54 * accepting bytes from the remote end, and cb_data will not be called any more. |
49 * |
55 * |
50 * Only call this once cb_sent has fired |
56 * Only call this once cb_sent has fired |
51 */ |
57 */ |
52 int render_remote_set_chunk_size (struct remote_render_ctx *ctx, size_t chunk_size, size_t overflow_buffer); |
58 int render_remote_set_recv (struct remote_render_ctx *ctx, size_t recv_threshold, size_t unread_buffer); |
|
59 |
|
60 /* |
|
61 * Call cb_data with the current set of buffered input data immediately, |
|
62 * regardless of whether or not the buffer contains any data, or any new |
|
63 * data has been received. |
|
64 * |
|
65 * Only call this after cb_sent and before cb_done/cb_fail. |
|
66 */ |
|
67 int render_remote_shake (struct remote_render_ctx *ctx); |
53 |
68 |
54 #endif /* RENDER_REMOTE_H */ |
69 #endif /* RENDER_REMOTE_H */ |