aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2023-07-18 15:00:25 -0300
committerJames Almer <jamrial@gmail.com>2024-07-08 13:29:49 -0300
commit893c6802acb58b5da252a71870787faebf580a97 (patch)
tree88fce472ff752cae188cad3f7853806b01f56a9d
parent1b58f3af30c49d78657df9f2b641e25cb52faa25 (diff)
downloadffmpeg-893c6802acb58b5da252a71870787faebf580a97.tar.gz
avformat/dump: print Frame Cropping packet side data info
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavformat/dump.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c
index b7d8352999..78b2481d90 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -442,6 +442,23 @@ static void dump_s12m_timecode(void *ctx, const AVStream *st, const AVPacketSide
}
}
+static void dump_cropping(void *ctx, const AVPacketSideData *sd)
+{
+ uint32_t top, bottom, left, right;
+
+ if (sd->size < sizeof(uint32_t) * 4) {
+ av_log(ctx, AV_LOG_ERROR, "invalid data\n");
+ return;
+ }
+
+ top = AV_RL32(sd->data + 0);
+ bottom = AV_RL32(sd->data + 4);
+ left = AV_RL32(sd->data + 8);
+ right = AV_RL32(sd->data + 12);
+
+ av_log(ctx, AV_LOG_INFO, "%d/%d/%d/%d", left, right, top, bottom);
+}
+
static void dump_sidedata(void *ctx, const AVStream *st, const char *indent,
int log_level)
{
@@ -516,6 +533,10 @@ static void dump_sidedata(void *ctx, const AVStream *st, const char *indent,
case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:
dump_ambient_viewing_environment_metadata(ctx, sd);
break;
+ case AV_PKT_DATA_FRAME_CROPPING:
+ av_log(ctx, AV_LOG_INFO, "Frame cropping: ");
+ dump_cropping(ctx, sd);
+ break;
default:
av_log(ctx, log_level, "unknown side data type %d "
"(%"SIZE_SPECIFIER" bytes)", sd->type, sd->size);