upipe-modules/upipe_transfer.h header reference

Upipe module allowing to transfer other pipes to a remote event loop More

Header inclusion  

Members  

Type  

Functions  

Description  

This is particularly helpful for multithreaded applications.

Members detail  

#define UPIPE_XFER_SIGNATURE  

This macro is declared in upipe-modules/upipe_transfer.h source file, line 39.

#define _UPIPE_MODULES_UPIPE_TRANSFER_H_  

This macro is declared in upipe-modules/upipe_transfer.h source file, line 32.

struct upipe * upipe_xfer_alloc(struct upipe_mgr *mgr, struct uprobe *uprobe, struct upipe *upipe_remote)  

This function is declared in upipe-modules/upipe_transfer.h source file, line 99.

This function allocates and initializes an xfer pipe. An xfer pipe allows to transfer an existing pipe to a remote upump_mgr. The xfer pipe is then used to remotely release the transferred pipe.

Please note that upipe_remote is not "used" so its refcount is not incremented. For that reason it shouldn't be "released" afterwards. Only release the xfer pipe.

Parameters list:

  • mgr: management structure for queue source type
  • uprobe: structure used to raise events
  • upipe_remote: pipe to transfer to remote upump_mgr

The return value is pointer to allocated pipe, or NULL in case of failure

struct upipe_mgr * upipe_xfer_mgr_alloc(uint8_t queue_length, uint16_t msg_pool_depth)  

This function is declared in upipe-modules/upipe_transfer.h source file, line 60.

This function returns a management structure for xfer pipes. You would need one management structure per target event loop (upump manager). The management structure can be allocated in any thread, but must be attached in the same thread as the one running the upump manager.

Parameters list:

  • queue_length: maximum length of the internal queues
  • msg_pool_depth: maximum number of messages in the pool

The return value is pointer to manager

int upipe_xfer_mgr_attach(struct upipe_mgr *mgr, struct upump_mgr *upump_mgr)  

This function is declared in upipe-modules/upipe_transfer.h source file, line 78.

This function attaches a upipe_xfer_mgr to a given event loop. The xfer manager will call upump_alloc_XXX and upump_start, so it must be done in a context where it is possible, which generally means that this command is done in the same thread that runs the event loop (upump managers aren't generally thread-safe).

Please note that an xfer_mgr must be attached to a upump manager before it can be released.

Parameters list:

  • mgr: xfer_mgr structure
  • upump_mgr: event loop to attach

The return value is an error code

enum upipe_xfer_mgr_command  

This enum is declared in upipe-modules/upipe_transfer.h source file, line 43.

This enum extends upipe_mgr_command with specific commands for xfer.

IdentifierValueDescription
UPIPE_XFER_MGR_SENTINEL0
UPIPE_XFER_MGR_ATTACH1attach to given upump manager (struct upump_mgr *)

Valid XHTML 1.0 StrictGenerated by cmassiot on Thu Nov 6 12:15:25 2014 using MkDoc