forked from marfrit/libva-v4l2-request-fourier
Eager CAPTURE format probe in RequestInit
Chromium's vaapi_video_decoder may call vaCreateContext with surfaces=NULL, surfaces_count=0 and then create surfaces afterwards via vaCreateSurfaces2. In that order driver_data->video_format is still NULL when CreateContext runs and our early `video_format == NULL` guard returns OPERATION_FAILED. Confirmed via temporary request_log() — Brave hits exactly that path on ohm. Move the probe out of RequestCreateSurfaces into a new video_format_probe() helper in video.c, and call it eagerly from RequestInit. RequestCreateSurfaces still re-probes if init came up NULL, which preserves the original lazy behaviour for any caller that needs it. Also small clean-up of surface.c since the probe block moved out: drop the now-dead `bool found` local. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,7 @@ struct video_format {
|
||||
};
|
||||
|
||||
struct video_format *video_format_find(unsigned int pixelformat, bool mplane);
|
||||
struct video_format *video_format_probe(int video_fd);
|
||||
bool video_format_is_linear(struct video_format *format);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user