Debian Codegraph @

src/videofilters/h26x/h264-nal-unpacker.h

raw symbols SCIP
1 /*
2 * Copyright (c) 2010-2022 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 "nal-unpacker.h"
24
25 namespace mediastreamer {
26
27 class H264FuaAggregator : public NalUnpacker::FuAggregatorInterface {
28 public:
29 mblk_t *feed(mblk_t *im) override;
30 bool isAggregating() const override {
31 return _m != nullptr;
32 }
33 void reset() override;
34 mblk_t *completeAggregation() override;
35 };
36
37 class H264StapaSpliter : public NalUnpacker::ApSpliterInterface {
38 public:
39 void feed(mblk_t *im) override;
40 MSQueue *getNalus() override {
41 return &_q;
42 }
43 };
44
45 class H264NalUnpacker : public NalUnpacker {
46 public:
47 H264NalUnpacker() : NalUnpacker(new H264FuaAggregator(), new H264StapaSpliter()) {
48 }
49 ~H264NalUnpacker();
50
51 void setOutOfBandSpsPps(mblk_t *sps, mblk_t *pps);
52
53 private:
54 NalUnpacker::PacketType getNaluType(const mblk_t *nalu) const override;
55 Status outputFrame(MSQueue *out, const Status &flags) override;
56
57 mblk_t *_sps = nullptr;
58 mblk_t *_pps = nullptr;
59 };
60
61 } // namespace mediastreamer