Skip to content

Commit

Permalink
Update Doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
libobjc committed Sep 11, 2019
1 parent d7ce863 commit e4d2ecb
Show file tree
Hide file tree
Showing 15 changed files with 158 additions and 152 deletions.
8 changes: 8 additions & 0 deletions SGPlayer/Classes/Core/SGAsset/SGAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@

#import <Foundation/Foundation.h>

/*!
@class SGAsset
@abstract
Abstract class for asset.
@discussion
Use SGURLAsset or SGMutableAsset.
*/
@interface SGAsset : NSObject <NSCopying>

@end
14 changes: 9 additions & 5 deletions SGPlayer/Classes/Core/SGAsset/SGMutableAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@

@interface SGMutableAsset : SGAsset

/**
*
*/
/*!
@property tracks
@abstract
Provides array of SGMutableAsset tracks.
*/
@property (nonatomic, copy, readonly) NSArray<SGMutableTrack *> *tracks;

/**
*
/*!
@method addTrack:
@abstract
Add a track to the asset.
*/
- (SGMutableTrack *)addTrack:(SGMediaType)type;

Expand Down
12 changes: 8 additions & 4 deletions SGPlayer/Classes/Core/SGAsset/SGMutableTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@

@interface SGMutableTrack : SGTrack

/**
*
/*!
@property segments
@abstract
Provides array of SGMutableTrack segments.
*/
@property (nonatomic, copy, readonly) NSArray<SGSegment *> *segments;

/**
*
/*!
@method appendSegment:
@abstract
Append a segment to the track.
*/
- (BOOL)appendSegment:(SGSegment *)segment;

Expand Down
6 changes: 4 additions & 2 deletions SGPlayer/Classes/Core/SGAsset/SGPaddingSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

@interface SGPaddingSegment : SGSegment

/**
*
/*!
@method initWithDuration:
@abstract
Initializes an SGPaddingSegment.
*/
- (instancetype)initWithDuration:(CMTime)duration;

Expand Down
15 changes: 8 additions & 7 deletions SGPlayer/Classes/Core/SGAsset/SGSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@

@interface SGSegment : NSObject <NSCopying>

/**
*
*/
+ (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;

Expand Down
15 changes: 8 additions & 7 deletions SGPlayer/Classes/Core/SGAsset/SGTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@

@interface SGTrack : NSObject <NSCopying>

/**
*
*/
+ (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;

Expand Down
15 changes: 8 additions & 7 deletions SGPlayer/Classes/Core/SGAsset/SGTrackSelection.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@
#import <Foundation/Foundation.h>
#import "SGTrack.h"

/**
*
*/
typedef NS_OPTIONS(NSUInteger, SGTrackSelectionAction) {
SGTrackSelectionActionTracks = 1 << 0,
SGTrackSelectionActionWeights = 1 << 1,
};

@interface SGTrackSelection : NSObject <NSCopying>

/**
*
/*!
@property tracks
@abstract
Provides array of SGTrackSelection tracks.
*/
@property (nonatomic, copy) NSArray<SGTrack *> *tracks;

/**
*
/*!
@property weights
@abstract
Provides array of SGTrackSelection weights.
*/
@property (nonatomic, copy) NSArray<NSNumber *> *weights;

Expand Down
15 changes: 8 additions & 7 deletions SGPlayer/Classes/Core/SGAsset/SGURLAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
25 changes: 17 additions & 8 deletions SGPlayer/Classes/Core/SGAsset/SGURLSegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
13 changes: 0 additions & 13 deletions SGPlayer/Classes/Core/SGCommon/SGError.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

#import <Foundation/Foundation.h>

/**
*
*/
typedef NS_ENUM(NSUInteger, SGErrorCode) {
SGErrorCodeUnknown = 0,
SGErrorImmediateExitRequested,
Expand All @@ -23,9 +20,6 @@ typedef NS_ENUM(NSUInteger, SGErrorCode) {
SGErrorCodeInvlidTime,
};

/**
*
*/
typedef NS_ENUM(NSUInteger, SGActionCode) {
SGActionCodeUnknown = 0,
SGActionCodeFormatCreate,
Expand All @@ -42,12 +36,5 @@ typedef NS_ENUM(NSUInteger, SGActionCode) {
SGActionCodeSegmentDemuxerNext,
};

/**
*
*/
NSError * SGGetFFError(int result, SGActionCode operation);

/**
*
*/
NSError * SGCreateError(NSUInteger code, SGActionCode operation);
29 changes: 0 additions & 29 deletions SGPlayer/Classes/Core/SGCommon/SGTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,13 @@
#import <Foundation/Foundation.h>
#import <CoreMedia/CoreMedia.h>

/**
*
*/
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);
26 changes: 0 additions & 26 deletions SGPlayer/Classes/Core/SGData/SGCapacity.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
15 changes: 8 additions & 7 deletions SGPlayer/Classes/Core/SGDemuxer/SGURLDemuxer.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@

@interface SGURLDemuxer : NSObject <SGDemuxable>

/**
*
*/
+ (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;

Expand Down
Loading

0 comments on commit e4d2ecb

Please sign in to comment.