AirPlaying HDR video via AVSampleBufferDisplayLayer - is this supposed to work?

Hi,

Our iOS HDR video app uses AVSampleBufferDisplayLayer to present CVPixelBuffers containing HDR images, and on the HDR iPad screen, the output video look great.

Recently I added support for external displays to the app, so that the app can play the video on Airplay-compatible devices, typically on an Apple TV 4K.

The video display on the Apple TV works as expected, except that the image colours and dynamic don't look right.

Same color issue when displaying the output video on a M1 max MacBook pro HDR screen, so it does no seem that the issue is due to the tv screen.

An example of presented image buffer format:

(lldb) po outputImage
▿ Optional<VideoImage>
  ▿ some : VideoImage
    - pixelBuffer : <CVPixelBuffer 0x283fa4960 width=3840 height=2160 pixelFormat=x444 iosurface=0x280cac880 planes=2>
<Plane 0 width=3840 height=2160 bytesPerRow=7680>
<Plane 1 width=3840 height=2160 bytesPerRow=15360>
<attributes={
    Height = 2160;
    IOSurfaceProperties =     {
        IOSurfacePurgeWhenNotInUse = 1;
    };
    PixelFormatType = 2016687156;
    Width = 3840;
} propagatedAttachments={
    CVFieldCount = 1;
    CVImageBufferChromaLocationBottomField = Left;
    CVImageBufferChromaLocationTopField = Left;
    CVImageBufferColorPrimaries = "ITU_R_2020";
    CVImageBufferTransferFunction = "SMPTE_ST_2084_PQ"
    CVImageBufferYCbCrMatrix = "ITU_R_2020";
} nonPropagatedAttachments={
}

Hence my question: is HDR video playback via AirPlay in this context supposed to work? Or is such configuration not supported yet (tested in iOS 15.6)?

Thanks.

AirPlaying HDR video via AVSampleBufferDisplayLayer - is this supposed to work?
 
 
Q