1
0

MP4Factory.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #include "api__mp3-mpg123.h"
  2. #include "MP4Factory.h"
  3. #include "mp3_in_mp4.h"
  4. static const char serviceName[] = "MP4 MP3 Decoder";
  5. static const char testString[] = "mp4a";
  6. // {ADBFEC60-41B4-4903-980B-0FA7E33D3567}
  7. static const GUID MPEG4_MP3_GUID =
  8. { 0xadbfec60, 0x41b4, 0x4903, { 0x98, 0xb, 0xf, 0xa7, 0xe3, 0x3d, 0x35, 0x67 } };
  9. FOURCC MPEG4Factory::GetServiceType()
  10. {
  11. return WaSvc::MP4AUDIODECODER;
  12. }
  13. const char *MPEG4Factory::GetServiceName()
  14. {
  15. return serviceName;
  16. }
  17. GUID MPEG4Factory::GetGUID()
  18. {
  19. return MPEG4_MP3_GUID;
  20. }
  21. void *MPEG4Factory::GetInterface(int global_lock)
  22. {
  23. return new MPEG4_MP3;
  24. }
  25. int MPEG4Factory::SupportNonLockingInterface()
  26. {
  27. return 1;
  28. }
  29. int MPEG4Factory::ReleaseInterface(void *ifc)
  30. {
  31. //plugin.service->service_unlock(ifc);
  32. MP4AudioDecoder *decoder = static_cast<MP4AudioDecoder *>(ifc);
  33. MPEG4_MP3 *mp3Decoder = static_cast<MPEG4_MP3 *>(decoder);
  34. delete mp3Decoder;
  35. return 1;
  36. }
  37. const char *MPEG4Factory::GetTestString()
  38. {
  39. return testString;
  40. }
  41. int MPEG4Factory::ServiceNotify(int msg, int param1, int param2)
  42. {
  43. return 1;
  44. }
  45. #ifdef CBCLASS
  46. #undef CBCLASS
  47. #endif
  48. #define CBCLASS MPEG4Factory
  49. START_DISPATCH;
  50. CB(WASERVICEFACTORY_GETSERVICETYPE, GetServiceType)
  51. CB(WASERVICEFACTORY_GETSERVICENAME, GetServiceName)
  52. CB(WASERVICEFACTORY_GETGUID, GetGUID)
  53. CB(WASERVICEFACTORY_GETINTERFACE, GetInterface)
  54. CB(WASERVICEFACTORY_SUPPORTNONLOCKINGGETINTERFACE, SupportNonLockingInterface)
  55. CB(WASERVICEFACTORY_RELEASEINTERFACE, ReleaseInterface)
  56. CB(WASERVICEFACTORY_GETTESTSTRING, GetTestString)
  57. CB(WASERVICEFACTORY_SERVICENOTIFY, ServiceNotify)
  58. END_DISPATCH;