refactor: move dispatch block to startGraphAndVideo
This commit is contained in:
parent
db712e31e2
commit
5ada0efd23
|
@ -112,9 +112,8 @@ static const char* kVideoQueueLabel = "com.google.mediapipe.example.videoQueue";
|
||||||
withExtension:@"mov"]];
|
withExtension:@"mov"]];
|
||||||
self.videoSource = [[MPPPlayerInputSource alloc] initWithAVAsset:video];
|
self.videoSource = [[MPPPlayerInputSource alloc] initWithAVAsset:video];
|
||||||
[self.videoSource setDelegate:self queue:self.videoQueue];
|
[self.videoSource setDelegate:self queue:self.videoQueue];
|
||||||
dispatch_async(self.videoQueue, ^{
|
self.noCameraLabel.hidden = YES;
|
||||||
[self startGraphAndVideo];
|
[self startGraphAndVideo];
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MediaPipeDemoSourceCamera: {
|
case MediaPipeDemoSourceCamera: {
|
||||||
|
@ -157,8 +156,9 @@ static const char* kVideoQueueLabel = "com.google.mediapipe.example.videoQueue";
|
||||||
else if (![self.mediapipeGraph waitUntilIdleWithError:&error]) {
|
else if (![self.mediapipeGraph waitUntilIdleWithError:&error]) {
|
||||||
NSLog(@"Failed to complete graph initial run: %@", error);
|
NSLog(@"Failed to complete graph initial run: %@", error);
|
||||||
}
|
}
|
||||||
|
dispatch_async(self.videoQueue, ^{
|
||||||
[self.videoSource start];
|
[self.videoSource start];
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)startGraphAndCamera {
|
- (void)startGraphAndCamera {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user