Debian Codegraph @

src/videofilters/h26x/h26x-encoder-filter.h

raw
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 <memory>
24
25 #include "h26x-encoder.h"
26 #include "nal-packer.h"
27
28 #include "filter-interface/encoder-filter.h"
29
30 namespace mediastreamer {
31
32 class H26xEncoderFilter : public EncoderFilter {
33 public:
34 void preprocess() override;
35 void process() override;
36 void postprocess() override;
37
38 const MSVideoConfiguration *getVideoConfigurations() const override;
39 const MSVideoConfiguration &getVideoConfiguration() const override {
40 return _vconf;
41 }
42 void setVideoConfiguration(MSVideoConfiguration vconf) override;
43
44 void enableAvpf(bool enable) override;
45
46 void requestVfu() override;
47 void notifyPli() override;
48 void notifyFir() override;
49 void notifySli() override;
50
51 protected:
52 H26xEncoderFilter(MSFilter *f, H26xEncoder *encoder, const MSVideoConfiguration *vconfList);
53
54 std::unique_ptr<H26xEncoder> _encoder;
55 std::unique_ptr<NalPacker> _packer;
56 const MSVideoConfiguration *_vconfList = nullptr;
57 MSVideoConfiguration _vconf;
58 bool _avpfEnabled = false;
59 bool _firstFrameDecoded = false;
60
61 MSVideoStarter _starter;
62 MSIFrameRequestsLimiterCtx _iframeLimiter;
63 };
64
65 } // namespace mediastreamer