Skip to content

Commit 704311b

Browse files
committed
decode: add a per-frame private data for hwaccel use
This will be useful in the CUVID hwaccel. It should also eventually replace current decoder-specific mechanisms used by various other hwaccels.
1 parent badf095 commit 704311b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libavcodec/decode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,9 @@ static void decode_data_free(void *opaque, uint8_t *data)
10251025
if (fdd->post_process_opaque_free)
10261026
fdd->post_process_opaque_free(fdd->post_process_opaque);
10271027

1028+
if (fdd->hwaccel_priv_free)
1029+
fdd->hwaccel_priv_free(fdd->hwaccel_priv);
1030+
10281031
av_freep(&fdd);
10291032
}
10301033

libavcodec/decode.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ typedef struct FrameDecodeData {
4949
int (*post_process)(void *logctx, AVFrame *frame);
5050
void *post_process_opaque;
5151
void (*post_process_opaque_free)(void *opaque);
52+
53+
/**
54+
* Per-frame private data for hwaccels.
55+
*/
56+
void *hwaccel_priv;
57+
void (*hwaccel_priv_free)(void *priv);
5258
} FrameDecodeData;
5359

5460
/**

0 commit comments

Comments
 (0)