c_encoder.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef __C_ENCODER_H__
  2. #define __C_ENCODER_H__
  3. #include <stdlib.h>
  4. #include <string.h>
  5. #include <stdio.h>
  6. #include <vector>
  7. #define C_ENCODER_NameLen 1024
  8. struct T_EncoderIOVals {
  9. unsigned int output_bitRate;
  10. };
  11. struct T_ATTRIB {
  12. char Text[256];
  13. void *OutputVals;
  14. };
  15. class C_ENCODER {
  16. private:
  17. char Name[C_ENCODER_NameLen];
  18. std::vector<T_ATTRIB*> AttribList;
  19. protected:
  20. T_EncoderIOVals *ExtendedInfoPtr;
  21. int ExtendedInfoSize;
  22. void SetName(const char *name);
  23. void ClearAttribs();
  24. void AddAttrib(const char *Text, const void *Attributes);
  25. public:
  26. C_ENCODER(int ExtInfoSize = 0);
  27. virtual ~C_ENCODER();
  28. virtual void ChangeSettings(const void *Settings);
  29. virtual void Create(const T_EncoderIOVals *Settings, const char *name = NULL);
  30. virtual void Close();
  31. virtual void Reset();
  32. virtual char *GetName();
  33. virtual void *GetExtInfo(int *ExtInfoSize = NULL) {
  34. if(ExtInfoSize != NULL) *ExtInfoSize = ExtendedInfoSize;
  35. return ExtendedInfoPtr;
  36. }
  37. virtual char * GetContentType();
  38. virtual int Encode(const void *inputbuf, const unsigned int inputbufsize, void *outputbuf, const unsigned int outputbufsize, int *inputamtused); /* all values are in BYTES! */
  39. virtual int GetNumAttribs();
  40. virtual int EnumAttrib(const int val, T_ATTRIB *buf);
  41. virtual bool UseNsvConfig() { return false; }
  42. };
  43. #endif /* !__C_ENCODER_H__ */