Skip to content

Commit

Permalink
Cleanup more of AVFoundation (#611) by cleaning up some CoreMedia (#683
Browse files Browse the repository at this point in the history
…).
  • Loading branch information
BlueRiverInteractive committed Dec 31, 2014
1 parent 471129b commit 05bb4d4
Show file tree
Hide file tree
Showing 14 changed files with 440 additions and 53 deletions.
4 changes: 2 additions & 2 deletions cocoatouch/src/main/bro-gen/avfoundation.yaml
Expand Up @@ -1334,7 +1334,7 @@ classes:
'keySpace': 'keySpace':
type: AVMetadataKeySpace type: AVMetadataKeySpace
'dataType': 'dataType':
type: String # TODO types defined in CMMetadata.h type: CMMetadataDataType
'value': 'value':
type: NSObject type: NSObject
'extraAttributes': 'extraAttributes':
Expand Down Expand Up @@ -1506,7 +1506,7 @@ classes:
'identifier': 'identifier':
type: AVMetadataIdentifier type: AVMetadataIdentifier
'dataType': 'dataType':
type: String # TODO types defined in CMMetadata.h type: CMMetadataDataType
'key': 'key':
type: AVMetadataKey type: AVMetadataKey
'keySpace': 'keySpace':
Expand Down
31 changes: 14 additions & 17 deletions cocoatouch/src/main/bro-gen/coremedia.yaml
Expand Up @@ -48,7 +48,7 @@ enums:
CMSampleBufferError: { first: kCMSampleBufferError_AllocationFailed, prefix: kCMSampleBufferError_ } CMSampleBufferError: { first: kCMSampleBufferError_AllocationFailed, prefix: kCMSampleBufferError_ }
CMSampleBufferFlag: { first: kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment, prefix: kCMSampleBufferFlag_, bits: true, marshaler: Bits.AsMachineSizedIntMarshaler } CMSampleBufferFlag: { first: kCMSampleBufferFlag_AudioBufferList_Assure16ByteAlignment, prefix: kCMSampleBufferFlag_, bits: true, marshaler: Bits.AsMachineSizedIntMarshaler }
CMSimpleQueueError: { first: kCMSimpleQueueError_AllocationFailed, prefix: kCMSimpleQueueError_ } CMSimpleQueueError: { first: kCMSimpleQueueError_AllocationFailed, prefix: kCMSimpleQueueError_ }
CMTimeFlag: { first: kCMTimeFlags_Valid, prefix: kCMTimeFlags_, bits: true, marshaler: Bits.AsMachineSizedIntMarshaler } CMTimeFlags: { first: kCMTimeFlags_Valid, prefix: kCMTimeFlags_, bits: true, marshaler: Bits.AsMachineSizedIntMarshaler }
CMTimeRoundingMethod: { first: kCMTimeRoundingMethod_RoundHalfAwayFromZero, prefix: kCMTimeRoundingMethod_, marshaler: ValuedEnum.AsMachineSizedUIntMarshaler } CMTimeRoundingMethod: { first: kCMTimeRoundingMethod_RoundHalfAwayFromZero, prefix: kCMTimeRoundingMethod_, marshaler: ValuedEnum.AsMachineSizedUIntMarshaler }


classes: classes:
Expand Down Expand Up @@ -607,12 +607,9 @@ functions:
name: "#{g[0]}" name: "#{g[0]}"


# Make sure we don't miss any functions if new ones are introduced in a later version # Make sure we don't miss any functions if new ones are introduced in a later version
(CM.*): (k?CM.*):
class: CoreMedia class: CoreMedia
name: "Function__#{g[0]}" name: 'Function__#{g[0]}'
(kCM.*):
class: CoreMedia
name: "Function__#{g[0]}"


values: # TODO converts keys, notifications... Strings to NSStrings/CFStrings?? values: # TODO converts keys, notifications... Strings to NSStrings/CFStrings??
# kCMTimebaseNotificationKey_(.*): # kCMTimebaseNotificationKey_(.*):
Expand Down Expand Up @@ -718,6 +715,13 @@ values: # TODO converts keys, notifications... Strings to NSStrings/CFStrings??
# class: CMTextMarkup # class: CMTextMarkup
# name: "CharacterEdgeStyle#{g[0]}" # name: "CharacterEdgeStyle#{g[0]}"


# CMMetadata
kCMMetadata.*DataType_(.*):
class: CMMetadataDataType
name: '#{g[0]}Value'
type: CFString
visibility: protected

kCMTimebaseNotificationKey_(.*): kCMTimebaseNotificationKey_(.*):
class: CoreMedia class: CoreMedia
name: "CMTimebaseNotificationKey#{g[0]}" name: "CMTimebaseNotificationKey#{g[0]}"
Expand Down Expand Up @@ -822,12 +826,9 @@ values: # TODO converts keys, notifications... Strings to NSStrings/CFStrings??
name: "CMTextMarkupCharacterEdgeStyle#{g[0]}" name: "CMTextMarkupCharacterEdgeStyle#{g[0]}"


# Make sure we don't miss any values if new ones are introduced in a later version # Make sure we don't miss any values if new ones are introduced in a later version
(CM): (k?CM.*):
class: CoreMedia class: CoreMedia
name: "Value__#{g[0]}" name: 'Value__#{g[0]}'
(kCM.*):
class: CoreMedia
name: "Value__#{g[0]}"


constants: constants:
kCMTime(MaxTimescale): kCMTime(MaxTimescale):
Expand All @@ -843,10 +844,6 @@ constants:
name: "PersistentTrackIDInvalid" name: "PersistentTrackIDInvalid"


# Make sure we don't miss any constants if new ones are introduced in a later version # Make sure we don't miss any constants if new ones are introduced in a later version
(CM.*): (k?CM.*):
class: CoreMedia
name: "Constant__#{g[0]}"

(kCM.*):
class: CoreMedia class: CoreMedia
name: "Constant__#{g[0]}" name: 'Constant__#{g[0]}'
Expand Up @@ -78,7 +78,7 @@ public AVMetadataItem() {}
* @since Available in iOS 8.0 and later. * @since Available in iOS 8.0 and later.
*/ */
@Property(selector = "dataType") @Property(selector = "dataType")
public native String getDataType(); public native CMMetadataDataType getDataType();
@Property(selector = "value") @Property(selector = "value")
public native NSObject getValue(); public native NSObject getValue();
@Property(selector = "extraAttributes") @Property(selector = "extraAttributes")
Expand Down
Expand Up @@ -98,12 +98,12 @@ public AVMutableMetadataItem() {}
* @since Available in iOS 8.0 and later. * @since Available in iOS 8.0 and later.
*/ */
@Property(selector = "dataType") @Property(selector = "dataType")
public native String getDataType(); public native CMMetadataDataType getDataType();
/** /**
* @since Available in iOS 8.0 and later. * @since Available in iOS 8.0 and later.
*/ */
@Property(selector = "setDataType:") @Property(selector = "setDataType:")
public native void setDataType(String v); public native void setDataType(CMMetadataDataType v);
@Property(selector = "value") @Property(selector = "value")
public native NSObject getValue(); public native NSObject getValue();
@Property(selector = "setValue:") @Property(selector = "setValue:")
Expand Down
Expand Up @@ -128,5 +128,20 @@ public boolean isDefaultStyleUnderline() {
*/ */
@Bridge(symbol="CMTextFormatDescriptionGetFontName", optional=true) @Bridge(symbol="CMTextFormatDescriptionGetFontName", optional=true)
protected native int getFontName(short localFontID, CFString.CFStringPtr outFontName); protected native int getFontName(short localFontID, CFString.CFStringPtr outFontName);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMTextFormatDescriptionCreateFromBigEndianTextDescriptionData", optional=true)
public static native int createFromBigEndianTextDescriptionData(CFAllocator allocator, BytePtr textDescriptionData, @MachineSizedUInt long textDescriptionSize, String textDescriptionFlavor, CMMediaType mediaType, CMTextFormatDescription.CMTextFormatDescriptionPtr textFormatDescriptionOut);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMTextFormatDescriptionCreateFromBigEndianTextDescriptionBlockBuffer", optional=true)
public static native int createFromBigEndianTextDescriptionBlockBuffer(CFAllocator allocator, CMBlockBuffer textDescriptionBlockBuffer, String textDescriptionFlavor, CMMediaType mediaType, CMTextFormatDescription.CMTextFormatDescriptionPtr textFormatDescriptionOut);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMTextFormatDescriptionCopyAsBigEndianTextDescriptionBlockBuffer", optional=true)
public static native int copyAsBigEndianTextDescriptionBlockBuffer(CFAllocator allocator, CMTextFormatDescription textFormatDescription, String textDescriptionFlavor, CMBlockBuffer.CMBlockBufferPtr textDescriptionBlockBufferOut);
/*</methods>*/ /*</methods>*/
} }
39 changes: 31 additions & 8 deletions cocoatouch/src/main/java/org/robovm/apple/coremedia/CMTime.java
Expand Up @@ -19,7 +19,6 @@
import java.io.*; import java.io.*;
import java.nio.*; import java.nio.*;
import java.util.*; import java.util.*;

import org.robovm.objc.*; import org.robovm.objc.*;
import org.robovm.objc.annotation.*; import org.robovm.objc.annotation.*;
import org.robovm.objc.block.*; import org.robovm.objc.block.*;
Expand Down Expand Up @@ -79,23 +78,47 @@ public static long toNative(List<CMTime> l, long flags) {
/*</constants>*/ /*</constants>*/
/*<constructors>*/ /*<constructors>*/
public CMTime() {} public CMTime() {}
public CMTime(long value, int timescale, int flags, long epoch) { public CMTime(long value, int timescale, CMTimeFlags flags, long epoch) {
this.value(value); this.setValue(value);
this.timescale(timescale); this.setTimescale(timescale);
this.flags(flags); this.setFlags(flags);
this.epoch(epoch); this.setEpoch(epoch);
} }
/*</constructors>*/ /*</constructors>*/
/*<properties>*//*</properties>*/ /*<properties>*//*</properties>*/
/*<members>*/ /*<members>*/
@StructMember(0) public native long getValue();
@StructMember(0) public native CMTime setValue(long value);

@Deprecated
@StructMember(0) public native long value(); @StructMember(0) public native long value();
@Deprecated
@StructMember(0) public native CMTime value(long value); @StructMember(0) public native CMTime value(long value);

@StructMember(1) public native int getTimescale();
@StructMember(1) public native CMTime setTimescale(int timescale);

@Deprecated
@StructMember(1) public native int timescale(); @StructMember(1) public native int timescale();
@Deprecated
@StructMember(1) public native CMTime timescale(int timescale); @StructMember(1) public native CMTime timescale(int timescale);
@StructMember(2) public native int flags();
@StructMember(2) public native CMTime flags(int flags); @StructMember(2) public native CMTimeFlags getFlags();
@StructMember(2) public native CMTime setFlags(CMTimeFlags flags);

@Deprecated
@StructMember(2) public native CMTimeFlags flags();
@Deprecated
@StructMember(2) public native CMTime flags(CMTimeFlags flags);

@StructMember(3) public native long getEpoch();
@StructMember(3) public native CMTime setEpoch(long epoch);

@Deprecated
@StructMember(3) public native long epoch(); @StructMember(3) public native long epoch();
@Deprecated
@StructMember(3) public native CMTime epoch(long epoch); @StructMember(3) public native CMTime epoch(long epoch);

/*</members>*/ /*</members>*/
public String asString() { public String asString() {
return copyDescription(null, this); return copyDescription(null, this);
Expand Down
Expand Up @@ -75,5 +75,20 @@ public static CMTimeCodeFormatDescription create(CMTimeCodeFormatType timeCodeFo
*/ */
@Bridge(symbol="CMTimeCodeFormatDescriptionGetTimeCodeFlags", optional=true) @Bridge(symbol="CMTimeCodeFormatDescriptionGetTimeCodeFlags", optional=true)
public native CMTimeCodeFlag getTimeCodeFlags(); public native CMTimeCodeFlag getTimeCodeFlags();
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionData", optional=true)
public static native int createFromBigEndianTimeCodeDescriptionData(CFAllocator allocator, BytePtr timeCodeDescriptionData, @MachineSizedUInt long timeCodeDescriptionSize, String timeCodeDescriptionFlavor, CMTimeCodeFormatDescription.CMTimeCodeFormatDescriptionPtr timeCodeFormatDescriptionOut);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMTimeCodeFormatDescriptionCreateFromBigEndianTimeCodeDescriptionBlockBuffer", optional=true)
public static native int createFromBigEndianTimeCodeDescriptionBlockBuffer(CFAllocator allocator, CMBlockBuffer timeCodeDescriptionBlockBuffer, String timeCodeDescriptionFlavor, CMTimeCodeFormatDescription.CMTimeCodeFormatDescriptionPtr timeCodeFormatDescriptionOut);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMTimeCodeFormatDescriptionCopyAsBigEndianTimeCodeDescriptionBlockBuffer", optional=true)
public static native int copyAsBigEndianTimeCodeDescriptionBlockBuffer(CFAllocator allocator, CMTimeCodeFormatDescription timeCodeFormatDescription, String timeCodeDescriptionFlavor, CMBlockBuffer.CMBlockBufferPtr timeCodeDescriptionBlockBufferOut);
/*</methods>*/ /*</methods>*/
} }
Expand Up @@ -40,33 +40,33 @@


/*</javadoc>*/ /*</javadoc>*/
/*<annotations>*/@Marshaler(Bits.AsMachineSizedIntMarshaler.class)/*</annotations>*/ /*<annotations>*/@Marshaler(Bits.AsMachineSizedIntMarshaler.class)/*</annotations>*/
public final class /*<name>*/CMTimeFlag/*</name>*/ extends Bits</*<name>*/CMTimeFlag/*</name>*/> { public final class /*<name>*/CMTimeFlags/*</name>*/ extends Bits</*<name>*/CMTimeFlags/*</name>*/> {
/*<values>*/ /*<values>*/
public static final CMTimeFlag None = new CMTimeFlag(0L); public static final CMTimeFlags None = new CMTimeFlags(0L);
public static final CMTimeFlag Valid = new CMTimeFlag(1L); public static final CMTimeFlags Valid = new CMTimeFlags(1L);
public static final CMTimeFlag HasBeenRounded = new CMTimeFlag(2L); public static final CMTimeFlags HasBeenRounded = new CMTimeFlags(2L);
public static final CMTimeFlag PositiveInfinity = new CMTimeFlag(4L); public static final CMTimeFlags PositiveInfinity = new CMTimeFlags(4L);
public static final CMTimeFlag NegativeInfinity = new CMTimeFlag(8L); public static final CMTimeFlags NegativeInfinity = new CMTimeFlags(8L);
public static final CMTimeFlag Indefinite = new CMTimeFlag(16L); public static final CMTimeFlags Indefinite = new CMTimeFlags(16L);
public static final CMTimeFlag ImpliedValueFlagsMask = new CMTimeFlag(28L); public static final CMTimeFlags ImpliedValueFlagsMask = new CMTimeFlags(28L);
/*</values>*/ /*</values>*/


/*<bind>*/ /*<bind>*/
/*</bind>*/ /*</bind>*/
/*<constants>*//*</constants>*/ /*<constants>*//*</constants>*/
/*<methods>*//*</methods>*/ /*<methods>*//*</methods>*/


private static final /*<name>*/CMTimeFlag/*</name>*/[] values = _values(/*<name>*/CMTimeFlag/*</name>*/.class); private static final /*<name>*/CMTimeFlags/*</name>*/[] values = _values(/*<name>*/CMTimeFlags/*</name>*/.class);


public /*<name>*/CMTimeFlag/*</name>*/(long value) { super(value); } public /*<name>*/CMTimeFlags/*</name>*/(long value) { super(value); }
private /*<name>*/CMTimeFlag/*</name>*/(long value, long mask) { super(value, mask); } private /*<name>*/CMTimeFlags/*</name>*/(long value, long mask) { super(value, mask); }
protected /*<name>*/CMTimeFlag/*</name>*/ wrap(long value, long mask) { protected /*<name>*/CMTimeFlags/*</name>*/ wrap(long value, long mask) {
return new /*<name>*/CMTimeFlag/*</name>*/(value, mask); return new /*<name>*/CMTimeFlags/*</name>*/(value, mask);
} }
protected /*<name>*/CMTimeFlag/*</name>*/[] _values() { protected /*<name>*/CMTimeFlags/*</name>*/[] _values() {
return values; return values;
} }
public static /*<name>*/CMTimeFlag/*</name>*/[] values() { public static /*<name>*/CMTimeFlags/*</name>*/[] values() {
return values.clone(); return values.clone();
} }
} }
Expand Up @@ -51,16 +51,28 @@
/*<constructors>*/ /*<constructors>*/
public CMTimeMapping() {} public CMTimeMapping() {}
public CMTimeMapping(CMTimeRange source, CMTimeRange target) { public CMTimeMapping(CMTimeRange source, CMTimeRange target) {
this.source(source); this.setSource(source);
this.target(target); this.setTarget(target);
} }
/*</constructors>*/ /*</constructors>*/
/*<properties>*//*</properties>*/ /*<properties>*//*</properties>*/
/*<members>*/ /*<members>*/
@StructMember(0) public native @ByVal CMTimeRange getSource();
@StructMember(0) public native CMTimeMapping setSource(@ByVal CMTimeRange source);

@Deprecated
@StructMember(0) public native @ByVal CMTimeRange source(); @StructMember(0) public native @ByVal CMTimeRange source();
@Deprecated
@StructMember(0) public native CMTimeMapping source(@ByVal CMTimeRange source); @StructMember(0) public native CMTimeMapping source(@ByVal CMTimeRange source);

@StructMember(1) public native @ByVal CMTimeRange getTarget();
@StructMember(1) public native CMTimeMapping setTarget(@ByVal CMTimeRange target);

@Deprecated
@StructMember(1) public native @ByVal CMTimeRange target(); @StructMember(1) public native @ByVal CMTimeRange target();
@Deprecated
@StructMember(1) public native CMTimeMapping target(@ByVal CMTimeRange target); @StructMember(1) public native CMTimeMapping target(@ByVal CMTimeRange target);

/*</members>*/ /*</members>*/
/*<methods>*//*</methods>*/ /*<methods>*//*</methods>*/
} }
Expand Up @@ -19,7 +19,6 @@
import java.io.*; import java.io.*;
import java.nio.*; import java.nio.*;
import java.util.*; import java.util.*;

import org.robovm.objc.*; import org.robovm.objc.*;
import org.robovm.objc.annotation.*; import org.robovm.objc.annotation.*;
import org.robovm.objc.block.*; import org.robovm.objc.block.*;
Expand Down Expand Up @@ -78,16 +77,28 @@ public static long toNative(List<CMTimeRange> l, long flags) {
/*<constructors>*/ /*<constructors>*/
public CMTimeRange() {} public CMTimeRange() {}
public CMTimeRange(CMTime start, CMTime duration) { public CMTimeRange(CMTime start, CMTime duration) {
this.start(start); this.setStart(start);
this.duration(duration); this.setDuration(duration);
} }
/*</constructors>*/ /*</constructors>*/
/*<properties>*//*</properties>*/ /*<properties>*//*</properties>*/
/*<members>*/ /*<members>*/
@StructMember(0) public native @ByVal CMTime getStart();
@StructMember(0) public native CMTimeRange setStart(@ByVal CMTime start);

@Deprecated
@StructMember(0) public native @ByVal CMTime start(); @StructMember(0) public native @ByVal CMTime start();
@Deprecated
@StructMember(0) public native CMTimeRange start(@ByVal CMTime start); @StructMember(0) public native CMTimeRange start(@ByVal CMTime start);

@StructMember(1) public native @ByVal CMTime getDuration();
@StructMember(1) public native CMTimeRange setDuration(@ByVal CMTime duration);

@Deprecated
@StructMember(1) public native @ByVal CMTime duration(); @StructMember(1) public native @ByVal CMTime duration();
@Deprecated
@StructMember(1) public native CMTimeRange duration(@ByVal CMTime duration); @StructMember(1) public native CMTimeRange duration(@ByVal CMTime duration);

/*</members>*/ /*</members>*/
/*<methods>*/ /*<methods>*/
/** /**
Expand Down
Expand Up @@ -19,7 +19,6 @@
import java.io.*; import java.io.*;
import java.nio.*; import java.nio.*;
import java.util.*; import java.util.*;

import org.robovm.objc.*; import org.robovm.objc.*;
import org.robovm.objc.annotation.*; import org.robovm.objc.annotation.*;
import org.robovm.objc.block.*; import org.robovm.objc.block.*;
Expand Down
Expand Up @@ -51,16 +51,28 @@
/*<constructors>*/ /*<constructors>*/
public CMVideoDimensions() {} public CMVideoDimensions() {}
public CMVideoDimensions(int width, int height) { public CMVideoDimensions(int width, int height) {
this.width(width); this.setWidth(width);
this.height(height); this.setHeight(height);
} }
/*</constructors>*/ /*</constructors>*/
/*<properties>*//*</properties>*/ /*<properties>*//*</properties>*/
/*<members>*/ /*<members>*/
@StructMember(0) public native int getWidth();
@StructMember(0) public native CMVideoDimensions setWidth(int width);

@Deprecated
@StructMember(0) public native int width(); @StructMember(0) public native int width();
@Deprecated
@StructMember(0) public native CMVideoDimensions width(int width); @StructMember(0) public native CMVideoDimensions width(int width);

@StructMember(1) public native int getHeight();
@StructMember(1) public native CMVideoDimensions setHeight(int height);

@Deprecated
@StructMember(1) public native int height(); @StructMember(1) public native int height();
@Deprecated
@StructMember(1) public native CMVideoDimensions height(int height); @StructMember(1) public native CMVideoDimensions height(int height);

/*</members>*/ /*</members>*/
/*<methods>*//*</methods>*/ /*<methods>*//*</methods>*/
} }
Expand Up @@ -106,5 +106,20 @@ public static CMVideoFormatDescription create(CVImageBuffer imageBuffer) {
*/ */
@Bridge(symbol="CMVideoFormatDescriptionMatchesImageBuffer", optional=true) @Bridge(symbol="CMVideoFormatDescriptionMatchesImageBuffer", optional=true)
public native boolean matchesImageBuffer(CVImageBuffer imageBuffer); public native boolean matchesImageBuffer(CVImageBuffer imageBuffer);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionData", optional=true)
protected static native int create(CFAllocator allocator, BytePtr imageDescriptionData, @MachineSizedUInt long imageDescriptionSize, int imageDescriptionStringEncoding, String imageDescriptionFlavor, CMVideoFormatDescription.CMVideoFormatDescriptionPtr videoFormatDescriptionOut);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMVideoFormatDescriptionCreateFromBigEndianImageDescriptionBlockBuffer", optional=true)
protected static native int create(CFAllocator allocator, CMBlockBuffer imageDescriptionBlockBuffer, int imageDescriptionStringEncoding, String imageDescriptionFlavor, CMVideoFormatDescription.CMVideoFormatDescriptionPtr videoFormatDescriptionOut);
/**
* @since Available in iOS 8.0 and later.
*/
@Bridge(symbol="CMVideoFormatDescriptionCopyAsBigEndianImageDescriptionBlockBuffer", optional=true)
public static native int copyAsBigEndianImageDescriptionBlockBuffer(CFAllocator allocator, CMVideoFormatDescription videoFormatDescription, int imageDescriptionStringEncoding, String imageDescriptionFlavor, CMBlockBuffer.CMBlockBufferPtr imageDescriptionBlockBufferOut);
/*</methods>*/ /*</methods>*/
} }

0 comments on commit 05bb4d4

Please sign in to comment.