Fix: start graph for the case where the input sourceMode is set to video.
This commit is contained in:
parent
7c5c216652
commit
db712e31e2
|
@ -113,7 +113,7 @@ static const char* kVideoQueueLabel = "com.google.mediapipe.example.videoQueue";
|
||||||
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, ^{
|
dispatch_async(self.videoQueue, ^{
|
||||||
[self.videoSource start];
|
[self startGraphAndVideo];
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -149,6 +149,18 @@ static const char* kVideoQueueLabel = "com.google.mediapipe.example.videoQueue";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)startGraphAndVideo {
|
||||||
|
NSError* error;
|
||||||
|
if (![self.mediapipeGraph startWithError:&error]) {
|
||||||
|
NSLog(@"Failed to start graph: %@", error);
|
||||||
|
}
|
||||||
|
else if (![self.mediapipeGraph waitUntilIdleWithError:&error]) {
|
||||||
|
NSLog(@"Failed to complete graph initial run: %@", error);
|
||||||
|
}
|
||||||
|
|
||||||
|
[self.videoSource start];
|
||||||
|
}
|
||||||
|
|
||||||
- (void)startGraphAndCamera {
|
- (void)startGraphAndCamera {
|
||||||
// Start running self.mediapipeGraph.
|
// Start running self.mediapipeGraph.
|
||||||
NSError* error;
|
NSError* error;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user