MP4MetadataService.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "metadata/svc_metadata.h"
  3. #include "file/svc_filemetadata.h"
  4. #include "nswasabi/ServiceName.h"
  5. #include "MP4MetadataFile.h"
  6. #include "nswasabi/MetadataChain.h"
  7. #include "nx/nxonce.h"
  8. // {71102FF2-D9CF-4a0e-9C83-858E80B65DD4}
  9. static const GUID mp4_metadata_guid =
  10. { 0x71102ff2, 0xd9cf, 0x4a0e, { 0x9c, 0x83, 0x85, 0x8e, 0x80, 0xb6, 0x5d, 0xd4 } };
  11. class MP4MetadataService : public svc_metadata
  12. {
  13. public:
  14. WASABI_SERVICE_NAME("MP4 Metadata");
  15. WASABI_SERVICE_GUID(mp4_metadata_guid);
  16. MP4MetadataService();
  17. static nx_once_value_t mime_once;
  18. private:
  19. int WASABICALL MetadataService_EnumerateExtensions(unsigned int index, nx_string_t *extension);
  20. int WASABICALL MetadataService_CreateMetadata(unsigned int pass, nx_uri_t filename, ifc_metadata **metadata);
  21. int WASABICALL MetadataService_CreateMetadataEditor(unsigned int pass, nx_uri_t filename, ifc_metadata_editor **metadata);
  22. };
  23. // {F3AD1E12-345C-4E00-83C1-4DAB2D88BF4F}
  24. static const GUID mp4_file_metadata_guid =
  25. { 0xf3ad1e12, 0x345c, 0x4e00, { 0x83, 0xc1, 0x4d, 0xab, 0x2d, 0x88, 0xbf, 0x4f } };
  26. class MP4FileMetadataService : public svc_filemetadata
  27. {
  28. public:
  29. WASABI_SERVICE_NAME("MP4 File Metadata");
  30. WASABI_SERVICE_GUID(mp4_file_metadata_guid);
  31. private:
  32. int WASABICALL FileMetadataService_EnumerateExtensions(unsigned int index, nx_string_t *extension);
  33. int WASABICALL FileMetadataService_CreateFileMetadata(ifc_metadata **file_metadata, nx_uri_t filename, nx_file_t file, ifc_metadata *parent_metadata);
  34. };
  35. class MP4FileMetadata : public MetadataChain<MP4MetadataFile>
  36. {
  37. public:
  38. MP4FileMetadata();
  39. ~MP4FileMetadata();
  40. ns_error_t Initialize(nx_uri_t filename, nx_file_t file, ifc_metadata *parent_metadata);
  41. };