开发版本-developer——01 first commit

This commit is contained in:
wbzhan
2019-07-08 18:24:03 +08:00
parent 5a10dfa182
commit 8693efe121
386 changed files with 7069 additions and 1951 deletions
@@ -30,8 +30,6 @@
-(NSInteger)getMessageCount:(NSString*)contactId;
-(void)setMessageCountWithId:(NSString*)contactId count:(NSInteger)count;
-(void)getDefenceStates;
-(void)setIsClickDefenceStateBtnWithId:(NSString*)contactId isClick:(BOOL)isClick;
-(BOOL)getIsClickDefenceStateBtn:(NSString*)contactId;
@end
@@ -11,7 +11,7 @@
#import "ContactDAO.h"
#import "Constants.h"
#import "UDManager.h"
#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
#import "ShakeManager.h"
#import "LocalDevice.h"
#import "AppDelegate.h"
@@ -234,17 +234,4 @@
oldContact = contact;
}
-(void)getDefenceStates{
NSArray *array = [self getContacts];
for(Contact *contact in array){
if(contact.contactType==CONTACT_TYPE_NPC||
contact.contactType==CONTACT_TYPE_IPC||
contact.contactType==CONTACT_TYPE_DOORBELL){
[[P2PClient sharedClient] getDefenceState:contact.contactId password:contact.contactPassword];
}
}
}
@end
@@ -14,8 +14,7 @@
#import <OpenGLES/ES2/glext.h>
#import "Constants.h"
#import "Utils.h"
#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
#import "AppDelegate.h"
#import "ShapeRenderNotifyMsg.h"
//////////////////////////////////////////////////////////
@@ -428,9 +427,9 @@ static GLfloat modelviewProj[16];
const char * cVersion = [strSysVersion UTF8String];
NSLog(@"系统版本号:%@", strSysVersion);// e.g. @"4.0"
NSString *contactId = [[P2PClient sharedClient] callId];
int callID = [contactId intValue];
NSLog(@"callid%@", contactId);// e.g. @"4.0"
// NSString *contactId = [[P2PClient sharedClient] callId];
int callID = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
// NSLog(@"callid%@", contactId);// e.g. @"4.0"
if (self.isFisheyeDevice) {//can delete
_shapeWarp.initData(self.bounds.size.width, self.bounds.size.height, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.width, _shapeWarp.SHAPE_CIRCLE, cVersion, callID, uuid, _uniformMatrix,_shapeWarp.FISHEYE_360);
@@ -591,13 +590,13 @@ static GLfloat modelviewProj[16];
UIImage *image = [[UIImage alloc] initWithCGImage:[self glToUIImage].CGImage];
NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(image)];
NSString* contactid = [[P2PClient sharedClient] callId];
int contactid = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
int dwApContactID = [[AppDelegate sharedDefault] dwApContactID];
if (dwApContactID != 0)
{
contactid = [NSString stringWithFormat:@"%d", dwApContactID];
contactid = dwApContactID;
}
[Utils saveHeaderFileWithId:contactid data:imgData];
[Utils saveHeaderFileWithId:[NSString stringWithFormat:@"%d",contactid] data:imgData];
if (dwApContactID != 0)
{
@@ -1072,13 +1071,13 @@ exit:
NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(image)];
NSString* contactid = [[P2PClient sharedClient] callId];
int contactid = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
int dwApContactID = [[AppDelegate sharedDefault] dwApContactID];
if (dwApContactID != 0)
{
contactid = [NSString stringWithFormat:@"%d", dwApContactID];
contactid = dwApContactID;
}
[Utils saveHeaderFileWithId:contactid data:imgData];
[Utils saveHeaderFileWithId:[NSString stringWithFormat:@"%d",contactid] data:imgData];
if (dwApContactID != 0)
{
@@ -1137,12 +1136,9 @@ exit:
if (!image) {
return;
}
NSData *imgData = [NSData dataWithData:UIImagePNGRepresentation(image)];
NSString* contactid = [[P2PClient sharedClient] callId];
[Utils saveHeaderFileWithId:contactid data:imgData];
int contactid = [[GWP2PClient sharedClient] getDeviceIDInAPMode];
[Utils saveHeaderFileWithId:[NSString stringWithFormat:@"%d",contactid] data:imgData];
}
@@ -9,8 +9,8 @@
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import <MediaPlayer/MediaPlayer.h>
#import "P2PClient.h"
//#import "P2PClient.h"
#import <GWP2P/GWP2P.h>
@interface PAIOUnit : NSObject
@property (nonatomic, assign) BOOL isRunning;
@@ -9,7 +9,7 @@
#import "PAIOUnit.h"
#import <AudioUnit/AudioUnit.h>
#import "AppDelegate.h"
#import "P2PCInterface.h"
//什么含义
#define kOutputBus 0
#define kInputBus 1
@@ -122,7 +122,8 @@ static OSStatus playbackCallback(void *inRefCon,
AudioBufferList *ioData)
{
BOOL isGetAudioOk = NO;
if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
// if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
if ([[GWP2PClient sharedClient] linkStatus] == P2PLinkStatusOK)
{
isGetAudioOk = fgGetAudioDataToPlay(ioData->mBuffers[0].mData, ioData->mBuffers[0].mDataByteSize );
}
@@ -366,7 +367,8 @@ static OSStatus playbackCallback(void *inRefCon,
}
else
{
if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
// if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P)
if ([[GWP2PClient sharedClient] linkStatus] == P2PLinkStatusOK)
{
vFillAudioRawData(bufferList->mBuffers[0].mData, bufferList->mBuffers[0].mDataByteSize);
}
@@ -475,20 +477,4 @@ static OSStatus playbackCallback(void *inRefCon,
AudioSessionSetProperty(kAudioSessionProperty_OverrideAudioRoute, sizeof(UInt32), &audioRoute);
}
-(void)setSpeckState:(BOOL)state{
if ([[P2PClient sharedClient]p2pCallState] == P2PCALL_STATUS_READY_P2P) {
self.silentAudio = state;
if(self.callType==P2PCALL_TYPE_MONITOR){
if(self.silentAudio){
fgSendUserData(5, 0, NULL, 0);
}else{
fgSendUserData(5, 1, NULL, 0);
}
}
}
}
@end
@@ -120,7 +120,7 @@
NSString* ssid = [Utils currentWifiSSID];
//ap模式不搜索
int dwApContactID = [[AppDelegate sharedDefault]dwApContactID];
int dwApContactID = [[AppDelegate sharedDefault] dwApContactID];
//后台运行不搜索
UIApplicationState iState = [UIApplication sharedApplication].applicationState;