Bläddra i källkod

added flash 11.7 support

Nicolas Cannasse 12 år sedan
förälder
incheckning
6b356f1786

+ 1 - 1
doc/extract.hxml

@@ -1,6 +1,6 @@
 -debug
 -swf-lib library.swf
 -swf test.swf
--swf-version 11.6
+-swf-version 11.7
 --macro patchTypes("../doc/extract.patch")
 --gen-hx-classes

+ 6 - 0
doc/extract.patch

@@ -1216,3 +1216,9 @@ flash.display3D.Context3D.$mipfilter : Context3DMipFilter;
 
 @:require(flash11_6) flash.display.Graphics.readGraphicsData
 
+@:require(flash11_7) flash.media.StageVideo.attachAVStream;
+@:require(flash11_7) static flash.net.SharedObject.preventBackup;
+@:require(flash11_7) flash.system.AuthorizedFeatures.enableHLSPlayback;
+@:require(flash11_7) flash.system.AuthorizedFeaturesLoader.loadAuthorizedFeaturesFromData;
+
+

+ 2 - 0
std/flash/display3D/Context3DTextureFormat.hx

@@ -2,6 +2,8 @@ package flash.display3D;
 
 @:fakeEnum(String) extern enum Context3DTextureFormat {
 	BGRA;
+	BGRA_PACKED;
+	BGR_PACKED;
 	COMPRESSED;
 	COMPRESSED_ALPHA;
 }

+ 7 - 0
std/flash/events/AVLoadInfoEvent.hx

@@ -0,0 +1,7 @@
+package flash.events;
+
+extern class AVLoadInfoEvent extends Event {
+	var loadInfo(default,null) : flash.utils.Dictionary;
+	function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inLoadInfo : flash.utils.Dictionary) : Void;
+	static var AV_LOAD_INFO : Dynamic;
+}

+ 10 - 0
std/flash/events/AVManifestLoadEvent.hx

@@ -0,0 +1,10 @@
+package flash.events;
+
+extern class AVManifestLoadEvent extends Event {
+	var duration(default,null) : Float;
+	var handle(default,null) : Int;
+	var result(default,null) : flash.media.AVResult;
+	var userData(default,null) : Int;
+	function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, inResult : Int = 0, inUserData : Int = 0, inHandle : Int = 0, inDuration : Float = 0) : Void;
+	static var AV_MANIFEST_LOAD : String;
+}

+ 7 - 0
std/flash/events/AVPlayStateEvent.hx

@@ -0,0 +1,7 @@
+package flash.events;
+
+extern class AVPlayStateEvent extends Event {
+	var playState(default,null) : flash.media.AVPlayState;
+	function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, inState : Int = 0) : Void;
+	static var AV_PLAY_STATE : String;
+}

+ 22 - 0
std/flash/events/AVStatusEvent.hx

@@ -0,0 +1,22 @@
+package flash.events;
+
+extern class AVStatusEvent extends Event {
+	var description(default,null) : String;
+	var notificationType(default,null) : String;
+	var result(default,null) : flash.media.AVResult;
+	function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inNotificationType : String, inResult : Int = 0, ?inDescription : String) : Void;
+	static var AV_STATUS : String;
+	static var BUFFER_STATE : String;
+	static var DECODER_TYPE : String;
+	static var DIMENSION_CHANGE : String;
+	static var ERROR : String;
+	static var INSERTION_COMPLETE : String;
+	static var LOAD_COMPLETE : String;
+	static var MANIFEST_UPDATE : String;
+	static var PLAY_STATE : String;
+	static var RENDER_TYPE : String;
+	static var SEEK_COMPLETE : String;
+	static var STEP_COMPLETE : String;
+	static var STREAM_SWITCH : String;
+	static var WARNING : String;
+}

+ 12 - 0
std/flash/events/AVStreamSwitchEvent.hx

@@ -0,0 +1,12 @@
+package flash.events;
+
+extern class AVStreamSwitchEvent extends Event {
+	var bitrate(default,null) : Int;
+	var switchType(default,null) : Int;
+	var time(default,null) : Float;
+	var userData(default,null) : Int;
+	function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, time : Float = 0, switchType : Int = 0, bitrate : Int = 0, userData : Int = 0) : Void;
+	static var ABR_SWITCH : Int;
+	static var AV_STREAM_SWITCH : String;
+	static var PERIOD_SWITCH : Int;
+}

+ 8 - 0
std/flash/events/DRMMetadataEvent.hx

@@ -0,0 +1,8 @@
+package flash.events;
+
+extern class DRMMetadataEvent extends Event {
+	var drmMetadata(default,null) : flash.net.drm.DRMContentData;
+	var timestamp(default,null) : Float;
+	function new(?type : String, bubbles : Bool = false, cancelable : Bool = false, ?inMetadata : flash.utils.ByteArray, inTimestamp : Float = 0) : Void;
+	static var DRM_METADATA : String;
+}

+ 12 - 0
std/flash/media/AVABRParameters.hx

@@ -0,0 +1,12 @@
+package flash.media;
+
+extern class AVABRParameters {
+	var maxBitsPerSecond : Int;
+	var minBitsPerSecond : Int;
+	var policy : String;
+	var startBitsPerSecond : Int;
+	function new(init_policy : String, init_startBitsPerSecond : UInt, init_minBitsPerSecond : UInt, init_maxBitsPerSecond : UInt) : Void;
+	static var AGGRESSIVE : String;
+	static var CONSERVATIVE : String;
+	static var MODERATE : String;
+}

+ 6 - 0
std/flash/media/AVABRProfileInfo.hx

@@ -0,0 +1,6 @@
+package flash.media;
+
+extern class AVABRProfileInfo {
+	var bitsPerSecond(default,null) : Int;
+	function new(init_bitsPerSecond : Int) : Void;
+}

+ 54 - 0
std/flash/media/AVCaptionStyle.hx

@@ -0,0 +1,54 @@
+package flash.media;
+
+extern class AVCaptionStyle {
+	var backgroundColor : String;
+	var backgroundOpacity : String;
+	var edgeColor : String;
+	var fillColor : String;
+	var fillOpacity : String;
+	var font : String;
+	var fontColor : String;
+	var fontEdge : String;
+	var fontOpacity : String;
+	var size : String;
+	function new() : Void;
+	static var BLACK : String;
+	static var BLUE : String;
+	static var BRIGHT_BLUE : String;
+	static var BRIGHT_CYAN : String;
+	static var BRIGHT_GREEN : String;
+	static var BRIGHT_MAGENTA : String;
+	static var BRIGHT_RED : String;
+	static var BRIGHT_WHITE : String;
+	static var BRIGHT_YELLOW : String;
+	static var CASUAL : String;
+	static var CURSIVE : String;
+	static var CYAN : String;
+	static var DARK_BLUE : String;
+	static var DARK_CYAN : String;
+	static var DARK_GREEN : String;
+	static var DARK_MAGENTA : String;
+	static var DARK_RED : String;
+	static var DARK_YELLOW : String;
+	static var DEFAULT : String;
+	static var DEPRESSED : String;
+	static var GRAY : String;
+	static var GREEN : String;
+	static var LARGE : String;
+	static var LEFT_DROP_SHADOW : String;
+	static var MAGENTA : String;
+	static var MEDIUM : String;
+	static var MONOSPACED_WITHOUT_SERIFS : String;
+	static var MONOSPACE_WITH_SERIFS : String;
+	static var NONE : String;
+	static var PROPORTIONAL_WITHOUT_SERIFS : String;
+	static var PROPORTIONAL_WITH_SERIFS : String;
+	static var RAISED : String;
+	static var RED : String;
+	static var RIGHT_DROP_SHADOW : String;
+	static var SMALL : String;
+	static var SMALL_CAPITALS : String;
+	static var UNIFORM : String;
+	static var WHITE : String;
+	static var YELLOW : String;
+}

+ 7 - 0
std/flash/media/AVCuePoint.hx

@@ -0,0 +1,7 @@
+package flash.media;
+
+extern class AVCuePoint {
+	var dictionary(default,null) : flash.utils.Dictionary;
+	var localTime(default,null) : Float;
+	function new(init_dictionary : flash.utils.Dictionary, init_localTime : Float) : Void;
+}

+ 7 - 0
std/flash/media/AVInsertionResult.hx

@@ -0,0 +1,7 @@
+package flash.media;
+
+extern class AVInsertionResult extends AVResult {
+	var insertedBeforeReadHead(default,null) : Bool;
+	var periodIndex(default,null) : Int;
+	function new(result : Int, periodIndex : Int, insertedBeforeReadHead : Bool) : Void;
+}

+ 11 - 0
std/flash/media/AVPeriodInfo.hx

@@ -0,0 +1,11 @@
+package flash.media;
+
+extern class AVPeriodInfo {
+	var duration(default,null) : Float;
+	var firstCuePointIndex(default,null) : Int;
+	var lastCuePointIndex(default,null) : Int;
+	var localStartTime(default,null) : Float;
+	var userData(default,null) : Int;
+	var virtualStartTime(default,null) : Float;
+	function new(init_localStartTime : Float, init_virtualStartTime : Float, init_duration : Float, init_firstCuePointIndex : Int, init_lastCuePointIndex : Int, init_userData : Int) : Void;
+}

+ 14 - 0
std/flash/media/AVPlayState.hx

@@ -0,0 +1,14 @@
+package flash.media;
+
+extern class AVPlayState {
+	var state(default,null) : Int;
+	function new(state : UInt) : Void;
+	static var BUFFERING : Int;
+	static var EOF : Int;
+	static var PAUSED : Int;
+	static var PLAYING : Int;
+	static var READY : Int;
+	static var SUSPENDED : Int;
+	static var UNINITIALIZED : Int;
+	static var UNRECOVERABLE_ERROR : Int;
+}

+ 64 - 0
std/flash/media/AVResult.hx

@@ -0,0 +1,64 @@
+package flash.media;
+
+extern class AVResult {
+	var result(default,null) : Int;
+	function new(inResult : Int) : Void;
+	static var ASYNC_OPERATION_IN_PROGRESS : Int;
+	static var BAD_MANIFEST_SIGNATURE : Int;
+	static var BAD_MEDIA_INTERLEAVING : Int;
+	static var CALLED_FROM_WRONG_THREAD : Int;
+	static var CANNOT_FAIL_OVER : Int;
+	static var CANNOT_LOAD_PLAY_LIST : Int;
+	static var CODEC_NOT_SUPPORTED : Int;
+	static var COMPONENT_CREATION_FAILURE : Int;
+	static var CONTAINER_NOT_SUPPORTED : Int;
+	static var CONTENT_LENGTH_MISMATCH : Int;
+	static var CURRENT_PERIOD_EXPIRED : Int;
+	static var DECODER_FAILED : Int;
+	static var DEVICE_OPEN_ERROR : Int;
+	static var DRM_INIT_ERROR : Int;
+	static var DRM_NOT_AVAILABLE : Int;
+	static var EOF : Int;
+	static var FILE_NOT_FOUND : Int;
+	static var FILE_STRUCTURE_INVALID : Int;
+	static var FRAGMENT_READ_ERROR : Int;
+	static var GENERIC_ERROR : Int;
+	static var HTTP_TIME_OUT : Int;
+	static var INVALID_OPERATION : Int;
+	static var INVALID_PARAMETER : Int;
+	static var INVALID_REPLACE_DURATION : Int;
+	static var INVALID_SEEK_TIME : Int;
+	static var INVALID_WITH_AUDIO_ONLY_FILE : Int;
+	static var IRRECOVERABLE_ERROR : Int;
+	static var LIVE_HOLD : Int;
+	static var LIVE_WINDOW_MOVED_BACKWARD : Int;
+	static var LOST_CONNECTION_RECOVERABLE : Int;
+	static var NETWORK_DOWN : Int;
+	static var NETWORK_ERROR : Int;
+	static var NETWORK_UNAVAILABLE : Int;
+	static var NOT_IMPLEMENTED : Int;
+	static var NO_FIXED_SIZE : Int;
+	static var NO_USEABLE_BITRATE_PROFILE : Int;
+	static var ONLY_ALLOWED_IN_PAUSED_STATE : Int;
+	static var OPERATION_ABORTED : Int;
+	static var OUT_OF_MEMORY : Int;
+	static var OVERFLOW : Int;
+	static var PARSE_ERROR : Int;
+	static var PERIOD_HOLD : Int;
+	static var PERIOD_NOT_LOADED : Int;
+	static var PLAYBACK_NOT_ENABLED : Int;
+	static var PREVIOUS_STEP_SEEK_IN_PROGRESS : Int;
+	static var RANGE_ERROR : Int;
+	static var REPLACEMENT_FAILED : Int;
+	static var RESOURCE_NOT_SPECIFIED : Int;
+	static var SEEK_FAILED : Int;
+	static var SIZE_UNKNOWN : Int;
+	static var SUCCESS : Int;
+	static var SWITCH_TO_ASYMMETRIC_PROFILE : Int;
+	static var UNDERFLOW : Int;
+	static var UNSUPPORTED_CONFIGURATION : Int;
+	static var UNSUPPORTED_HLS_VERSION : Int;
+	static var UNSUPPORTED_OPERATION : Int;
+	static var VIDEO_PROFILE_NOT_SUPPORTED : Int;
+	static var WAITING_FOR_INIT : Int;
+}

+ 27 - 0
std/flash/media/AVSegmentedSource.hx

@@ -0,0 +1,27 @@
+package flash.media;
+
+extern class AVSegmentedSource extends AVSource {
+	function new() : Void;
+	function getABRProfileCount(periodIndex : Int) : Int;
+	function getABRProfileInfoAtIndex(periodIndex : Int, abrProfileIndex : Int) : AVABRProfileInfo;
+	function getCuePoint(periodIndex : Int, cuePointIndex : Int) : AVCuePoint;
+	function getPeriodInfo(periodIndex : Int) : AVPeriodInfo;
+	function getTimeline() : AVTimeline;
+	function getTrackCount(periodIndex : Int, payloadType : String) : Int;
+	function getTrackInfo(periodIndex : Int, payloadType : String, trackIndex : Int) : AVTrackInfo;
+	function insertByLocalTime(periodIndex : Int, insertionTime : Float, handle : Int, userData : Int = 0, replaceDuration : Float = 0) : AVInsertionResult;
+	function insertByVirtualTime(insertionTime : Float, handle : Int, userData : Int = 0, replaceDuration : Float = 0) : AVInsertionResult;
+	function load(url : String, ?containerType : String, userData : Int = 0) : AVResult;
+	function loadManifest(uri : String, userData : Int = 0, ?containerType : String) : AVResult;
+	function releaseManifest(handle : Int) : AVResult;
+	function removeByLocalTime(periodIndex : Int, timeStart : Float, timeEnd : Float) : AVResult;
+	function removeByVirtualTime(virtualTimeStart : Float, virtualTimeEnd : Float) : AVResult;
+	function selectTrack(periodIndex : Int, payloadType : String, trackIndex : Int) : AVResult;
+	function setABRParameters(params : AVABRParameters) : AVResult;
+	function setBandwidth(bitsPerSecond : Int) : AVResult;
+	function setHoldAt(time : Float) : AVResult;
+	static var AUDIO : String;
+	static var DATA : String;
+	static var HLS : String;
+	static var VIDEO : String;
+}

+ 6 - 0
std/flash/media/AVSource.hx

@@ -0,0 +1,6 @@
+package flash.media;
+
+extern class AVSource extends flash.events.EventDispatcher {
+	function new() : Void;
+	function dispose() : Void;
+}

+ 32 - 0
std/flash/media/AVStream.hx

@@ -0,0 +1,32 @@
+package flash.media;
+
+extern class AVStream extends flash.events.EventDispatcher {
+	var backBufferLength(default,null) : Float;
+	var backBufferTime(null,default) : Float;
+	var bufferLength(default,null) : Float;
+	var bufferTime(null,default) : Float;
+	var captionStyle(null,default) : AVCaptionStyle;
+	var captionsEnabled : Bool;
+	var currentFPS(default,null) : Float;
+	var decoderType(default,null) : String;
+	var droppedFrames(default,null) : Int;
+	var frameTime(default,null) : Float;
+	var initialBufferTime(null,default) : Float;
+	var playState(default,null) : AVPlayState;
+	var renderType(default,null) : String;
+	var time(default,null) : Float;
+	var useHardwareDecoder : Bool;
+	var volume : Float;
+	function new(source : AVSource) : Void;
+	function dispose() : Void;
+	function pause() : AVResult;
+	function play() : AVResult;
+	function resume() : Bool;
+	function seek(offset : Float, inBufferSeek : Bool = true) : AVResult;
+	function seekToLivePoint() : AVResult;
+	function seekToLocalTime(periodIndex : Int, time : Float) : AVResult;
+	function step(frames : Int) : AVResult;
+	static var HARDWARE : String;
+	static var SOFTWARE : String;
+	static var UNDEFINED : String;
+}

+ 11 - 0
std/flash/media/AVTimeline.hx

@@ -0,0 +1,11 @@
+package flash.media;
+
+extern class AVTimeline {
+	var complete(default,null) : Bool;
+	var firstPeriodIndex(default,null) : Int;
+	var lastPeriodIndex(default,null) : Int;
+	var type(default,null) : String;
+	var virtualDuration(default,null) : Float;
+	var virtualStartTime(default,null) : Float;
+	function new(init_type : String, init_virtualStartTime : Float, init_virtualDuration : Float, init_firstPeriodIndex : Int, init_lastPeriodIndex : Int, init_complete : Bool) : Void;
+}

+ 14 - 0
std/flash/media/AVTrackInfo.hx

@@ -0,0 +1,14 @@
+package flash.media;
+
+extern class AVTrackInfo {
+	var activity(default,null) : Bool;
+	var autoSelect(default,null) : Bool;
+	var dataTrackInfoServiceType(default,null) : String;
+	var defaultTrack(default,null) : Bool;
+	var description(default,null) : String;
+	var forced(default,null) : Bool;
+	var language(default,null) : String;
+	function new(init_description : String, init_language : String, init_defaultTrack : Bool, init_autoSelect : Bool, init_forced : Bool, init_activity : Bool, init_dataTrackInfoServiceType : String) : Void;
+	static var DTI_608_CAPTIONS : String;
+	static var DTI_708_CAPTIONS : String;
+}

+ 1 - 0
std/flash/media/StageVideo.hx

@@ -9,6 +9,7 @@ package flash.media;
 	var viewPort : flash.geom.Rectangle;
 	var zoom : flash.geom.Point;
 	function new() : Void;
+	@:require(flash11_7) function attachAVStream(avStream : AVStream) : Void;
 	@:require(flash11_4) function attachCamera(theCamera : Camera) : Void;
 	function attachNetStream(netStream : flash.net.NetStream) : Void;
 }

+ 1 - 0
std/flash/net/SharedObject.hx

@@ -15,6 +15,7 @@ extern class SharedObject extends flash.events.EventDispatcher {
 	function setDirty(propertyName : String) : Void;
 	function setProperty(propertyName : String, ?value : flash.utils.Object) : Void;
 	static var defaultObjectEncoding : UInt;
+	@:require(flash11_7) static var preventBackup : Bool;
 	static function deleteAll(url : String) : Int;
 	static function getDiskUsage(url : String) : Int;
 	static function getLocal(name : String, ?localPath : String, secure : Bool = false) : SharedObject;

+ 1 - 0
std/flash/system/AuthorizedFeatures.hx

@@ -4,6 +4,7 @@ package flash.system;
 	function new() : Void;
 	function createApplicationInstaller(strings : flash.xml.XML, icon : flash.utils.ByteArray) : ApplicationInstaller;
 	@:require(flash11_4) function enableDiskCache(stream : flash.net.URLStream) : Bool;
+	@:require(flash11_7) function enableHLSPlayback(stream : flash.media.AVStream) : Bool;
 	@:require(flash11_4) function isFeatureEnabled(feature : String, ?data : String) : Bool;
 	@:require(flash11_4) function isNegativeToken() : Bool;
 }

+ 1 - 0
std/flash/system/AuthorizedFeaturesLoader.hx

@@ -4,5 +4,6 @@ package flash.system;
 	var authorizedFeatures(default,null) : AuthorizedFeatures;
 	function new() : Void;
 	function loadAuthorizedFeatures() : Void;
+	@:require(flash11_7) function loadAuthorizedFeaturesFromData(data : flash.utils.ByteArray) : Void;
 	@:require(flash11_4) function makeGlobal() : Void;
 }

+ 5 - 8
std/flash/ui/GameInputControl.hx

@@ -1,13 +1,10 @@
 package flash.ui;
 
-@:final extern class GameInputControl extends flash.events.EventDispatcher {
+extern class GameInputControl extends flash.events.EventDispatcher implements Dynamic {
 	var device(default,null) : GameInputDevice;
-	var finger(default,null) : GameInputFinger;
-	var hand(default,null) : GameInputHand;
-	var index(default,null) : Int;
-	var numValues(default,null) : Int;
-	var relative(default,null) : Bool;
-	var type(default,null) : GameInputControlType;
+	var id(default,null) : String;
+	var maxValue(default,null) : Float;
+	var minValue(default,null) : Float;
+	var value(default,null) : Float;
 	function new() : Void;
-	function getValueAt(index : Int = 0) : Float;
 }

+ 2 - 2
std/flash/ui/GameInputDevice.hx

@@ -1,6 +1,6 @@
 package flash.ui;
 
-@:final @:require(flash11_2) extern class GameInputDevice extends flash.events.EventDispatcher {
+@:final @:require(flash11_2) extern class GameInputDevice {
 	var enabled : Bool;
 	var id(default,null) : String;
 	var name(default,null) : String;
@@ -9,7 +9,7 @@ package flash.ui;
 	function new() : Void;
 	function getCachedSamples(data : flash.utils.ByteArray, append : Bool = false) : Int;
 	function getControlAt(i : Int) : GameInputControl;
-	function startCachingSamples(numSamples : Int, controls : flash.Vector<Int>) : Void;
+	function startCachingSamples(numSamples : Int, controls : flash.Vector<String>) : Void;
 	function stopCachingSamples() : Void;
 	static var MAX_BUFFER_SIZE : Int;
 }