History

fftools/ffplay: use swapchain_colorspace_hint to get better HDR support

For example, the default surface configuration on macOS is: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_PASS_THROUGH_EXT With HDR10 content and swapchain_colorspace_hint, the surface configuration updated to: VK_FORMAT_A2B10G10R10_UNORM_PACK32 + VK_COLOR_SPACE_HDR10_ST2084_EXT

Zhao Zhili committed 2 years ago

Commit 05522381 parent fe219441 file · +3 −0Browse files

Unified · Split

fftools/ffplay_renderer.c+3−0
@@ -697,6 +697,7 @@ static int display(VkRenderer *renderer, AVFrame *frame) · 696 unmodified lines
697697 struct pl_frame target = {0};
698698 RendererContext *ctx = (RendererContext *) renderer;
699699 int ret = 0;
700+ struct pl_color_space hint = {0};
700701
701702 ret = convert_frame(renderer, frame);
702703 if (ret < 0)
@@ -709,6 +710,8 @@ static int display(VkRenderer *renderer, AVFrame *frame) · 6 unmodified lines
709710 return AVERROR_EXTERNAL;
710711 }
711712
713+ pl_color_space_from_avframe(&hint, frame);
714+ pl_swapchain_colorspace_hint(ctx->swapchain, &hint);
712715 if (!pl_swapchain_start_frame(ctx->swapchain, &swap_frame)) {
713716 av_log(NULL, AV_LOG_ERROR, "start frame failed\n");
714717 ret = AVERROR_EXTERNAL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t