WinGui: Fix another instance of the Caliburn vs Json.net sillyness where objects...
[HandBrake.git] / libhb / nal_units.h
blob3beb42d68d96fe97940a657d551b8ed4e7fed97a
1 /* nal_units.h
3 * Copyright (c) 2003-2015 HandBrake Team
4 * This file is part of the HandBrake source code.
5 * Homepage: <http://handbrake.fr/>.
6 * It may be used under the terms of the GNU General Public License v2.
7 * For full terms see the file COPYING file or visit http://www.gnu.org/licenses/gpl-2.0.html
8 */
10 #ifndef HB_NAL_UNITS_H
11 #define HB_NAL_UNITS_H
13 #include <stdint.h>
15 #include "common.h"
18 * Write a NAL unit of the specified size to the provided
19 * output buffer, using the requested output format.
20 * Returns the amount (in bytes) of data written to the buffer.
22 * The provided NAL unit must start with the NAL unit header.
24 * Note: the buffer is assumed to be large enough to hold the NAL unit
25 * as well as any additonal data the function may prepend/append to it.
27 * The caller may check the minimum required buffer size by passing a
28 * NULL buffer to the fucntion and checking the returned size value.
30 size_t hb_nal_unit_write_annexb(uint8_t *buf, const uint8_t *nal_unit, const size_t nal_unit_size);
31 size_t hb_nal_unit_write_isomp4(uint8_t *buf, const uint8_t *nal_unit, const size_t nal_unit_size);
34 * Search the provided data buffer for NAL units in Annex B format.
36 * Returns a pointer to the start (start code prefix excluded) of the
37 * first NAL unit found, or NULL if no NAL units were found in the buffer.
39 * On input, size holds the length of the provided data buffer.
40 * On output, size holds the length of the returned NAL unit.
42 uint8_t* hb_annexb_find_next_nalu(const uint8_t *start, size_t *size);
45 * Returns a newly-allocated buffer holding a copy of the provided
46 * NAL unit bitstream data, converted to the requested format.
48 hb_buffer_t* hb_nal_bitstream_annexb_to_mp4(const uint8_t *data, const size_t size);
49 hb_buffer_t* hb_nal_bitstream_mp4_to_annexb(const uint8_t *data, const size_t size, const uint8_t nal_length_size);
51 #endif // HB_NAL_UNITS_H