Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 87
View file
lightspark.spec
Changed
@@ -24,7 +24,7 @@ %bcond_with rtmp %endif Name: lightspark -Version: 0.7.2.99+git20151101.1724 +Version: 0.7.2.99+git20151107.1914 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/src/allclasses.h
Changed
@@ -234,6 +234,7 @@ REGISTER_CLASS_NAME(SecurityDomain,"flash.system") REGISTER_CLASS_NAME(System,"flash.system") REGISTER_CLASS_NAME(ASWorker,"flash.system") +REGISTER_CLASS_NAME(ImageDecodingPolicy,"flash.system") //Text REGISTER_CLASS_NAME2(ASFont,"Font","flash.text")
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -1105,6 +1105,10 @@ if (v) v->isenumerable = isEnum; } +void ASObject::destroyContents() +{ + Variables.destroyContents(); +} ASFUNCTIONBODY(ASObject,_constructor) { @@ -1839,15 +1843,14 @@ const variables_map::const_var_iterator beginIt = Variables.Variables.begin(); const variables_map::const_var_iterator endIt = Variables.Variables.end(); bool bfirst = true; + path.push_back(this); for(variables_map::const_var_iterator varIt=beginIt; varIt != endIt; ++varIt) { // check for cylic reference if (varIt->second.var->getObjectType() != T_UNDEFINED && varIt->second.var->getObjectType() != T_NULL && varIt->second.var->getObjectType() != T_BOOLEAN && - (varIt->second.var == this || - std::find(path.begin(),path.end(), varIt->second.var) != path.end() || - std::find(path.begin(),path.end(), this) != path.end() )) + std::find(path.begin(),path.end(), varIt->second.var) != path.end()) throwError<TypeError>(kJSONCyclicStructure); if (replacer != NULL) @@ -1887,15 +1890,12 @@ res += varIt->second.var->toJSON(path,replacer,spaces+spaces,filter); bfirst = false; } - if (varIt->second.var->getObjectType() != T_UNDEFINED && - varIt->second.var->getObjectType() != T_NULL && - varIt->second.var->getObjectType() != T_BOOLEAN) - path.push_back(varIt->second.var); } if (!bfirst) res += newline+spaces.substr_bytes(0,spaces.numBytes()/2); res += "}"; + path.pop_back(); } return res; }
View file
lightspark.tar.xz/src/asobject.h
Changed
@@ -80,7 +80,7 @@ c* th = obj->as<c>(); \ if(argslen != 0) \ throw Class<ArgumentError>::getInstanceS("Arguments provided in getter"); \ - LOG(LOG_NOT_IMPLEMENTED,obj->getClassName() <<"."<< #name << " is not implemented"); \ + LOG(LOG_NOT_IMPLEMENTED,obj->getClassName() <<"."<< #name << " getter is not implemented"); \ return ArgumentConversion<decltype(th->name)>::toAbstract(th->name); \ } @@ -97,6 +97,19 @@ return NULL; \ } +#define ASFUNCTIONBODY_SETTER_NOT_IMPLEMENTED(c,name) \ + ASObject* c::_setter_##name(ASObject* obj, ASObject* const* args, const unsigned int argslen) \ + { \ + if(!obj->is<c>()) \ + throw Class<ArgumentError>::getInstanceS("Function applied to wrong object"); \ + c* th = obj->as<c>(); \ + if(argslen != 1) \ + throw Class<ArgumentError>::getInstanceS("Wrong number of arguments in setter"); \ + LOG(LOG_NOT_IMPLEMENTED,obj->getClassName() <<"."<< #name << " setter is not implemented"); \ + th->name = ArgumentConversion<decltype(th->name)>::toConcrete(args[0]); \ + return NULL; \ + } + /* full body for a getter declared by ASPROPERTY_SETTER or ASFUNCTION_SETTER. * After the property has been updated, the callback member function is called with the old value * as parameter */ @@ -119,6 +132,10 @@ ASFUNCTIONBODY_GETTER(c,name) \ ASFUNCTIONBODY_SETTER(c,name) +#define ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(c,name) \ + ASFUNCTIONBODY_GETTER_NOT_IMPLEMENTED(c,name) \ + ASFUNCTIONBODY_SETTER_NOT_IMPLEMENTED(c,name) + #define ASFUNCTIONBODY_GETTER_SETTER_CB(c,name,callback) \ ASFUNCTIONBODY_GETTER(c,name) \ ASFUNCTIONBODY_SETTER_CB(c,name,callback) @@ -514,6 +531,7 @@ void setConstructorCallComplete() { constructorCallComplete = true; } void setIsEnumerable(const multiname& name, bool isEnum); + void destroyContents(); }; class Number;
View file
lightspark.tar.xz/src/backends/builtindecoder.cpp
Changed
@@ -144,6 +144,8 @@ #endif videoDecoder->decodeData(tag.packetData,tag.packetLen, frameTime); videoDecoder->framesdecoded++; + if (videoDecoder->frameRate != 0) + frameRate = videoDecoder->frameRate; decodedVideoFrames++; } } @@ -159,6 +161,8 @@ { videoDecoder->decodeData(tag.packetData,tag.packetLen, frameTime); videoDecoder->framesdecoded++; + if (videoDecoder->frameRate != 0) + frameRate = videoDecoder->frameRate; decodedVideoFrames++; } } @@ -168,7 +172,7 @@ { ScriptDataTag tag(stream); prevSize=tag.getTotalLen(); - netstream->sendClientNotification(tag.methodName,tag.dataobject.getPtr()); + netstream->sendClientNotification(tag.methodName,tag.dataobjectlist); break; } default:
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -762,7 +762,7 @@ int out_linesize; int out_samples = avresample_available(avr) + av_rescale_rnd(avresample_get_delay(avr) + frameIn->linesize[0], frameIn->sample_rate, frameIn->sample_rate, AV_ROUND_UP); av_samples_alloc(&output, &out_linesize, frameIn->nb_samples, out_samples, AV_SAMPLE_FMT_S16, 0); - maxLen = avresample_convert(avr, &output, out_linesize, out_samples, frameIn->extended_data, frameIn->linesize[0], frameIn->nb_samples)*4; + maxLen = avresample_convert(avr, &output, out_linesize, out_samples, frameIn->extended_data, frameIn->linesize[0], frameIn->nb_samples)*2*frameIn->channels; // 2 bytes in AV_SAMPLE_FMT_S16 memcpy(curTail.samples, output, maxLen); av_freep(&output); avresample_free(&avr);
View file
lightspark.tar.xz/src/parsing/amf3_generator.cpp
Changed
@@ -604,16 +604,20 @@ _R<ASObject> ret=_MR(Class<ASObject>::getInstanceS()); //Read name, value pairs - while(count) + while(true) { tiny_string varName = parseStringAMF0(); if (varName == "") + { + uint8_t marker = 0; + input->readByte(marker); + if (marker == amf0_object_end_marker ) + break; throw ParseException("empty key in AMF0 ECMA array"); + } _R<ASObject> value=parseValue(stringMap, objMap, traitsMap); value->incRef(); - ret->setVariableByQName(varName,"",value.getPtr(),DYNAMIC_TRAIT); - count--; } return ret; }
View file
lightspark.tar.xz/src/parsing/flv.cpp
Changed
@@ -94,21 +94,26 @@ { unsigned int start=s.tellg(); - _R<ByteArray> b = _NR<ByteArray>(Class<ByteArray>::getInstanceS()); - uint8_t* data =b->getBuffer(dataSize,true); - s.read((char*)data,dataSize); - b->setObjectEncoding(ObjectEncoding::AMF0); - b->setCurrentObjectEncoding(ObjectEncoding::AMF0); - b->setPosition(0); - uint8_t tagtype; - if (!b->readByte(tagtype)) - throw ParseException("Not enough data to parse tag type"); - if (tagtype != amf0_string_marker) - throw ParseException("wrong tagtype in ScriptDataTag"); - - Amf3Deserializer d(b.getPtr()); - methodName=d.parseStringAMF0(); - dataobject = d.readObject(); + if (dataSize > 0) + { + _R<ByteArray> b = _NR<ByteArray>(Class<ByteArray>::getInstanceS()); + uint8_t* data =b->getBuffer(dataSize,true); + s.read((char*)data,dataSize); + b->setObjectEncoding(ObjectEncoding::AMF0); + b->setCurrentObjectEncoding(ObjectEncoding::AMF0); + b->setPosition(0); + uint8_t tagtype; + if (!b->readByte(tagtype)) + throw ParseException("Not enough data to parse tag type"); + if (tagtype != amf0_string_marker) + throw ParseException("wrong tagtype in ScriptDataTag"); + + Amf3Deserializer d(b.getPtr()); + methodName=d.parseStringAMF0(); + + while (b->getPosition() < dataSize) + dataobjectlist.push_back(d.readObject()); + } //Compute totalLen unsigned int end=s.tellg();
View file
lightspark.tar.xz/src/parsing/flv.h
Changed
@@ -63,7 +63,7 @@ { public: tiny_string methodName; - _NR<ASObject> dataobject; + std::list<_NR<ASObject> > dataobjectlist; ScriptDataTag() {} ScriptDataTag(std::istream& s); };
View file
lightspark.tar.xz/src/scripting/abc.cpp
Changed
@@ -479,6 +479,8 @@ builtin->registerBuiltin("LoaderContext","flash.system",Class<LoaderContext>::getRef()); builtin->registerBuiltin("System","flash.system",Class<System>::getRef()); builtin->registerBuiltin("Worker","flash.system",Class<ASWorker>::getRef()); + builtin->registerBuiltin("ImageDecodingPolicy","flash.system",Class<ImageDecodingPolicy>::getRef()); + builtin->registerBuiltin("SoundTransform","flash.media",Class<SoundTransform>::getRef()); builtin->registerBuiltin("Video","flash.media",Class<Video>::getRef());
View file
lightspark.tar.xz/src/scripting/flash/display/DisplayObject.cpp
Changed
@@ -410,6 +410,13 @@ ABCVm::publicHandleEvent(_MR(this),e); else getVm()->addEvent(_MR(this),e); + if (getStage()) + { + // it seems that DisplayObjects can expect a StageVideoAvailabilityEvent after + // they are added to the stage + getStage()->incRef(); + getVm()->addEvent(_MR(getStage()),_MR(Class<StageVideoAvailabilityEvent>::getInstanceS())); + } } else if(onStage==false) {
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.cpp
Changed
@@ -55,7 +55,7 @@ contentType("application/x-shockwave-flash"), bytesLoaded(0),bytesTotal(0),sharedEvents(NullRef), loader(NullRef),bytesData(NullRef),loadStatus(STARTED),actionScriptVersion(3),swfVersion(0), - childAllowsParent(true),uncaughtErrorEvents(NullRef),parentAllowsChild(true) + childAllowsParent(true),uncaughtErrorEvents(NullRef),parentAllowsChild(true),frameRate(0) { LOG(LOG_NOT_IMPLEMENTED,"LoaderInfo: childAllowsParent and parentAllowsChild always return true"); } @@ -64,7 +64,7 @@ contentType("application/x-shockwave-flash"), bytesLoaded(0),bytesTotal(0),sharedEvents(NullRef), loader(l),bytesData(NullRef),loadStatus(STARTED),actionScriptVersion(3),swfVersion(0), - childAllowsParent(true),uncaughtErrorEvents(NullRef),parentAllowsChild(true) + childAllowsParent(true),uncaughtErrorEvents(NullRef),parentAllowsChild(true),frameRate(0) { LOG(LOG_NOT_IMPLEMENTED,"LoaderInfo: childAllowsParent and parentAllowsChild always return true"); } @@ -90,6 +90,7 @@ REGISTER_GETTER(c,contentType); REGISTER_GETTER(c,uncaughtErrorEvents); REGISTER_GETTER(c,parentAllowsChild); + REGISTER_GETTER(c,frameRate); } ASFUNCTIONBODY_GETTER(LoaderInfo,parameters); @@ -99,6 +100,7 @@ ASFUNCTIONBODY_GETTER(LoaderInfo,swfVersion); ASFUNCTIONBODY_GETTER(LoaderInfo,uncaughtErrorEvents); ASFUNCTIONBODY_GETTER(LoaderInfo,parentAllowsChild); +ASFUNCTIONBODY_GETTER(LoaderInfo,frameRate); void LoaderInfo::buildTraits(ASObject* o) { @@ -131,12 +133,12 @@ { SpinlockLocker l(spinlock); bytesLoaded=b; - if(isVmThread()) + if(getVm()) { this->incRef(); getVm()->addEvent(_MR(this),_MR(Class<ProgressEvent>::getInstanceS(bytesLoaded,bytesTotal))); } - if(loadStatus==INIT_SENT) + if(loadStatus==INIT_SENT || (bytesLoaded == bytesTotal)) { //The clip is also complete now this->incRef(); @@ -351,6 +353,8 @@ { assert_and_throw(bytes->bytes); + loaderInfo->incRef(); + getVm()->addEvent(loaderInfo,_MR(Class<Event>::getInstanceS("open"))); loaderInfo->setBytesTotal(bytes->getLength()); loaderInfo->setBytesLoaded(bytes->getLength()); @@ -2120,6 +2124,7 @@ REGISTER_GETTER_SETTER(c,showDefaultContextMenu); REGISTER_GETTER_SETTER(c,quality); REGISTER_GETTER_SETTER(c,stageFocusRect); + REGISTER_GETTER(c,allowsFullScreen); } ASFUNCTIONBODY_GETTER_SETTER_CB(Stage,align,onAlign); @@ -2129,6 +2134,7 @@ ASFUNCTIONBODY_GETTER_SETTER_CB(Stage,fullScreenSourceRect,onFullScreenSourceRect); ASFUNCTIONBODY_GETTER_SETTER(Stage,quality); ASFUNCTIONBODY_GETTER_SETTER(Stage,stageFocusRect); // stub +ASFUNCTIONBODY_GETTER_NOT_IMPLEMENTED(Stage,allowsFullScreen); // stub void Stage::onDisplayState(const tiny_string&) { @@ -2165,7 +2171,7 @@ Stage::Stage(Class_base* c): DisplayObjectContainer(c), colorCorrection("default"), - showDefaultContextMenu(true), quality("high") + showDefaultContextMenu(true),quality("high"),stageFocusRect(false),allowsFullScreen(false) { onStage = true; }
View file
lightspark.tar.xz/src/scripting/flash/display/flashdisplay.h
Changed
@@ -254,6 +254,7 @@ ASPROPERTY_GETTER(bool, childAllowsParent); ASPROPERTY_GETTER(_NR<UncaughtErrorEvents>,uncaughtErrorEvents); ASPROPERTY_GETTER(bool,parentAllowsChild); + ASPROPERTY_GETTER(number_t,frameRate); LoaderInfo(Class_base* c); LoaderInfo(Class_base* c, _R<Loader> l); void finalize(); @@ -285,6 +286,7 @@ void setLoaderURL(const tiny_string& _url) { loaderURL=_url; } void setParameters(_NR<ASObject> p) { parameters = p; } void resetState(); + void setFrameRate(number_t f) { frameRate=f; } }; class URLRequest; @@ -561,6 +563,7 @@ ASPROPERTY_GETTER_SETTER(bool,showDefaultContextMenu); ASPROPERTY_GETTER_SETTER(tiny_string,quality); ASPROPERTY_GETTER_SETTER(bool,stageFocusRect); + ASPROPERTY_GETTER(bool,allowsFullScreen); }; class StageScaleMode: public ASObject
View file
lightspark.tar.xz/src/scripting/flash/media/flashmedia.cpp
Changed
@@ -30,15 +30,27 @@ using namespace lightspark; using namespace std; +SoundTransform::SoundTransform(Class_base* c): ASObject(c),leftToLeft(1.0),leftToRight(0),rightToLeft(0),rightToRight(1.0) +{ +} + void SoundTransform::sinit(Class_base* c) { CLASS_SETUP(c, ASObject, _constructor, CLASS_SEALED | CLASS_FINAL); REGISTER_GETTER_SETTER(c,volume); REGISTER_GETTER_SETTER(c,pan); + REGISTER_GETTER_SETTER(c,leftToLeft); + REGISTER_GETTER_SETTER(c,leftToRight); + REGISTER_GETTER_SETTER(c,rightToLeft); + REGISTER_GETTER_SETTER(c,rightToRight); } -ASFUNCTIONBODY_GETTER_SETTER(SoundTransform,volume); -ASFUNCTIONBODY_GETTER_SETTER(SoundTransform,pan); +ASFUNCTIONBODY_GETTER_SETTER(SoundTransform,volume) +ASFUNCTIONBODY_GETTER_SETTER(SoundTransform,pan) +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(SoundTransform,leftToLeft) +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(SoundTransform,leftToRight) +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(SoundTransform,rightToLeft) +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(SoundTransform,rightToRight) ASFUNCTIONBODY(SoundTransform,_constructor) { @@ -555,7 +567,7 @@ do { decoder->decodeStreamSomePackets(stream, 0); - if (decoder->isValid()) + if (decoder->isValid() && (audioStream == NULL)) audioStream=getSys()->audioManager->createStreamPlugin(decoder); } while (!ACQUIRE_READ(stopped) && !stream.eof() && !stream.fail() && !stream.bad());
View file
lightspark.tar.xz/src/scripting/flash/media/flashmedia.h
Changed
@@ -78,9 +78,13 @@ class SoundTransform: public ASObject { public: - SoundTransform(Class_base* c):ASObject(c){} + SoundTransform(Class_base* c); ASPROPERTY_GETTER_SETTER(number_t,volume); ASPROPERTY_GETTER_SETTER(number_t,pan); + ASPROPERTY_GETTER_SETTER(number_t,leftToLeft); + ASPROPERTY_GETTER_SETTER(number_t,leftToRight); + ASPROPERTY_GETTER_SETTER(number_t,rightToLeft); + ASPROPERTY_GETTER_SETTER(number_t,rightToRight); static void sinit(Class_base*); ASFUNCTION(_constructor); }; @@ -88,7 +92,7 @@ class SoundChannel : public EventDispatcher, public IThreadJob { private: - _NR<StreamCache> stream; + _NR<StreamCache> stream; Mutex mutex; ACQUIRE_RELEASE_FLAG(stopped); AudioDecoder* audioDecoder;
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.cpp
Changed
@@ -398,6 +398,10 @@ { //Send a complete event for this object loader->setData(data); + + loader->incRef(); + getVm()->addEvent(loader,_MR(Class<ProgressEvent>::getInstanceS(downloader->getLength(),downloader->getLength()))); + //Send a complete event for this object loader->incRef(); getVm()->addEvent(loader,_MR(Class<Event>::getInstanceS("complete"))); } @@ -416,7 +420,7 @@ } } -URLLoader::URLLoader(Class_base* c):EventDispatcher(c),dataFormat("text"),data(),job(NULL) +URLLoader::URLLoader(Class_base* c):EventDispatcher(c),dataFormat("text"),data(),job(NULL),timestamp_last_progress(0) { } @@ -473,6 +477,13 @@ void URLLoader::setBytesLoaded(uint32_t b) { bytesLoaded = b; + uint64_t cur=compat_get_thread_cputime_us(); + if (cur > timestamp_last_progress+ 40*1000) + { + timestamp_last_progress = cur; + this->incRef(); + getVm()->addEvent(_MR(this),_MR(Class<ProgressEvent>::getInstanceS(b,bytesTotal))); + } } ASFUNCTIONBODY(URLLoader,_constructor) @@ -609,6 +620,7 @@ CLASS_SETUP_NO_CONSTRUCTOR(c, EventDispatcher, CLASS_SEALED); c->setDeclaredMethodByQName("getLocal","",Class<IFunction>::getFunction(getLocal),NORMAL_METHOD,false); c->setDeclaredMethodByQName("flush","",Class<IFunction>::getFunction(flush),NORMAL_METHOD,true); + c->setDeclaredMethodByQName("clear","",Class<IFunction>::getFunction(clear),NORMAL_METHOD,true); REGISTER_GETTER(c,data); } @@ -641,6 +653,12 @@ LOG(LOG_NOT_IMPLEMENTED,"SharedObject.flush not implemented"); return NULL; } +ASFUNCTIONBODY(SharedObject,clear) +{ + SharedObject* th=static_cast<SharedObject*>(obj); + th->data->destroyContents(); + return NULL; +} void ObjectEncoding::sinit(Class_base* c) { @@ -1086,6 +1104,7 @@ REGISTER_GETTER_SETTER(c, bufferTimeMax); REGISTER_GETTER_SETTER(c, maxPauseBufferTime); REGISTER_GETTER_SETTER(c,soundTransform); + REGISTER_GETTER_SETTER(c,useHardwareDecoder); c->setDeclaredMethodByQName("info","",Class<IFunction>::getFunction(_getInfo),GETTER_METHOD,true); } @@ -1100,6 +1119,7 @@ ASFUNCTIONBODY_GETTER_SETTER(NetStream, bufferTimeMax); ASFUNCTIONBODY_GETTER_SETTER(NetStream, maxPauseBufferTime); ASFUNCTIONBODY_GETTER_SETTER(NetStream,soundTransform); +ASFUNCTIONBODY_GETTER_SETTER(NetStream,useHardwareDecoder); ASFUNCTIONBODY(NetStream,_getInfo) { @@ -1745,7 +1765,7 @@ this->playbackBytesPerSecond = s.tellg() / (framesdecoded / frameRate); // TODO this overrides the real number of decoded frames // otherwise on slow computers we never get the buffer filled - framesdecoded = (this->getReceivedLength() / this->playbackBytesPerSecond) * frameRate; + //framesdecoded = (this->getReceivedLength() / this->playbackBytesPerSecond) * frameRate; this->bufferLength = (framesdecoded / frameRate) - (streamTime-prevstreamtime)/1000.0; } countermutex.unlock(); @@ -1767,15 +1787,14 @@ getVm()->addEvent(_MR(this), _MR(Class<NetStatusEvent>::getInstanceS("status", "NetStream.Play.Start"))); } + if(audioDecoder==NULL && streamDecoder->audioDecoder) + audioDecoder=streamDecoder->audioDecoder; + + if(audioStream==NULL && audioDecoder && audioDecoder->isValid() && getSys()->audioManager->pluginLoaded()) + audioStream=getSys()->audioManager->createStreamPlugin(audioDecoder); if(!tickStarted && isReady() && ((framesdecoded / frameRate) >= this->bufferTime)) { - if(audioDecoder==NULL && streamDecoder->audioDecoder) - audioDecoder=streamDecoder->audioDecoder; - - if(audioStream==NULL && audioDecoder && audioDecoder->isValid() && getSys()->audioManager->pluginLoaded()) - audioStream=getSys()->audioManager->createStreamPlugin(audioDecoder); - tickStarted=true; this->incRef(); getVm()->addEvent(_MR(this), @@ -1878,9 +1897,9 @@ } } -void NetStream::sendClientNotification(const tiny_string& name, ASObject *arg) +void NetStream::sendClientNotification(const tiny_string& name, std::list<_NR<ASObject> >& arglist) { - if (client.isNull() || !arg) + if (client.isNull()) return; multiname callbackName(NULL); @@ -1890,15 +1909,20 @@ _NR<ASObject> callback = client->getVariableByMultiname(callbackName); if(!callback.isNull() && callback->is<Function>()) { - ASObject* callbackArgs[1]; + ASObject* callbackArgs[arglist.size()]; client->incRef(); - arg->incRef(); - callbackArgs[0] = arg; + int i= 0; + for (auto it = arglist.cbegin();it != arglist.cend(); it++) + { + _NR<ASObject> arg = (*it); + arg->incRef(); + callbackArgs[i++] = arg.getPtr(); + } callback->incRef(); _R<FunctionEvent> event(new (getSys()->unaccountedMemory) FunctionEvent(_MR( static_cast<IFunction*>(callback.getPtr())), - _MR(client), callbackArgs, 1)); + _MR(client), callbackArgs, arglist.size())); getVm()->addEvent(NullRef,event); } }
View file
lightspark.tar.xz/src/scripting/flash/net/flashnet.h
Changed
@@ -113,6 +113,7 @@ static void sinit(Class_base*); ASFUNCTION(getLocal); ASFUNCTION(flush); + ASFUNCTION(clear); ASPROPERTY_GETTER(_NR<ASObject>,data); }; @@ -142,6 +143,7 @@ _NR<ASObject> data; Spinlock spinlock; URLLoaderThread *job; + uint64_t timestamp_last_progress; public: URLLoader(Class_base* c); void finalize(); @@ -319,8 +321,9 @@ ASPROPERTY_GETTER_SETTER(number_t, bufferTime); ASPROPERTY_GETTER_SETTER(number_t, bufferTimeMax); ASPROPERTY_GETTER_SETTER(number_t, maxPauseBufferTime); + ASPROPERTY_GETTER_SETTER(bool, useHardwareDecoder); - void sendClientNotification(const tiny_string& name, ASObject *args); + void sendClientNotification(const tiny_string& name, std::list<_NR<ASObject> >& arglist); //Interface for video /**
View file
lightspark.tar.xz/src/scripting/flash/system/flashsystem.cpp
Changed
@@ -403,7 +403,7 @@ } LoaderContext::LoaderContext(Class_base* c): - ASObject(c),allowCodeImport(true),checkPolicyFile(false) + ASObject(c),allowCodeImport(true),checkPolicyFile(false),imageDecodingPolicy("onDemand") { } @@ -417,6 +417,7 @@ REGISTER_GETTER_SETTER(c, checkPolicyFile); REGISTER_GETTER_SETTER(c, parameters); REGISTER_GETTER_SETTER(c, securityDomain); + REGISTER_GETTER_SETTER(c, imageDecodingPolicy); } void LoaderContext::finalize() @@ -440,6 +441,7 @@ ASFUNCTIONBODY_GETTER_SETTER(LoaderContext, checkPolicyFile); ASFUNCTIONBODY_GETTER_SETTER(LoaderContext, parameters); ASFUNCTIONBODY_GETTER_SETTER(LoaderContext, securityDomain); +ASFUNCTIONBODY_GETTER_SETTER_NOT_IMPLEMENTED(LoaderContext, imageDecodingPolicy); bool LoaderContext::getCheckPolicyFile() { @@ -626,4 +628,10 @@ return Class<ASObject>::getInstanceS(); } +void ImageDecodingPolicy::sinit(Class_base* c) +{ + CLASS_SETUP(c, ASObject, _constructorNotInstantiatable, CLASS_SEALED | CLASS_FINAL); + c->setVariableByQName("ON_DEMAND","",Class<ASString>::getInstanceS("onDemand"),CONSTANT_TRAIT); + c->setVariableByQName("ON_LOAD ","",Class<ASString>::getInstanceS("onLoad"),CONSTANT_TRAIT); +}
View file
lightspark.tar.xz/src/scripting/flash/system/flashsystem.h
Changed
@@ -119,6 +119,7 @@ ASPROPERTY_GETTER_SETTER(bool, checkPolicyFile); ASPROPERTY_GETTER_SETTER(_NR<ASObject>, parameters); ASPROPERTY_GETTER_SETTER(_NR<SecurityDomain>, securityDomain); + ASPROPERTY_GETTER_SETTER(tiny_string, imageDecodingPolicy); void finalize(); bool getAllowCodeImport(); bool getCheckPolicyFile(); @@ -167,6 +168,12 @@ ASFUNCTION(_getCurrent); ASFUNCTION(getSharedProperty); }; +class ImageDecodingPolicy: public ASObject +{ +public: + ImageDecodingPolicy(Class_base* c):ASObject(c){} + static void sinit(Class_base* c); +}; } #endif /* SCRIPTING_FLASH_SYSTEM_FLASHSYSTEM_H */
View file
lightspark.tar.xz/src/scripting/flash/utils/IntervalRunner.cpp
Changed
@@ -56,6 +56,7 @@ } _R<FunctionEvent> event(new (getSys()->unaccountedMemory) FunctionEvent(callback, obj, args, argslen)); getVm()->addEvent(NullRef,event); + event->done.wait(); if(type == TIMEOUT) { //TODO: IntervalRunner deletes itself. Is this allowed?
View file
lightspark.tar.xz/src/scripting/flash/xml/flashxml.cpp
Changed
@@ -248,8 +248,17 @@ th->node.append_move(c->node); if (!c->root.isNull()) c->root->decRef(); - c->root = th->root; - th->root->incRef(); + if (th->is<XMLDocument>()) + { + th->incRef(); + c->root = _MR(th->as<XMLDocument>()); + } + else + { + assert_and_throw(!th->root.isNull()); + c->root = th->root; + th->root->incRef(); + } return NULL; } tiny_string XMLNode::toString()
View file
lightspark.tar.xz/src/scripting/toplevel/Array.cpp
Changed
@@ -1626,13 +1626,13 @@ tiny_string res = call_toJSON(ok,path,replacer,spaces,filter); if (ok) return res; - - res += "["; - std::map<uint32_t,data_slot>::iterator it; // check for cylic reference if (std::find(path.begin(),path.end(), this) != path.end()) throwError<TypeError>(kJSONCyclicStructure); + path.push_back(this); + res += "["; + std::map<uint32_t,data_slot>::iterator it; bool bfirst = true; tiny_string newline = (spaces.empty() ? "" : "\n"); for (it=data.begin() ; it != data.end(); ++it) @@ -1672,11 +1672,11 @@ bfirst = false; res += subres; } - path.push_back(o); } if (!bfirst) res += newline+spaces.substr_bytes(0,spaces.numBytes()/2); res += "]"; + path.pop_back(); return res; }
View file
lightspark.tar.xz/src/scripting/toplevel/JSON.cpp
Changed
@@ -55,7 +55,7 @@ if (argslen > 0 && (args[0]->is<Null>() ||args[0]->is<Undefined>())) throwError<SyntaxError>(kJSONInvalidParseInput); - ARG_UNPACK(text); + ARG_UNPACK_MORE_ALLOWED(text); if (argslen > 1) { if (!args[1]->is<IFunction>()) @@ -72,7 +72,7 @@ ASFUNCTIONBODY(JSON,_stringify) { _NR<ASObject> value; - ARG_UNPACK(value); + ARG_UNPACK_MORE_ALLOWED(value); std::vector<ASObject *> path; tiny_string filter; IFunction* replacer = NULL; @@ -131,7 +131,7 @@ } void JSON::parseAll(const tiny_string &jsonstring, ASObject** parent , const multiname& key, IFunction *reviver) { - int len = jsonstring.numBytes(); + int len = jsonstring.numChars(); int pos = 0; while (pos < len) { @@ -154,7 +154,7 @@ jsonstring.charAt(pos) == '\r' ) pos++; - int len = jsonstring.numBytes(); + int len = jsonstring.numChars(); if (pos < len) { char c = jsonstring.charAt(pos); @@ -241,7 +241,7 @@ } int JSON::parseTrue(const tiny_string &jsonstring, int pos,ASObject** parent,const multiname& key) { - int len = jsonstring.numBytes(); + int len = jsonstring.numChars(); if (len >= pos+4) { if (jsonstring.charAt(pos) == 't' && @@ -264,7 +264,7 @@ } int JSON::parseFalse(const tiny_string &jsonstring, int pos,ASObject** parent,const multiname& key) { - int len = jsonstring.numBytes(); + int len = jsonstring.numChars(); if (len >= pos+5) { if (jsonstring.charAt(pos) == 'f' && @@ -288,7 +288,7 @@ } int JSON::parseNull(const tiny_string &jsonstring, int pos,ASObject** parent,const multiname& key) { - int len = jsonstring.numBytes(); + int len = jsonstring.numChars(); if (len >= pos+4) { if (jsonstring.charAt(pos) == 'n' && @@ -428,7 +428,7 @@ } int JSON::parseNumber(const tiny_string &jsonstring, int pos, ASObject** parent, const multiname& key) { - int len = jsonstring.numBytes(); + int len = jsonstring.numChars(); tiny_string res; bool done = false; while (!done && pos < len)
View file
lightspark.tar.xz/src/scripting/toplevel/Vector.cpp
Changed
@@ -1099,12 +1099,12 @@ tiny_string res = call_toJSON(ok,path,replacer,spaces,filter); if (ok) return res; - - res += "["; // check for cylic reference if (std::find(path.begin(),path.end(), this) != path.end()) throwError<TypeError>(kJSONCyclicStructure); + path.push_back(this); + res += "["; bool bfirst = true; tiny_string newline = (spaces.empty() ? "" : "\n"); for (uint i =0; i < vec.size(); i++) @@ -1138,11 +1138,11 @@ bfirst = false; res += subres; } - path.push_back(o); } if (!bfirst) res += newline+spaces.substr_bytes(0,spaces.numBytes()/2); res += "]"; + path.pop_back(); return res; } @@ -1197,7 +1197,11 @@ for(uint32_t i=0;i<count;i++) { if (!vec[i]) + { + //TODO should we write a null_marker here? + LOG(LOG_NOT_IMPLEMENTED,"serialize unset vector objects"); continue; + } switch (marker) { case vector_int_marker:
View file
lightspark.tar.xz/src/swf.cpp
Changed
@@ -1283,6 +1283,7 @@ frameRate/=256; LOG(LOG_INFO,_("FrameRate ") << frameRate); root->setFrameRate(frameRate); + root->loaderInfo->setFrameRate(frameRate); //TODO: setting render rate should be done when the clip is added to the displaylist getSys()->setRenderRate(frameRate); root->setFrameSize(FrameSize); @@ -1797,6 +1798,9 @@ { stage->incRef(); currentVm->addEvent(_MR(stage),_MR(Class<Event>::getInstanceS("resize",false))); + + stage->incRef(); + currentVm->addEvent(_MR(stage),_MR(Class<StageVideoAvailabilityEvent>::getInstanceS())); } }
View file
lightspark.tar.xz/src/threading.cpp
Changed
@@ -95,7 +95,8 @@ CondTime::CondTime(long milliseconds) { - timepoint=g_get_monotonic_time()+milliseconds*G_TIME_SPAN_MILLISECOND; + // round to full milliseconds + timepoint=((g_get_monotonic_time()+G_TIME_SPAN_MILLISECOND/2)/G_TIME_SPAN_MILLISECOND+milliseconds)*G_TIME_SPAN_MILLISECOND; } bool CondTime::operator<(CondTime& c) const
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.