Skip to content

Commit

Permalink
lavu/videotoolbox: expose routine to set CVPixelBufferRef metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
rcombs committed Dec 23, 2021
1 parent 69bd95d commit b7e1ec7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions doc/APIchanges
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ libavutil: 2021-04-27

API changes, most recent first:

2021-12-xx - xxxxxxxxxx - lavu 57.13.100 - hwcontext_videotoolbox.h
Add av_vt_pixbuf_set_attachments

2021-12-xx - xxxxxxxxxx - lavu 57.13.100 - hwcontext_videotoolbox.h
Add av_map_videotoolbox_chroma_loc_from_av
Add av_map_videotoolbox_color_matrix_from_av
Expand Down
6 changes: 6 additions & 0 deletions libavutil/hwcontext_videotoolbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@ static int vt_pixbuf_set_attachments(void *log_ctx,
return 0;
}

int av_vt_pixbuf_set_attachments(void *log_ctx,
CVPixelBufferRef pixbuf, const AVFrame *src)
{
return vt_pixbuf_set_attachments(log_ctx, pixbuf, src);
}

static int vt_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src,
int flags)
{
Expand Down
7 changes: 7 additions & 0 deletions libavutil/hwcontext_videotoolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,11 @@ CFStringRef av_map_videotoolbox_color_primaries_from_av(enum AVColorPrimaries pr
*/
CFStringRef av_map_videotoolbox_color_trc_from_av(enum AVColorTransferCharacteristic trc);

/**
* Update a CVPixelBufferRef's metadata to based on an AVFrame.
* Returns 0 if no known equivalent was found.
*/
int av_vt_pixbuf_set_attachments(void *log_ctx,
CVPixelBufferRef pixbuf, const struct AVFrame *src);

#endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */
2 changes: 1 addition & 1 deletion libavutil/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
*/

#define LIBAVUTIL_VERSION_MAJOR 57
#define LIBAVUTIL_VERSION_MINOR 12
#define LIBAVUTIL_VERSION_MINOR 13
#define LIBAVUTIL_VERSION_MICRO 100

#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
Expand Down

0 comments on commit b7e1ec7

Please sign in to comment.