Meant to reset the internal bsf state without the need to reinitialize it.
Unified · Split
| @@ -15,6 +15,9 @@ libavutil: 2017-10-21 · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | API changes, most recent first: |
| 17 | 17 | |
| 18 | +2018-08-16 - xxxxxxxxxx - lavc 58.23.100 - avcodec.h | |
| 19 | + Add av_bsf_flush(). | |
| 20 | + | |
| 18 | 21 | 2018-05-xx - xxxxxxxxxx - lavf 58.15.100 - avformat.h |
| 19 | 22 | Add pmt_version field to AVProgram |
| 20 | 23 | |
| @@ -5769,6 +5769,7 @@ typedef struct AVBitStreamFilter { · 5768 unmodified lines | ||
| 5769 | 5769 | int (*init)(AVBSFContext *ctx); |
| 5770 | 5770 | int (*filter)(AVBSFContext *ctx, AVPacket *pkt); |
| 5771 | 5771 | void (*close)(AVBSFContext *ctx); |
| 5772 | + void (*flush)(AVBSFContext *ctx); | |
| 5772 | 5773 | } AVBitStreamFilter; |
| 5773 | 5774 | |
| 5774 | 5775 | #if FF_API_OLD_BSF |
| @@ -5895,6 +5896,11 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); · 120 unmodified lines | ||
| 5895 | 5896 | */ |
| 5896 | 5897 | int av_bsf_receive_packet(AVBSFContext *ctx, AVPacket *pkt); |
| 5897 | 5898 | |
| 5899 | +/** | |
| 5900 | + * Reset the internal bitstream filter state / flush internal buffers. | |
| 5901 | + */ | |
| 5902 | +void av_bsf_flush(AVBSFContext *ctx); | |
| 5903 | + | |
| 5898 | 5904 | /** |
| 5899 | 5905 | * Free a bitstream filter context and everything associated with it; write NULL |
| 5900 | 5906 | * into the supplied pointer. |
| @@ -172,6 +172,16 @@ int av_bsf_init(AVBSFContext *ctx) · 171 unmodified lines | ||
| 172 | 172 | return 0; |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | +void av_bsf_flush(AVBSFContext *ctx) | |
| 176 | +{ | |
| 177 | + ctx->internal->eof = 0; | |
| 178 | + | |
| 179 | + av_packet_unref(ctx->internal->buffer_pkt); | |
| 180 | + | |
| 181 | + if (ctx->filter->flush) | |
| 182 | + ctx->filter->flush(ctx); | |
| 183 | +} | |
| 184 | + | |
| 175 | 185 | int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt) |
| 176 | 186 | { |
| 177 | 187 | int ret; |
| @@ -28,8 +28,8 @@ · 27 unmodified lines | ||
| 28 | 28 | #include "libavutil/version.h" |
| 29 | 29 | |
| 30 | 30 | #define LIBAVCODEC_VERSION_MAJOR 58 |
| 31 | −#define LIBAVCODEC_VERSION_MINOR 22 | |
| 32 | −#define LIBAVCODEC_VERSION_MICRO 101 | |
| 31 | +#define LIBAVCODEC_VERSION_MINOR 23 | |
| 32 | +#define LIBAVCODEC_VERSION_MICRO 100 | |
| 33 | 33 | |
| 34 | 34 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 35 | 35 | LIBAVCODEC_VERSION_MINOR, \ |