2015-08-13 14:26 GMT+08:00 Clément Bœsch <u...@pkh.me>: > On Thu, Aug 13, 2015 at 01:07:38PM +0800, Zhang Rui wrote: >> > status = VTDecompressionSessionDecodeFrame(videotoolbox->session, >> > sample_buf, >> > - 0, // decodeFlags >> > + decodeFlags, >> > NULL, // >> > sourceFrameRefCon >> > 0); // infoFlagsOut >> >> Better keep tracking how many decoding samples, >> that are passed in and not yet received in callback. >> >> VideoToolbox doesn't limit the number of frames in callback thread in >> async mode. > > doc used to say that VTDecompressionSessionDecodeFrame will block when the > internal queue is full in async mode. I haven't check if this is verified > in practice though.
I was wrong. After a real test, I found out that VTDecompressionSessionDecodeFrame does block when there are several frames in VideoToolbox's internal queue. But when I enter background by pressing home button while async-decoding. VTB hangs for a while and returns kVTVideoDecoderMalfunctionErr. So I have to track the number of frames in VTB's queue, and limit it to 3 frames as a workaround in my own player. I guess this problem may related to the app state. But neither doc nor demo says anything about it. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel