AnyChat技术支持论坛
标题:
服务器录像回调函数(扩展)OnServerRecordExCallBack获取不到lpUserStr值
[打印本页]
作者:
lincy
时间:
2017-7-10 18:15
标题:
服务器录像回调函数(扩展)OnServerRecordExCallBack获取不到lpUserStr值
1、客户端代码:
//开始录像
ulong flags = AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_SERVER + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_VIDEO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_AUDIO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_MIXAUDIO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_MIXVIDEO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_ABREAST;
AnyChatCoreSDK.StreamRecordCtrlEx(customerUID, true, flags, 0, "111");
//结束录像
ulong flags = AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_SERVER + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_VIDEO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_AUDIO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_MIXAUDIO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_MIXVIDEO + AnyChatCoreSDK.ANYCHAT_RECORD_FLAGS_ABREAST;
AnyChatCoreSDK.StreamRecordCtrlEx(customerUID, false, flags, 0, "222");
2、服务器端代码入下:
public static void OnServerRecordExCallBack(int dwUserId, string lpFileName, int dwElapse, int dwFlags, int dwParam, string lpUserStr, int dwRecordServerId, IntPtr lpCallBackUserValue)
{
if (OnServerRecordExReceived != null)
{
OnServerRecordExReceived(dwUserId, lpFileName, dwElapse, dwFlags, dwParam, lpUserStr, dwRecordServerId, lpCallBackUserValue);
}
}
}
private static AnyChatServerSDK.OnServerRecordExCallBack mServerRecordExCallBack = OnServerRecordExCallBack;
// //设置录像成功扩展回调函数
IntPtr delegPtr = Marshal.GetFunctionPointerForDelegate(mServerRecordExCallBack);
IntPtr userval = (IntPtr)0;
AnyChatServerSDK.BRAS_SetCallBack(AnyChatServerSDK.BRAS_CBTYPE_SERVERRECORDEX, delegPtr, userval);
3、问题
在OnServerRecordExCallBack中获取到的lpUserStr值总是为""
作者:
lincy
时间:
2017-7-10 18:16
日志:[2017-07-10 17:46:08(983)] ---------------------------AnyChat Platform Core SDK Client Log---------------------------
[2017-07-10 17:46:08(984)] Load BRAnyChatCore.dll success!(V5.2 Build Time:Feb 10 2015 14:09:19)
[2017-07-10 17:46:09(009)] Load BRMiscUtil.dll success!(V5.2 Build Time:Feb 10 2015 14:07:32)
[2017-07-10 17:46:09(082)] Load BRMediaUtil.dll success!(V5.2 Build Time:Feb 10 2015 14:07:48)
[2017-07-10 17:46:09(084)] Load BRMediaShow.dll success!(V5.2 Build Time:Feb 10 2015 14:07:40)
[2017-07-10 17:46:09(088)] Load BRMediaCore.dll success!(V5.2 Build Time:Feb 10 2015 14:08:00)
[2017-07-10 17:46:09(256)] Invoke BRAC_Connect(192.168.52.242,8906)=0
[2017-07-10 17:46:09(257)] Invoke LoginServer(username=lincy:TTTNET01)
[2017-07-10 17:46:09(257)] Invoke EnterRoom(lincyV20170710174425462)
[2017-07-10 17:46:09(269)] CheckClientSocketLink Connect(ip=192.168.52.242,port=8906)
[2017-07-10 17:46:09(380)] Server version: V5.2(Build Time:2015-02-10 14:08:34, Server OS:Windows)
[2017-07-10 17:46:09(598)] Message OnConnect(bSuccess:1, errorcode=0)
[2017-07-10 17:46:10(039)] Message OnLoginSystem(userid=16,errorcode=0,username=lincy:TTTNET01), msg deliver worked(1)
[2017-07-10 17:46:10(041)] Server running time: 56 days, 20 hours, 0 minutes, license mode:0
[2017-07-10 17:46:10(082)] Connection to streaming media server successfully!(udp delay:23ms)
[2017-07-10 17:46:10(122)] Message OnEnterRoom(roomid=77,errorcode=0,siteindex=0)
[2017-07-10 17:46:10(123)] Message OnReceiveOnlineUser(count=1,roomid=77)
[2017-07-10 17:46:10(124)] Invoke BRAC_SetVideoPos(dwUserId:-1, hWnd:0x1101fa, l:0, t:0, r:300, b:224)
[2017-07-10 17:46:10(125)] Invoke UserCameraControl(userid=-1,bOpen=1)
[2017-07-10 17:46:10(126)] Invoke UserSpeakControl(userid=-1,bOpen=1)
[2017-07-10 17:46:10(169)] WaveIn Audio Capture Driver(麦克风 (HD Webcam C270))
[2017-07-10 17:46:10(169)] Audio Init, error:0, device:0, 1, 16000, 16, capmode:0
[2017-07-10 17:46:10(170)] Audio codec init, handle:1, 11, 1, 16000, 16, 15850
[2017-07-10 17:46:10(247)] Audio Playback Device Init(0, 1, 16000, 16), WaveOut Playback Driver
[2017-07-10 17:46:10(249)] Audio FX Status: VAD:1, NS:1, AGC:1, AEC:1
[2017-07-10 17:46:10(407)] MinCroppingSize(640, 480) MaxCroppingSize(640, 480) Format(RGB24, 0x0)
[2017-07-10 17:46:10(408)] MinCroppingSize(160, 120) MaxCroppingSize(160, 120) Format(RGB24, 0x0)
[2017-07-10 17:46:10(408)] MinCroppingSize(176, 144) MaxCroppingSize(176, 144) Format(RGB24, 0x0)
[2017-07-10 17:46:10(409)] MinCroppingSize(320, 176) MaxCroppingSize(320, 176) Format(RGB24, 0x0)
[2017-07-10 17:46:10(410)] MinCroppingSize(320, 240) MaxCroppingSize(320, 240) Format(RGB24, 0x0)
[2017-07-10 17:46:10(410)] MinCroppingSize(352, 288) MaxCroppingSize(352, 288) Format(RGB24, 0x0)
[2017-07-10 17:46:10(411)] MinCroppingSize(432, 240) MaxCroppingSize(432, 240) Format(RGB24, 0x0)
[2017-07-10 17:46:10(411)] MinCroppingSize(544, 288) MaxCroppingSize(544, 288) Format(RGB24, 0x0)
[2017-07-10 17:46:10(412)] MinCroppingSize(640, 360) MaxCroppingSize(640, 360) Format(RGB24, 0x0)
[2017-07-10 17:46:10(412)] MinCroppingSize(752, 416) MaxCroppingSize(752, 416) Format(RGB24, 0x0)
[2017-07-10 17:46:10(413)] MinCroppingSize(800, 448) MaxCroppingSize(800, 448) Format(RGB24, 0x0)
[2017-07-10 17:46:10(414)] MinCroppingSize(800, 600) MaxCroppingSize(800, 600) Format(RGB24, 0x0)
[2017-07-10 17:46:10(414)] MinCroppingSize(864, 480) MaxCroppingSize(864, 480) Format(RGB24, 0x0)
[2017-07-10 17:46:10(415)] MinCroppingSize(960, 544) MaxCroppingSize(960, 544) Format(RGB24, 0x0)
[2017-07-10 17:46:10(415)] MinCroppingSize(960, 720) MaxCroppingSize(960, 720) Format(RGB24, 0x0)
[2017-07-10 17:46:10(416)] MinCroppingSize(1024, 576) MaxCroppingSize(1024, 576) Format(RGB24, 0x0)
[2017-07-10 17:46:10(416)] MinCroppingSize(1184, 656) MaxCroppingSize(1184, 656) Format(RGB24, 0x0)
[2017-07-10 17:46:10(417)] MinCroppingSize(1280, 720) MaxCroppingSize(1280, 720) Format(RGB24, 0x0)
[2017-07-10 17:46:10(418)] MinCroppingSize(1280, 960) MaxCroppingSize(1280, 960) Format(RGB24, 0x0)
[2017-07-10 17:46:10(418)] MinCroppingSize(640, 480) MaxCroppingSize(640, 480) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(419)] MinCroppingSize(160, 120) MaxCroppingSize(160, 120) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(419)] MinCroppingSize(176, 144) MaxCroppingSize(176, 144) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(420)] MinCroppingSize(320, 176) MaxCroppingSize(320, 176) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(420)] MinCroppingSize(320, 240) MaxCroppingSize(320, 240) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(421)] MinCroppingSize(352, 288) MaxCroppingSize(352, 288) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(421)] MinCroppingSize(432, 240) MaxCroppingSize(432, 240) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(422)] MinCroppingSize(544, 288) MaxCroppingSize(544, 288) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(422)] MinCroppingSize(640, 360) MaxCroppingSize(640, 360) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(423)] MinCroppingSize(752, 416) MaxCroppingSize(752, 416) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(423)] MinCroppingSize(800, 448) MaxCroppingSize(800, 448) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(424)] MinCroppingSize(800, 600) MaxCroppingSize(800, 600) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(424)] MinCroppingSize(864, 480) MaxCroppingSize(864, 480) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(425)] MinCroppingSize(960, 544) MaxCroppingSize(960, 544) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(426)] MinCroppingSize(960, 720) MaxCroppingSize(960, 720) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(426)] MinCroppingSize(1024, 576) MaxCroppingSize(1024, 576) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(427)] MinCroppingSize(1184, 656) MaxCroppingSize(1184, 656) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(427)] MinCroppingSize(1280, 720) MaxCroppingSize(1280, 720) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(428)] MinCroppingSize(1280, 960) MaxCroppingSize(1280, 960) Format(YUV420P, 0x30323449)
[2017-07-10 17:46:10(437)] Video Config Size(320, 240) Format(YUV420P, 25fps)
[2017-07-10 17:46:10(750)] video init finish:320x240, YUV420, fps:25
[2017-07-10 17:46:11(226)] Message OnUserEnterRoom(userid=-96,nickname=customerTTTNET01_V20170710174425462,siteindex=1)
[2017-07-10 17:46:11(296)] Invoke BRAC_SetVideoPos(dwUserId:-96, hWnd:0x110282, l:0, t:0, r:531, b:306)
[2017-07-10 17:46:11(297)] Invoke UserCameraControl(userid=-96,bOpen=1)
[2017-07-10 17:46:11(299)] Invoke UserSpeakControl(userid=-96,bOpen=1)
[2017-07-10 17:46:11(326)] On Remote UserCameraControl(dwUserId:-96, bOpen:1)
[2017-07-10 17:46:11(326)] On Remote UserSpeakControl(dwUserId:-96, bOpen:1)
[2017-07-10 17:46:11(327)] video codec init:codec:1, 10fps, 320x240, bitrate:300kbps, quality:3, preset:3, gop:15, handle:2
[2017-07-10 17:46:11(527)] Message OnP2PConnectState(userid=-96, state=1)
[2017-07-10 17:46:11(727)] Message OnP2PConnectState(userid=-96, state=3)
[2017-07-10 17:46:19(802)] Invoke StreamRecordCtrlEx(-96, 1, 0x137, 0, )=0
作者:
佰锐科技-梁国桦
时间:
2017-7-11 09:21
lpUserStr的值其实需要传json字符串,是用来做一些扩展功能的,包括修改文件名、增加子目录等。请参考:
http://bbs.anychat.cn/forum.php?mod=viewthread&tid=2425
http://bbs.anychat.cn/forum.php?mod=viewthread&tid=2976
(标题虽然只写了文件上传,但录像也可用)
作者:
lincy
时间:
2017-7-12 08:43
佰锐科技-梁国桦 发表于 2017-7-11 09:21
lpUserStr的值其实需要传json字符串,是用来做一些扩展功能的,包括修改文件名、增加子目录等。请参考:htt ...
好的,谢谢,我试一下
欢迎光临 AnyChat技术支持论坛 (http://bbs.anychat.cn/)
Powered by Discuz! X3