GPUImageMovie processPlayerItem method not work.
-
(void)processPlayerItem { runSynchronouslyOnVideoProcessingQueue(^{ displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(displayLinkCallback:)]; [displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; [displayLink setPaused:YES];
dispatch_queue_t videoProcessingQueue = [GPUImageContext sharedContextQueue]; NSDictionary *pixBuffAttributes = @{(id)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange)}; playerItemOutput = [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:pixBuffAttributes]; [playerItemOutput setDelegate:self queue:videoProcessingQueue]; [_playerItem addOutput:playerItemOutput]; [playerItemOutput requestNotificationOfMediaDataChangeWithAdvanceInterval:0.1];}); }
-
(void)outputMediaDataWillChange:(AVPlayerItemOutput *)sender { // Restart display link. [displayLink setPaused:NO]; }
it just set the delegate of playerItemOutput and never make the playerItem start to pull,so the method outputMediaDataWillChange never been called,should need a AVPlayer to make the playerItem to Pull?
I'm not sure what you're asking. Could you restate that?
I tested it on commit 56300d11d9 . It's true that outputMediaDataWillChange will never be called .
Which cause initialize of GPUMovie through playItem(GPUImageMovie(playerItem: playItem)) does not work.
@Khazmovsky did you find any solution? I'm experiencing the same issue
it will be use when you add playItem to AVPlayer and play the video