Debian Codegraph @

src/videofilters/av1/decoder/av1-decoder-filter.h

raw
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 <memory>
24
25 #include "../obu/obu-unpacker.h"
26 #include "av1-decoder.h"
27 #include "filter-interface/decoder-filter.h"
28 #include "mediastreamer2/msvideo.h"
29
30 namespace mediastreamer {
31
32 class Av1DecoderFilter : public DecoderFilter {
33 public:
34 Av1DecoderFilter(MSFilter *f, Av1Decoder *codec);
35
36 void preprocess() override;
37 void process() override;
38 void postprocess() override;
39
40 MSVideoSize getVideoSize() const override;
41 float getFps() const override;
42 const MSFmtDescriptor *getOutputFmt() const override;
43 void addFmtp([[maybe_unused]] const char *fmtp) override {
44 }
45
46 void enableAvpf(bool enable) override;
47
48 bool freezeOnErrorEnabled() const override {
49 return mFreezeOnError;
50 }
51 void enableFreezeOnError(bool enable) override;
52
53 void resetFirstImage() override;
54
55 protected:
56 MSVideoSize mVsize;
57 MSAverageFPS mFps;
58 bool mAvpfEnabled = false;
59 bool mFreezeOnError = true;
60 bool mFirstImageDecoded = false;
61
62 std::unique_ptr<Av1Decoder> mCodec;
63 ObuUnpacker mUnpacker;
64 };
65
66 } // namespace mediastreamer