Home --> Documentations --> PJSIP Reference

Data Structures | Functions

Video support. More...

Data Structures

struct  pjsua_vid_preview_param
 
struct  pjsua_vid_win_info
 

Functions

unsigned pjsua_vid_dev_count (void)
 
pj_status_t pjsua_vid_dev_get_info (pjmedia_vid_dev_index id, pjmedia_vid_dev_info *vdi)
 
pj_bool_t pjsua_vid_dev_is_active (pjmedia_vid_dev_index id)
 
pj_status_t pjsua_vid_dev_set_setting (pjmedia_vid_dev_index id, pjmedia_vid_dev_cap cap, const void *pval, pj_bool_t keep)
 
pj_status_t pjsua_vid_dev_get_setting (pjmedia_vid_dev_index id, pjmedia_vid_dev_cap cap, void *pval)
 
pj_status_t pjsua_vid_enum_devs (pjmedia_vid_dev_info info[], unsigned *count)
 
void pjsua_vid_preview_param_default (pjsua_vid_preview_param *p)
 
pj_bool_t pjsua_vid_preview_has_native (pjmedia_vid_dev_index id)
 
pj_status_t pjsua_vid_preview_start (pjmedia_vid_dev_index id, const pjsua_vid_preview_param *p)
 
pjsua_vid_win_id pjsua_vid_preview_get_win (pjmedia_vid_dev_index id)
 
pj_status_t pjsua_vid_preview_stop (pjmedia_vid_dev_index id)
 
pj_status_t pjsua_vid_enum_wins (pjsua_vid_win_id wids[], unsigned *count)
 
pj_status_t pjsua_vid_win_get_info (pjsua_vid_win_id wid, pjsua_vid_win_info *wi)
 
pj_status_t pjsua_vid_win_set_show (pjsua_vid_win_id wid, pj_bool_t show)
 
pj_status_t pjsua_vid_win_set_pos (pjsua_vid_win_id wid, const pjmedia_coord *pos)
 
pj_status_t pjsua_vid_win_set_size (pjsua_vid_win_id wid, const pjmedia_rect_size *size)
 
pj_status_t pjsua_vid_win_set_win (pjsua_vid_win_id wid, const pjmedia_vid_dev_hwnd *win)
 
pj_status_t pjsua_vid_win_rotate (pjsua_vid_win_id wid, int angle)
 
pj_status_t pjsua_vid_enum_codecs (pjsua_codec_info id[], unsigned *count)
 
pj_status_t pjsua_vid_codec_set_priority (const pj_str_t *codec_id, pj_uint8_t priority)
 
pj_status_t pjsua_vid_codec_get_param (const pj_str_t *codec_id, pjmedia_vid_codec_param *param)
 
pj_status_t pjsua_vid_codec_set_param (const pj_str_t *codec_id, const pjmedia_vid_codec_param *param)
 

Detailed Description

Function Documentation

unsigned pjsua_vid_dev_count ( void  )

Get the number of video devices installed in the system.

Returns
The number of devices.
pj_status_t pjsua_vid_dev_get_info ( pjmedia_vid_dev_index  id,
pjmedia_vid_dev_info vdi 
)

Retrieve the video device info for the specified device index.

Parameters
idThe device index.
vdiDevice info to be initialized.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_bool_t pjsua_vid_dev_is_active ( pjmedia_vid_dev_index  id)

Check whether the video capture device is currently active, i.e. if a video preview has been started or there is a video call using the device. This function will return PJ_FALSE for video renderer device.

Parameters
idThe video device index.
Returns
PJ_TRUE if active, PJ_FALSE otherwise.
pj_status_t pjsua_vid_dev_set_setting ( pjmedia_vid_dev_index  id,
pjmedia_vid_dev_cap  cap,
const void *  pval,
pj_bool_t  keep 
)

Configure the capability of a video capture device. If the device is currently active (i.e. if there is a video call using the device or a video preview has been started), the function will forward the setting to the video device instance to be applied immediately, if it supports it.

The setting will be saved for future opening of the video device, if the "keep" argument is set to non-zero. If the video device is currently inactive, and the "keep" argument is false, this function will return error.

Note: This function will only works for video capture devices. To configure the setting of video renderer device instances, use pjsua_vid_win API instead.

Warning: If application refreshes the video device list, it needs to manually update the settings to reflect the newly updated video device indexes. See pjmedia_vid_dev_refresh() for more information.

See also #pjmedia_vid_stream_set_cap() for more information about setting a video device capability.

Parameters
idThe video device index.
capThe video device capability to change.
pvalPointer to value. Please see pjmedia_vid_dev_cap documentation about the type of value to be supplied for each setting.
Returns
PJ_SUCCESS on success or the appropriate error code.
pj_status_t pjsua_vid_dev_get_setting ( pjmedia_vid_dev_index  id,
pjmedia_vid_dev_cap  cap,
void *  pval 
)

Retrieve the value of a video capture device setting. If the device is currently active (i.e. if there is a video call using the device or a video preview has been started), the function will forward the request to the video device. If video device is currently inactive, and if application had previously set the setting and mark the setting as kept, then that setting will be returned. Otherwise, this function will return error. The function only works for video capture device.

Parameters
idThe video device index.
capThe video device capability to retrieve.
pvalPointer to receive the value. Please see pjmedia_vid_dev_cap documentation about the type of value to be supplied for each setting.
Returns
PJ_SUCCESS on success or the appropriate error code.
pj_status_t pjsua_vid_enum_devs ( pjmedia_vid_dev_info  info[],
unsigned *  count 
)

Enum all video devices installed in the system.

Parameters
infoArray of info to be initialized.
countOn input, specifies max elements in the array. On return, it contains actual number of elements that have been initialized.
Returns
PJ_SUCCESS on success, or the appropriate error code.
void pjsua_vid_preview_param_default ( pjsua_vid_preview_param p)

Initialize pjsua_vid_preview_param

Parameters
pThe parameter to be initialized.
pj_bool_t pjsua_vid_preview_has_native ( pjmedia_vid_dev_index  id)

Determine if the specified video input device has built-in native preview capability. This is a convenience function that is equal to querying device's capability for PJMEDIA_VID_DEV_CAP_INPUT_PREVIEW capability.

Parameters
idThe capture device ID.
Returns
PJ_TRUE if it has.
pj_status_t pjsua_vid_preview_start ( pjmedia_vid_dev_index  id,
const pjsua_vid_preview_param p 
)

Start video preview window for the specified capture device.

Parameters
idThe capture device ID where its preview will be started.
pOptional video preview parameters. Specify NULL to use default values.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pjsua_vid_win_id pjsua_vid_preview_get_win ( pjmedia_vid_dev_index  id)

Get the preview window handle associated with the capture device, if any.

Parameters
idThe capture device ID.
Returns
The window ID of the preview window for the specified capture device ID, or PJSUA_INVALID_ID if preview has not been started for the device.
pj_status_t pjsua_vid_preview_stop ( pjmedia_vid_dev_index  id)

Stop video preview.

Parameters
idThe capture device ID.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_enum_wins ( pjsua_vid_win_id  wids[],
unsigned *  count 
)

Enumerates all video windows.

Parameters
idArray of window ID to be initialized.
countOn input, specifies max elements in the array. On return, it contains actual number of elements that have been initialized.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_win_get_info ( pjsua_vid_win_id  wid,
pjsua_vid_win_info wi 
)

Get window info.

Parameters
widThe video window ID.
wiThe video window info to be initialized.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_win_set_show ( pjsua_vid_win_id  wid,
pj_bool_t  show 
)

Show or hide window. This operation is not valid for native windows (pjsua_vid_win_info.is_native=PJ_TRUE), on which native windowing API must be used instead.

Parameters
widThe video window ID.
showSet to PJ_TRUE to show the window, PJ_FALSE to hide the window.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_win_set_pos ( pjsua_vid_win_id  wid,
const pjmedia_coord pos 
)

Set video window position. This operation is not valid for native windows (pjsua_vid_win_info.is_native=PJ_TRUE), on which native windowing API must be used instead.

Parameters
widThe video window ID.
posThe window position.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_win_set_size ( pjsua_vid_win_id  wid,
const pjmedia_rect_size size 
)

Resize window. This operation is not valid for native windows (pjsua_vid_win_info.is_native=PJ_TRUE), on which native windowing API must be used instead.

Parameters
widThe video window ID.
sizeThe new window size.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_win_set_win ( pjsua_vid_win_id  wid,
const pjmedia_vid_dev_hwnd win 
)

Set output window. This operation is valid only when the underlying video device supports PJMEDIA_VIDEO_DEV_CAP_OUTPUT_WINDOW capability AND allows the output window to be changed on-the-fly. Currently it is only supported on Android.

Parameters
widThe video window ID.
winThe new output window.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_win_rotate ( pjsua_vid_win_id  wid,
int  angle 
)

Rotate the video window. This function will change the video orientation and also possibly the video window size (width and height get swapped). This operation is not valid for native windows (pjsua_vid_win_info.is_native =PJ_TRUE), on which native windowing API must be used instead.

Parameters
widThe video window ID.
angleThe rotation angle in degrees, must be multiple of 90. Specify positive value for clockwise rotation or negative value for counter-clockwise rotation.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_enum_codecs ( pjsua_codec_info  id[],
unsigned *  count 
)

Enum all supported video codecs in the system.

Parameters
idArray of ID to be initialized.
countOn input, specifies max elements in the array. On return, it contains actual number of elements that have been initialized.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_codec_set_priority ( const pj_str_t codec_id,
pj_uint8_t  priority 
)

Change video codec priority.

Parameters
codec_idCodec ID, which is a string that uniquely identify the codec (such as "H263/90000"). Please see pjsua manual or pjmedia codec reference for details.
priorityCodec priority, 0-255, where zero means to disable the codec.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_codec_get_param ( const pj_str_t codec_id,
pjmedia_vid_codec_param param 
)

Get video codec parameters.

Parameters
codec_idCodec ID.
paramStructure to receive video codec parameters.
Returns
PJ_SUCCESS on success, or the appropriate error code.
pj_status_t pjsua_vid_codec_set_param ( const pj_str_t codec_id,
const pjmedia_vid_codec_param param 
)

Set video codec parameters.

Parameters
codec_idCodec ID.
paramCodec parameter to set. Set to NULL to reset codec parameter to library default settings.
Returns
PJ_SUCCESS on success, or the appropriate error code.

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.