FFmpeg
libavformat
hevc.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2014 Tim Walker <tdskywalker@gmail.com>
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
/**
22
* @file
23
* internal header for HEVC (de)muxer utilities
24
*/
25
26
#ifndef AVFORMAT_HEVC_H
27
#define AVFORMAT_HEVC_H
28
29
#include <stdint.h>
30
#include "
avio.h
"
31
32
/**
33
* Writes Annex B formatted HEVC NAL units to the provided AVIOContext.
34
*
35
* The NAL units are converted to an MP4-compatible format (start code prefixes
36
* are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
37
*
38
* If filter_ps is non-zero, any HEVC parameter sets found in the input will be
39
* discarded, and *ps_count will be set to the number of discarded PS NAL units.
40
*
41
* @param pb address of the AVIOContext where the data shall be written
42
* @param buf_in address of the buffer holding the input data
43
* @param size size (in bytes) of the input buffer
44
* @param filter_ps whether to write parameter set NAL units to the output (0)
45
* or to discard them (non-zero)
46
* @param ps_count address of the variable where the number of discarded
47
* parameter set NAL units shall be written, may be NULL
48
* @return the amount (in bytes) of data written in case of success, a negative
49
* value corresponding to an AVERROR code in case of failure
50
*/
51
int
ff_hevc_annexb2mp4
(
AVIOContext
*pb,
const
uint8_t *buf_in,
52
int
size
,
int
filter_ps,
int
*ps_count);
53
54
/**
55
* Writes Annex B formatted HEVC NAL units to a data buffer.
56
*
57
* The NAL units are converted to an MP4-compatible format (start code prefixes
58
* are replaced by 4-byte size fields, as per ISO/IEC 14496-15).
59
*
60
* If filter_ps is non-zero, any HEVC parameter sets found in the input will be
61
* discarded, and *ps_count will be set to the number of discarded PS NAL units.
62
*
63
* On success, *size holds the size (in bytes) of the output data buffer.
64
*
65
* @param buf_in address of the buffer holding the input data
66
* @param size address of the variable holding the size (in bytes) of the input
67
* buffer (on input) and of the output buffer (on success)
68
* @param buf_out on success, address of the variable holding the address of
69
* the output buffer
70
* @param filter_ps whether to write parameter set NAL units to the output (0)
71
* or to discard them (non-zero)
72
* @param ps_count address of the variable where the number of discarded
73
* parameter set NAL units shall be written, may be NULL
74
* @return 0 in case of success, a negative value corresponding to an AVERROR
75
* code in case of failure
76
* @note *buf_out will be treated as uninitialized on input and won't be freed.
77
*/
78
int
ff_hevc_annexb2mp4_buf
(
const
uint8_t *buf_in, uint8_t **buf_out,
79
int
*
size
,
int
filter_ps,
int
*ps_count);
80
81
/**
82
* Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the
83
* provided AVIOContext.
84
*
85
* If the extradata is Annex B format, it gets converted to hvcC format before
86
* writing.
87
*
88
* @param pb address of the AVIOContext where the hvcC shall be written
89
* @param data address of the buffer holding the data needed to write the hvcC
90
* @param size size (in bytes) of the data buffer
91
* @param ps_array_completeness whether all parameter sets are in the hvcC (1)
92
* or there may be additional parameter sets in the bitstream (0)
93
* @return >=0 in case of success, a negative value corresponding to an AVERROR
94
* code in case of failure
95
*/
96
int
ff_isom_write_hvcc
(
AVIOContext
*pb,
const
uint8_t *
data
,
97
int
size
,
int
ps_array_completeness);
98
99
#endif
/* AVFORMAT_HEVC_H */
ff_hevc_annexb2mp4_buf
int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out, int *size, int filter_ps, int *ps_count)
Writes Annex B formatted HEVC NAL units to a data buffer.
Definition:
hevc.c:1021
data
const char data[16]
Definition:
mxf.c:148
AVIOContext
Bytestream IO Context.
Definition:
avio.h:166
ff_hevc_annexb2mp4
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 the provided AVIOContext.
Definition:
hevc.c:973
size
int size
Definition:
twinvq_data.h:10344
avio.h
ff_isom_write_hvcc
int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data, int size, int ps_array_completeness)
Writes HEVC extradata (parameter sets, declarative SEI NAL units) to the provided AVIOContext.
Definition:
hevc.c:1042
Generated on Thu Apr 18 2024 22:41:51 for FFmpeg by
1.8.17