Skip to content

Commit

Permalink
SGPlayer: Headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
libobjc committed Aug 14, 2019
1 parent 7debac2 commit 8f63a80
Show file tree
Hide file tree
Showing 24 changed files with 345 additions and 379 deletions.
200 changes: 87 additions & 113 deletions SGPlayer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions SGPlayer/Classes/Core/SGPlatform/SGPlatform.h

This file was deleted.

9 changes: 3 additions & 6 deletions SGPlayer/Classes/Core/SGSession/SGFrameOutput.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import "SGFrameOutput.h"
#import "SGAsset+Internal.h"
#import "SGAudioDecoder.h"
#import "SGVideoDecoder.h"
#import "SGPacketOutput.h"
Expand All @@ -27,7 +26,6 @@ @interface SGFrameOutput () <SGPacketOutputDelegate, SGDecodeLoopDelegate>
}

@property (nonatomic, strong, readonly) NSLock *lock;
@property (nonatomic, strong, readonly) id<SGDemuxable> demuxer;
@property (nonatomic, strong, readonly) SGDecodeLoop *audioDecoder;
@property (nonatomic, strong, readonly) SGDecodeLoop *videoDecoder;
@property (nonatomic, strong, readonly) SGPacketOutput *packetOutput;
Expand All @@ -49,8 +47,7 @@ - (instancetype)initWithAsset:(SGAsset *)asset
self->_audioDecoder.delegate = self;
self->_videoDecoder = [[SGDecodeLoop alloc] initWithDecodableClass:[SGVideoDecoder class]];
self->_videoDecoder.delegate = self;
self->_demuxer = [asset newDemuxable];
self->_packetOutput = [[SGPacketOutput alloc] initWithDemuxable:self->_demuxer];
self->_packetOutput = [[SGPacketOutput alloc] initWithAsset:asset];
self->_packetOutput.delegate = self;
for (int i = 0; i < 8; i++) {
self->_capacityFlags[i] = NO;
Expand Down Expand Up @@ -78,9 +75,9 @@ - (void)dealloc
SGGet0Map(CMTime, duration, self->_packetOutput)
SGGet0Map(NSDictionary *, metadata, self->_packetOutput)
SGGet0Map(NSArray<SGTrack *> *, tracks, self->_packetOutput)
SGGet00Map(SGDemuxerOptions *, demuxerOptions, options, self->_demuxer)
SGGet0Map(SGDemuxerOptions *, demuxerOptions, self->_packetOutput)
SGSet1Map(void, setDemuxerOptions, SGDemuxerOptions *, self->_packetOutput)
SGGet00Map(SGDecoderOptions *, decoderOptions, options, self->_audioDecoder)
SGSet11Map(void, setDemuxerOptions, setOptions, SGDemuxerOptions *, self->_demuxer);

#pragma mark - Setter & Getter

Expand Down
11 changes: 9 additions & 2 deletions SGPlayer/Classes/Core/SGSession/SGPacketOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
//

#import <Foundation/Foundation.h>
#import "SGDemuxable.h"
#import "SGDemuxerOptions.h"
#import "SGPacket.h"
#import "SGAsset.h"

@protocol SGPacketOutputDelegate;

Expand All @@ -34,7 +36,12 @@ typedef NS_ENUM(NSUInteger, SGPacketOutputState) {
/**
*
*/
- (instancetype)initWithDemuxable:(id<SGDemuxable>)demuxable;
- (instancetype)initWithAsset:(SGAsset *)asset;

/**
*
*/
@property (nonatomic, copy) SGDemuxerOptions *demuxerOptions;

/**
*
Expand Down
8 changes: 6 additions & 2 deletions SGPlayer/Classes/Core/SGSession/SGPacketOutput.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//

#import "SGPacketOutput.h"
#import "SGAsset+Internal.h"
#import "SGDemuxable.h"
#import "SGError.h"
#import "SGMacro.h"
#import "SGLock.h"
Expand Down Expand Up @@ -34,10 +36,10 @@ @interface SGPacketOutput () <SGDemuxableDelegate>

@implementation SGPacketOutput

- (instancetype)initWithDemuxable:(id<SGDemuxable>)demuxable
- (instancetype)initWithAsset:(SGAsset *)asset
{
if (self = [super init]) {
self->_demuxable = demuxable;
self->_demuxable = [asset newDemuxable];
self->_demuxable.delegate = self;
self->_lock = [[NSLock alloc] init];
self->_wakeup = [[NSCondition alloc] init];
Expand All @@ -62,6 +64,8 @@ - (void)dealloc
SGGet0Map(CMTime, duration, self->_demuxable)
SGGet0Map(NSDictionary *, metadata, self->_demuxable)
SGGet0Map(NSArray<SGTrack *> *, tracks, self->_demuxable)
SGGet0Map(SGDemuxerOptions *, options, self->_demuxable)
SGSet1Map(void, setOptions, SGDemuxerOptions *, self->_demuxable)

#pragma mark - Setter & Getter

Expand Down
Loading

0 comments on commit 8f63a80

Please sign in to comment.