summaryrefslogtreecommitdiff
path: root/decode.c
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-06-04 18:12:05 +0200
committerMikhail Burakov <mburakov@mailbox.org>2023-06-04 18:12:05 +0200
commit5999efd02fa5151f4a12833fa438b3532414c22a (patch)
treebd55f8908624f3412d7f936682c964829516c2d8 /decode.c
parent3166394909e8ae8703c4b1d77610e0a356fe9107 (diff)
Add primitive bitsteam indicator to overlay
Diffstat (limited to 'decode.c')
-rw-r--r--decode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/decode.c b/decode.c
index f58538f..2f86a3f 100644
--- a/decode.c
+++ b/decode.c
@@ -51,6 +51,8 @@ struct DecodeContext {
struct Buffer buffer;
struct Surface** surfaces;
+
+ size_t bitrate;
};
static const char* VaStatusString(VAStatus status) {
@@ -492,10 +494,17 @@ again:
}
BufferDiscard(&decode_context->buffer, sizeof(uint32_t) + packet_size);
+ decode_context->bitrate += (sizeof(uint32_t) + packet_size) * 8;
goto again;
}
}
+void DecodeContextGetStats(struct DecodeContext* decode_context,
+ struct DecodeStats* decode_stats) {
+ decode_stats->bitrate = decode_context->bitrate;
+ decode_context->bitrate = 0;
+}
+
void DecodeContextDestroy(struct DecodeContext* decode_context) {
BufferDestroy(&decode_context->buffer);
MFXClose(decode_context->mfx_session);