plugin_audio_dsp_mediabuffer.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copyright (C) 2013 Mamadou DIOP
  2. * Copyright (C) 2013 Doubango Telecom <http://www.doubango.org>
  3. *
  4. * This file is part of Open Source Doubango Framework.
  5. *
  6. * DOUBANGO is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * DOUBANGO is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with DOUBANGO.
  18. */
  19. #ifndef PLUGIN_AUDIO_DSP_MEDIABUFFER_H
  20. #define PLUGIN_AUDIO_DSP_MEDIABUFFER_H
  21. #include "plugin_audio_dsp_config.h"
  22. #include <dmo.h>
  23. class AudioDSPMediaBuffer : public IMediaBuffer
  24. {
  25. private:
  26. DWORD m_cbLength;
  27. const DWORD m_cbMaxLength;
  28. LONG m_nRefCount; // Reference count
  29. BYTE *m_pbData;
  30. AudioDSPMediaBuffer(DWORD cbMaxLength, HRESULT& hr);
  31. ~AudioDSPMediaBuffer();
  32. public:
  33. static HRESULT Create(long cbMaxLen, IMediaBuffer **ppBuffer);
  34. // IUnknown methods.
  35. STDMETHODIMP QueryInterface(REFIID riid, void **ppv);
  36. STDMETHODIMP_(ULONG) AddRef();
  37. STDMETHODIMP_(ULONG) Release();
  38. // IMediaBuffer methods.
  39. STDMETHODIMP SetLength(DWORD cbLength);
  40. STDMETHODIMP GetMaxLength(DWORD *pcbMaxLength);
  41. STDMETHODIMP GetBufferAndLength(BYTE **ppbBuffer, DWORD *pcbLength);
  42. };
  43. #endif /* PLUGIN_AUDIO_DSP_MEDIABUFFER_H */