1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avformat/hevc: add a function to write a lhvC box

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer
2024-06-15 14:50:03 -03:00
parent cee43e512d
commit cbfbacff20
2 changed files with 145 additions and 35 deletions

View File

@@ -97,4 +97,21 @@ int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out,
int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data,
int size, int ps_array_completeness);
/**
* Writes L-HEVC extradata (parameter sets with nuh_layer_id > 0, as a
* LHEVCDecoderConfigurationRecord) to the provided AVIOContext.
*
* If the extradata is Annex B format, it gets converted to lhvC format before
* writing. Otherwise, hvcC formated extradata is expected, not lhvC.
*
* @param pb address of the AVIOContext where the lhvC shall be written
* @param data address of the buffer holding the data needed to write the lhvC
* @param size size (in bytes) of the data buffer
* @param ps_array_completeness whether all parameter sets are in the lhvC (1)
* or there may be additional parameter sets in the bitstream (0)
* @return >=0 in case of success, a negative value corresponding to an AVERROR
* code in case of failure
*/
int ff_isom_write_lhvc(AVIOContext *pb, const uint8_t *data,
int size, int ps_array_completeness);
#endif /* AVFORMAT_HEVC_H */