aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-01-30 13:18:28 (GMT)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-01-30 13:18:28 (GMT)
commit0a739ef88924b2cdbc0d9541d1d9abd112999a7e (patch)
treeff19064be01ae8faef5ee85654834882c9a3a13e
parente4b30f3aee9540eefb7ab450424dc31b90816d4c (diff)
v4l-stream: adapt to latest fwht codec changes
The merge of the latest fwht codec code required some additional changes in v4l-stream.c: 1) state->stride now has to be filled in 2) the decoder expects the fwht header in state->header Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/common/v4l-stream.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/common/v4l-stream.c b/utils/common/v4l-stream.c
index a1cabad..ce7cca7 100644
--- a/utils/common/v4l-stream.c
+++ b/utils/common/v4l-stream.c
@@ -193,6 +193,7 @@ struct codec_ctx *fwht_alloc(unsigned pixfmt, unsigned visible_width, unsigned v
ctx->state.coded_height = coded_height;
ctx->state.visible_width = visible_width;
ctx->state.visible_height = visible_height;
+ ctx->state.stride = coded_width * info->bytesperline_mult;
ctx->state.info = info;
ctx->field = field;
ctx->state.colorspace = colorspace;
@@ -236,5 +237,7 @@ __u8 *fwht_compress(struct codec_ctx *ctx, __u8 *buf, unsigned uncomp_size, unsi
bool fwht_decompress(struct codec_ctx *ctx, __u8 *p_in, unsigned comp_size,
__u8 *p_out, unsigned uncomp_size)
{
+ memcpy(&ctx->state.header, p_in, sizeof(ctx->state.header));
+ p_in += sizeof(ctx->state.header);
return !v4l2_fwht_decode(&ctx->state, p_in, p_out);
}

Privacy Policy