Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IFRAMEENCODER_H
  8. #define IFRAMEENCODER_H
  9. #pragma once
  10. // A frame encoder is a codec that encodes and decodes data in fixed-size frames.
  11. // VoiceCodec_Frame handles queuing of data and the IVoiceCodec interface.
  12. abstract_class IFrameEncoder
  13. {
  14. public:
  15. virtual ~IFrameEncoder() {}
  16. // This is called by VoiceCodec_Frame to see if it can initialize..
  17. // Fills in the uncompressed and encoded frame size (both are in BYTES).
  18. virtual bool Init(int quality, int &rawFrameSize, int &encodedFrameSize) = 0;
  19. virtual void Release() = 0;
  20. // pUncompressed is 8-bit signed mono sound data with 'rawFrameSize' bytes.
  21. // pCompressed is the size of encodedFrameSize.
  22. virtual void EncodeFrame(const char *pUncompressed, char *pCompressed) = 0;
  23. // pCompressed is encodedFrameSize.
  24. // pDecompressed is where the 8-bit signed mono samples are stored and has space for 'rawFrameSize' bytes.
  25. virtual void DecodeFrame(const char *pCompressed, char *pDecompressed) = 0;
  26. // Some codecs maintain state between Compress and Decompress calls. This should clear that state.
  27. virtual bool ResetState() = 0;
  28. };
  29. #endif // IFRAMEENCODER_H