Pass AVCodecContext to frame sinks

Frame consumers may need details about the frame format.
This commit is contained in:
Romain Vimont
2023-02-25 16:19:58 +01:00
parent 84703fe6af
commit 34ab105d10
4 changed files with 17 additions and 6 deletions

View File

@@ -156,7 +156,9 @@ sc_video_buffer_on_new_frame(struct sc_video_buffer *vb, bool previous_skipped,
}
static bool
sc_v4l2_sink_open(struct sc_v4l2_sink *vs) {
sc_v4l2_sink_open(struct sc_v4l2_sink *vs, const AVCodecContext *ctx) {
assert(ctx->pix_fmt == AV_PIX_FMT_YUV420P);
static const struct sc_video_buffer_callbacks cbs = {
.on_new_frame = sc_video_buffer_on_new_frame,
};