WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJMEDIA Reference

Video source duplicator

Duplicate video data from a media port into multiple media port destinations. More...

Enumerations

enum  pjmedia_vid_tee_flag { PJMEDIA_VID_TEE_DST_DO_IN_PLACE_PROC = 4 }
 

Functions

pj_status_t pjmedia_vid_tee_create (pj_pool_t *pool, const pjmedia_format *fmt, unsigned max_dst_cnt, pjmedia_port **p_vid_tee)
 
pj_status_t pjmedia_vid_tee_add_dst_port (pjmedia_port *vid_tee, unsigned option, pjmedia_port *port)
 
pj_status_t pjmedia_vid_tee_add_dst_port2 (pjmedia_port *vid_tee, unsigned option, pjmedia_port *port)
 
pj_status_t pjmedia_vid_tee_remove_dst_port (pjmedia_port *vid_tee, pjmedia_port *port)
 

Detailed Description

This section describes media port to duplicate video data in the stream.

A video tee branches video stream flow from one source port to multiple destination ports by simply duplicating the video data supplied by the source port and delivering the copy to all registered destinations.

The video tee is a unidirectional port, i.e: data flows from source port to destination ports only. Also, the video source port MUST actively call pjmedia_port_put_frame() to the video tee and the video destination ports MUST NEVER call pjmedia_port_get_frame() to the video tee. Please note that there is no specific order of which destination port will receive a frame from the video tee.

The video tee is not thread-safe, so it is application responsibility to synchronize video tee operations, e.g: make sure the source port is paused during adding or removing a destination port.

Enumeration Type Documentation

◆ pjmedia_vid_tee_flag

Enumeration of video tee flags.

Enumerator
PJMEDIA_VID_TEE_DST_DO_IN_PLACE_PROC 

Tell the video tee that the destination port will do in-place processing, so the delivered data may be modified by this port. If this flag is used, buffer will be copied before being given to the destination port.

Function Documentation

◆ pjmedia_vid_tee_create()

pj_status_t pjmedia_vid_tee_create ( pj_pool_t pool,
const pjmedia_format fmt,
unsigned  max_dst_cnt,
pjmedia_port **  p_vid_tee 
)

Create a video tee port with the specified source media port. Application should destroy the tee with pjmedia_port_destroy() as usual. Note that destroying the tee does not destroy its destination ports.

Parameters
poolThe pool.
fmtThe source media port's format.
max_dst_cntThe maximum number of destination ports supported.
p_vid_teePointer to receive the video tee port.
Returns
PJ_SUCCESS on success, or the appropriate error code.

◆ pjmedia_vid_tee_add_dst_port()

pj_status_t pjmedia_vid_tee_add_dst_port ( pjmedia_port vid_tee,
unsigned  option,
pjmedia_port port 
)

Add a destination media port to the video tee. For this function, the destination port's media format must match the source format.

Parameters
vid_teeThe video tee.
optionVideo tee option, see pjmedia_vid_tee_flag.
portThe destination media port.
Returns
PJ_SUCCESS on success, or the appropriate error code.

◆ pjmedia_vid_tee_add_dst_port2()

pj_status_t pjmedia_vid_tee_add_dst_port2 ( pjmedia_port vid_tee,
unsigned  option,
pjmedia_port port 
)

Add a destination media port to the video tee. This function will also create a converter if the destination port's media format does not match the source format.

Parameters
vid_teeThe video tee.
optionVideo tee option, see pjmedia_vid_tee_flag.
portThe destination media port.
Returns
PJ_SUCCESS on success, or the appropriate error code.

◆ pjmedia_vid_tee_remove_dst_port()

pj_status_t pjmedia_vid_tee_remove_dst_port ( pjmedia_port vid_tee,
pjmedia_port port 
)

Remove a destination media port from the video tee.

Parameters
vid_teeThe video tee.
portThe destination media port to be removed.
Returns
PJ_SUCCESS on success, or the appropriate error code.

References PJ_END_DECL.

 


PJMEDIA small footprint Open Source media stack
Copyright (C) 2006-2008 Teluu Inc.