From 2ba3536e2d318130242c35ed053aaae7f771b261 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Wed, 7 Dec 2011 10:43:28 +0000 Subject: Re #1234: Initial version of keyframe request/response via SIP INFO. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3901 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/include/pjsua-lib/pjsua.h | 53 +++++++++++++++++++++++++++++++- pjsip/include/pjsua-lib/pjsua_internal.h | 4 +++ 2 files changed, 56 insertions(+), 1 deletion(-) (limited to 'pjsip/include/pjsua-lib') diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 31fbfca1..b043f266 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -331,6 +331,17 @@ typedef struct pjsua_msg_data pjsua_msg_data; # define PJSUA_HAS_VIDEO PJMEDIA_HAS_VIDEO #endif + +/** + * Interval between two keyframe requests, in milliseconds. + * + * Default: 500 ms + */ +#ifndef PJSUA_VID_REQ_KEYFRAME_INTERVAL +# define PJSUA_VID_REQ_KEYFRAME_INTERVAL 500 +#endif + + /** * This enumeration represents pjsua state. */ @@ -3370,18 +3381,46 @@ typedef enum pjsua_call_media_status } pjsua_call_media_status; +/** + * Enumeration of video keyframe request methods. Keyframe request is + * triggered by decoder, usually when the incoming video stream cannot + * be decoded properly due to missing video keyframe. + */ +typedef enum pjsua_vid_req_keyframe_method +{ + /** + * Requesting keyframe via SIP INFO message. Note that incoming keyframe + * request via SIP INFO will always be handled even if this flag is unset. + */ + PJSUA_VID_REQ_KEYFRAME_SIP_INFO = 1, + + /** + * Requesting keyframe via Picture Loss Indication of RTCP feedback. + * This is currently not supported. + */ + PJSUA_VID_REQ_KEYFRAME_RTCP_PLI = 2 + +} pjsua_vid_req_keyframe_method; + + /** * Call settings. */ typedef struct pjsua_call_setting { /** - * Bitmask of pjsua_call_flag constants. + * Bitmask of #pjsua_call_flag constants. * * Default: 0 */ unsigned flag; + /** + * This flag controls what methods to request keyframe are allowed on + * the call. Value is bitmask of #pjsua_vid_req_keyframe_method. + */ + unsigned req_keyframe_method; + /** * Number of simultaneous active audio streams for this call. Setting * this to zero will disable audio in this call. @@ -3649,6 +3688,13 @@ typedef enum pjsua_call_vid_strm_op */ PJSUA_CALL_VID_STRM_STOP_TRANSMIT, + /** + * Send keyframe in the video stream. This will force the stream to + * generate and send video keyframe as soon as possible. No + * re-INVITE/UPDATE is to be transmitted to remote with this operation. + */ + PJSUA_CALL_VID_STRM_SEND_KEYFRAME + } pjsua_call_vid_strm_op; @@ -4664,6 +4710,11 @@ PJ_DECL(void) pjsua_pres_dump(pj_bool_t verbose); extern const pjsip_method pjsip_message_method; +/** + * The INFO method (defined in pjsua_call.c) + */ +extern const pjsip_method pjsip_info_method; + /** * Send instant messaging outside dialog, using the specified account for diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h index 5c16370a..31447ddf 100644 --- a/pjsip/include/pjsua-lib/pjsua_internal.h +++ b/pjsip/include/pjsua-lib/pjsua_internal.h @@ -84,6 +84,7 @@ struct pjsua_call_media (used to update ICE default address) */ pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */ + pj_timestamp last_req_keyframe;/**< Last TX keyframe request. */ pjsua_med_tp_state_cb med_init_cb;/**< Media transport initialization callback. */ @@ -477,6 +478,9 @@ typedef struct pjsua_im_data void *user_data; } pjsua_im_data; +pj_status_t pjsua_media_apply_xml_control(pjsua_call_id call_id, + const pj_str_t *xml_st); + /** * Duplicate IM data. -- cgit v1.2.3