From e4d2ecbb3f8c27c4a3151f3d3f49a1dd1988be95 Mon Sep 17 00:00:00 2001 From: Single Date: Wed, 11 Sep 2019 18:43:02 +0800 Subject: [PATCH] Update Doc. --- SGPlayer/Classes/Core/SGAsset/SGAsset.h | 8 +++ .../Classes/Core/SGAsset/SGMutableAsset.h | 14 +++-- .../Classes/Core/SGAsset/SGMutableTrack.h | 12 ++-- .../Classes/Core/SGAsset/SGPaddingSegment.h | 6 +- SGPlayer/Classes/Core/SGAsset/SGSegment.h | 15 ++--- SGPlayer/Classes/Core/SGAsset/SGTrack.h | 15 ++--- .../Classes/Core/SGAsset/SGTrackSelection.h | 15 ++--- SGPlayer/Classes/Core/SGAsset/SGURLAsset.h | 15 ++--- SGPlayer/Classes/Core/SGAsset/SGURLSegment.h | 25 +++++--- SGPlayer/Classes/Core/SGCommon/SGError.h | 13 ----- SGPlayer/Classes/Core/SGCommon/SGTime.h | 29 ---------- SGPlayer/Classes/Core/SGData/SGCapacity.h | 26 --------- .../Classes/Core/SGDemuxer/SGURLDemuxer.h | 15 ++--- .../Core/SGDescription/SGAudioDescriptor.h | 57 +++++++++++++------ .../Core/SGDescription/SGVideoDescriptor.h | 45 +++++++++++---- 15 files changed, 158 insertions(+), 152 deletions(-) diff --git a/SGPlayer/Classes/Core/SGAsset/SGAsset.h b/SGPlayer/Classes/Core/SGAsset/SGAsset.h index c71209f3..3cb7f372 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGAsset.h +++ b/SGPlayer/Classes/Core/SGAsset/SGAsset.h @@ -8,6 +8,14 @@ #import +/*! + @class SGAsset + @abstract + Abstract class for asset. + + @discussion + Use SGURLAsset or SGMutableAsset. + */ @interface SGAsset : NSObject @end diff --git a/SGPlayer/Classes/Core/SGAsset/SGMutableAsset.h b/SGPlayer/Classes/Core/SGAsset/SGMutableAsset.h index 45121a52..0131bdfa 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGMutableAsset.h +++ b/SGPlayer/Classes/Core/SGAsset/SGMutableAsset.h @@ -12,13 +12,17 @@ @interface SGMutableAsset : SGAsset -/** - * - */ +/*! + @property tracks + @abstract + Provides array of SGMutableAsset tracks. +*/ @property (nonatomic, copy, readonly) NSArray *tracks; -/** - * +/*! + @method addTrack: + @abstract + Add a track to the asset. */ - (SGMutableTrack *)addTrack:(SGMediaType)type; diff --git a/SGPlayer/Classes/Core/SGAsset/SGMutableTrack.h b/SGPlayer/Classes/Core/SGAsset/SGMutableTrack.h index 71e8da4d..efbddcb6 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGMutableTrack.h +++ b/SGPlayer/Classes/Core/SGAsset/SGMutableTrack.h @@ -12,13 +12,17 @@ @interface SGMutableTrack : SGTrack -/** - * +/*! + @property segments + @abstract + Provides array of SGMutableTrack segments. */ @property (nonatomic, copy, readonly) NSArray *segments; -/** - * +/*! + @method appendSegment: + @abstract + Append a segment to the track. */ - (BOOL)appendSegment:(SGSegment *)segment; diff --git a/SGPlayer/Classes/Core/SGAsset/SGPaddingSegment.h b/SGPlayer/Classes/Core/SGAsset/SGPaddingSegment.h index 76043774..40e0f1b4 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGPaddingSegment.h +++ b/SGPlayer/Classes/Core/SGAsset/SGPaddingSegment.h @@ -10,8 +10,10 @@ @interface SGPaddingSegment : SGSegment -/** - * +/*! + @method initWithDuration: + @abstract + Initializes an SGPaddingSegment. */ - (instancetype)initWithDuration:(CMTime)duration; diff --git a/SGPlayer/Classes/Core/SGAsset/SGSegment.h b/SGPlayer/Classes/Core/SGAsset/SGSegment.h index 68d837ad..2a752205 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGSegment.h +++ b/SGPlayer/Classes/Core/SGAsset/SGSegment.h @@ -11,19 +11,20 @@ @interface SGSegment : NSObject -/** - * - */ + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; -/** - * +/*! + @property timeRange + @abstract + Indicates the timeRange of the segment. */ @property (nonatomic, readonly) CMTimeRange timeRange; -/** - * +/*! + @property scale + @abstract + Indicates the scale of the segment. */ @property (nonatomic, readonly) CMTime scale; diff --git a/SGPlayer/Classes/Core/SGAsset/SGTrack.h b/SGPlayer/Classes/Core/SGAsset/SGTrack.h index 04bcd430..5f4a2918 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGTrack.h +++ b/SGPlayer/Classes/Core/SGAsset/SGTrack.h @@ -11,19 +11,20 @@ @interface SGTrack : NSObject -/** - * - */ + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; -/** - * +/*! + @property type + @abstract + Indicates the track media type. */ @property (nonatomic, readonly) SGMediaType type; -/** - * +/*! + @property type + @abstract + Indicates the track index. */ @property (nonatomic, readonly) NSInteger index; diff --git a/SGPlayer/Classes/Core/SGAsset/SGTrackSelection.h b/SGPlayer/Classes/Core/SGAsset/SGTrackSelection.h index 09b183ec..62b4d3b0 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGTrackSelection.h +++ b/SGPlayer/Classes/Core/SGAsset/SGTrackSelection.h @@ -9,9 +9,6 @@ #import #import "SGTrack.h" -/** - * - */ typedef NS_OPTIONS(NSUInteger, SGTrackSelectionAction) { SGTrackSelectionActionTracks = 1 << 0, SGTrackSelectionActionWeights = 1 << 1, @@ -19,13 +16,17 @@ typedef NS_OPTIONS(NSUInteger, SGTrackSelectionAction) { @interface SGTrackSelection : NSObject -/** - * +/*! + @property tracks + @abstract + Provides array of SGTrackSelection tracks. */ @property (nonatomic, copy) NSArray *tracks; -/** - * +/*! + @property weights + @abstract + Provides array of SGTrackSelection weights. */ @property (nonatomic, copy) NSArray *weights; diff --git a/SGPlayer/Classes/Core/SGAsset/SGURLAsset.h b/SGPlayer/Classes/Core/SGAsset/SGURLAsset.h index fa2aa54f..2f4e14a3 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGURLAsset.h +++ b/SGPlayer/Classes/Core/SGAsset/SGURLAsset.h @@ -10,19 +10,20 @@ @interface SGURLAsset : SGAsset -/** - * - */ + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; -/** - * +/*! + @method initWithURL: + @abstract + Initializes an SGURLAsset with an NSURL. */ - (instancetype)initWithURL:(NSURL *)URL; -/** - * +/*! + @property URL + @abstract + Indicates the URL of the asset. */ @property (nonatomic, copy, readonly) NSURL *URL; diff --git a/SGPlayer/Classes/Core/SGAsset/SGURLSegment.h b/SGPlayer/Classes/Core/SGAsset/SGURLSegment.h index 46adb778..f8bf9d2a 100644 --- a/SGPlayer/Classes/Core/SGAsset/SGURLSegment.h +++ b/SGPlayer/Classes/Core/SGAsset/SGURLSegment.h @@ -10,23 +10,32 @@ @interface SGURLSegment : SGSegment -/** - * +/*! + @method initWithURL:index: + @abstract + Equivalent: + [self initWithURL:URL index:index timeRange:kCMTimeRangeInvalid scale:kCMTimeInvalid]; */ - (instancetype)initWithURL:(NSURL *)URL index:(NSInteger)index; -/** - * +/*! + @method initWithURL:index:timeRange:scale: + @abstract + Initializes an SGURLSegment. */ - (instancetype)initWithURL:(NSURL *)URL index:(NSInteger)index timeRange:(CMTimeRange)timeRange scale:(CMTime)scale; -/** - * +/*! + @property URL + @abstract + Indicates the URL of the segment. */ @property (nonatomic, copy, readonly) NSURL *URL; -/** - * +/*! + @property type + @abstract + Indicates the index. */ @property (nonatomic, readonly) NSInteger index; diff --git a/SGPlayer/Classes/Core/SGCommon/SGError.h b/SGPlayer/Classes/Core/SGCommon/SGError.h index 2a0a379b..830983a2 100644 --- a/SGPlayer/Classes/Core/SGCommon/SGError.h +++ b/SGPlayer/Classes/Core/SGCommon/SGError.h @@ -8,9 +8,6 @@ #import -/** - * - */ typedef NS_ENUM(NSUInteger, SGErrorCode) { SGErrorCodeUnknown = 0, SGErrorImmediateExitRequested, @@ -23,9 +20,6 @@ typedef NS_ENUM(NSUInteger, SGErrorCode) { SGErrorCodeInvlidTime, }; -/** - * - */ typedef NS_ENUM(NSUInteger, SGActionCode) { SGActionCodeUnknown = 0, SGActionCodeFormatCreate, @@ -42,12 +36,5 @@ typedef NS_ENUM(NSUInteger, SGActionCode) { SGActionCodeSegmentDemuxerNext, }; -/** - * - */ NSError * SGGetFFError(int result, SGActionCode operation); - -/** - * - */ NSError * SGCreateError(NSUInteger code, SGActionCode operation); diff --git a/SGPlayer/Classes/Core/SGCommon/SGTime.h b/SGPlayer/Classes/Core/SGCommon/SGTime.h index aa045f80..7d421862 100644 --- a/SGPlayer/Classes/Core/SGCommon/SGTime.h +++ b/SGPlayer/Classes/Core/SGCommon/SGTime.h @@ -9,42 +9,13 @@ #import #import -/** - * - */ BOOL SGCMTimeIsValid(CMTime time, BOOL infinity); -/** - * - */ CMTime SGCMTimeValidate(CMTime time, CMTime defaultTime, BOOL infinity); - -/** - * - */ CMTime SGCMTimeMakeWithSeconds(Float64 seconds); - -/** - * - */ CMTime SGCMTimeMultiply(CMTime time, CMTime multiplier); - -/** - * - */ CMTime SGCMTimeDivide(CMTime time, CMTime divisor); - -/** - * - */ CMTime SGCMTimeDivide(CMTime time, CMTime divisor); -/** - * - */ CMTimeRange SGCMTimeRangeFit(CMTimeRange timeRange); - -/** - * - */ CMTimeRange SGCMTimeRangeGetIntersection(CMTimeRange timeRange1, CMTimeRange timeRange2); diff --git a/SGPlayer/Classes/Core/SGData/SGCapacity.h b/SGPlayer/Classes/Core/SGData/SGCapacity.h index df3039c5..d63a9bd6 100644 --- a/SGPlayer/Classes/Core/SGData/SGCapacity.h +++ b/SGPlayer/Classes/Core/SGData/SGCapacity.h @@ -15,37 +15,11 @@ typedef struct SGCapacity { CMTime duration; } SGCapacity; -/** - * - */ SGCapacity SGCapacityCreate(void); - -/** - * - */ SGCapacity SGCapacityAdd(SGCapacity c1, SGCapacity c2); - -/** - * - */ SGCapacity SGCapacityMinimum(SGCapacity c1, SGCapacity c2); - -/** - * - */ SGCapacity SGCapacityMaximum(SGCapacity c1, SGCapacity c2); -/** - * - */ BOOL SGCapacityIsEqual(SGCapacity c1, SGCapacity c2); - -/** - * - */ BOOL SGCapacityIsEnough(SGCapacity c1); - -/** - * - */ BOOL SGCapacityIsEmpty(SGCapacity c1); diff --git a/SGPlayer/Classes/Core/SGDemuxer/SGURLDemuxer.h b/SGPlayer/Classes/Core/SGDemuxer/SGURLDemuxer.h index 6b9cf6e2..60422f53 100644 --- a/SGPlayer/Classes/Core/SGDemuxer/SGURLDemuxer.h +++ b/SGPlayer/Classes/Core/SGDemuxer/SGURLDemuxer.h @@ -10,19 +10,20 @@ @interface SGURLDemuxer : NSObject -/** - * - */ + (instancetype)new NS_UNAVAILABLE; - (instancetype)init NS_UNAVAILABLE; -/** - * +/*! + @method initWithURL: + @abstract + Initializes an SGURLDemuxer with an NSURL. */ - (instancetype)initWithURL:(NSURL *)URL; -/** - * +/*! + @property URL + @abstract + Indicates the URL of the demuxer. */ @property (nonatomic, copy, readonly) NSURL *URL; diff --git a/SGPlayer/Classes/Core/SGDescription/SGAudioDescriptor.h b/SGPlayer/Classes/Core/SGDescription/SGAudioDescriptor.h index 3d371ef7..cc82ca00 100644 --- a/SGPlayer/Classes/Core/SGDescription/SGAudioDescriptor.h +++ b/SGPlayer/Classes/Core/SGDescription/SGAudioDescriptor.h @@ -10,48 +10,69 @@ @interface SGAudioDescriptor : NSObject -/** - * AVSampleFormat +/*! + @property format + @abstract + Indicates the audio format. + + @discussion + The value corresponds to AVSampleFormat. */ @property (nonatomic) int format; -/** - * +/*! + @property sampleRate + @abstract + Indicates the sample rate. */ @property (nonatomic) int sampleRate; -/** - * +/*! + @property numberOfChannels + @abstract + Indicates the channel count. */ @property (nonatomic) int numberOfChannels; -/** - * +/*! + @property channelLayout + @abstract + Indicates the channel layout. */ @property (nonatomic) uint64_t channelLayout; -/** - * +/*! + @method isPlanar + @abstract + Get whether the sample format is planar. */ - (BOOL)isPlanar; -/** - * +/*! + @method bytesPerSample + @abstract + Get the bytes per sample. */ - (int)bytesPerSample; -/** - * +/*! + @method bytesPerSample + @abstract + Get the number of planes. */ - (int)numberOfPlanes; -/** - * +/*! + @method linesize: + @abstract + Get the linesize of the number of samples. */ - (int)linesize:(int)numberOfSamples; -/** - * +/*! + @method isEqualToDescriptor: + @abstract + Check if the descriptor is equal to another. */ - (BOOL)isEqualToDescriptor:(SGAudioDescriptor *)descriptor; diff --git a/SGPlayer/Classes/Core/SGDescription/SGVideoDescriptor.h b/SGPlayer/Classes/Core/SGDescription/SGVideoDescriptor.h index a01849ca..f9ceedb3 100644 --- a/SGPlayer/Classes/Core/SGDescription/SGVideoDescriptor.h +++ b/SGPlayer/Classes/Core/SGDescription/SGVideoDescriptor.h @@ -10,33 +10,54 @@ @interface SGVideoDescriptor : NSObject -/** - * AVPixelFormat +/*! + @property format + @abstract + Indicates the vdieo format. + + @discussion + The value corresponds to AVPixelFormat. */ @property (nonatomic) int format; -/** - * kCVPixelFormatType_XXX +/*! + @property cv_format + @abstract + Indicates the vdieo format. + + @discussion + The value corresponds to kCVPixelFormatType_XXX. */ @property (nonatomic) OSType cv_format; -/** - * +/*! + @property width + @abstract + Indicates the width. */ @property (nonatomic) int width; -/** - * +/*! + @property height + @abstract + Indicates the height. */ @property (nonatomic) int height; -/** - * AVColorSpace +/*! + @property colorspace + @abstract + Indicates the colorspace. + + @discussion + The value corresponds to AVColorSpace. */ @property (nonatomic) int colorspace; -/** - * +/*! + @method isEqualToDescriptor: + @abstract + Check if the descriptor is equal to another. */ - (BOOL)isEqualToDescriptor:(SGVideoDescriptor *)descriptor;