From b96dc9d2d8f837636090ed878ca523f0413a34d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Roff=C3=A9?= Date: Wed, 3 Apr 2024 17:45:38 +0000 Subject: [PATCH] libtxproto/encoder: Add pix_format --- src/include/libtxproto/txproto.h | 4 ++++ src/txproto.c | 1 + 2 files changed, 5 insertions(+) diff --git a/src/include/libtxproto/txproto.h b/src/include/libtxproto/txproto.h index 87b618c..85a0c3c 100644 --- a/src/include/libtxproto/txproto.h +++ b/src/include/libtxproto/txproto.h @@ -56,7 +56,11 @@ typedef struct TxEncoderOptions { const char *name; AVDictionary *options; AVDictionary *init_opts; + + /* Video options only */ + enum AVPixelFormat pix_fmt; } TxEncoderOptions; + AVBufferRef *tx_encoder_create( TXMainContext *ctx, const TxEncoderOptions *options diff --git a/src/txproto.c b/src/txproto.c index ec3204a..b847f83 100644 --- a/src/txproto.c +++ b/src/txproto.c @@ -203,6 +203,7 @@ AVBufferRef *tx_encoder_create( } ectx->codec_config = options->options; + ectx->pix_fmt = options->pix_fmt; if (options->init_opts) { err = sp_encoder_ctrl(ectx_ref, SP_EVENT_CTRL_OPTS | SP_EVENT_FLAG_IMMEDIATE, options->init_opts);