Resurgence (PY2022)
Codebase for the Husky Robotics 2021-2022 rover Resurgence
Loading...
Searching...
No Matches
src
video
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
8
namespace
h264encoder {
9
10
class
EncoderImpl
;
11
12
// simplified version of the x264_nal_t struct containing only the necessary fields for
13
// encoding
14
typedef
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;
21
}
x264_nal_t_simple
;
22
23
class
Encoder {
24
public
:
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
30
private
:
31
std::shared_ptr<EncoderImpl>
impl;
32
};
33
34
}
// namespace h264encoder
memory
vector
std::shared_ptr
std::vector
h264encoder::EncoderImpl
Definition
encoder.cpp:17
uint8_t
::uint8_t uint8_t
h264encoder::x264_nal_t_simple
Definition
encoder.hpp:14
Generated by
1.13.2