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 media port. More...

Data Structures

struct  pjmedia_vid_port_param
 

Typedefs

typedef struct pjmedia_vid_port pjmedia_vid_port
 

Functions

void pjmedia_vid_port_param_default (pjmedia_vid_port_param *prm)
 
pj_status_t pjmedia_vid_port_create (pj_pool_t *pool, const pjmedia_vid_port_param *prm, pjmedia_vid_port **p_vp)
 
void pjmedia_vid_port_set_cb (pjmedia_vid_port *vid_port, const pjmedia_vid_dev_cb *cb, void *user_data)
 
pjmedia_vid_dev_stream * pjmedia_vid_port_get_stream (pjmedia_vid_port *vid_port)
 
pjmedia_port * pjmedia_vid_port_get_passive_port (pjmedia_vid_port *vid_port)
 
pjmedia_clock_src * pjmedia_vid_port_get_clock_src (pjmedia_vid_port *vid_port)
 
pj_status_t pjmedia_vid_port_set_clock_src (pjmedia_vid_port *vid_port, pjmedia_clock_src *clocksrc)
 
pj_status_t pjmedia_vid_port_subscribe_event (pjmedia_vid_port *vid_port, pjmedia_port *port)
 
pj_status_t pjmedia_vid_port_unsubscribe_event (pjmedia_vid_port *vid_port, pjmedia_port *port)
 
pj_status_t pjmedia_vid_port_connect (pjmedia_vid_port *vid_port, pjmedia_port *port, pj_bool_t destroy)
 
pj_status_t pjmedia_vid_port_disconnect (pjmedia_vid_port *vid_port)
 
pjmedia_port * pjmedia_vid_port_get_connected_port (pjmedia_vid_port *vid_port)
 
pj_status_t pjmedia_vid_port_start (pjmedia_vid_port *vid_port)
 
pj_bool_t pjmedia_vid_port_is_running (pjmedia_vid_port *vid_port)
 
pj_status_t pjmedia_vid_port_stop (pjmedia_vid_port *vid_port)
 
void pjmedia_vid_port_destroy (pjmedia_vid_port *vid_port)
 

Detailed Description

Typedef Documentation

◆ pjmedia_vid_port

Opaque data type for video port.

Function Documentation

◆ pjmedia_vid_port_param_default()

void pjmedia_vid_port_param_default ( pjmedia_vid_port_param *  prm)

Initialize the parameter with the default values. Note that this typically would only fill the structure to zeroes unless they have different default values.

Parameters
prmThe parameter.

◆ pjmedia_vid_port_create()

pj_status_t pjmedia_vid_port_create ( pj_pool_t *  pool,
const pjmedia_vid_port_param *  prm,
pjmedia_vid_port **  p_vp 
)

Create a video port with the specified parameter. When video port opens the video stream with different parameter than the requested values in the prm.vidparam argument, it will automatically do the necessary conversion.

Parameters
poolPool to allocate memory from.
prmThe video port parameter.
p_vpPointer to receive the result.
Returns
PJ_SUCCESS if video port has been created successfully, or the appropriate error code.

◆ pjmedia_vid_port_set_cb()

void pjmedia_vid_port_set_cb ( pjmedia_vid_port *  vid_port,
const pjmedia_vid_dev_cb *  cb,
void *  user_data 
)

Set the callbacks of the video port's underlying video stream.

Parameters
vid_portThe video port.
cbPointer to structure containing video stream callbacks.
user_dataArbitrary user data, which will be given back in the callbacks.

◆ pjmedia_vid_port_get_stream()

pjmedia_vid_dev_stream * pjmedia_vid_port_get_stream ( pjmedia_vid_port *  vid_port)

Return the underlying video stream of the video port.

Parameters
vid_portThe video port.
Returns
The video stream.

◆ pjmedia_vid_port_get_passive_port()

pjmedia_port * pjmedia_vid_port_get_passive_port ( pjmedia_vid_port *  vid_port)

Return the (passive) media port of the video port. This operation is only valid for video ports created with passive interface selected. Retrieving the media port for active video ports may raise an assertion.

Parameters
vid_portThe video port.
Returns
The media port instance, or NULL.

◆ pjmedia_vid_port_get_clock_src()

pjmedia_clock_src * pjmedia_vid_port_get_clock_src ( pjmedia_vid_port *  vid_port)

Get a clock source from the video port.

Parameters
vid_portThe video port.
Returns
The clock source.

◆ pjmedia_vid_port_set_clock_src()

pj_status_t pjmedia_vid_port_set_clock_src ( pjmedia_vid_port *  vid_port,
pjmedia_clock_src *  clocksrc 
)

Set a clock source for the video port.

Parameters
vid_portThe video port.
clocksrcThe clock source.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_vid_port_subscribe_event()

pj_status_t pjmedia_vid_port_subscribe_event ( pjmedia_vid_port *  vid_port,
pjmedia_port *  port 
)

Subscribe media event notifications from the specified media port. Sample use case is that renderer video port needs to monitor stream port events so renderer can adjust its param whenever stream port detects format change.

Parameters
vid_portThe video port.
portThe media port whose events to be monitored.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_vid_port_unsubscribe_event()

pj_status_t pjmedia_vid_port_unsubscribe_event ( pjmedia_vid_port *  vid_port,
pjmedia_port *  port 
)

Unsubscribe media event notifications from the specified media port.

Parameters
vid_portThe video port.
portThe media port whose events to be unsubscribed.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_vid_port_connect()

pj_status_t pjmedia_vid_port_connect ( pjmedia_vid_port *  vid_port,
pjmedia_port *  port,
pj_bool_t  destroy 
)

Connect the video port to a downstream (slave) media port. This operation is only valid for video ports created with active interface selected. Connecting a passive video port may raise an assertion.

Parameters
vid_portThe video port.
portA downstream media port to be connected to this video port.
destroySpecify if the downstream media port should also be destroyed by this video port when the video port is destroyed.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_vid_port_disconnect()

pj_status_t pjmedia_vid_port_disconnect ( pjmedia_vid_port *  vid_port)

Disconnect the video port from its downstream (slave) media port, if any. This operation is only valid for video ports created with active interface selected, and assertion may be triggered if this is invoked on a passive video port.

Parameters
vid_portThe video port.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_vid_port_get_connected_port()

pjmedia_port * pjmedia_vid_port_get_connected_port ( pjmedia_vid_port *  vid_port)

Retrieve the media port currently connected as downstream media port of the specified video port. This operation is only valid for video ports created with active interface selected, and assertion may be triggered if this is invoked on a passive video port.

Parameters
vid_portThe video port.
Returns
Media port currently connected to the video port, if any.

◆ pjmedia_vid_port_start()

pj_status_t pjmedia_vid_port_start ( pjmedia_vid_port *  vid_port)

Start the video port.

Parameters
vid_portThe video port.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_vid_port_is_running()

pj_bool_t pjmedia_vid_port_is_running ( pjmedia_vid_port *  vid_port)

Query whether the video port has been started.

Parameters
vid_portThe video port.
Returns
PJ_TRUE if the video port has been started.

◆ pjmedia_vid_port_stop()

pj_status_t pjmedia_vid_port_stop ( pjmedia_vid_port *  vid_port)

Stop the video port.

Parameters
vid_portThe video port.
Returns
PJ_SUCCESS on success or the appropriate error code.

◆ pjmedia_vid_port_destroy()

void pjmedia_vid_port_destroy ( pjmedia_vid_port *  vid_port)

Destroy the video port, along with its video stream. If the video port is an active one, this may also destroy the downstream media port, if the destroy flag is set when the media port is connected.

Parameters
vid_portThe video port.

 


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