You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-29 05:57:37 +02:00
lavc/packet: add API for an AVPacket-based AVContainerFifo
This commit is contained in:
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07
|
|||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
|
2024-12-15 - xxxxxxxxxx - lavc 61.27.100 packet.h
|
||||||
|
Add av_container_fifo_alloc_avpacket().
|
||||||
|
|
||||||
2024-12-15 - xxxxxxxxxx - lavu 59.51.100 - refstruct.h container_fifo.h
|
2024-12-15 - xxxxxxxxxx - lavu 59.51.100 - refstruct.h container_fifo.h
|
||||||
Add a new public header refstruct.h with new API for
|
Add a new public header refstruct.h with new API for
|
||||||
reference-counted objects.
|
reference-counted objects.
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
#include "libavutil/avutil.h"
|
#include "libavutil/avutil.h"
|
||||||
|
#include "libavutil/container_fifo.h"
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "libavutil/mathematics.h"
|
#include "libavutil/mathematics.h"
|
||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
@@ -752,3 +753,35 @@ void av_packet_side_data_free(AVPacketSideData **psd, int *pnb_sd)
|
|||||||
av_freep(psd);
|
av_freep(psd);
|
||||||
*pnb_sd = 0;
|
*pnb_sd = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *container_packet_alloc(void *opaque)
|
||||||
|
{
|
||||||
|
return av_packet_alloc();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void container_packet_reset(void *opaque, void *obj)
|
||||||
|
{
|
||||||
|
av_packet_unref(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void container_packet_free(void *opaque, void *obj)
|
||||||
|
{
|
||||||
|
AVPacket *pkt = obj;
|
||||||
|
av_packet_free(&pkt);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int container_packet_transfer(void *opaque, void *dst, void *src, unsigned flags)
|
||||||
|
{
|
||||||
|
if (flags & AV_CONTAINER_FIFO_FLAG_REF)
|
||||||
|
return av_packet_ref(dst, src);
|
||||||
|
|
||||||
|
av_packet_move_ref(dst, src);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
AVContainerFifo *av_container_fifo_alloc_avpacket(unsigned flags)
|
||||||
|
{
|
||||||
|
return av_container_fifo_alloc(NULL, container_packet_alloc,
|
||||||
|
container_packet_reset, container_packet_free,
|
||||||
|
container_packet_transfer, 0);
|
||||||
|
}
|
||||||
|
|||||||
@@ -880,6 +880,13 @@ int av_packet_make_writable(AVPacket *pkt);
|
|||||||
*/
|
*/
|
||||||
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst);
|
void av_packet_rescale_ts(AVPacket *pkt, AVRational tb_src, AVRational tb_dst);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allocate an AVContainerFifo instance for AVPacket.
|
||||||
|
*
|
||||||
|
* @param flags currently unused
|
||||||
|
*/
|
||||||
|
struct AVContainerFifo *av_container_fifo_alloc_avpacket(unsigned flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include "version_major.h"
|
#include "version_major.h"
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MINOR 26
|
#define LIBAVCODEC_VERSION_MINOR 27
|
||||||
#define LIBAVCODEC_VERSION_MICRO 100
|
#define LIBAVCODEC_VERSION_MICRO 100
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
|
|||||||
Reference in New Issue
Block a user