Debian Codegraph @

src/videofilters/av1/obu/obu-packer.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2010-2023 Belledonne Communications SARL.
3 *
4 * This file is part of mediastreamer2
5 * (see https://gitlab.linphone.org/BC/public/mediastreamer2).
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #pragma once
22
23 #include <utility>
24 #include <vector>
25
26 #include "mediastreamer2/mediastream.h"
27 #include "obuparse.h"
28
29 namespace mediastreamer {
30
31 class ObuPacker {
32 public:
33 ObuPacker(size_t maxPayloadSize);
34
35 void setMaxPayloadSize(size_t size);
36 size_t getMaxPayloadSize() {
37 return mMaxPayloadSize;
38 }
39
40 void enableAggregation(bool enable);
41 bool isAggregationEnabled() {
42 return mAggregationEnabled;
43 }
44
45 void pack(MSQueue *input, MSQueue *output, uint32_t timestamp);
46
47 protected:
48 struct ParsedObu {
49 OBPOBUType type;
50 uint8_t *start;
51 size_t size;
52 };
53
54 static ParsedObu parseNextObu(uint8_t *buf, size_t size);
55 void sendObus(std::vector<ParsedObu> &obus, MSQueue *output, uint32_t ts);
56 mblk_t *makePacket(uint8_t *buf, size_t size, bool Z, bool Y, bool N, bool M, uint32_t ts);
57
58 size_t mMaxPayloadSize;
59 bool mAggregationEnabled = false;
60 };
61
62 } // namespace mediastreamer