1
0

factory_alac.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* copyright 2006 Ben Allison */
  2. #include "factory_alac.h"
  3. #include "ALACMP4Decoder.h"
  4. static const char serviceName[] = "ALAC Decoder";
  5. static const char testString[] = "alac";
  6. // {47ADFABA-BDB5-4e2e-A91F-BC184C123DE9}
  7. static const GUID api_downloads_GUID= { 0x47adfaba, 0xbdb5, 0x4e2e, { 0xa9, 0x1f, 0xbc, 0x18, 0x4c, 0x12, 0x3d, 0xe9 } };
  8. FOURCC ALACFactory::GetServiceType()
  9. {
  10. return WaSvc::MP4AUDIODECODER;
  11. }
  12. const char *ALACFactory::GetServiceName()
  13. {
  14. return serviceName;
  15. }
  16. GUID ALACFactory::GetGUID()
  17. {
  18. return api_downloads_GUID;
  19. }
  20. void *ALACFactory::GetInterface(int global_lock)
  21. {
  22. MP4AudioDecoder *ifc=new ALACMP4Decoder;
  23. // if (global_lock)
  24. // WASABI_API_SVC->service_lock(this, (void *)ifc);
  25. return ifc;
  26. }
  27. int ALACFactory::SupportNonLockingInterface()
  28. {
  29. return 1;
  30. }
  31. int ALACFactory::ReleaseInterface(void *ifc)
  32. {
  33. //WASABI_API_SVC->service_unlock(ifc);
  34. MP4AudioDecoder *decoder = static_cast<MP4AudioDecoder *>(ifc);
  35. ALACMP4Decoder *aacPlusDecoder = static_cast<ALACMP4Decoder *>(decoder);
  36. delete aacPlusDecoder;
  37. return 1;
  38. }
  39. const char *ALACFactory::GetTestString()
  40. {
  41. return testString;
  42. }
  43. int ALACFactory::ServiceNotify(int msg, int param1, int param2)
  44. {
  45. return 1;
  46. }
  47. #ifdef CBCLASS
  48. #undef CBCLASS
  49. #endif
  50. #define CBCLASS ALACFactory
  51. START_DISPATCH;
  52. CB( WASERVICEFACTORY_GETSERVICETYPE, GetServiceType )
  53. CB( WASERVICEFACTORY_GETSERVICENAME, GetServiceName )
  54. CB( WASERVICEFACTORY_GETGUID, GetGUID )
  55. CB( WASERVICEFACTORY_GETINTERFACE, GetInterface )
  56. CB( WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface )
  57. CB( WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface )
  58. CB( WASERVICEFACTORY_GETTESTSTRING, GetTestString )
  59. CB( WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify )
  60. END_DISPATCH;