aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cbs_bsf.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2023-09-11 15:52:26 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2023-09-22 13:15:00 +0800
commitabe16daea1b72323e3544cb6ec12bec010b6ba54 (patch)
tree11f6d79648bf2b85829d4f95fc029d8ff22dc1a2 /libavcodec/cbs_bsf.c
parent6c3a5d625f917631d1c8bab31ed65ebe26d14f47 (diff)
downloadffmpeg-abe16daea1b72323e3544cb6ec12bec010b6ba54.tar.gz
cbs: Make tracing more general
Turn tracing into callbacks for each syntax element, with default callbacks to match current trace_headers behaviour for debug. Move the construction of bit strings into the trace callback, which simplifies all of the read and write functions. Signed-off-by: Fei Wang <fei.w.wang@intel.com> Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Diffstat (limited to 'libavcodec/cbs_bsf.c')
-rw-r--r--libavcodec/cbs_bsf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/cbs_bsf.c b/libavcodec/cbs_bsf.c
index 069f6e9918..b25285483b 100644
--- a/libavcodec/cbs_bsf.c
+++ b/libavcodec/cbs_bsf.c
@@ -123,6 +123,11 @@ int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type)
if (err < 0)
return err;
+ ctx->output->trace_enable = 1;
+ ctx->output->trace_level = AV_LOG_TRACE;
+ ctx->output->trace_context = ctx->output;
+ ctx->output->trace_write_callback = ff_cbs_trace_write_log;
+
if (bsf->par_in->extradata) {
err = ff_cbs_read_extradata(ctx->input, frag, bsf->par_in);
if (err < 0) {