Optimize Decoder inheritance relationship (#1760)

This commit is contained in:
CharleyWangHZ
2022-06-29 11:01:16 +08:00
committed by GitHub
parent 07982b7243
commit 28350c0d05
6 changed files with 16 additions and 27 deletions

View File

@@ -25,12 +25,16 @@ public:
typedef std::function<void(int stream, int codecid, const void *extra, size_t bytes, int finish)> onStream;
virtual ssize_t input(const uint8_t *data, size_t bytes) = 0;
virtual void setOnDecode(onDecode cb) = 0;
virtual void setOnStream(onStream cb) = 0;
void setOnDecode(onDecode cb);
void setOnStream(onStream cb);
protected:
Decoder() = default;
virtual ~Decoder() = default;
protected:
onDecode _on_decode;
onStream _on_stream;
};
class DecoderImp{