1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) STMicroelectronics SA 2015
4 * Authors: Hugues Fruchet <hugues.fruchet@st.com>
5 * Fabrice Lecoultre <fabrice.lecoultre@st.com>
6 * for STMicroelectronics.
10 #include "delta-debug.h"
12 char *delta_streaminfo_str(struct delta_streaminfo
*s
, char *str
,
19 "%4.4s %dx%d %s %s dpb=%d %s %s %s%dx%d@(%d,%d) %s%d/%d",
20 (char *)&s
->streamformat
, s
->width
, s
->height
,
21 s
->profile
, s
->level
, s
->dpb
,
22 (s
->field
== V4L2_FIELD_NONE
) ? "progressive" : "interlaced",
24 s
->flags
& DELTA_STREAMINFO_FLAG_CROP
? "crop=" : "",
25 s
->crop
.width
, s
->crop
.height
,
26 s
->crop
.left
, s
->crop
.top
,
27 s
->flags
& DELTA_STREAMINFO_FLAG_PIXELASPECT
? "par=" : "",
28 s
->pixelaspect
.numerator
,
29 s
->pixelaspect
.denominator
);
34 char *delta_frameinfo_str(struct delta_frameinfo
*f
, char *str
,
41 "%4.4s %dx%d aligned %dx%d %s %s%dx%d@(%d,%d) %s%d/%d",
42 (char *)&f
->pixelformat
, f
->width
, f
->height
,
43 f
->aligned_width
, f
->aligned_height
,
44 (f
->field
== V4L2_FIELD_NONE
) ? "progressive" : "interlaced",
45 f
->flags
& DELTA_STREAMINFO_FLAG_CROP
? "crop=" : "",
46 f
->crop
.width
, f
->crop
.height
,
47 f
->crop
.left
, f
->crop
.top
,
48 f
->flags
& DELTA_STREAMINFO_FLAG_PIXELASPECT
? "par=" : "",
49 f
->pixelaspect
.numerator
,
50 f
->pixelaspect
.denominator
);
55 void delta_trace_summary(struct delta_ctx
*ctx
)
57 struct delta_dev
*delta
= ctx
->dev
;
58 struct delta_streaminfo
*s
= &ctx
->streaminfo
;
59 unsigned char str
[100] = "";
61 if (!(ctx
->flags
& DELTA_FLAG_STREAMINFO
))
64 dev_dbg(delta
->dev
, "%s %s, %d frames decoded, %d frames output, %d frames dropped, %d stream errors, %d decode errors",
66 delta_streaminfo_str(s
, str
, sizeof(str
)),