1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-29 22:00:58 +02:00

swscale: add sws_free_context()

Merely a convenience wrapper around sws_freeContext(). The name change is for
parity with the other sws_* functions.

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas 2024-10-09 23:15:48 +02:00
parent 3bf12beae9
commit 87baf9ab2c
4 changed files with 22 additions and 2 deletions

View File

@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
API changes, most recent first:
2024-10-23 - xxxxxxxxxx - lsws 8.7.100 - swscale.h
Add sws_free_context().
2024-10-23 - xxxxxxxxxx - lavu 59.45.100 - pixfmt.h
Add AV_PIX_FMT_Y216.

View File

@ -1,4 +1,5 @@
/*
* Copyright (C) 2024 Niklas Haas
* Copyright (C) 2001-2011 Michael Niedermayer <michaelni@gmx.at>
*
* This file is part of FFmpeg.
@ -78,6 +79,12 @@ const AVClass *sws_get_class(void);
*/
SwsContext *sws_alloc_context(void);
/**
* Free the context and everything associated with it, and write NULL
* to the provided pointer.
*/
void sws_free_context(SwsContext **ctx);
/* values for the flags, the stuff on the command line is different */
#define SWS_FAST_BILINEAR 1
#define SWS_BILINEAR 2

View File

@ -2515,6 +2515,16 @@ void sws_freeContext(SwsContext *c)
av_free(c);
}
void sws_free_context(SwsContext **pctx)
{
SwsContext *ctx = *pctx;
if (!ctx)
return;
sws_freeContext(ctx);
*pctx = NULL;
}
SwsContext *sws_getCachedContext(SwsContext *context, int srcW,
int srcH, enum AVPixelFormat srcFormat,
int dstW, int dstH,

View File

@ -28,8 +28,8 @@
#include "version_major.h"
#define LIBSWSCALE_VERSION_MINOR 6
#define LIBSWSCALE_VERSION_MICRO 101
#define LIBSWSCALE_VERSION_MINOR 7
#define LIBSWSCALE_VERSION_MICRO 100
#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
LIBSWSCALE_VERSION_MINOR, \