PJSip | 用call setting启用或拒绝video(pjsua_call_setting,via vid_cnt | Video Utils library
kandi X-RAY | PJSip Summary
kandi X-RAY | PJSip Summary
用call setting启用或拒绝video(pjsua_call_setting,via vid_cnt setting). pjsua_call_answer2() (so for example, to reject the video, set vid_cnt to 0 and call pjsua_call_answer2()). pjsua_acc_config cfg;pjsua_acc_config_default(&cfg);cfg.vid_in_auto_show = PJ_TRUE;. int vid_idx;pjsua_vid_win_id wid;vid_idx = pjsua_call_get_vid_stream_idx(call_id);if (vid_idx >= 0) { pjsua_call_info ci; pjsua_call_get_info(call_id, &ci); wid = ci.media[vid_idx].stream.vid.win_in;}. PJSUA_CALL_VID_STRM_CHANGE_DIR: change the media direction (e.g. to "sendonly", or even "inactive") PJSUA_CALL_VID_STRM_REMOVE: remove the media stream altogether by settings its port to zero PJSUA_CALL_VID_STRM_ADD: add new video media stream. 呼出通话前把 pjsua_call_setting.flag 设置成 PJSUA_CALL_INCLUDE_DISABLED_MEDIA ,意味着禁止视频。. 由 pjsua_acc_config.vid_out_auto_transmit 来设置传出视频,默认是 PJ_FALSE. 设为 PJ_TRUE 就可以开启所有呼出通话和带视频的呼入通话的视频传出。. 设置vid_cnt of pjsua_call_setting 可以增删视频。。。. 应用程序可以用 pjsua_vid_win_get_info() 获得 pjsua_vid_win_info 。大多数应用程序会对一个窗口的属性感兴趣,就是本地窗口句柄native window handle。video handle由pjsua_vid_win_info里面的 pjmedia_vid_dev_hwnd 结构体控制。利用这个video handle,应用程序可以把video window 嵌入到 GUI 。另外,pj库也提供了一些常用API来操作窗口,诸如pjsua_vid_win_set_show(),pjsua_vid_win_set_size()等。但这些API不担保有效,因为这取决于底层设备。. const pj_str_t codec_id = {"H264", 4};pjmedia_vid_codec_param param;pjsua_vid_codec_get_param(&codec_id, ¶m);/* Modify param here */...pjsua_vid_codec_set_param(&codec_id, ¶m);. PJSIP Video Users Guide (PJSIP视频用户指南) - kai7613 - 天空安静. /**获得系统中的视频设备数量 * Get the number of video devices installed in the system. *返回:设备数量 * @return The number of devices. */PJ_DECL(unsigned) pjsua_vid_dev_count(void);. /**根据索引取得设备信息 * Retrieve the video device info for the specified device index. * * @param id The device index. 设备索引 * @param vdi Device info to be initialized. 存放信息的结构体 * * @return PJ_SUCCESS on success, or the appropriate error code. */PJ_DECL(pj_status_t) pjsua_vid_dev_get_info(pjmedia_vid_dev_index id, pjmedia_vid_dev_info *vdi);. /**枚举系统中所有视频设备 * Enum all video devices installed in the system. * * @param info Array of info to be initialized. 存放设备信息的数组 * @param count On input, specifies max elements in the array. 传入时,指定数组的最大值 * On return, it contains actual number of elements 传回来实际的数量 * that have been initialized. * * @return PJ_SUCCESS on success, or the appropriate error code. */PJ_DECL(pj_status_t) pjsua_vid_enum_devs(pjmedia_vid_dev_info info[], unsigned *count);. /**刷新系统中的设备列表,这将可能导致设备索引号的重新编排,但不影响已经使用中的媒体流。刷新后,要注意所有的索引pjmedia_vid_dev_index变量已经失效,调用以索引作为参数的函数就要尤其注意。 * Refresh the list of video devices installed in the system. This function * will only refresh the list of videoo device so all active video streams will * be unaffected. After refreshing the device list, application MUST make sure * to update all index references to video devices (i.e. all variables of type * pjmedia_vid_dev_index) before calling any function that accepts video device * index as its parameter. * * @return PJ_SUCCESS on successful operation or the appropriate * error code. */PJ_DECL(pj_status_t) pjmedia_vid_dev_refresh(void);. /** * Parameters for starting video preview with pjsua_vid_preview_start(). * Application should initialize this structure with * pjsua_vid_preview_param_default(). */typedef struct pjsua_vid_preview_param{ /**视频渲染器(即播放设备)的ID。 * Device ID for the video renderer to be used for rendering the * capture stream for preview. */ pjmedia_vid_dev_index rend_id;} pjsua_vid_preview_param;. /**为指定的捕获设备开启视频预览窗口 * Start video preview window for the specified capture device. * * @param id The capture device ID where its preview will be * started. 捕获设备的ID * @param prm Optional video preview parameters. Specify NULL * to use default values.预览选项,NULL为默认 * * @return PJ_SUCCESS on success, or the appropriate error code. */PJ_DECL(pj_status_t) pjsua_vid_preview_start(pjmedia_vid_dev_index id, pjsua_vid_preview_param *prm);. /**如果有的话,获取与捕获设备关联了的预览窗口handle * Get the preview window handle associated with the capture device, if any. * * @param id The capture device ID. * * @return The window ID of the preview window for the * specified capture device ID, or NULL if preview * does not exist. */PJ_DECL(pjsua_vid_win_id) pjsua_vid_preview_get_win(pjmedia_vid_dev_index id);. /**停止视频预览 * Stop video preview. * * @param id The capture device ID. * * @return PJ_SUCCESS on success, or the appropriate error code. */PJ_DECL(pj_status_t) pjsua_vid_preview_stop(pjmedia_vid_dev_index id);. pj_bool_t vid_in_auto_show; 指定传入的视频是否自动显示在屏幕上。 PJ_TRUE / PJ_FALSE. pj_bool_t vid_out_auto_transmit; 设定当有视频来电,或拨出电话时,是否默认激活视频传出。PJ_TRUE / PJ_FALSE. pjmedia_vid_dev_index vid_cap_dev; 指定使用的捕获设备。Default: PJMEDIA_VID_DEFAULT_CAPTURE_DEV. pjmedia_vid_dev_index vid_rend_dev; 指定使用的显示设备。Default: PJMEDIA_VID_DEFAULT_RENDER_DEV. typedef enum pjsua_call_vid_strm_op{ /** * No operation */ PJSUA_CALL_VID_STRM_NO_OP, /**增加视频流 * Add a new video stream. This will add a new m=video line to * the media, regardless of whether existing video is/are present * or not. This will cause re-INVITE or UPDATE to be sent to remote * party. */ PJSUA_CALL_VID_STRM_ADD, /**移除视频流 * Remove/disable an existing video stream. This will * cause re-INVITE or UPDATE to be sent to remote party. */ PJSUA_CALL_VID_STRM_REMOVE, /**改变流方向 * Change direction of a video stream. This operation can be used * to activate or deactivate an existing video media. This will * cause re-INVITE or UPDATE to be sent to remote party. */ PJSUA_CALL_VID_STRM_CHANGE_DIR, /**改变捕获设备 * Change capture device of a video stream. This will not send * re-INVITE or UPDATE to remote party. */ PJSUA_CALL_VID_STRM_CHANGE_CAP_DEV, /**开启流传输 * Start transmitting video stream. This will cause previously * stopped stream to start transmitting again. Note that no * re-INVITE/UPDATE is to be transmitted to remote since this * operation only operates on local stream. */ PJSUA_CALL_VID_STRM_START_TRANSMIT, /**停止流传输 * Stop transmitting video stream. This will cause the stream to * be paused in TX direction, causing it to stop sending any video * packets. No re-INVITE/UPDATE is to be transmitted to remote * with this operation. */ 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;. /** * Parameters for video stream operation on a call. /typedef struct pjsua_call_vid_strm_op_param{ /* * Specify the media stream index. This can be set to -1 to denote * the default video stream in the call, which is the first active * video stream or any first video stream if none is active. * * This field is valid for all video stream operations, except * PJSUA_CALL_VID_STRM_ADD. * * Default: -1 (first active video stream, or any first video stream * if none is active) / int med_idx; /* * Specify the media stream direction. * * This field is valid for the following video stream operations: * PJSUA_CALL_VID_STRM_ADD and PJSUA_CALL_VID_STRM_CHANGE_DIR. * * Default: PJMEDIA_DIR_ENCODING_DECODING / pjmedia_dir dir; /* * Specify the video capture device ID. This can be set to * PJMEDIA_VID_DEFAULT_CAPTURE_DEV to specify the default capture * device as configured in the account. * * This field is valid for the following video stream operations: * PJSUA_CALL_VID_STRM_ADD and PJSUA_CALL_VID_STRM_CHANGE_CAP_DEV. * * Default: capture device configured in account. */ pjmedia_vid_dev_index cap_dev;} pjsua_call_vid_strm_op_param;. /** * Add, remove, modify, and/or manipulate video media stream for the * specified call. This may trigger a re-INVITE or UPDATE to be sent * for the call. * * @param call_id Call identification. * @param op The video stream operation to be performed, * possible values are #pjsua_call_vid_strm_op. * @param param The parameters for the video stream operation, * or NULL for the default parameter values * (see #pjsua_call_vid_strm_op_param). * * @return PJ_SUCCESS on success or the appropriate error. */PJ_DECL(pj_status_t) pjsua_call_set_vid_strm ( pjsua_call_id call_id, pjsua_call_vid_strm_op op, const pjsua_call_vid_strm_op_param *param);. 检索the call,获得video stream index:. /** * Get the media stream index of the default video stream in the call. * Typically this will just retrieve the stream index of the first * activated video stream in the call. * * @param call_id Call identification. * * @return The media stream index or -1 if no video stream * is present in the call. */PJ_DECL(int) pjsua_call_get_vid_stream_idx(pjsua_call_id call_id);. /** Number of media streams in this call / unsigned media_cnt; /* Array of media stream information / struct { /* Media index in SDP. / unsigned index; /* Media type. / pjmedia_type type; /* Media direction. / pjmedia_dir dir; /* Call media status. / pjsua_call_media_status status; /* The specific media stream info. / union { /* Audio stream / struct { /* The conference port number for the call. / pjsua_conf_port_id conf_slot; } aud; /* Video stream / struct { /* * The window id for incoming video, if any, or * PJSUA_INVALID_ID. / pjsua_vid_win_id win_in; /* The video capture device for outgoing transmission, * if any, or PJMEDIA_VID_INVALID_DEV */ pjmedia_vid_dev_index cap_dev; } vid; } stream; } media[PJMEDIA_MAX_SDP_MEDIA];. 5.6 Video Call Stream Information and Statistic. 5.7 Video Window API. 5.8 Video Codec API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PJSip
PJSip Key Features
PJSip Examples and Code Snippets
Community Discussions
Trending Discussions on PJSip
QUESTION
I can't find info on the net how to forward a call with pjsua2. Currently Im trying with the xfer method but Im getting:
...ANSWER
Answered 2022-Mar-18 at 16:38I did something like this and works, dont know if some other way exist:
(answering with no media, setting flag and in other thread xfering call to fwd_to string)
QUESTION
How can I determine the version of PJSIP library installed on my Asterisk server in CentOS platform? Also, how can I update the mentioned library?
...ANSWER
Answered 2022-Mar-07 at 22:37You can do like this:
QUESTION
I started writing application with Qt5, Im running pjsua2_demo.cpp from pjproject-2.9/pjsip-apps/src/samples/ in a QThread with infinite while(1) loop to leave pjsua2 running forever.
When I make 1-2 calls it blocks/hangs at the makeCall() function here:
...ANSWER
Answered 2022-Feb-27 at 14:44I solved the problem, it was the version of pjproject. Now I tried with v2.10 and everything fine.
v2.12 and v2.11 don't work because they give me undefined references when I compile the demo app.
QUESTION
I'm trying to use the latest version of pjsip for android https://github.com/VoiSmart/pjsip-android.
And got an error for incoming call:
...ANSWER
Answered 2022-Feb-24 at 13:08It was a server problem. Works well after upgrade server and add a=crypto attribute into SDP.
QUESTION
I am trying to build MicroSIP version 3.20.7 for Windows 10 64-bit Operating System.
I already build PjProject (As mentioned in the documentation) and obtained all the .lib files for the same and now I am trying to use those .lib files for building MicroSIP as mentioned in the documentation over their website.
But I fall for an error of Unresolved External Symbols that is LNK2019 / LNK2001 / LNK1120.
(An image for the reference have been attached)
I am concluding with following steps.
- Download the source for PjProject and extract the source using 7Zip.
- Added a config_site.h file in the pjlib\include\pj.
- Using Visual Studio 2022, Open PjProject and select pjsua as the source project.
- Setting up the configuration for the project as -> Debug-Static for x64. and Build.
- After a successfull build I got all the .lib files for the PjProject and successfully deployed the pjsua project showing a cli menu for PjSIP.
- Now, I downloaded the latest source of MicroSIP 3.20.7 from the official website and extracted the source code using 7Zip.
- Setting the configuration for the project as Debug for x64, and including all the header files and library files from windows kit as well as the other media libraries to the Include Directories and Library Directories {Opus, SDL2, FFMPEG,x264, VPX, PjProject}
- I started to build the MicroSIP 3.20.7 and obtained the MicroSIP.lib file successfully.
But at the last where the build must give an executable file for MicroSIP, there are the list of error stating Unresolved External Symbols {LNK2019 / LNK2001 / LNK1120}
Below is the link to the image having all the error in console windows.
The error states the following message.
unresolved external symbol pjmedia_get_vid_subsys referenced in function "public: void __cdecl CmainDlg::OnTimer(unsigned __int64)" (?OnTimer@CmainDlg@@QEAAX_K@Z)
unresolved external symbol pjmedia_vid_dev_refrence referenced in function "public: void __cdecl CmainDlg::OnTimer(unsigned __int64)" (?OnTimer@CmainDlg@@QEAAX_K@Z).
etc there are other 17 error (Kindly take the refrence of above image.)
Below is the link to the image having error logged in output tab.
These are the message logged into the output tab
...ANSWER
Answered 2022-Jan-04 at 19:30It might be missing
QUESTION
I am trying to compile and build PjProject {PJSUA}, with both audio and video support into it. But falling into the errors everytime which is Unresolved_External_Symbols.
I am building this project for Windows-32-BIT using Visual Studio 2022 and toolchain set latest version that is v143.
I want to intialize the various codec {OPUS, OPENH264, FFMPEG, OPENSSL, SDL etc}. I will just ask about the OPUS LIBRARY.
The steps are as follows:
Got the source of latest version of PjProject and loaded the project in Visual Studio 2022.
Mention the Opus Include directory and Opus Library Directory after compiling and building LibOpus.
Making PJSUA as source project and Setting configuration as Debug-Static-Win32 and start building the project.
NOTE
- Other addition dependencies such as SDL header and lib file have been included already.
- The config_site.h have been used to define the codec use {#define PJMEDIA_HAS_OPUS_CODEC 1}
The error that I have received into the error log are as following:
...ANSWER
Answered 2022-Jan-27 at 05:38After a long try I get the solution as following:
- In config_site.h we need to mention and activate our codec for compilation as #define PJMEDIA_HAS_OPUS_CODEC
#define PJMEDIA_HAS_OPUS_CODEC must be active througout the program and rest function line that is #define PJMEDIA_HAS_OPUS_CODEC 1 must be clearly removed from the program to find the ease for the compilation which will ommit out the different function those are called during the build.
I would still refer that while building on windows use Microsoft Visual Studio latest Version along with the latest toolset to compile and built different programs for a Single Linker.
QUESTION
How can i read below message: connection established while making call in pjsip pjsua2 for android app.
...
ANSWER
Answered 2021-Oct-27 at 09:08you will require. onCallTsxState call back function from call class to listen to Sip message shared during the call. I have already answered here at below link link
QUESTION
is it possible to build pjsip with opus-codec for windows as dll? I built pjsua2.dll alone but seems no way to use opus with it.
...ANSWER
Answered 2021-Oct-24 at 08:06I downloaded opus and pjsip , opened pjsip from visual studio solution, added opus projects to solution and made reference to them from libpjpproject, then build it using this link link
QUESTION
If I set AccountVideoConfig::autoTransmitOutgoing false in pjsip sdk, I can not show window remote, and the screen is green without video data, I do not know why? But by the note, if AccountVideoConfig::autoTransmitOutgoing be set false, it just will not send video data to remote, and can receive and show window from remote. What has happen?
This is my code:
...ANSWER
Answered 2021-Sep-28 at 02:08I solved this problem by commenting out two lines of code at dshow_dev.c file:
QUESTION
./configure --host=arm-elf-linux CC=aarch64-linux-gnu-gcc --disable-sdl --disable-ffmpeg --disable-v4l2 --disable-openh264 --disable-libwebrtc --disable-libyuv
make dep && make
...ANSWER
Answered 2021-Sep-27 at 12:41Some of the libraries to link may not be built with the same toolchain. You can check with objdump
.
Example (The "file format" may not be the exact result in your case):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PJSip
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page