Skip to content

Commit f463082

Browse files
ログの削除、レコーダ名をAndroid側と合わせた。その他、Warning消し残し修正。
1 parent dc1f22d commit f463082

19 files changed

Lines changed: 176 additions & 155 deletions

File tree

dConnectDevicePlugin/dConnectDeviceAWSIoT/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ SPEC CHECKSUMS:
1212

1313
PODFILE CHECKSUM: e57f03e93e2bb0fafc6335552293afc70c7f47dc
1414

15-
COCOAPODS: 1.2.0
15+
COCOAPODS: 1.3.1

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT.xcodeproj/project.pbxproj

Lines changed: 93 additions & 89 deletions
Large diffs are not rendered by default.

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/DPAWSIoTUtils.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ + (NSString *)packageName {
443443
}
444444

445445
// アラート表示
446-
+ (void)showAlert:(UIViewController*)vc title:(NSString*)title message:(NSString*)message handler:(void (^)())handler {
446+
+ (void)showAlert:(UIViewController*)vc title:(NSString*)title message:(NSString*)message handler:(void (^)(void))handler {
447447
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
448448
message:message
449449
preferredStyle:UIAlertControllerStyleAlert];

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/P2P/Core/DPAWSIoTRelayClient.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ - (int) execute:(NSString *)address port:(int)port
100100
NSLog(@"DPAWSIoTRelayClient: connect: %s", UDT::getlasterror().getErrorMessage());
101101
return 0;
102102
}
103-
104103
freeaddrinfo(peer);
105104

106105
_socket = [[DPAWSIoTSocketTask alloc] initWithSocket:socket];

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/P2P/Core/DPAWSIoTSocketTask.mm

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
//
99

1010
#import "DPAWSIoTSocketTask.h"
11-
1211
#define BUFFER_SIZE 512
1312

1413
char const HEADER[4] = {
@@ -57,30 +56,26 @@ - (void) sendData:(const char *)data offset:(int)offset length:(int)length
5756
NSLog(@"DPAWSIoTSocketTask send error .");
5857
return;
5958
}
60-
6159
if (length == 0) {
6260
return;
6361
}
64-
6562
[self intToByte:length to:_sendBuffer];
66-
6763
if (UDT::ERROR == UDT::send(_socket, HEADER, 4, 0)) {
6864
NSLog(@"DPAWSIoTSocketTask send error .");
6965
return;
7066
}
71-
7267
if (UDT::ERROR == UDT::send(_socket, _sendBuffer, 4, 0)) {
7368
NSLog(@"DPAWSIoTSocketTask send error .");
7469
return;
7570
}
76-
7771
int _offset = offset;
7872
int _length;
7973
while (_offset < offset + length) {
8074
_length = offset + length - _offset;
8175
if (_length > BUFFER_SIZE) {
8276
_length = BUFFER_SIZE;
8377
}
78+
8479
if (UDT::ERROR == UDT::send(_socket, data + _offset, _length, 0)) {
8580
NSLog(@"DPAWSIoTSocketTask send error .");
8681
return;
@@ -96,26 +91,22 @@ - (void) execute
9691
if ([_delegate respondsToSelector:@selector(didConnectedAddress:port:)]) {
9792
[_delegate didConnectedAddress:_address port:_port];
9893
}
99-
10094
while (!_closeFlag) {
10195
if (![self readHeader]) {
10296
NSLog(@"DPAWSIoTSocketTask header error.");
10397
}
104-
10598
int size = [self readSize];
10699
if (size == -1) {
107100
NSLog(@"DPAWSIoTSocketTask size error.");
108101
break;
109102
}
110-
111103
while (size > 0 && !_closeFlag) {
112104
int rs = UDT::recv(_socket, data, BUFFER_SIZE, 0);
113105
if (_closeFlag || UDT::ERROR == rs) {
114106
NSLog(@"DPAWSIoTSocketTask UDT error...");
115107
break;
116108
}
117109
size -= rs;
118-
119110
if ([_delegate respondsToSelector:@selector(didReceivedData:length:)]) {
120111
[_delegate didReceivedData:(const char *)data length:(int)rs];
121112
}

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/P2P/Core/DPAWSIoTStunClient.mm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ - (instancetype) init
4141
- (void) bindingRequest:(StunBindingRequestCallback)callback
4242
{
4343
_callback = callback;
44-
4544
if (_stunAddress) {
4645
[self doBindingRequest:_stunAddress];
4746
} else {
@@ -149,7 +148,7 @@ - (void) parse:(NSData *)data
149148
_cancelBlock = nil;
150149

151150
if (_callback) {
152-
_callback(ip, [port integerValue]);
151+
_callback(ip, (int)[port integerValue]);
153152
}
154153
}
155154

@@ -174,8 +173,8 @@ - (void) didConnect
174173
[request appendBytes:changeRequest length:sizeof(changeRequest)];
175174
[request appendBytes:attributeSize length:sizeof(attributeSize)];
176175
[request appendBytes:attributeBody length:sizeof(attributeBody)];
177-
178-
[_server sendData:(const char *)[request bytes] length:[request length] to:_stunAddress port:_stunPort];
176+
177+
[_server sendData:(const char *)[request bytes] length:(int)[request length] to:_stunAddress port:_stunPort];
179178
}
180179

181180
- (void) didNotConnect

dConnectDevicePlugin/dConnectDeviceAWSIoT/dConnectDeviceAWSIoT/Classes/P2P/DPAWSIoTServerRunnable.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ - (void) r:(NSData *)data
4747
if (headerSize > 0) {
4848
NSData *d = [self convHeader:_headerData];
4949
[self.connection sendData:d.bytes length:(int)d.length];
50-
[self.connection sendData:data.bytes offset:headerSize length:data.length - headerSize];
50+
[self.connection sendData:data.bytes offset:headerSize length:(int) (data.length - headerSize)];
5151
_headerEndFlag = YES;
5252
}
5353
} else {

dConnectDevicePlugin/dConnectDeviceChromeCast/dConnectDeviceChromecast/Classes/DPChromecastMediaPlayerProfile.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ - (id)init
6767
[DConnectMediaPlayerProfile setTitle:@"Title: Sample" target:response];
6868
[DConnectMediaPlayerProfile setLanguage:@"ja" target:response];
6969
[DConnectMediaPlayerProfile setDescription:@"Sample Movie" target:response];
70-
[DConnectMediaPlayerProfile setDuration:9999 target:response];
70+
[DConnectMediaPlayerProfile setDuration:600 target:response];
7171

7272
} else {
7373
NSURL *url = [NSURL URLWithString:mediaId];
@@ -278,7 +278,6 @@ - (id)init
278278
[weakSelf saveMovie:ctx
279279
callback:
280280
^(NSString *url) {
281-
NSLog(@"url:%@", url);
282281
if (url) {
283282
DPChromecastManager *mgr = [DPChromecastManager sharedManager];
284283
NSInteger requestId = [mgr loadMediaWithID:serviceId

dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes/profile/DPHostMediaPlayer/DPHostMediaContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
extern NSString *MediaContextMediaIdSchemeIPodAudio; ///< iPodライブラリの音声メディアのmediaIdに使用されるスキーム
1616
extern NSString *MediaContextMediaIdSchemeIPodMovie; ///< iPodライブラリの動画メディアのmediaIdに使用されるスキーム
1717
extern NSString *MediaContextMediaIdSchemeIPodLibrary;
18-
18+
extern NSString *MediaContextMediaIdSchemeFile;
1919
typedef NS_ENUM(NSUInteger, MediaPlayerType) {
2020
MediaPlayerTypeIPod, ///< iPodミュージックプレイヤー
2121
MediaPlayerTypeMoviePlayer, ///< MoviePlayer + 独自UI

dConnectDevicePlugin/dConnectDeviceHost/dConnectDeviceHost/Classes/profile/DPHostMediaPlayer/DPHostMediaPlayerProfile.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,16 @@ - (instancetype)init
6969
[response setErrorToInvalidRequestParameterWithMessage:@"mediaId must be specified."];
7070
return YES;
7171
}
72-
if (![mediaId hasPrefix:@"file://"]) {
72+
if (![mediaId hasPrefix:MediaContextMediaIdSchemeIPodAudio]
73+
&& ![mediaId hasPrefix:MediaContextMediaIdSchemeFile]
74+
&& ![mediaId hasPrefix:MediaContextMediaIdSchemeIPodLibrary]
75+
&& ![mediaId hasPrefix:MediaContextMediaIdSchemeIPodMovie]
76+
&& [mediaId hasPrefix:@"/"]) {
7377
mediaId = [NSString stringWithFormat:@"file://%@", mediaId];
7478
}
7579
NSURL *url = [NSURL URLWithString:[mediaId stringByReplacingOccurrencesOfString:@" " withString:@"%20"]];
7680
DPHostMediaContext *ctx = [DPHostMediaContext contextWithURL:url];
81+
7782
if (ctx) {
7883
[ctx setVariousMetadataToMessage:response omitMediaId:YES];
7984
[response setResult:DConnectMessageResultTypeOk];
@@ -142,7 +147,11 @@ - (instancetype)init
142147
sleep(1.0);
143148
}
144149
}
145-
if (![mediaId hasPrefix:@"file://"]) {
150+
if (![mediaId hasPrefix:MediaContextMediaIdSchemeIPodAudio]
151+
&& ![mediaId hasPrefix:MediaContextMediaIdSchemeFile]
152+
&& ![mediaId hasPrefix:MediaContextMediaIdSchemeIPodLibrary]
153+
&& ![mediaId hasPrefix:MediaContextMediaIdSchemeIPodMovie]
154+
&& [mediaId hasPrefix:@"/"]) {
146155
mediaId = [NSString stringWithFormat:@"file://%@", mediaId];
147156
}
148157
weakSelf.mediaPlayer = [DPHostMediaPlayerFactory createPlayerWithMediaId:[mediaId stringByReplacingOccurrencesOfString:@" " withString:@"%20"]

0 commit comments

Comments
 (0)