1
0

mp4.cpp 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "vlb_sub/aacdecoder.h"
  2. #include "vlbout.h"
  3. void CStreamInfo::setSampleRate()
  4. {
  5. SetSamplingRate(CChannelInfo::SamplingRateFromIndex(GetSamplingRateIndex ()));
  6. }
  7. #ifndef ACTIVEX_CONTROL
  8. //methods used by in_mp4
  9. extern "C"
  10. {
  11. __declspec( dllexport ) int aacGetBitBuffer()
  12. {
  13. return (int) new CBitBuffer;
  14. }
  15. __declspec( dllexport ) int aacGetDecoderInterfaces(CAacDecoder **decoder, CBitBuffer *buf, CStreamInfo **info, VLBOut **dataout)
  16. {
  17. *decoder=new CAacDecoder(*buf);
  18. *info=new CStreamInfo;
  19. *dataout=new VLBOut();
  20. return 1;
  21. }
  22. __declspec( dllexport ) void aacDeleteBitBuffer(CBitBuffer *bitBuffer)
  23. {
  24. if (bitBuffer)
  25. delete bitBuffer;
  26. }
  27. __declspec( dllexport ) void aacDeleteDecoderInterfaces(CAacDecoder *decoder, CStreamInfo *info, VLBOut *dataout)
  28. {
  29. if (decoder)
  30. delete decoder;
  31. if (info)
  32. delete info;
  33. if (dataout)
  34. delete dataout;
  35. }
  36. }
  37. #endif