From 82bcc977da838801b53786670f42892250b9469d Mon Sep 17 00:00:00 2001 From: Single Date: Mon, 28 Oct 2019 18:36:41 +0800 Subject: [PATCH] SGOutput: Optsions. --- SGPlayer/Classes/Core/SGSession/SGFrameOutput.m | 6 ++++-- SGPlayer/Classes/Core/SGSession/SGPacketOutput.h | 2 +- SGPlayer/Classes/Core/SGSession/SGPacketOutput.m | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/SGPlayer/Classes/Core/SGSession/SGFrameOutput.m b/SGPlayer/Classes/Core/SGSession/SGFrameOutput.m index 9158c5b1..20150d4f 100644 --- a/SGPlayer/Classes/Core/SGSession/SGFrameOutput.m +++ b/SGPlayer/Classes/Core/SGSession/SGFrameOutput.m @@ -11,6 +11,7 @@ #import "SGVideoDecoder.h" #import "SGPacketOutput.h" #import "SGDecodeLoop.h" +#import "SGOptions.h" #import "SGMacro.h" #import "SGLock.h" @@ -53,6 +54,7 @@ - (instancetype)initWithAsset:(SGAsset *)asset self->_capacityFlags[i] = NO; self->_capacities[i] = SGCapacityCreate(); } + [self setDecoderOptions:[SGOptions sharedOptions].decoder.copy]; } return self; } @@ -75,9 +77,9 @@ - (void)dealloc SGGet0Map(CMTime, duration, self->_packetOutput) SGGet0Map(NSDictionary *, metadata, self->_packetOutput) SGGet0Map(NSArray *, tracks, self->_packetOutput) -SGGet0Map(SGDemuxerOptions *, demuxerOptions, self->_packetOutput) -SGSet1Map(void, setDemuxerOptions, SGDemuxerOptions *, self->_packetOutput) +SGGet00Map(SGDemuxerOptions *,demuxerOptions, options, self->_packetOutput) SGGet00Map(SGDecoderOptions *, decoderOptions, options, self->_audioDecoder) +SGSet11Map(void, setDemuxerOptions, setOptions, SGDemuxerOptions *, self->_packetOutput) #pragma mark - Setter & Getter diff --git a/SGPlayer/Classes/Core/SGSession/SGPacketOutput.h b/SGPlayer/Classes/Core/SGSession/SGPacketOutput.h index d0a24bb1..55e06713 100644 --- a/SGPlayer/Classes/Core/SGSession/SGPacketOutput.h +++ b/SGPlayer/Classes/Core/SGSession/SGPacketOutput.h @@ -41,7 +41,7 @@ typedef NS_ENUM(NSUInteger, SGPacketOutputState) { /** * */ -@property (nonatomic, copy) SGDemuxerOptions *demuxerOptions; +@property (nonatomic, copy) SGDemuxerOptions *options; /** * diff --git a/SGPlayer/Classes/Core/SGSession/SGPacketOutput.m b/SGPlayer/Classes/Core/SGSession/SGPacketOutput.m index bc789a6f..f4ee753b 100644 --- a/SGPlayer/Classes/Core/SGSession/SGPacketOutput.m +++ b/SGPlayer/Classes/Core/SGSession/SGPacketOutput.m @@ -9,6 +9,7 @@ #import "SGPacketOutput.h" #import "SGAsset+Internal.h" #import "SGDemuxable.h" +#import "SGOptions.h" #import "SGError.h" #import "SGMacro.h" #import "SGLock.h" @@ -43,6 +44,7 @@ - (instancetype)initWithAsset:(SGAsset *)asset self->_demuxable.delegate = self; self->_lock = [[NSLock alloc] init]; self->_wakeup = [[NSCondition alloc] init]; + [self setOptions:[SGOptions sharedOptions].demuxer.copy]; } return self; }