Revert "fix: frozen image when switching from metal to AVSB"
This reverts commit 2b052fef1e.
This commit is contained in:
1 parent
d90657b05a
commit
678c8054d7
1 file changed
+5
-30
@@ -59,18 +59,12 @@ extern int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size,
|
|||||||
|
|
||||||
- (void)reinitializeDisplayLayer
|
- (void)reinitializeDisplayLayer
|
||||||
{
|
{
|
||||||
// Clean up existing display layer if it exists
|
if (_displayLayer == nil) {
|
||||||
if (_displayLayer != nil) {
|
_displayLayer = [[AVSampleBufferDisplayLayer alloc] init];
|
||||||
[_displayLayer flushAndRemoveImage];
|
_displayLayer.backgroundColor = [UIColor blackColor].CGColor;
|
||||||
[_displayLayer removeFromSuperlayer];
|
_displayLayer.videoGravity = AVLayerVideoGravityResize;
|
||||||
_displayLayer = nil;
|
[_view.layer addSublayer:_displayLayer];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new display layer
|
|
||||||
_displayLayer = [[AVSampleBufferDisplayLayer alloc] init];
|
|
||||||
_displayLayer.backgroundColor = [UIColor blackColor].CGColor;
|
|
||||||
_displayLayer.videoGravity = AVLayerVideoGravityResize;
|
|
||||||
[_view.layer addSublayer:_displayLayer];
|
|
||||||
|
|
||||||
// Ensure the AVSampleBufferDisplayLayer is sized to preserve the aspect ratio
|
// Ensure the AVSampleBufferDisplayLayer is sized to preserve the aspect ratio
|
||||||
// of the video stream. We used to use AVLayerVideoGravityResizeAspect, but that
|
// of the video stream. We used to use AVLayerVideoGravityResizeAspect, but that
|
||||||
@@ -369,14 +363,6 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
|
|
||||||
if (_renderingBackend == RENDER_AVSB) {
|
if (_renderingBackend == RENDER_AVSB) {
|
||||||
[_displayLink invalidate];
|
[_displayLink invalidate];
|
||||||
_displayLink = nil;
|
|
||||||
|
|
||||||
// Properly clean up the display layer
|
|
||||||
if (_displayLayer != nil) {
|
|
||||||
[_displayLayer flushAndRemoveImage];
|
|
||||||
[_displayLayer removeFromSuperlayer];
|
|
||||||
_displayLayer = nil;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_decompressionSession != NULL) {
|
if (_decompressionSession != NULL) {
|
||||||
@@ -384,17 +370,6 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
CFRelease(_decompressionSession);
|
CFRelease(_decompressionSession);
|
||||||
_decompressionSession = nil;
|
_decompressionSession = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up format descriptors
|
|
||||||
if (_formatDesc != nil) {
|
|
||||||
CFRelease(_formatDesc);
|
|
||||||
_formatDesc = nil;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_formatDescImageBuffer != nil) {
|
|
||||||
CFRelease(_formatDescImageBuffer);
|
|
||||||
_formatDescImageBuffer = nil;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define NALU_START_PREFIX_SIZE 3
|
#define NALU_START_PREFIX_SIZE 3
|
||||||
|
|||||||
Reference in new issue
Block a user