| 73 | }; |
| 74 | |
| 75 | class 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 | |
| 96 | static ExternalDecoderFactory externalDecoderFactory = {}; |
| 97 | static SoftwareAVCDecoderFactory softwareAVCDecoderFactory = {}; |
no outgoing calls
no test coverage detected