svc_nsvFactory.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef NULLSOFT_NSV_SVC_NSVFACTORY_H
  2. #define NULLSOFT_NSV_SVC_NSVFACTORY_H
  3. #include <bfc/Dispatch.h>
  4. #include <bfc/platform/types.h>
  5. #include <api/service/services.h>
  6. class IAudioDecoder;
  7. class IVideoDecoder;
  8. class IAudioOutput;
  9. /*
  10. **********************************************************************
  11. * Important Note! *
  12. * *
  13. * *
  14. * Objects created by this class are allocated using api_memmgr *
  15. * You MUST call api_memmgr::Delete() to delete these objects. *
  16. * Do not use the C++ delete operator *
  17. * as the memory was allocated with a different heap / malloc arena *
  18. * *
  19. **********************************************************************
  20. */
  21. class svc_nsvFactory : public Dispatchable
  22. {
  23. protected:
  24. svc_nsvFactory(){}
  25. ~svc_nsvFactory(){}
  26. public:
  27. virtual IAudioDecoder *CreateAudioDecoder(FOURCC format, IAudioOutput **output);
  28. IVideoDecoder *CreateVideoDecoder(int w, int h, double framerate, unsigned int fmt, int *flip);
  29. public:
  30. DISPATCH_CODES
  31. {
  32. SVC_NSVFACTORY_CREATEAUDIODECODER=10,
  33. SVC_NSVFACTORY_CREATEVIDEODECODER=20,
  34. };
  35. static FOURCC getServiceType() { return WaSvc::NSVFACTORY; }
  36. };
  37. inline IAudioDecoder *svc_nsvFactory::CreateAudioDecoder(FOURCC format, IAudioOutput **output)
  38. {
  39. return _call(SVC_NSVFACTORY_CREATEAUDIODECODER, (IAudioDecoder *)0, format, output);
  40. }
  41. inline IVideoDecoder *svc_nsvFactory::CreateVideoDecoder(int w, int h, double framerate, unsigned int fmt, int *flip)
  42. {
  43. return _call(SVC_NSVFACTORY_CREATEVIDEODECODER, (IVideoDecoder *)0, w, h, framerate, fmt, flip);
  44. }
  45. #endif