Skip to content

Commit

Permalink
decode: add a per-frame private data for hwaccel use
Browse files Browse the repository at this point in the history
This will be useful in the CUVID hwaccel. It should also eventually
replace current decoder-specific mechanisms used by various other
hwaccels.
  • Loading branch information
elenril committed Jul 26, 2017
1 parent badf095 commit 704311b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavcodec/decode.c
Expand Up @@ -1025,6 +1025,9 @@ static void decode_data_free(void *opaque, uint8_t *data)
if (fdd->post_process_opaque_free)
fdd->post_process_opaque_free(fdd->post_process_opaque);

if (fdd->hwaccel_priv_free)
fdd->hwaccel_priv_free(fdd->hwaccel_priv);

av_freep(&fdd);
}

Expand Down
6 changes: 6 additions & 0 deletions libavcodec/decode.h
Expand Up @@ -49,6 +49,12 @@ typedef struct FrameDecodeData {
int (*post_process)(void *logctx, AVFrame *frame);
void *post_process_opaque;
void (*post_process_opaque_free)(void *opaque);

/**
* Per-frame private data for hwaccels.
*/
void *hwaccel_priv;
void (*hwaccel_priv_free)(void *priv);
} FrameDecodeData;

/**
Expand Down

0 comments on commit 704311b

Please sign in to comment.