Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
encoder.hpp
1// This code is partially adapted from https://github.com/cbachhuber/CppVideoStreamer
2#pragma once
3
4#include <memory>
5#include <stdint.h>
6#include <vector>
7
8namespace h264encoder {
9
10class EncoderImpl;
11
12// simplified version of the x264_nal_t struct containing only the necessary fields for
13// encoding
14typedef struct x264_nal_t_simple {
15 /* Size of payload (including any padding) in bytes. */
16 int i_payload;
17 /* If param->b_annexb is set, Annex-B bytestream with startcode.
18 * Otherwise, startcode is replaced with a 4-byte size.
19 * This size is the size used in mp4/similar muxing; it is equal to i_payload-4 */
20 uint8_t* p_payload;
22
23class Encoder {
24public:
25 Encoder(){};
26 Encoder(int, int, int, int, float, int);
27 int encode(unsigned char*);
28 const std::vector<x264_nal_t_simple>& getNals();
29
30private:
32};
33
34} // namespace h264encoder
Definition encoder.cpp:17
::uint8_t uint8_t
Definition encoder.hpp:14