Duplicate video data from a media port into multiple media port destinations.
More...
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.
◆ 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.
|
◆ pjmedia_vid_tee_create()
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
-
pool | The pool. |
fmt | The source media port's format. |
max_dst_cnt | The maximum number of destination ports supported. |
p_vid_tee | Pointer to receive the video tee port. |
- Returns
- PJ_SUCCESS on success, or the appropriate error code.
◆ pjmedia_vid_tee_add_dst_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_tee | The video tee. |
option | Video tee option, see pjmedia_vid_tee_flag. |
port | The destination media port. |
- Returns
- PJ_SUCCESS on success, or the appropriate error code.
◆ pjmedia_vid_tee_add_dst_port2()
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_tee | The video tee. |
option | Video tee option, see pjmedia_vid_tee_flag. |
port | The destination media port. |
- Returns
- PJ_SUCCESS on success, or the appropriate error code.
◆ pjmedia_vid_tee_remove_dst_port()
Remove a destination media port from the video tee.
- Parameters
-
vid_tee | The video tee. |
port | The destination media port to be removed. |
- Returns
- PJ_SUCCESS on success, or the appropriate error code.
References PJ_END_DECL.