diff options
author | Michael Niedermayer | 2014-03-09 23:07:48 +0100 |
---|---|---|
committer | Michael Niedermayer | 2014-03-09 23:08:33 +0100 |
commit | a379813ceed6b24c149aa8e50a7bd2b09639208a (patch) | |
tree | 2282139849530947c3dabb6b430291cf071fc83c /libavformat/hevc.h | |
parent | cb403b2570385cbf48a11f9f48441de5cd01171e (diff) | |
parent | b6c61fb83e876d404ac3b0b3657ebfcafdcd1926 (diff) |
Merge commit 'b6c61fb83e876d404ac3b0b3657ebfcafdcd1926'
* commit 'b6c61fb83e876d404ac3b0b3657ebfcafdcd1926':
movenc: enable Annex B to MP4 conversion for HEVC tracks.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/hevc.h')
-rw-r--r-- | libavformat/hevc.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/libavformat/hevc.h b/libavformat/hevc.h index 8b9350dbe5..edf7527aa4 100644 --- a/libavformat/hevc.h +++ b/libavformat/hevc.h @@ -30,6 +30,54 @@ #include "avio.h" /** + * Writes Annex B formatted HEVC NAL units to the provided AVIOContext. + * + * The NAL units are converted to an MP4-compatible format (start code prefixes + * are replaced by 4-byte size fields, as per ISO/IEC 14496-15). + * + * If filter_ps is non-zero, any HEVC parameter sets found in the input will be + * discarded, and *ps_count will be set to the number of discarded PS NAL units. + * + * @param pb address of the AVIOContext where the data shall be written + * @param buf_in address of the buffer holding the input data + * @param size size (in bytes) of the input buffer + * @param filter_ps whether to write parameter set NAL units to the output (0) + * or to discard them (non-zero) + * @param ps_count address of the variable where the number of discarded + * parameter set NAL units shall be written, may be NULL + * @return the amount (in bytes) of data written in case of success, a negative + * value corresponding to an AVERROR code in case of failure + */ +int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in, + int size, int filter_ps, int *ps_count); + +/** + * Writes Annex B formatted HEVC NAL units to a data buffer. + * + * The NAL units are converted to an MP4-compatible format (start code prefixes + * are replaced by 4-byte size fields, as per ISO/IEC 14496-15). + * + * If filter_ps is non-zero, any HEVC parameter sets found in the input will be + * discarded, and *ps_count will be set to the number of discarded PS NAL units. + * + * On output, *size holds the size (in bytes) of the output data buffer. + * + * @param buf_in address of the buffer holding the input data + * @param size address of the variable holding the size (in bytes) of the input + * buffer (on input) and of the output buffer (on output) + * @param buf_out address of the variable holding the address of the output + * buffer + * @param filter_ps whether to write parameter set NAL units to the output (0) + * or to discard them (non-zero) + * @param ps_count address of the variable where the number of discarded + * parameter set NAL units shall be written, may be NULL + * @return 0 in case of success, a negative value corresponding to an AVERROR + * code in case of failure + */ +int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out, + int *size, int filter_ps, int *ps_count); + +/** * Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the * provided AVIOContext. * |