GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageMovie processPlayerItem method not work.

Open Khazmovsky opened this issue 12 years ago • 4 comments

  • (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?

Khazmovsky avatar May 07 '14 03:05 Khazmovsky

I'm not sure what you're asking. Could you restate that?

BradLarson avatar May 07 '14 14:05 BradLarson

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.

alex-chan avatar Apr 01 '15 01:04 alex-chan

@Khazmovsky did you find any solution? I'm experiencing the same issue

Azat92 avatar Jun 05 '17 13:06 Azat92

it will be use when you add playItem to AVPlayer and play the video

jst000000 avatar Feb 27 '18 09:02 jst000000