DSFrameRateFilter.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright (C) 2011-2013 Doubango Telecom <http://www.doubango.org>
  2. *
  3. * This file is part of Open Source Doubango Framework.
  4. *
  5. * DOUBANGO is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * DOUBANGO is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with DOUBANGO.
  17. */
  18. #ifndef PLUGIN_DSHOW_DSFRAMERATEFILTER_H
  19. #define PLUGIN_DSHOW_DSFRAMERATEFILTER_H
  20. #include "plugin_dshow_config.h"
  21. #include <streams.h>
  22. #include <math.h>
  23. class DSFrameRateFilter : public CTransInPlaceFilter
  24. {
  25. public:
  26. DSFrameRateFilter(TCHAR *tszName, LPUNKNOWN punk, HRESULT *phr);
  27. ~DSFrameRateFilter(void);
  28. public:
  29. HRESULT Transform(IMediaSample *pSample);
  30. HRESULT CheckInputType(const CMediaType* mtIn);
  31. public:
  32. /**
  33. * \def SetFps
  34. * \brief fps1 define source .
  35. */
  36. HRESULT SetFps(int inputFps, int outputFps);
  37. static CUnknown *WINAPI CreateInstance(LPUNKNOWN punk, HRESULT *phr);
  38. DECLARE_IUNKNOWN;
  39. /*STDMETHODIMP_(ULONG) NonDelegatingRelease()
  40. {
  41. if(InterlockedDecrement(&m_cRef) == 0)
  42. {
  43. delete this;
  44. return 0;
  45. }
  46. return m_cRef;
  47. }*/
  48. private:
  49. int m_progress;
  50. int m_inputFps, m_outputFps;
  51. bool m_bProcessFrame;
  52. REFERENCE_TIME m_rtFrameLength; // UNITS/fps
  53. LONGLONG m_iFrameNumber;
  54. };
  55. #endif ////DSFrameRateFilter_H