diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-03-29 07:58:56 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-04-01 18:23:13 +0200 |
commit | 39ecb63d0f082ee3b2ac2ac65577170deb245ec4 (patch) | |
tree | dec03fe40d01b51e21929d00c3e45732163447a5 /libavformat/internal.h | |
parent | b7b73e83e3d5c78a5fea96a6bcae02e1f0a5c45f (diff) |
avformat: Add and use helper function to add attachment streams
All instances of adding attached pictures to a stream or adding
a stream and an attached packet to said stream have several things
in common like setting the index and flags of the packet, setting
the stream disposition etc. This commit therefore factors this out.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/internal.h')
-rw-r--r-- | libavformat/internal.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/internal.h b/libavformat/internal.h index 8631694d00..b3c5d8a1d5 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -670,6 +670,19 @@ int ff_framehash_write_header(AVFormatContext *s); int ff_read_packet(AVFormatContext *s, AVPacket *pkt); /** + * Add an attached pic to an AVStream. + * + * @param st if set, the stream to add the attached pic to; + * if unset, a new stream will be added to s. + * @param pb AVIOContext to read data from if buf is unset. + * @param buf if set, it contains the data and size information to be used + * for the attached pic; if unset, data is read from pb. + * @param size the size of the data to read if buf is unset. + */ +int ff_add_attached_pic(AVFormatContext *s, AVStream *st, AVIOContext *pb, + AVBufferRef **buf, int size); + +/** * Interleave an AVPacket per dts so it can be muxed. * * @param s an AVFormatContext for output. pkt resp. out will be added to |