mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-03 00:06:31 +00:00
Fix black screen in HDR mode in newer AppleTV 4K Models
This commit is contained in:
parent
3494962bc0
commit
71b953cdd2
@ -330,11 +330,12 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
|
|
||||||
CMSampleBufferRef sampleBuffer;
|
CMSampleBufferRef sampleBuffer;
|
||||||
|
|
||||||
status = CMSampleBufferCreate(kCFAllocatorDefault,
|
CMSampleTimingInfo sampleTiming = {kCMTimeInvalid, CMTimeMake(pts, 1000), kCMTimeInvalid};
|
||||||
|
|
||||||
|
status = CMSampleBufferCreateReady(kCFAllocatorDefault,
|
||||||
frameBlockBuffer,
|
frameBlockBuffer,
|
||||||
true, NULL,
|
formatDesc, 1, 1,
|
||||||
NULL, formatDesc, 1, 0,
|
&sampleTiming, 0, NULL,
|
||||||
NULL, 0, NULL,
|
|
||||||
&sampleBuffer);
|
&sampleBuffer);
|
||||||
if (status != noErr) {
|
if (status != noErr) {
|
||||||
Log(LOG_E, @"CMSampleBufferCreate failed: %d", (int)status);
|
Log(LOG_E, @"CMSampleBufferCreate failed: %d", (int)status);
|
||||||
@ -343,22 +344,6 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit);
|
|||||||
return DR_NEED_IDR;
|
return DR_NEED_IDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFArrayRef attachments = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, YES);
|
|
||||||
CFMutableDictionaryRef dict = (CFMutableDictionaryRef)CFArrayGetValueAtIndex(attachments, 0);
|
|
||||||
|
|
||||||
CFDictionarySetValue(dict, kCMSampleAttachmentKey_DisplayImmediately, kCFBooleanTrue);
|
|
||||||
CFDictionarySetValue(dict, kCMSampleAttachmentKey_IsDependedOnByOthers, kCFBooleanTrue);
|
|
||||||
|
|
||||||
if (frameType == FRAME_TYPE_PFRAME) {
|
|
||||||
// P-frame
|
|
||||||
CFDictionarySetValue(dict, kCMSampleAttachmentKey_NotSync, kCFBooleanTrue);
|
|
||||||
CFDictionarySetValue(dict, kCMSampleAttachmentKey_DependsOnOthers, kCFBooleanTrue);
|
|
||||||
} else {
|
|
||||||
// I-frame
|
|
||||||
CFDictionarySetValue(dict, kCMSampleAttachmentKey_NotSync, kCFBooleanFalse);
|
|
||||||
CFDictionarySetValue(dict, kCMSampleAttachmentKey_DependsOnOthers, kCFBooleanFalse);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enqueue the next frame
|
// Enqueue the next frame
|
||||||
[self->displayLayer enqueueSampleBuffer:sampleBuffer];
|
[self->displayLayer enqueueSampleBuffer:sampleBuffer];
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user