forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[media] st-delta: debug: trace stream/frame information & summary
Adds some trace points showing input compressed stream or output decoded frame information. Adds an unconditional trace point when streaming starts showing the compressed stream and the decoded frame information. Adds an unconditional trace point at instance closure summarizing into a single line the decoding process (stream information, decoded and output frames number, potential errors observed). Acked-by: Peter Griffin <[email protected]> Signed-off-by: Hugues Fruchet <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
- Loading branch information
Showing
4 changed files
with
117 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright (C) STMicroelectronics SA 2015 | ||
* Authors: Hugues Fruchet <[email protected]> | ||
* Fabrice Lecoultre <[email protected]> | ||
* for STMicroelectronics. | ||
* License terms: GNU General Public License (GPL), version 2 | ||
*/ | ||
|
||
#include "delta.h" | ||
#include "delta-debug.h" | ||
|
||
char *delta_streaminfo_str(struct delta_streaminfo *s, char *str, | ||
unsigned int len) | ||
{ | ||
if (!s) | ||
return NULL; | ||
|
||
snprintf(str, len, | ||
"%4.4s %dx%d %s %s dpb=%d %s %s %s%dx%d@(%d,%d) %s%d/%d", | ||
(char *)&s->streamformat, s->width, s->height, | ||
s->profile, s->level, s->dpb, | ||
(s->field == V4L2_FIELD_NONE) ? "progressive" : "interlaced", | ||
s->other, | ||
s->flags & DELTA_STREAMINFO_FLAG_CROP ? "crop=" : "", | ||
s->crop.width, s->crop.height, | ||
s->crop.left, s->crop.top, | ||
s->flags & DELTA_STREAMINFO_FLAG_PIXELASPECT ? "par=" : "", | ||
s->pixelaspect.numerator, | ||
s->pixelaspect.denominator); | ||
|
||
return str; | ||
} | ||
|
||
char *delta_frameinfo_str(struct delta_frameinfo *f, char *str, | ||
unsigned int len) | ||
{ | ||
if (!f) | ||
return NULL; | ||
|
||
snprintf(str, len, | ||
"%4.4s %dx%d aligned %dx%d %s %s%dx%d@(%d,%d) %s%d/%d", | ||
(char *)&f->pixelformat, f->width, f->height, | ||
f->aligned_width, f->aligned_height, | ||
(f->field == V4L2_FIELD_NONE) ? "progressive" : "interlaced", | ||
f->flags & DELTA_STREAMINFO_FLAG_CROP ? "crop=" : "", | ||
f->crop.width, f->crop.height, | ||
f->crop.left, f->crop.top, | ||
f->flags & DELTA_STREAMINFO_FLAG_PIXELASPECT ? "par=" : "", | ||
f->pixelaspect.numerator, | ||
f->pixelaspect.denominator); | ||
|
||
return str; | ||
} | ||
|
||
void delta_trace_summary(struct delta_ctx *ctx) | ||
{ | ||
struct delta_dev *delta = ctx->dev; | ||
struct delta_streaminfo *s = &ctx->streaminfo; | ||
unsigned char str[100] = ""; | ||
|
||
if (!(ctx->flags & DELTA_FLAG_STREAMINFO)) | ||
return; | ||
|
||
dev_dbg(delta->dev, "%s %s, %d frames decoded, %d frames output, %d frames dropped, %d stream errors, %d decode errors", | ||
ctx->name, | ||
delta_streaminfo_str(s, str, sizeof(str)), | ||
ctx->decoded_frames, | ||
ctx->output_frames, | ||
ctx->dropped_frames, | ||
ctx->stream_errors, | ||
ctx->decode_errors); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (C) STMicroelectronics SA 2015 | ||
* Authors: Hugues Fruchet <[email protected]> | ||
* Fabrice Lecoultre <[email protected]> | ||
* for STMicroelectronics. | ||
* License terms: GNU General Public License (GPL), version 2 | ||
*/ | ||
|
||
#ifndef DELTA_DEBUG_H | ||
#define DELTA_DEBUG_H | ||
|
||
char *delta_streaminfo_str(struct delta_streaminfo *s, char *str, | ||
unsigned int len); | ||
char *delta_frameinfo_str(struct delta_frameinfo *f, char *str, | ||
unsigned int len); | ||
void delta_trace_summary(struct delta_ctx *ctx); | ||
|
||
#endif /* DELTA_DEBUG_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters