Skip to content
Snippets Groups Projects
Commit 66b6be74 authored by George Nachman's avatar George Nachman
Browse files

Additional cleanup

parent 681c27e7
No related branches found
No related tags found
No related merge requests found
Showing
with 148 additions and 156 deletions
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15A284" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
Loading
Loading
@@ -977,7 +977,7 @@ DQ
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" headerView="5844" id="5845">
<rect key="frame" x="0.0" y="0.0" width="763" height="19"/>
<rect key="frame" x="0.0" y="0.0" width="763" height="247"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<size key="intercellSpacing" width="3" height="2"/>
Loading
Loading
@@ -1211,7 +1211,7 @@ DQ
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" headerView="6284" id="6283">
<rect key="frame" x="0.0" y="0.0" width="533" height="19"/>
<rect key="frame" x="0.0" y="0.0" width="533" height="136"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<size key="intercellSpacing" width="3" height="2"/>
Loading
Loading
@@ -3083,7 +3083,7 @@ DQ
</connections>
</slider>
<textField verticalHuggingPriority="750" id="5364">
<rect key="frame" x="35" y="276" width="60" height="11"/>
<rect key="frame" x="35" y="276" width="61" height="11"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Small Radius" id="5367">
Loading
Loading
@@ -5101,6 +5101,7 @@ DQ
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="sxm-tG-syy">
<rect key="frame" x="18" y="296" width="107" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Tab bar location:" id="jnA-10-c4D">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Loading
Loading
@@ -5110,6 +5111,7 @@ DQ
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="ThU-HR-f8F">
<rect key="frame" x="18" y="264" width="107" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<animations/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="Theme:" id="uhj-9S-l8R">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Loading
Loading
@@ -5617,7 +5619,7 @@ DQ
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" headerView="5563" id="5562">
<rect key="frame" x="0.0" y="0.0" width="238" height="19"/>
<rect key="frame" x="0.0" y="0.0" width="238" height="361"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<size key="intercellSpacing" width="3" height="2"/>
Loading
Loading
@@ -5745,7 +5747,7 @@ DQ
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" headerView="6206" id="6091">
<rect key="frame" x="0.0" y="0.0" width="849" height="19"/>
<rect key="frame" x="0.0" y="0.0" width="849" height="228"/>
<autoresizingMask key="autoresizingMask"/>
<animations/>
<size key="intercellSpacing" width="3" height="2"/>
Loading
Loading
Loading
Loading
@@ -2109,10 +2109,10 @@ NSLog(@"Known bug: %s should be true, but %s is.", #expressionThatShouldBeTrue,
inContext:ctx]);
XCTAssert(results.count == 1);
SearchResult *range = results[0];
XCTAssert(range->startX == 0);
XCTAssert(range->absStartY == 5);
XCTAssert(range->endX == 3);
XCTAssert(range->absEndY == 5);
XCTAssert(range.startX == 0);
XCTAssert(range.absStartY == 5);
XCTAssert(range.endX == 3);
XCTAssert(range.absEndY == 5);
 
// Make sure there's nothing else to find
[results removeAllObjects];
Loading
Loading
@@ -2139,10 +2139,10 @@ NSLog(@"Known bug: %s should be true, but %s is.", #expressionThatShouldBeTrue,
inContext:ctx]);
XCTAssert(results.count == 1);
range = results[0];
XCTAssert(range->startX == 0);
XCTAssert(range->absStartY == 8);
XCTAssert(range->endX == 3);
XCTAssert(range->absEndY == 8);
XCTAssert(range.startX == 0);
XCTAssert(range.absStartY == 8);
XCTAssert(range.endX == 3);
XCTAssert(range.absEndY == 8);
 
// Make sure there's nothing else to find
[results removeAllObjects];
Loading
Loading
Loading
Loading
@@ -14,6 +14,6 @@
@property(nonatomic, copy) Profile *profile;
 
// An array of keys that may be changed in self.profile. All take string values.
@property (readonly, strong) NSArray<NSString*> *allKeys;
@property (readonly) NSArray<NSString*> *allKeys;
 
@end
Loading
Loading
@@ -492,10 +492,10 @@ const int kMaxResultContextWords = 4;
++n;
SearchResult* result = [findResults_ objectAtIndex:0];
 
startX = result->startX;
startY = result->absStartY - [screen totalScrollbackOverflow];
endX = result->endX;
endY = result->absEndY - [screen totalScrollbackOverflow];
startX = result.startX;
startY = result.absStartY - [screen totalScrollbackOverflow];
endX = result.endX;
endY = result.absEndY - [screen totalScrollbackOverflow];
 
[findResults_ removeObjectAtIndex:0];
 
Loading
Loading
Loading
Loading
@@ -27,14 +27,12 @@
#import <Cocoa/Cocoa.h>
 
@interface ColorsMenuItemView : NSView
{
NSColor* color_;
}
@property(nonatomic, readonly) NSColor *color;
 
- (NSGradient *)gradientForColorIndex:(NSInteger)colorIndex;
- (void)drawRect:(NSRect)rect;
- (void)mouseUp:(NSEvent*) event;
@property (readonly, retain) NSColor *color;
 
@end
 
Loading
Loading
@@ -26,8 +26,11 @@
 
#import "ColorsMenuItemView.h"
 
@interface ColorsMenuItemView()
@property(nonatomic, retain) NSColor *color;
@end
@implementation ColorsMenuItemView
@synthesize color = color_;
 
const int kNumberOfColors = 8;
const int kColorAreaOffsetX = 20;
Loading
Loading
@@ -57,8 +60,7 @@ enum {
// These colours were chosen to appear similar to those in Aperture 3.
// Based on http://cocoatricks.com/2010/07/a-label-color-picker-menu-item-2/
 
- (NSGradient *)gradientForColorIndex:(NSInteger)colorIndex
{
- (NSGradient *)gradientForColorIndex:(NSInteger)colorIndex {
NSGradient *gradient = nil;
 
switch (colorIndex) {
Loading
Loading
@@ -173,28 +175,28 @@ enum {
colorIndex >= 0 && colorIndex < kNumberOfColors) {
switch (colorIndex) {
case kMenuItemDefault:
color_ = nil;
self.color = nil;
break;
case kMenuItemRed:
color_ = [NSColor colorWithDeviceRed:251.0/255.0 green:107.0/255.0 blue:98.0/255.0 alpha:1.0];
self.color = [NSColor colorWithDeviceRed:251.0/255.0 green:107.0/255.0 blue:98.0/255.0 alpha:1.0];
break;
case kMenuItemOrange:
color_ = [NSColor colorWithDeviceRed:246.0/255.0 green:172.0/255.0 blue:71.0/255.0 alpha:1.0];
self.color = [NSColor colorWithDeviceRed:246.0/255.0 green:172.0/255.0 blue:71.0/255.0 alpha:1.0];
break;
case kMenuItemYellow:
color_ = [NSColor colorWithDeviceRed:240.0/255.0 green:220.0/255.0 blue:79.0/255.0 alpha:1.0];
self.color = [NSColor colorWithDeviceRed:240.0/255.0 green:220.0/255.0 blue:79.0/255.0 alpha:1.0];
break;
case kMenuItemGreen:
color_ = [NSColor colorWithDeviceRed:181.0/255.0 green:215.0/255.0 blue:73.0/255.0 alpha:1.0];
self.color = [NSColor colorWithDeviceRed:181.0/255.0 green:215.0/255.0 blue:73.0/255.0 alpha:1.0];
break;
case kMenuItemBlue:
color_ = [NSColor colorWithDeviceRed:95.0/255.0 green:163.0/255.0 blue:248.0/255.0 alpha:1.0];
self.color = [NSColor colorWithDeviceRed:95.0/255.0 green:163.0/255.0 blue:248.0/255.0 alpha:1.0];
break;
case kMenuItemPurple:
color_ = [NSColor colorWithDeviceRed:193.0/255.0 green:142.0/255.0 blue:217.0/255.0 alpha:1.0];
self.color = [NSColor colorWithDeviceRed:193.0/255.0 green:142.0/255.0 blue:217.0/255.0 alpha:1.0];
break;
case kMenuItemGray:
color_ = [NSColor colorWithDeviceRed:120.0/255.0 green:120.0/255.0 blue:120.0/255.0 alpha:1.0];
self.color = [NSColor colorWithDeviceRed:120.0/255.0 green:120.0/255.0 blue:120.0/255.0 alpha:1.0];
break;
}
// perform the menu action (set the color)
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ extern NSString *const kCommandHistoryDidChangeNotificationName;
 
+ (void)showInformationalMessage;
 
@property (readonly) BOOL commandHistoryHasEverBeenUsed;
- (BOOL)commandHistoryHasEverBeenUsed;
 
- (void)addCommand:(NSString *)command
onHost:(VT100RemoteHost *)host
Loading
Loading
Loading
Loading
@@ -40,7 +40,7 @@ static const int kMaxCommandsToSavePerHost = 200;
return instance;
}
 
- (instancetype)init {
- (id)init {
self = [super init];
if (self) {
_hosts = [[NSMutableDictionary alloc] init];
Loading
Loading
Loading
Loading
@@ -39,7 +39,7 @@ static NSString *const kCommandUses = @"use times"; // The name is a historical
return entry;
}
 
- (instancetype)init {
- (id)init {
self = [super init];
if (self) {
_commandUses = [[NSMutableArray alloc] init];
Loading
Loading
Loading
Loading
@@ -27,8 +27,7 @@
int _partialCommandLength;
}
 
- (instancetype)init
{
- (instancetype)init {
self = [super initWithWindowNibName:@"CommandHistoryPopup"
tablePtr:nil
model:[[[PopupModel alloc] init] autorelease]];
Loading
Loading
Loading
Loading
@@ -26,15 +26,9 @@ typedef NS_ENUM(NSInteger, ContextMenuActions) {
@end
 
 
@interface ContextMenuActionPrefsController : NSWindowController <NSWindowDelegate, NSTableViewDelegate, NSTableViewDataSource> {
IBOutlet NSTableView *tableView_;
IBOutlet NSTableColumn *titleColumn_;
IBOutlet NSTableColumn *actionColumn_;
IBOutlet NSTableColumn *parameterColumn_;
NSMutableArray *model_;
id<ContextMenuActionPrefsDelegate> delegate_;
BOOL hasSelection_;
}
@interface ContextMenuActionPrefsController : NSWindowController <
NSWindowDelegate, NSTableViewDelegate, NSTableViewDataSource>
 
@property (nonatomic, assign) id<ContextMenuActionPrefsDelegate> delegate;
@property (nonatomic, assign) BOOL hasSelection;
Loading
Loading
Loading
Loading
@@ -15,23 +15,25 @@ static NSString* kTitleKey = @"title";
static NSString* kActionKey = @"action";
static NSString* kParameterKey = @"parameter";
 
@implementation ContextMenuActionPrefsController
@synthesize delegate = delegate_;
@synthesize hasSelection = hasSelection_;
@implementation ContextMenuActionPrefsController {
IBOutlet NSTableView *_tableView;
IBOutlet NSTableColumn *_titleColumn;
IBOutlet NSTableColumn *_actionColumn;
IBOutlet NSTableColumn *_parameterColumn;
NSMutableArray *_model;
}
 
- (instancetype)initWithWindow:(NSWindow *)window
{
- (instancetype)initWithWindow:(NSWindow *)window {
self = [super initWithWindow:window];
if (self) {
model_ = [[NSMutableArray alloc] init];
_model = [[NSMutableArray alloc] init];
}
return self;
}
 
- (void)dealloc
{
[model_ release];
[_model release];
[super dealloc];
}
 
Loading
Loading
@@ -107,7 +109,7 @@ static NSString* kParameterKey = @"parameter";
 
- (IBAction)ok:(id)sender
{
[delegate_ contextMenuActionsChanged:model_];
[_delegate contextMenuActionsChanged:_model];
}
 
- (IBAction)add:(id)sender
Loading
Loading
@@ -116,15 +118,15 @@ static NSString* kParameterKey = @"parameter";
@"", kTitleKey,
[NSNumber numberWithInt:kOpenFileContextMenuAction], kActionKey,
nil];
[model_ addObject:defaultAction];
[tableView_ reloadData];
[_model addObject:defaultAction];
[_tableView reloadData];
}
 
- (IBAction)remove:(id)sender
{
[tableView_ reloadData];
[model_ removeObjectAtIndex:[tableView_ selectedRow]];
[tableView_ reloadData];
[_tableView reloadData];
[_model removeObjectAtIndex:[_tableView selectedRow]];
[_tableView reloadData];
}
 
- (void)setActions:(NSArray *)newActions
Loading
Loading
@@ -132,25 +134,25 @@ static NSString* kParameterKey = @"parameter";
if (!newActions) {
newActions = [NSMutableArray array];
}
[model_ autorelease];
model_ = [newActions mutableCopy];
[tableView_ reloadData];
[_model autorelease];
_model = [newActions mutableCopy];
[_tableView reloadData];
}
 
#pragma mark NSTableViewDataSource
 
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
{
return [model_ count];
return [_model count];
}
 
- (NSString *)keyForColumn:(NSTableColumn *)aTableColumn
{
if (aTableColumn == titleColumn_) {
if (aTableColumn == _titleColumn) {
return kTitleKey;
} else if (aTableColumn == actionColumn_) {
} else if (aTableColumn == _actionColumn) {
return kActionKey;
} else if (aTableColumn == parameterColumn_) {
} else if (aTableColumn == _parameterColumn) {
return kParameterKey;
} else {
return nil;
Loading
Loading
@@ -160,7 +162,7 @@ static NSString* kParameterKey = @"parameter";
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
{
NSString *key = [self keyForColumn:aTableColumn];
NSDictionary *row = [model_ objectAtIndex:rowIndex];
NSDictionary *row = [_model objectAtIndex:rowIndex];
return key ? [row objectForKey:key] : nil;
}
 
Loading
Loading
@@ -168,9 +170,9 @@ static NSString* kParameterKey = @"parameter";
{
NSString *key = [self keyForColumn:aTableColumn];
if (key) {
NSMutableDictionary *temp = [[[model_ objectAtIndex:rowIndex] mutableCopy] autorelease];
NSMutableDictionary *temp = [[[_model objectAtIndex:rowIndex] mutableCopy] autorelease];
[temp setObject:anObject forKey:key];
[model_ replaceObjectAtIndex:rowIndex withObject:temp];
[_model replaceObjectAtIndex:rowIndex withObject:temp];
[aTableView reloadData];
}
}
Loading
Loading
@@ -192,7 +194,7 @@ static NSString* kParameterKey = @"parameter";
@"Enter text" ];
 
 
if (tableColumn == titleColumn_) {
if (tableColumn == _titleColumn) {
NSTextFieldCell *cell = [[[NSTextFieldCell alloc] initTextCell:@""] autorelease];
[cell setPlaceholderString:@"Enter Title"];
[cell setEditable:YES];
Loading
Loading
@@ -200,7 +202,7 @@ static NSString* kParameterKey = @"parameter";
[cell setLineBreakMode:NSLineBreakByTruncatingTail];
 
return cell;
} else if (tableColumn == actionColumn_) {
} else if (tableColumn == _actionColumn) {
NSPopUpButtonCell *cell =
[[[NSPopUpButtonCell alloc] initTextCell:[actionNames objectAtIndex:0] pullsDown:NO] autorelease];
for (int i = 0; i < actionNames.count; i++) {
Loading
Loading
@@ -212,8 +214,8 @@ static NSString* kParameterKey = @"parameter";
[cell setBordered:NO];
 
return cell;
} else if (tableColumn == parameterColumn_) {
NSDictionary *actionDict = [model_ objectAtIndex:row];
} else if (tableColumn == _parameterColumn) {
NSDictionary *actionDict = [_model objectAtIndex:row];
int actionNum = [[actionDict objectForKey:kActionKey] intValue];
NSString *placeholder = [paramPlaceholders objectAtIndex:actionNum];
if (placeholder.length) {
Loading
Loading
@@ -241,14 +243,14 @@ static NSString* kParameterKey = @"parameter";
 
- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
{
self.hasSelection = [tableView_ numberOfSelectedRows] > 0;
self.hasSelection = [_tableView numberOfSelectedRows] > 0;
}
 
#pragma mark NSWindowDelegate
 
- (void)windowWillClose:(NSNotification *)notification
{
[tableView_ reloadData];
[_tableView reloadData];
}
 
@end
Loading
Loading
@@ -44,7 +44,7 @@
- (BOOL)wantToWrite;
- (void)mainProcessDidTerminate;
- (void)terminate;
@property (readonly) int readFileDescriptor; // for reading
@property (readonly) int writeFileDescriptor; // for writing
@property(nonatomic, readonly) int readFileDescriptor; // for reading
@property(nonatomic, readonly) int writeFileDescriptor; // for writing
 
@end
Loading
Loading
@@ -121,8 +121,7 @@ static NSString *kCoprocessMruKey = @"Coprocess MRU";
return result;
}
 
- (instancetype)init
{
- (instancetype)init {
self = [super init];
if (self) {
inputBuffer_ = [[NSMutableData alloc] init];
Loading
Loading
Loading
Loading
@@ -33,12 +33,10 @@
#import "DVREncoder.h"
 
@interface DVR : NSObject
{
DVRBuffer* buffer_;
int capacity_;
NSMutableArray* decoders_;
DVREncoder* encoder_;
}
// Get timestamp of first/last frame. Times are in microseconds since 1970.
@property(nonatomic, readonly) long long lastTimeStamp;
@property(nonatomic, readonly) long long firstTimeStamp;
 
// Allocates a circular buffer of the given size in bytes to store screen
// contents. Somewhat more memory is used because there's some per-frame
Loading
Loading
@@ -57,8 +55,4 @@
// frees a decoder allocated with -[getDecoder].
- (void)releaseDecoder:(DVRDecoder*)decoder;
 
// Get timestamp of first/last frame. Times are in microseconds since 1970.
@property (readonly) long long lastTimeStamp;
@property (readonly) long long firstTimeStamp;
@end
Loading
Loading
@@ -31,10 +31,14 @@
#import "DVRIndexEntry.h"
#include <sys/time.h>
 
@implementation DVR
@implementation DVR {
DVRBuffer* buffer_;
int capacity_;
NSMutableArray* decoders_;
DVREncoder* encoder_;
}
 
- (instancetype)initWithBufferCapacity:(int)bytes
{
- (instancetype)initWithBufferCapacity:(int)bytes {
self = [super init];
if (self) {
buffer_ = [DVRBuffer alloc];
Loading
Loading
Loading
Loading
@@ -45,41 +45,16 @@ typedef enum {
} DVRFrameType;
 
@interface DVRBuffer : NSObject
{
@private
// Points to start of large circular buffer.
char* store_;
 
// Points into store_ after -[reserve:] is called.
char* scratch_;
// Total size of storage in bytes.
long long capacity_;
// Maps a frame key number to DVRIndexEntry*.
NSMutableDictionary* index_;
// First key in index.
long long firstKey_;
// Next key number to add to index.
long long nextKey_;
// begin may be before or after end. If "-" is an allocated byte and "." is
// a free byte then you can have one of two cases:
//
// begin------end.....
// ----end....begin---
// Beginning of circular buffer's used region.
long long begin_;
// Returns first/last used keys.
@property(nonatomic, readonly) long long firstKey;
@property(nonatomic, readonly) long long lastKey;
 
// Non-inclusive end of circular buffer's used regino.
long long end_;
// Total size of storage.
@property(nonatomic, readonly) long long capacity;
 
// this must always equal index_.
id sanityCheck; // TODO(georgen): remove this after the source of corruption of index_ is found
}
// Are there no frames?
@property(nonatomic, readonly, getter=isEmpty) BOOL empty;
 
- (instancetype)initWithBufferCapacity:(long long)capacity;
 
Loading
Loading
@@ -101,17 +76,8 @@ typedef enum {
// Returns true if there's enough free space without deallocating a block.
- (BOOL)hasSpaceAvailable:(long long)length;
 
// Returns first/last used keys.
@property (readonly) long long firstKey;
@property (readonly) long long lastKey;
// Look up an index entry by key.
- (DVRIndexEntry*)entryForKey:(long long)key;
 
// Total size of storage.
@property (readonly) long long capacity;
// Are there no frames?
@property (readonly, getter=isEmpty) BOOL empty;
@end
 
Loading
Loading
@@ -29,7 +29,40 @@
#import "DVRBuffer.h"
 
 
@implementation DVRBuffer
@implementation DVRBuffer {
// Points to start of large circular buffer.
char* store_;
// Points into store_ after -[reserve:] is called.
char* scratch_;
// Total size of storage in bytes.
long long capacity_;
// Maps a frame key number to DVRIndexEntry*.
NSMutableDictionary* index_;
// First key in index.
long long firstKey_;
// Next key number to add to index.
long long nextKey_;
// begin may be before or after end. If "-" is an allocated byte and "." is
// a free byte then you can have one of two cases:
//
// begin------end.....
// ----end....begin---
// Beginning of circular buffer's used region.
long long begin_;
// Non-inclusive end of circular buffer's used regino.
long long end_;
// this must always equal index_.
id sanityCheck; // TODO(georgen): remove this after the source of corruption of index_ is found
}
 
- (instancetype)initWithBufferCapacity:(long long)maxsize
{
Loading
Loading
Loading
Loading
@@ -31,22 +31,8 @@
#import "DVRBuffer.h"
 
@interface DVRDecoder : NSObject
{
// Circular buffer not owned by us.
DVRBuffer* buffer_;
 
// Most recent frame's metadata.
DVRFrameInfo info_;
// Most recent frame.
char* frame_;
// Length of frame.
int length_;
// Most recent frame's key (not timestamp).
long long key_;
}
@property(nonatomic, readonly) long long timestamp;
 
- (instancetype)initWithBuffer:(DVRBuffer*)buffer;
 
Loading
Loading
@@ -57,7 +43,6 @@
// Accessors for the most recent frame.
- (char*)decodedFrame;
- (int)length;
@property (readonly) long long timestamp;
- (DVRFrameInfo)info;
 
// Advance to next frame.
Loading
Loading
Loading
Loading
@@ -42,10 +42,24 @@
 
@end
 
@implementation DVRDecoder
@implementation DVRDecoder {
// Circular buffer not owned by us.
DVRBuffer* buffer_;
// Most recent frame's metadata.
DVRFrameInfo info_;
// Most recent frame.
char* frame_;
// Length of frame.
int length_;
// Most recent frame's key (not timestamp).
long long key_;
}
 
- (instancetype)initWithBuffer:(DVRBuffer*)buffer
{
- (instancetype)initWithBuffer:(DVRBuffer *)buffer {
self = [super init];
if (self) {
buffer_ = buffer;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment