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 3557e13 commit 50def88
Show file tree
Hide file tree
Showing 8 changed files with 302 additions and 118 deletions.
42 changes: 30 additions & 12 deletions SGPlayer/Classes/Core/SGOption/SGDecoderOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,51 @@

@interface SGDecoderOptions : NSObject <NSCopying>

/**
*
/*!
@property options
@abstract
The options for avformat_open_input.
Default is nil.
*/
@property (nonatomic, copy) NSDictionary *options;

/**
*
/*!
@property threadsAuto
@abstract
The option for avformat_open_input.
Default is YES.
*/
@property (nonatomic) BOOL threadsAuto;

/**
*
/*!
@property refcountedFrames
@abstract
The option for avformat_open_input.
Default is YES.
*/
@property (nonatomic) BOOL refcountedFrames;

/**
*
/*!
@property hardwareDecodeH264
@abstract
Indicates whether hardware decoding is enabled for H264.
Default is YES.
*/
@property (nonatomic) BOOL hardwareDecodeH264;

/**
*
/*!
@property hardwareDecodeH265
@abstract
Indicates whether hardware decoding is enabled for H265.
Default is YES.
*/
@property (nonatomic) BOOL hardwareDecodeH265;

/**
*
/*!
@property preferredPixelFormat
@abstract
Indicates the default hardware decoding output format.
Default is kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange.
*/
@property (nonatomic) OSType preferredPixelFormat;

Expand Down
10 changes: 8 additions & 2 deletions SGPlayer/Classes/Core/SGOption/SGDemuxerOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@

@interface SGDemuxerOptions : NSObject <NSCopying>

/**
*
/*!
@property options
@abstract
The options for avformat_open_input.
Default:
@{@"reconnect" : @(1),
@"user-agent" : @"SGPlayer",
@"timeout" : @(20 * 1000 * 1000)}
*/
@property (nonatomic, copy) NSDictionary *options;

Expand Down
24 changes: 16 additions & 8 deletions SGPlayer/Classes/Core/SGOption/SGOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,31 @@

@interface SGOptions : NSObject <NSCopying>

/**
*
/*!
@method sharedOptions
@abstract
Globally shared configuration options.
*/
+ (instancetype)sharedOptions;

/**
*
/*!
@property demuxer
@abstract
The options for demuxer.
*/
@property (nonatomic, strong) SGDemuxerOptions *demuxer;

/**
*
/*!
@property decoder
@abstract
The options for decoder.
*/
@property (nonatomic, strong) SGDecoderOptions *decoder;

/**
*
/*!
@property processor
@abstract
The options for processor.
*/
@property (nonatomic, strong) SGProcessorOptions *processor;

Expand Down
14 changes: 10 additions & 4 deletions SGPlayer/Classes/Core/SGOption/SGProcessorOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@

@interface SGProcessorOptions : NSObject <NSCopying>

/**
*
/*!
@property audioClass
@abstract
The audio frame processor class.
Default is SGAudioProcessor.
*/
@property (nonatomic, copy) Class audioClass;

/**
*
/*!
@property videoClass
@abstract
The video frame processor class.
Default is SGVideoProcessor.
*/
@property (nonatomic, copy) Class videoClass;

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

@interface SGAudioRenderer : NSObject

/**
*
/*!
@property volume
@abstract
Indicates the current audio volume.
*/
@property (nonatomic) Float64 volume;

Expand Down
64 changes: 50 additions & 14 deletions SGPlayer/Classes/Core/SGRenderer/SGVideoRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,74 @@ typedef NS_ENUM(NSUInteger, SGScalingMode) {

@interface SGVideoRenderer : NSObject

/**
* Main thread only.
/*!
@property view
@abstract
Indicates the view that displays content.
@discussion
Main thread only.
*/
@property (nonatomic, strong) SGPLFView *view;

/**
* Main thread only.
/*!
@property viewport
@abstract
Indicates the current vr viewport.
@discussion
Main thread only.
*/
@property (nonatomic, strong, readonly) SGVRViewport *viewport;

/**
* Main thread only.
/*!
@property frameOutput
@abstract
Capture the video frame that will be rendered.
@discussion
Main thread only.
*/
@property (nonatomic, copy) void (^frameOutput)(SGVideoFrame *frame);

/**
* Main thread only.
/*!
@property preferredFramesPerSecond
@abstract
Indicates how many frames are rendered in one second.
Default is 30.
@discussion
Main thread only.
*/
@property (nonatomic) NSInteger preferredFramesPerSecond;

/**
* Main thread only.
/*!
@property scalingMode
@abstract
Indicates current scaling mode.
@discussion
Main thread only.
*/
@property (nonatomic) SGScalingMode scalingMode;

/**
* Main thread only.
/*!
@property displayMode
@abstract
Indicates current display mode.
@discussion
Main thread only.
*/
@property (nonatomic) SGDisplayMode displayMode;

/**
* Main thread only.
/*!
@method currentImage
@abstract
Generate a screenshot of the current view.
@discussion
Main thread only.
*/
- (SGPLFImage *)currentImage;

Expand Down
54 changes: 36 additions & 18 deletions SGPlayer/Classes/Core/SGSession/SGPlayerItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,66 @@
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;

/**
*
/*!
@method initWithAsset:
@abstract
Initializes an SGPlayerItem with an SGAsset.
*/
- (instancetype)initWithAsset:(SGAsset *)asset;

/**
*
/*!
@property error
@abstract
If the loading item failed, this describes the error that caused the failure.
*/
@property (nonatomic, copy, readonly) NSError *error;

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

/**
*
/*!
@property duration
@abstract
Indicates the metadata of the item.
*/
@property (nonatomic, copy, readonly) NSDictionary *metadata;

/**
*
/*!
@property duration
@abstract
Indicates the duration of the item.
*/
@property (nonatomic, readonly) CMTime duration;

/**
*
/*!
@property duration
@abstract
Indicates the audioSelection of the item.
*/
@property (nonatomic, copy, readonly) SGTrackSelection *audioSelection;

/**
*
/*!
@method setAudioSelection:action:
@abstract
Select specific audio tracks.
*/
- (void)setAudioSelection:(SGTrackSelection *)audioSelection action:(SGTrackSelectionAction)action;

/**
*
/*!
@property duration
@abstract
Indicates the videoSelection of the item.
*/
@property (nonatomic, copy, readonly) SGTrackSelection *videoSelection;

/**
*
/*!
@method setVideoSelection:action:
@abstract
Select specific video tracks.
*/
- (void)setVideoSelection:(SGTrackSelection *)videoSelection action:(SGTrackSelectionAction)action;

Expand Down
Loading

0 comments on commit 50def88

Please sign in to comment.