-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathipcamvideofilefmt.h
74 lines (65 loc) · 1.88 KB
/
ipcamvideofilefmt.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (C) 2023 Francesco Vannini
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// Inspired by https://spitzner.org/kkmoon.html
//
#ifndef IPCAMVIDEOFILEFMT_H
#define IPCAMVIDEOFILEFMT_H
#define HXVS 1398167624
typedef struct HXVSFrame_t {
uint32_t width;
uint32_t height;
uint8_t padding[4];
} HXVSFrame_t;
#define HXVT 1414944840
typedef struct HXVTFrame_t {
uint32_t width;
uint32_t height;
uint8_t padding[4];
} HXVTFrame_t;
#define HXVF 1180063816
typedef struct HXVFFrame_t {
uint32_t length;
uint32_t timestamp;
uint8_t padding[4];
} HXVFFrame_t;
#define HXAF 1178687560
typedef struct HXAFFrame_t {
uint32_t length;
uint32_t timestamp;
uint8_t padding[8];
} HXAFFrame_t;
#define HXFI 1229346888
typedef struct HXFIFrame_t {
uint32_t length;
uint8_t padding[12];
} HXFIFrame_t;
typedef struct HXFrame_t {
uint32_t header;
union {
struct HXVSFrame_t hxvs;
struct HXVTFrame_t hxvt;
struct HXVFFrame_t hxvf;
struct HXAFFrame_t hxaf;
struct HXFIFrame_t hxfi;
} data;
} HXFrame_t;
typedef struct H26X_Nal_Header_t { // https://stackoverflow.com/a/38095609
uint8_t start_code[4];
uint8_t unit_type:5;
uint8_t nri:2;
uint8_t f:1;
} H26X_Nal_Header_t;
#endif