diff options
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 25 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_media.c | 14 |
2 files changed, 21 insertions, 18 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 8eeceed8..efdf9f4c 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -2529,27 +2529,32 @@ PJ_DECL(pj_status_t) pjsua_player_destroy(pjsua_player_id id); /** * Create a file recorder, and automatically connect this recorder to - * the conference bridge. + * the conference bridge. The recorder currently supports recording WAV file, + * and on Windows, MP3 file. The type of the recorder to use is determined + * by the extension of the file (e.g. ".wav" or ".mp3"). * * @param filename Output file name. The function will determine the * default format to be used based on the file extension. * Currently ".wav" is supported on all platforms, and * also ".mp3" is support on Windows. - * @param file_format This option is obsolete. - * @param encoding Optionally specify the encoding to be applied to the - * file. By default (if NULL is specified), the encoding - * is determined from the file extension (i.e. 16bit PCM - * is used for the WAV files). - * @param max_size Maximum file size. Specify -1 to remove size - * limitation. + * @param enc_type Optionally specify the type of encoder to be used to + * compress the media, if the file can support different + * encodings. This value must be zero for now. + * @param enc_param Optionally specify codec specific parameter to be + * passed to the file writer. For .MP3 recorder, this + * can point to pjmedia_mp3_encoder_option structure to + * specify additional settings for the .mp3 recorder. + * For .WAV recorder, this value must be NULL. + * @param max_size Maximum file size. Specify zero or -1 to remove size + * limitation. This value must be zero or -1 for now. * @param options Optional options. * @param p_id Pointer to receive the recorder instance. * * @return PJ_SUCCESS on success, or the appropriate error code. */ PJ_DECL(pj_status_t) pjsua_recorder_create(const pj_str_t *filename, - unsigned file_format, - const pj_str_t *encoding, + unsigned enc_type, + void *enc_param, pj_ssize_t max_size, unsigned options, pjsua_recorder_id *p_id); diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index c94265d0..b040ff84 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -796,8 +796,8 @@ PJ_DEF(pj_status_t) pjsua_player_destroy(pjsua_player_id id) * the conference bridge. */ PJ_DEF(pj_status_t) pjsua_recorder_create( const pj_str_t *filename, - unsigned file_format, - const pj_str_t *encoding, + unsigned enc_type, + void *enc_param, pj_ssize_t max_size, unsigned options, pjsua_recorder_id *p_id) @@ -811,6 +811,7 @@ PJ_DEF(pj_status_t) pjsua_recorder_create( const pj_str_t *filename, unsigned slot, file_id; char path[128]; pj_str_t ext; + int file_format; pjmedia_port *port; pj_status_t status; @@ -820,11 +821,8 @@ PJ_DEF(pj_status_t) pjsua_recorder_create( const pj_str_t *filename, /* Don't support max_size at present */ PJ_ASSERT_RETURN(max_size == 0 || max_size == -1, PJ_EINVAL); - /* Don't support file format at present */ - PJ_ASSERT_RETURN(file_format == 0, PJ_EINVAL); - - /* Don't support encoding at present */ - PJ_ASSERT_RETURN(encoding == NULL, PJ_EINVAL); + /* Don't support encoding type at present */ + PJ_ASSERT_RETURN(enc_type == 0, PJ_EINVAL); if (pjsua_var.rec_cnt >= PJ_ARRAY_SIZE(pjsua_var.recorder)) return PJ_ETOOMANY; @@ -874,7 +872,7 @@ PJ_DEF(pj_status_t) pjsua_recorder_create( const pj_str_t *filename, pjsua_var.mconf_cfg.channel_count, pjsua_var.mconf_cfg.samples_per_frame, pjsua_var.mconf_cfg.bits_per_sample, - NULL, &port); + enc_param, &port); } else { port = NULL; status = PJ_ENOTSUP; |