Valkka  1.6.1
OpenSource Video Management
metadata.h
Go to the documentation of this file.
1 #ifndef metadata_HEADER_GUARD
2 #define metadata_HEADER_GUARD
3 /*
4  * metadata.h : enums and structs for converting byte blobs into metadata
5  *
6  * (c) Copyright 2017-2024 Sampsa Riikonen
7  *
8  * Authors: Sampsa Riikonen <sampsa.riikonen@iki.fi>
9  *
10  * This file is part of the Valkka library.
11  *
12  * Valkka is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License as
14  * published by the Free Software Foundation, either version 3 of the
15  * License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>
24  *
25  */
26 
39 #endif
40 
41 #include "constant.h"
42 
43 static const int METADATA_MAX_SIZE = 10*1024; // 10 kB
44 
45 
46 enum class MuxMetaType
47 {
48  none,
49  fragmp4
50 };
51 
52 
53 struct FragMP4Meta { // <pyapi>
54  FragMP4Meta() : is_first(false), // <pyapi>
55  size(0), slot(0), mstimestamp(0) {} // <pyapi>
56  char name[4]; // <pyapi>
57  bool is_first; // <pyapi>
58  std::size_t size;
59  SlotNumber slot; // <pyapi>
60  long int mstimestamp; // <pyapi>
61 }; // <pyapi>
62 
63 
64 /* test code:
65 int main(int argv, char** argvc) {
66  std::vector<uint8_t> meta_blob;
67  meta_blob.reserve(METADATA_MAX_SIZE);
68  FragMP4Meta* metap;
69  metap = (FragMP4Meta*)(meta_blob.data());
70  memcpy(&metap->name[0], "moof", 4);
71  metap->is_first = true;
72 
73  std::cout << std::string(metap->name) << std::endl;
74  std::cout << int(metap->is_first) << std::endl;
75 }
76 */
Constant/default values, version numbers.
MuxMetaType
Definition: metadata.h:47
Definition: metadata.h:53
std::size_t size
Actual size copied // <pyapi>
Definition: metadata.h:58
@ none
undefined (initial value)
Definition: usbthread.h:143