Skip to content

Commit

Permalink
Merging from develop to master for 11/12 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Raj Seshasankaran committed Nov 12, 2015
2 parents 3f281f6 + 566f8dc commit 5d7e24c
Show file tree
Hide file tree
Showing 1,044 changed files with 60,081 additions and 34,747 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.opensdf
*.sdf
*.suo
*.user
*.orig
ipch
Debug
Expand Down
14 changes: 14 additions & 0 deletions Frameworks/AVFoundation/AVAudioPlayer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
//
//******************************************************************************

#import "Starboard.h"
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

Expand All @@ -22,14 +23,22 @@ @implementation AVAudioPlayer : NSObject
@synthesize numberOfLoops;
@synthesize volume;

/**
@Status Stub
*/
- (id)initWithContentsOfURL:(NSURL*)url error:(NSError**)outError {
UNIMPLEMENTED();
if (outError) {
*outError = [NSError errorWithDomain:@"AVAudioPlayer" code:100 userInfo:nil];
}
return nil;
}

/**
@Status Stub
*/
- (id)initWithData:(NSData*)data error:(NSError**)outError {
UNIMPLEMENTED();
if (outError) {
*outError = [NSError errorWithDomain:@"AVAudioPlayer" code:100 userInfo:nil];
}
Expand All @@ -38,7 +47,12 @@ - (id)initWithData:(NSData*)data error:(NSError**)outError {
@end

@implementation AVAudioSession

/**
@Status Stub
*/
+ (AVAudioSession*)sharedInstance {
UNIMPLEMENTED();
return nil;
}
@end
21 changes: 21 additions & 0 deletions Frameworks/AVFoundation/AudioSession.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,47 @@
//
//******************************************************************************

#import "Starboard.h"
#import <AVFoundation/AVFoundation.h>

/**
@Status Stub
*/
void AudioServicesPlaySystemSound(SystemSoundID soundID) {
UNIMPLEMENTED();
}

/**
@Status Stub
*/
OSStatus AudioSessionGetProperty(AudioSessionPropertyID id, UInt32* dataSize, void* outData) {
UNIMPLEMENTED();
return 100;
}

/**
@Status Stub
*/
OSStatus AudioSessionSetActive(Boolean active) {
UNIMPLEMENTED();
return 100;
}

/**
@Status Stub
*/
OSStatus AudioSessionInitialize(CFRunLoopRef inRunLoop,
CFStringRef inRunLoopMode,
AudioSessionInterruptionListener inInterruptionListener,
void* inClientData) {
UNIMPLEMENTED();
return 100;
}

/**
@Status Stub
*/
OSStatus AudioSessionSetProperty(AudioSessionPropertyID inID, UInt32 inDataSize, const void* inData) {
UNIMPLEMENTED();
return 100;
}
33 changes: 33 additions & 0 deletions Frameworks/AudioToolbox/AudioFile.mm
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ int readBytes(i64 start, u32* numBytes, void* buffer) {
}
};

/**
@Status Caveat
@Notes Only file:// URLs supported
*/
OSStatus AudioFileOpenURL(CFURLRef url, SInt8 permissions, AudioFileTypeID type, AudioFileID* out) {
char* filename = (char*)[[url path] UTF8String];
EbrFile* f = EbrFopen(filename, "rb");
Expand Down Expand Up @@ -572,6 +576,10 @@ DWORD AudioFileOpenWithCallbacks(void* context,

typedef ExtAudioFile* ExtAudioFileRef;

/**
@Status Caveat
@Notes Only file:// URLs supported
*/
OSStatus ExtAudioFileOpenURL(CFURLRef url, ExtAudioFileRef* out) {
AudioFile* audioFile = NULL;
int ret = AudioFileOpenURL(url, 0, 0, &audioFile);
Expand All @@ -597,16 +605,26 @@ OSStatus AudioFileCreateWithURL(
return 0;
}

/**
@Status Interoperable
*/
OSStatus AudioFileClose(AudioFileID fileID) {
delete fileID;
return 0;
}

/**
@Status Interoperable
*/
OSStatus ExtAudioFileDispose(ExtAudioFileRef fileID) {
delete fileID;
return 0;
}

/**
@Status Caveat
@Notes Limited properties supported depending on codec
*/
OSStatus AudioFileGetProperty(AudioFileID fileID, AudioFilePropertyID propID, UInt32* ioDataSize, void* propOutData) {
if (fileID == NULL) {
return 1234;
Expand All @@ -615,6 +633,10 @@ OSStatus AudioFileGetProperty(AudioFileID fileID, AudioFilePropertyID propID, UI
return fileID->getProperty(propID, ioDataSize, propOutData);
}

/**
@Status Caveat
@Notes Limited properties supported depending on codec
*/
OSStatus ExtAudioFileGetProperty(ExtAudioFileRef fileID, ExtAudioFilePropertyID propID, UInt32* ioDataSize, void* propOutData) {
if (fileID) {
return fileID->pAudioFile->getProperty(propID, ioDataSize, propOutData);
Expand All @@ -623,6 +645,10 @@ OSStatus ExtAudioFileGetProperty(ExtAudioFileRef fileID, ExtAudioFilePropertyID
}
}

/**
@Status Caveat
@Notes Only ClientDataFormat property supported
*/
OSStatus ExtAudioFileSetProperty(ExtAudioFileRef fileID, ExtAudioFilePropertyID propID, UInt32 ioDataSize, const void* propInData) {
fileID->pAudioFile->setProperty(propID, ioDataSize, propInData);
return 0;
Expand Down Expand Up @@ -658,6 +684,10 @@ DWORD AudioFileGetPropertyInfo(AudioFile* fileID, DWORD propID, DWORD* outDataSi
return (DWORD)0;
}

/**
@Status Caveat
@Notes useCached parameter not supported
*/
OSStatus AudioFileReadBytes(AudioFileID fileID, Boolean useCached, SInt64 startByte, UInt32* ioNumBytes, void* outBuffer) {
return fileID->readBytes(startByte, ioNumBytes, outBuffer);
}
Expand All @@ -667,6 +697,9 @@ OSStatus ExtAudioFileSeek(ExtAudioFileRef fileID, SInt64 pos) {
return 0;
}

/**
@Status Interoperable
*/
OSStatus ExtAudioFileRead(ExtAudioFileRef fileID, UInt32* numFrames, AudioBufferList* pData) {
if (fileID == NULL) {
*numFrames = 0;
Expand Down
45 changes: 45 additions & 0 deletions Frameworks/CoreFoundation/CFArray.mm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ BOOL doesContainValue(uint32_t start, uint32_t length, id value) {
}
};

/**
@Status Interoperable
*/
CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex max, const CFArrayCallBacks* valueCallbacks) {
static int numCreated;
numCreated++;
Expand All @@ -323,18 +326,27 @@ CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex max, co
return (CFMutableArrayRef)ret;
}

/**
@Status Interoperable
*/
CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex max, CFArrayRef array) {
id ret = [(NSArray*)array mutableCopy];

return (CFMutableArrayRef)ret;
}

/**
@Status Interoperable
*/
CFArrayRef CFArrayCreateCopy(CFAllocatorRef allocator, CFArrayRef array) {
id ret = [(NSArray*)array copy];

return (CFArrayRef)ret;
}

/**
@Status Interoperable
*/
CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void** values, CFIndex numValues, const CFArrayCallBacks* valueCallbacks) {
NSArray* ret = [_LazyNSArray alloc];
__CFArray* cfarr = new (_LazyArraySpaceOffset.member(ret)) __CFArray(valueCallbacks);
Expand All @@ -347,24 +359,39 @@ CFArrayRef CFArrayCreate(CFAllocatorRef allocator, const void** values, CFIndex
return (CFArrayRef)ret;
}

/**
@Status Interoperable
*/
CFIndex CFArrayGetCount(CFArrayRef array) {
return _LazyArrOffset.member(array)->getCount();
}

/**
@Status Interoperable
*/
void CFArraySortValues(CFMutableArrayRef array, CFRange range, id comparator, id context) {
[(NSArray*)array sortUsingFunction:comparator context:context range:range];
}

/**
@Status Interoperable
*/
const void* CFArrayGetValueAtIndex(CFArrayRef array, CFIndex index) {
return (const void*)_LazyArrOffset.member(array)->objectFromIndex(index);
}

/**
@Status Interoperable
*/
void CFArrayGetValues(CFArrayRef array, CFRange range, void** values) {
for (unsigned i = range.location; i < range.location + range.length; i++) {
values[i] = (void*)_LazyArrOffset.member(array)->objectFromIndex(i);
}
}

/**
@Status Interoperable
*/
void CFArrayAppendValue(CFMutableArrayRef array, const void* value) {
_LazyArrOffset.member(array)->addObject((id)value, true);
}
Expand All @@ -377,13 +404,19 @@ void CFArrayAppendValueExport(CFMutableArrayRef array, const void* value) {
CFArrayAppendValue(array, value);
}

/**
@Status Interoperable
*/
void CFArrayAppendArray(CFMutableArrayRef array, CFArrayRef arrayToAppend, CFRange range) {
for (unsigned i = range.location; i < range.location + range.length; i++) {
const void* curVal = CFArrayGetValueAtIndex(arrayToAppend, i);
CFArrayAppendValue(array, curVal);
}
}

/**
@Status Interoperable
*/
Boolean CFArrayContainsValue(CFArrayRef array, CFRange range, const void* value) {
return _LazyArrOffset.member(array)->doesContainValue(range.location, range.length, (id)value) != FALSE;
}
Expand All @@ -392,10 +425,16 @@ Boolean CFArrayDoesContainValue(CFArrayRef array, const void* value) {
return _LazyArrOffset.member(array)->doesContainValue(0, CFArrayGetCount(array), (id)value) != FALSE;
}

/**
@Status Interoperable
*/
void CFArrayInsertValueAtIndex(CFMutableArrayRef array, CFIndex index, const void* value) {
_LazyArrOffset.member(array)->addObjectAtIndex((id)value, index);
}

/**
@Status Interoperable
*/
void CFArrayReplaceValues(CFMutableArrayRef array, CFRange range, const void** values, CFIndex newCount) {
CFIndex curPos = range.location;
const id* newValues = (const id*)values;
Expand Down Expand Up @@ -423,13 +462,19 @@ void CFArrayReplaceValues(CFMutableArrayRef array, CFRange range, const void** v
}
}

/**
@Status Interoperable
*/
void CFArrayRemoveAllValues(CFMutableArrayRef array) {
if (_LazyArrOffset.member(array) == nil)
return;

_LazyArrOffset.member(array)->removeAllObjects();
}

/**
@Status Interoperable
*/
void CFArrayRemoveValueAtIndex(CFMutableArrayRef array, CFIndex idx) {
_LazyArrOffset.member(array)->removeObject(idx);
}
Expand Down
21 changes: 21 additions & 0 deletions Frameworks/CoreFoundation/CFBundle.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
//******************************************************************************

#include "Starboard.h"

#import "CoreFoundation/CFBundle.h""
const CFStringRef kCFBundleVersionKey = (CFStringRef)@"kCFBundleVersionKey";
3 changes: 3 additions & 0 deletions Frameworks/CoreFoundation/CFData.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/NSData.h>

/**
@Status Interoperable
*/
const uint8_t* CFDataGetBytePtr(CFDataRef data) {
return (uint8_t*)[(NSData*)data bytes];
}
Loading

0 comments on commit 5d7e24c

Please sign in to comment.