summaryrefslogtreecommitdiff
path: root/engine/voice_codecs/frame_encoder/iframeencoder.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /engine/voice_codecs/frame_encoder/iframeencoder.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'engine/voice_codecs/frame_encoder/iframeencoder.h')
-rw-r--r--engine/voice_codecs/frame_encoder/iframeencoder.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/engine/voice_codecs/frame_encoder/iframeencoder.h b/engine/voice_codecs/frame_encoder/iframeencoder.h
new file mode 100644
index 0000000..8bf5594
--- /dev/null
+++ b/engine/voice_codecs/frame_encoder/iframeencoder.h
@@ -0,0 +1,39 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef IFRAMEENCODER_H
+#define IFRAMEENCODER_H
+#pragma once
+
+
+// A frame encoder is a codec that encodes and decodes data in fixed-size frames.
+// VoiceCodec_Frame handles queuing of data and the IVoiceCodec interface.
+abstract_class IFrameEncoder
+{
+public:
+ virtual ~IFrameEncoder() {}
+
+ // This is called by VoiceCodec_Frame to see if it can initialize..
+ // Fills in the uncompressed and encoded frame size (both are in BYTES).
+ virtual bool Init(int quality, int &rawFrameSize, int &encodedFrameSize) = 0;
+
+ virtual void Release() = 0;
+
+ // pUncompressed is 8-bit signed mono sound data with 'rawFrameSize' bytes.
+ // pCompressed is the size of encodedFrameSize.
+ virtual void EncodeFrame(const char *pUncompressed, char *pCompressed) = 0;
+
+ // pCompressed is encodedFrameSize.
+ // pDecompressed is where the 8-bit signed mono samples are stored and has space for 'rawFrameSize' bytes.
+ virtual void DecodeFrame(const char *pCompressed, char *pDecompressed) = 0;
+
+ // Some codecs maintain state between Compress and Decompress calls. This should clear that state.
+ virtual bool ResetState() = 0;
+};
+
+
+#endif // IFRAMEENCODER_H