mbox series

[FFmpeg-devel,00/18] AVPacketList public API

Message ID 20201118165247.4130-1-jamrial@gmail.com
Headers show
Series AVPacketList public API | expand

Message

James Almer Nov. 18, 2020, 4:52 p.m. UTC
This is an attempt at introducing a public packet list API, after the
need for it outside of libavformat became evident.

It reuses the existing AVPacketList struct by making it opaque, so we
can have a head and tail pointers internally instead of having to expose
them in a very awkward way in the functions, like it's currently the case
with the private packet list functions.
Since AVPacketList is already a public struct, the only way to reuse it
was by deprecating all of its fields and scheduling making it opaque in
a soname bump >= 2 years from now.

James Almer (18):
  avcodec/packet_internal: add a PacketListEntry struct
  avformat/internal: make last_in_packet_buffer of type PacketListEntry
  avcodec/avpacket: make avpriv_packet_* use PacketListEntry
  avcodec/avpacket: add a new public AVPacketList API
  avcodec/decode: port to the new packet list API
  avformat: port AVFormatInternal->packet_buffer to the new packet list
    API
  avformat: port AVFormatInternal->raw_packet_buffer to the new packet
    list API
  avformat: port AVFormatInternal->parse_queue to the new packet list
    API
  avdevice/dshow: port to the new packet list API
  avdevice/decklink_dec: port to the new packet list API
  avdevice/vfwcap: port to the new packet list API
  avformat/ttaenc: port to the new packet list API
  avformat/mp3enc: port to the new packet list API
  avformat/flacenc: port to the new packet list API
  avformat/aiffenc: port to the new packet list API
  avformat/matroskadec: port to the new packet list API
  avcodec/avpacket: schedule the removal of avpriv_packet_list_*
  avcodec/avpacket: make the AVPacketList API thread safe

 libavcodec/avpacket.c         | 189 ++++++++++++++++++++++++++++++++--
 libavcodec/decode.c           |  20 ++--
 libavcodec/internal.h         |   1 -
 libavcodec/packet.h           |  88 +++++++++++++++-
 libavcodec/packet_internal.h  |  24 ++++-
 libavcodec/utils.c            |  11 +-
 libavcodec/version.h          |   3 +
 libavdevice/decklink_common.h |   2 +-
 libavdevice/decklink_dec.cpp  |  53 ++++------
 libavdevice/dshow.c           |  52 +++++-----
 libavdevice/vfwcap.c          |  49 ++++-----
 libavformat/aiffenc.c         |  22 ++--
 libavformat/flacenc.c         |  13 ++-
 libavformat/internal.h        |   6 +-
 libavformat/matroskadec.c     |  29 +++---
 libavformat/mp3enc.c          |  13 ++-
 libavformat/mux.c             |  64 +++++++-----
 libavformat/mxfenc.c          |  23 +++--
 libavformat/options.c         |  13 +++
 libavformat/ttaenc.c          |  14 +--
 libavformat/utils.c           | 128 ++++++++++++++++-------
 21 files changed, 583 insertions(+), 234 deletions(-)

Comments

Derek Buitenhuis Nov. 18, 2020, 8:03 p.m. UTC | #1
On 18/11/2020 16:52, James Almer wrote:
> This is an attempt at introducing a public packet list API, after the
> need for it outside of libavformat became evident.

Can you mention what the intended use is outside of lavf, for those
of us who may have missed the conversations around it?

- Derek
James Almer Nov. 19, 2020, 1:52 a.m. UTC | #2
On 11/18/2020 5:03 PM, Derek Buitenhuis wrote:
> On 18/11/2020 16:52, James Almer wrote:
>> This is an attempt at introducing a public packet list API, after the
>> need for it outside of libavformat became evident.
> 
> Can you mention what the intended use is outside of lavf, for those
> of us who may have missed the conversations around it?

It's currently used in decode.c in libavcodec, and on three devices in 
libavdevice, hence the avpriv_ implementation.

It's also reimplemented in ffplay, which could be ported to this API if 
we add some sort of opaque user field to be attached to each packet in 
the list.
ffplay is a library user, so there's clearly interest for a packet queue 
outside of libav*.

> 
> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>