[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / utils / BitstreamWriter.h
blob91257b2223c12e469c9a503457269d19f72f0f02
1 /*
2 * Copyright (C) 2017-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <stdint.h>
13 class CBitstreamWriter
15 public:
16 CBitstreamWriter(uint8_t *buffer, unsigned int buffer_size, int writer_le);
17 void WriteBits(int n, unsigned int value);
18 void SkipBits(int n);
19 void FlushBits();
21 private:
22 int writer_le;
23 uint32_t bit_buf;
24 int bit_left;
25 uint8_t *buf, *buf_ptr;
28 ////////////////////////////////////////////////////////////////////////////////////////////
29 //! @todo refactor this so as not to need these ffmpeg routines.
30 //! These are not exposed in ffmpeg's API so we dupe them here.
33 * AVC helper functions for muxers
34 * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@smartjog.com>
35 * This is part of FFmpeg
37 * SPDX-License-Identifier: LGPL-2.1-or-later
38 * See LICENSES/README.md for more information.
40 #define BS_WB32(p, d) { \
41 ((uint8_t*)(p))[3] = (d); \
42 ((uint8_t*)(p))[2] = (d) >> 8; \
43 ((uint8_t*)(p))[1] = (d) >> 16; \
44 ((uint8_t*)(p))[0] = (d) >> 24; }
46 #define BS_WL32(p, d) { \
47 ((uint8_t*)(p))[0] = (d); \
48 ((uint8_t*)(p))[1] = (d) >> 8; \
49 ((uint8_t*)(p))[2] = (d) >> 16; \
50 ((uint8_t*)(p))[3] = (d) >> 24; }