2
0
mirror of https://github.com/rehlds/revoice.git synced 2024-12-27 23:25:53 +03:00

Access to pending samples in the Silk encoding buffer

This commit is contained in:
thecrock 2015-12-14 21:49:28 +04:00
parent 8eb9367dcd
commit f2c262cdb4
3 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,6 @@
#include "precompiled.h"
CSteamP2PCodec::CSteamP2PCodec(IVoiceCodec* backend) {
CSteamP2PCodec::CSteamP2PCodec(VoiceEncoder_Silk* backend) {
m_BackendCodec = backend;
}

View File

@ -5,16 +5,18 @@
class CSteamP2PCodec : public IVoiceCodec {
public:
CSteamP2PCodec(IVoiceCodec* backend);
CSteamP2PCodec(VoiceEncoder_Silk* backend);
virtual bool Init(int quality);
virtual void Release();
virtual int Compress(const char *pUncompressedBytes, int nSamples, char *pCompressed, int maxCompressedBytes, bool bFinal);
virtual int Decompress(const char *pCompressed, int compressedBytes, char *pUncompressed, int maxUncompressedBytes);
virtual bool ResetState();
VoiceEncoder_Silk* GetSilkCodec() const { return m_BackendCodec; }
private:
int StreamDecode(const char *pCompressed, int compressedBytes, char *pUncompressed, int maxUncompressedBytes) const;
int StreamEncode(const char *pUncompressedBytes, int nSamples, char *pCompressed, int maxCompressedBytes, bool bFinal) const;
private:
IVoiceCodec* m_BackendCodec;
VoiceEncoder_Silk* m_BackendCodec;
};

View File

@ -27,4 +27,5 @@ public:
virtual int Compress(const char *pUncompressedBytes, int nSamples, char *pCompressed, int maxCompressedBytes, bool bFinal);
virtual int Decompress(const char *pCompressed, int compressedBytes, char *pUncompressed, int maxUncompressedBytes);
int GetNumQueuedEncodingSamples() const { return m_bufOverflowBytes.TellPut() / 2; }
}; /* size: 100 */