Add some metadata keys that will be used in the future.
This commit is contained in:
1 parent
a98e085a9f
commit
9e4658acb2
6 files changed
+100
-8
No files matched your search
@@ -396,11 +396,12 @@
|
||||
MP42MetadataKeyAppleID, AVMetadataiTunesMetadataKeyAppleID,
|
||||
MP42MetadataKeyArtistID, AVMetadataiTunesMetadataKeyArtistID,
|
||||
MP42MetadataKeyContentID, AVMetadataiTunesMetadataKeySongID,
|
||||
@"Compilation", AVMetadataiTunesMetadataKeyDiscCompilation,
|
||||
MP42MetadataKeyDiscCompilation, AVMetadataiTunesMetadataKeyDiscCompilation,
|
||||
MP42MetadataKeyDiscNumber, AVMetadataiTunesMetadataKeyDiscNumber,
|
||||
MP42MetadataKeyGenreID, AVMetadataiTunesMetadataKeyGenreID,
|
||||
MP42MetadataKeyGrouping, AVMetadataiTunesMetadataKeyGrouping,
|
||||
MP42MetadataKeyPlaylistID, AVMetadataiTunesMetadataKeyPlaylistID,
|
||||
MP42MetadataKeyXID, @"xid ",
|
||||
MP42MetadataKeyContentRating, AVMetadataiTunesMetadataKeyContentRating,
|
||||
MP42MetadataKeyRating, @"com.apple.iTunes.iTunEXTC",
|
||||
MP42MetadataKeyBeatsPerMin, AVMetadataiTunesMetadataKeyBeatsPerMin,
|
||||
@@ -415,14 +416,14 @@
|
||||
MP42MetadataKeyDescription, @"desc",
|
||||
MP42MetadataKeyLongDescription, @"ldes",
|
||||
MP42MetadataKeySeriesDescription, @"sdes",
|
||||
@"Media Kind", @"stik",
|
||||
MP42MetadataKeyMediaKind, @"stik",
|
||||
MP42MetadataKeyTVShow, @"tvsh",
|
||||
MP42MetadataKeyTVEpisodeNumber, @"tves",
|
||||
MP42MetadataKeyTVNetwork, @"tvnn",
|
||||
MP42MetadataKeyTVEpisodeID, @"tven",
|
||||
MP42MetadataKeyTVSeason, @"tvsn",
|
||||
@"HD Video", @"hdvd",
|
||||
@"Gapless", @"pgap",
|
||||
MP42MetadataKeyHDVideo, @"hdvd",
|
||||
MP42MetadataKeyGapless, @"pgap",
|
||||
MP42MetadataKeySortName, @"sonm",
|
||||
MP42MetadataKeySortArtist, @"soar",
|
||||
MP42MetadataKeySortAlbumArtist, @"soaa",
|
||||
@@ -430,7 +431,7 @@
|
||||
MP42MetadataKeySortComposer, @"soco",
|
||||
MP42MetadataKeySortTVShow, @"sosn",
|
||||
MP42MetadataKeyCategory, @"catg",
|
||||
@"iTunes U", @"itnu",
|
||||
MP42MetadataKeyiTunesU, @"itnu",
|
||||
MP42MetadataKeyPurchasedDate, @"purd",
|
||||
MP42MetadataKeyDirector, AVMetadataiTunesMetadataKeyDirector,
|
||||
//AVMetadataiTunesMetadataKeyEQ,
|
||||
|
||||
+7
-2
@@ -49,6 +49,13 @@ extern NSString *const MP42MetadataKeyContentRating;
|
||||
extern NSString *const MP42MetadataKeyEncodedBy;
|
||||
extern NSString *const MP42MetadataKeyEncodingTool;
|
||||
|
||||
// TODO
|
||||
extern NSString *const MP42MetadataKeyCoverArt;
|
||||
extern NSString *const MP42MetadataKeyMediaKind;
|
||||
extern NSString *const MP42MetadataKeyGapless;
|
||||
extern NSString *const MP42MetadataKeyHDVideo;
|
||||
extern NSString *const MP42MetadataKeyiTunesU;
|
||||
|
||||
// Movie and TV Show Specific keys
|
||||
extern NSString *const MP42MetadataKeyStudio;
|
||||
extern NSString *const MP42MetadataKeyCast;
|
||||
@@ -104,8 +111,6 @@ extern NSString *const MP42MetadataKeyAccountCountry;
|
||||
extern NSString *const MP42MetadataKeyPurchasedDate;
|
||||
extern NSString *const MP42MetadataKeyOnlineExtras;
|
||||
|
||||
extern NSString *const MP42MetadataKeyCoverArt; // TO-DO
|
||||
|
||||
// Sort Metadata Keys
|
||||
extern NSString *const MP42MetadataKeySortName;
|
||||
extern NSString *const MP42MetadataKeySortArtist;
|
||||
|
||||
+7
-1
@@ -48,6 +48,12 @@ NSString *const MP42MetadataKeyContentRating = @"Content Rating";
|
||||
NSString *const MP42MetadataKeyEncodedBy = @"Encoded By";
|
||||
NSString *const MP42MetadataKeyEncodingTool = @"Encoding Tool";
|
||||
|
||||
NSString *const MP42MetadataKeyCoverArt = @"Cover Art";
|
||||
NSString *const MP42MetadataKeyMediaKind = @"Media Kind";
|
||||
NSString *const MP42MetadataKeyGapless = @"Gapless";
|
||||
NSString *const MP42MetadataKeyHDVideo = @"HD Video";
|
||||
NSString *const MP42MetadataKeyiTunesU = @"iTunes U";
|
||||
|
||||
NSString *const MP42MetadataKeyStudio = @"Studio";
|
||||
NSString *const MP42MetadataKeyCast = @"Cast";
|
||||
NSString *const MP42MetadataKeyDirector = @"Director";
|
||||
@@ -78,6 +84,7 @@ NSString *const MP42MetadataKeyPerformer = @"Performer";
|
||||
NSString *const MP42MetadataKeyPublisher = @"Publisher";
|
||||
NSString *const MP42MetadataKeySoundEngineer = @"Sound Engineer";
|
||||
NSString *const MP42MetadataKeySoloist = @"Soloist";
|
||||
NSString *const MP42MetadataKeyDiscCompilation = @"Compilation";
|
||||
|
||||
NSString *const MP42MetadataKeyWorkName = @"Work Name";
|
||||
NSString *const MP42MetadataKeyMovementName = @"Movement Name";
|
||||
@@ -1489,7 +1496,6 @@ static const genreType_t genreType_strings[] = {
|
||||
MP4TagsFree(tags);
|
||||
|
||||
// Rewrite extended metadata using the generic iTMF api
|
||||
|
||||
if (tagsDict[MP42MetadataKeyRating]) {
|
||||
|
||||
MP4ItmfItemList *list = MP4ItmfGetItemsByMeaning(fileHandle, "com.apple.iTunes", "iTunEXTC");
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// MP42MetadataItem.h
|
||||
// MP42Foundation
|
||||
//
|
||||
// Created by Damiano Galassi on 25/08/2016.
|
||||
// Copyright © 2016 Damiano Galassi. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef NS_ENUM(NSUInteger, MP42MetadataItemDataType) {
|
||||
MP42MetadataItemDataTypeString,
|
||||
MP42MetadataItemDataTypeBool,
|
||||
MP42MetadataItemDataTypeInteger,
|
||||
MP42MetadataItemDataTypePlist,
|
||||
MP42MetadataItemDataTypeImage,
|
||||
};
|
||||
|
||||
@interface MP42MetadataItem : NSObject
|
||||
|
||||
/* Indicates the identifier of the metadata item. Publicly defined identifiers are declared in AVMetadataIdentifiers.h. */
|
||||
@property (nonatomic, readonly, copy) NSString *identifier;
|
||||
|
||||
/* indicates the IETF BCP 47 (RFC 4646) language identifier of the metadata item; may be nil if no language tag information is available */
|
||||
@property (nonatomic, readonly, copy, nullable) NSString *extendedLanguageTag;
|
||||
|
||||
/* provides the value of the metadata item */
|
||||
@property (nonatomic, readonly, copy, nullable) id<NSObject, NSCopying> value;
|
||||
|
||||
/* indicates the data type of the metadata item's value. */
|
||||
@property (nonatomic, readonly) MP42MetadataItemDataType dataType;
|
||||
|
||||
@end
|
||||
|
||||
@interface MP42MetadataItem (MP42MetadataItemTypeCoercion)
|
||||
|
||||
/* provides the value of the metadata item as a string; will be nil if the value cannot be represented as a string */
|
||||
@property (nonatomic, readonly, nullable) NSString *stringValue;
|
||||
|
||||
/* provides the value of the metadata item as an NSNumber. If the metadata item's value can't be coerced to a number, @"numberValue" will be nil. */
|
||||
@property (nonatomic, readonly, nullable) NSNumber *numberValue;
|
||||
|
||||
/* provides the value of the metadata item as an NSDate. If the metadata item's value can't be coerced to a date, @"dateValue" will be nil. */
|
||||
@property (nonatomic, readonly, nullable) NSDate *dateValue;
|
||||
|
||||
/* provides the raw bytes of the value of the metadata item */
|
||||
@property (nonatomic, readonly, nullable) NSData *dataValue;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MP42MetadataItem.m
|
||||
// MP42Foundation
|
||||
//
|
||||
// Created by Damiano Galassi on 25/08/2016.
|
||||
// Copyright © 2016 Damiano Galassi. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MP42MetadataItem.h"
|
||||
|
||||
@implementation MP42MetadataItem
|
||||
|
||||
@end
|
||||
@@ -7,6 +7,10 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
A9022A941D6F3FD9005F0920 /* MP42MetadataItem.h in Headers */ = {isa = PBXBuildFile; fileRef = A9022A921D6F3FD9005F0920 /* MP42MetadataItem.h */; };
|
||||
A9022A951D6F3FD9005F0920 /* MP42MetadataItem.h in Headers */ = {isa = PBXBuildFile; fileRef = A9022A921D6F3FD9005F0920 /* MP42MetadataItem.h */; };
|
||||
A9022A961D6F3FD9005F0920 /* MP42MetadataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A9022A931D6F3FD9005F0920 /* MP42MetadataItem.m */; };
|
||||
A9022A971D6F3FD9005F0920 /* MP42MetadataItem.m in Sources */ = {isa = PBXBuildFile; fileRef = A9022A931D6F3FD9005F0920 /* MP42MetadataItem.m */; };
|
||||
A90800FD1D4B82E8002B6950 /* libmp4v2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A99DB6A41D4648A800C6E56C /* libmp4v2.a */; };
|
||||
A90800FE1D4B82FB002B6950 /* libjpeg.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A99DB6A61D4648B700C6E56C /* libjpeg.a */; };
|
||||
A90800FF1D4B82FB002B6950 /* liblept.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A99DB6A71D4648B700C6E56C /* liblept.a */; };
|
||||
@@ -273,6 +277,8 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
A9022A921D6F3FD9005F0920 /* MP42MetadataItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42MetadataItem.h; sourceTree = "<group>"; };
|
||||
A9022A931D6F3FD9005F0920 /* MP42MetadataItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MP42MetadataItem.m; sourceTree = "<group>"; };
|
||||
A90801051D4B830A002B6950 /* libavfilter.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavfilter.a; path = contrib/ffmpeg/lib/libavfilter.a; sourceTree = "<group>"; };
|
||||
A90801061D4B830A002B6950 /* libavformat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libavformat.a; path = contrib/ffmpeg/lib/libavformat.a; sourceTree = "<group>"; };
|
||||
A908010C1D4B83A3002B6950 /* MP42AudioDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MP42AudioDecoder.h; sourceTree = "<group>"; };
|
||||
@@ -554,6 +560,8 @@
|
||||
A9B9C22C1823923100416A4E /* MP42ClosedCaptionTrack.m */,
|
||||
A9B9C23C1823923100416A4E /* MP42Metadata.h */,
|
||||
A9B9C23D1823923100416A4E /* MP42Metadata.m */,
|
||||
A9022A921D6F3FD9005F0920 /* MP42MetadataItem.h */,
|
||||
A9022A931D6F3FD9005F0920 /* MP42MetadataItem.m */,
|
||||
A96D28921BAD390400403327 /* MP42Metadata+Private.h */,
|
||||
A9B9C23A1823923100416A4E /* MP42MediaFormat.h */,
|
||||
A9B9C23B1823923100416A4E /* MP42MediaFormat.m */,
|
||||
@@ -744,6 +752,7 @@
|
||||
A9AEFE161B9B111B00771292 /* MP42FileImporter+Private.h in Headers */,
|
||||
A96523461BAC315900E994E0 /* NSString+MP42Additions.h in Headers */,
|
||||
A908011A1D4B83A3002B6950 /* MP42AudioUnit.h in Headers */,
|
||||
A9022A951D6F3FD9005F0920 /* MP42MetadataItem.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -774,6 +783,7 @@
|
||||
A9B9C2AA1823923200416A4E /* MatroskaParser.h in Headers */,
|
||||
A9B9C26E1823923200416A4E /* MP42AVFImporter.h in Headers */,
|
||||
A9B9C2791823923200416A4E /* MP42Fifo.h in Headers */,
|
||||
A9022A941D6F3FD9005F0920 /* MP42MetadataItem.h in Headers */,
|
||||
A9AEFE151B9B111B00771292 /* MP42FileImporter+Private.h in Headers */,
|
||||
A9B9C2A31823923200416A4E /* MP42XMLReader.h in Headers */,
|
||||
A90801151D4B83A3002B6950 /* MP42AudioEncoder.h in Headers */,
|
||||
@@ -963,6 +973,7 @@
|
||||
A910B5C818394EB20064028F /* MP42Track.m in Sources */,
|
||||
A910B5CA18394EB20064028F /* MP42VideoTrack.m in Sources */,
|
||||
A910B5CC18394EB20064028F /* MP42AudioTrack.m in Sources */,
|
||||
A9022A971D6F3FD9005F0920 /* MP42MetadataItem.m in Sources */,
|
||||
A910B5CE18394EB20064028F /* MP42ChapterTrack.m in Sources */,
|
||||
A910B5D018394EB20064028F /* MP42SubtitleTrack.m in Sources */,
|
||||
A910B5D218394EB20064028F /* MP42ClosedCaptionTrack.m in Sources */,
|
||||
@@ -1018,6 +1029,7 @@
|
||||
A9B9C27A1823923200416A4E /* MP42Fifo.m in Sources */,
|
||||
A9B9C2801823923200416A4E /* MP42H264Importer.mm in Sources */,
|
||||
A9B9C26B1823923200416A4E /* MP42AudioConverter.m in Sources */,
|
||||
A9022A961D6F3FD9005F0920 /* MP42MetadataItem.m in Sources */,
|
||||
A9B9C2961823923200416A4E /* MP42SrtImporter.m in Sources */,
|
||||
A9B9C2AB1823923200416A4E /* mbs.cpp in Sources */,
|
||||
A9B9C2AE1823923200416A4E /* sfifo.c in Sources */,
|
||||
|
||||
Reference in new issue
Block a user