- MP42Ebml: EBML vint/ID primitives, flat Segment scanner, block track number decoding, and element builders shared by all Matroska writers. - MP42MkvImporter / MP42FileImporter: tagsOnly mode that mirrors the file's own track flags instead of the MP4 conversion heuristics. - MP42MatroskaTagMapping: read/write SimpleTag maps shared by importer and writer, including community names for MP4-only movie fields. - MP42MkvTagWriter: mkvpropedit-style in-place rewrite of Tags, cover art, and per-track name/language/enabled/forced fields with a size+mtime staleness guard; an untouched save is a byte-for-byte no-op. - MP42MkvRemuxer: stream-copy rebuild that drops the blocks of removed tracks (TrackNumbers keep their gaps; block bytes are never rewritten), regenerates SeekHead and Cues, carries metadata edits in the same pass, and writes via temp file + atomic rename. - MP42MkvTagWriter+Internal.h exposes the tag writer's scanning and payload builders so the remuxer reuses them unchanged. Verified with the external matrix harness: 241 assertions green across layout fixtures (ffmpeg/mkvmerge/streamed), removal scenarios, cue parity, and idempotency. Co-Authored-By: Claude Code <noreply@anthropic.com>
53 lines
1.6 KiB
Objective-C
53 lines
1.6 KiB
Objective-C
//
|
|
// MP42Track+Private.h
|
|
// MP42Foundation
|
|
//
|
|
// Created by Damiano Galassi on 19/09/15.
|
|
// Copyright © 2022 Damiano Galassi. All rights reserved.
|
|
//
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@class MP42FileImporter;
|
|
@class MP42SampleBuffer;
|
|
@protocol MP42ConverterProtocol;
|
|
|
|
@interface MP42Track (Private)
|
|
|
|
- (instancetype)initWithSourceURL:(NSURL *)URL trackID:(MP42TrackId)trackID fileHandle:(MP42FileHandle)fileHandle;
|
|
- (BOOL)writeToFile:(MP42FileHandle)fileHandle error:(NSError * __autoreleasing *)outError;
|
|
|
|
// Localized media-type label ("Video", "Sound", …) shown when the container
|
|
// carries no explicit track name.
|
|
- (NSString *)defaultName;
|
|
|
|
// trackId is readwrite in the public header
|
|
@property(nonatomic, readwrite) MP42TrackId sourceId;
|
|
|
|
@property(nonatomic, readwrite, copy, nullable) NSURL *URL;
|
|
|
|
@property(nonatomic, readonly) MP42CodecType targetFormat;
|
|
@property(nonatomic, readwrite) MP42CodecType format;
|
|
@property(nonatomic, readwrite) MP42MediaType mediaType;
|
|
|
|
@property(nonatomic, readwrite) NSArray<MP42SampleDescription *> *sampleDescriptions;
|
|
|
|
@property(nonatomic, readwrite) uint32_t timescale;
|
|
@property(nonatomic, readwrite) MP42Duration duration;
|
|
@property(nonatomic, readwrite) uint32_t bitrate;
|
|
@property(nonatomic, readwrite) uint64_t dataLength;
|
|
|
|
@property(nonatomic, readwrite, getter=isEdited) BOOL edited;
|
|
@property(nonatomic, readwrite) BOOL muxed;
|
|
|
|
@property(nonatomic, readonly) NSMutableDictionary<NSString *, NSNumber *> *updatedProperty;
|
|
|
|
@property (nonatomic, readwrite, nullable) MP42FileImporter *importer;
|
|
@property (nonatomic, readwrite, nullable) id <MP42ConverterProtocol> converter;
|
|
|
|
- (void)startReading;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|