MCPcopy Create free account
hub / github.com/Tencent/libpag / SoftwareAVCDecoderFactory

Class SoftwareAVCDecoderFactory

src/rendering/video/VideoDecoderFactory.cpp:75–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73};
74
75class SoftwareAVCDecoderFactory : public VideoDecoderFactory {
76 public:
77 bool isHardwareBacked() const override {
78 return false;
79 }
80
81 protected:
82 std::unique_ptr<VideoDecoder> onCreateDecoder(const VideoFormat& format) const override {
83 std::unique_ptr<VideoDecoder> videoDecoder = nullptr;
84#ifdef PAG_USE_LIBAVC
85 videoDecoder = SoftwareDecoderWrapper::Wrap(std::make_shared<SoftAVCDecoder>(), format);
86 if (videoDecoder != nullptr) {
87 LOGI("All other video decoders are not available, fallback to SoftAVCDecoder!");
88 }
89#else
90 USE(format);
91#endif
92 return videoDecoder;
93 }
94};
95
96static ExternalDecoderFactory externalDecoderFactory = {};
97static SoftwareAVCDecoderFactory softwareAVCDecoderFactory = {};

Calls

no outgoing calls

Tested by

no test coverage detected