Projects
Essentials
lightspark
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 112
View file
lightspark.spec
Changed
@@ -20,7 +20,7 @@ %bcond_without librtmp Name: lightspark -Version: 0.7.2.99+git20160710.1738 +Version: 0.7.2.99+git20160814.1809 Release: 0 Summary: Modern, free, open-source flash player implementation License: LGPL-3.0+
View file
lightspark.tar.xz/CMakeLists.txt
Changed
@@ -323,6 +323,8 @@ CHECK_FUNCTION_EXISTS(av_frame_alloc HAVE_AV_FRAME_ALLOC) CHECK_FUNCTION_EXISTS(av_frame_unref HAVE_AV_FRAME_UNREF) CHECK_FUNCTION_EXISTS(av_packet_unref HAVE_AV_PACKET_UNREF) + CHECK_FUNCTION_EXISTS(avcodec_send_packet HAVE_AVCODEC_SEND_PACKET) + CHECK_FUNCTION_EXISTS(avcodec_receive_frame HAVE_AVCODEC_RECEIVE_FRAME) CHECK_C_SOURCE_COMPILES("#include <libavcodec/avcodec.h>\nint main() { enum AVCodecID c; return 0; }" HAVE_AVCODECID) @@ -368,6 +370,12 @@ IF(HAVE_AV_PACKET_UNREF) ADD_DEFINITIONS(-DHAVE_AV_PACKET_UNREF) ENDIF(HAVE_AV_PACKET_UNREF) + IF(HAVE_AVCODEC_SEND_PACKET) + ADD_DEFINITIONS(-DHAVE_AVCODEC_SEND_PACKET) + ENDIF(HAVE_AVCODEC_SEND_PACKET) + IF(HAVE_AVCODEC_RECEIVE_FRAME) + ADD_DEFINITIONS(-DHAVE_AVCODEC_RECEIVE_FRAME) + ENDIF(HAVE_AVCODEC_RECEIVE_FRAME) ADD_DEFINITIONS(-DENABLE_LIBAVCODEC) ENDIF(ENABLE_LIBAVCODEC)
View file
lightspark.tar.xz/src/asobject.cpp
Changed
@@ -1344,8 +1344,8 @@ } } -ASObject::ASObject(Class_base* c,SWFOBJECT_TYPE t):objfreelist(c && c->isReusable ? c->freelist : NULL),Variables((c)?c->memoryAccount:NULL),varcount(0),classdef(c),proxyMultiName(NULL),sys(c?c->sys:NULL), - type(t),traitsInitialized(false),constructIndicator(false),constructorCallComplete(false),implEnable(true) +ASObject::ASObject(Class_base* c,SWFOBJECT_TYPE t,CLASS_SUBTYPE st):objfreelist(c && c->isReusable ? c->freelist : NULL),Variables((c)?c->memoryAccount:NULL),varcount(0),classdef(c),proxyMultiName(NULL),sys(c?c->sys:NULL), + type(t),subtype(st),traitsInitialized(false),constructIndicator(false),constructorCallComplete(false),implEnable(true) { #ifndef NDEBUG //Stuff only used in debugging @@ -1354,7 +1354,7 @@ } ASObject::ASObject(const ASObject& o):objfreelist(o.classdef && o.classdef->isReusable ? o.classdef->freelist : NULL),Variables((o.classdef)?o.classdef->memoryAccount:NULL),varcount(0),classdef(NULL),proxyMultiName(NULL),sys(o.classdef? o.classdef->sys : NULL), - type(o.type),traitsInitialized(false),constructIndicator(false),constructorCallComplete(false),implEnable(true) + type(o.type),subtype(o.subtype),traitsInitialized(false),constructIndicator(false),constructorCallComplete(false),implEnable(true) { #ifndef NDEBUG //Stuff only used in debugging
View file
lightspark.tar.xz/src/asobject.h
Changed
@@ -217,7 +217,7 @@ uint32_t nameId; nsNameAndKind ns; varName(uint32_t name, const nsNameAndKind& _ns):nameId(name),ns(_ns){} - bool operator<(const varName& r) const + inline bool operator<(const varName& r) const { //Sort by name first if(nameId==r.nameId) @@ -228,6 +228,10 @@ else return nameId<r.nameId; } + inline bool operator==(const varName& r) const + { + return nameId==r.nameId && ns == r.ns; + } }; class variables_map @@ -362,7 +366,7 @@ SystemState* sys; protected: ASObject(MemoryAccount* m):objfreelist(NULL),Variables(m),varcount(0),classdef(NULL),proxyMultiName(NULL),sys(NULL), - type(T_OBJECT),traitsInitialized(false),constructIndicator(false),constructorCallComplete(false),implEnable(true) + type(T_OBJECT),subtype(SUBTYPE_NOT_SET),traitsInitialized(false),constructIndicator(false),constructorCallComplete(false),implEnable(true) { #ifndef NDEBUG //Stuff only used in debugging @@ -376,6 +380,8 @@ destroy(); } SWFOBJECT_TYPE type; + CLASS_SUBTYPE subtype; + bool traitsInitialized:1; bool constructIndicator:1; bool constructorCallComplete:1; // indicates that the constructor including all super constructors has been called @@ -410,7 +416,7 @@ // called when object is really destroyed virtual void destroy(){} public: - ASObject(Class_base* c,SWFOBJECT_TYPE t = T_OBJECT); + ASObject(Class_base* c,SWFOBJECT_TYPE t = T_OBJECT,CLASS_SUBTYPE subtype = SUBTYPE_NOT_SET); #ifndef NDEBUG //Stuff only used in debugging @@ -658,6 +664,15 @@ class Type; class ASQName; class Namespace; +class Proxy; +class RegExp; +class XML; +class XMLList; +class Class_inherit; +class ObjectConstructor; +class Function_object; +class Date; + template<> inline bool ASObject::is<Number>() const { return type==T_NUMBER; } template<> inline bool ASObject::is<Integer>() const { return type==T_INTEGER; } template<> inline bool ASObject::is<UInteger>() const { return type==T_UINTEGER; } @@ -673,5 +688,15 @@ template<> inline bool ASObject::is<Type>() const { return type==T_CLASS; } template<> inline bool ASObject::is<ASQName>() const { return type==T_QNAME; } template<> inline bool ASObject::is<Namespace>() const { return type==T_NAMESPACE; } +template<> inline bool ASObject::is<Proxy>() const { return subtype==SUBTYPE_PROXY; } +template<> inline bool ASObject::is<RegExp>() const { return subtype==SUBTYPE_REGEXP; } +template<> inline bool ASObject::is<XML>() const { return subtype==SUBTYPE_XML; } +template<> inline bool ASObject::is<XMLList>() const { return subtype==SUBTYPE_XMLLIST; } +template<> inline bool ASObject::is<Date>() const { return subtype==SUBTYPE_DATE; } +template<> inline bool ASObject::is<Class_inherit>() const { return subtype==SUBTYPE_INHERIT; } +template<> inline bool ASObject::is<ObjectConstructor>() const { return subtype==SUBTYPE_OBJECTCONSTRUCTOR; } +template<> inline bool ASObject::is<Function_object>() const { return subtype==SUBTYPE_FUNCTIONOBJECT; } + + } #endif /* ASOBJECT_H */
View file
lightspark.tar.xz/src/backends/decoder.cpp
Changed
@@ -181,7 +181,47 @@ else status=INIT; } +#if LIBAVFORMAT_VERSION_MAJOR > 56 +FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecID codecID, double frameRateHint): + ownedContext(true),curBuffer(0),codecContext(NULL),curBufferOffset(0) +{ + status=INIT; +#ifdef HAVE_AVCODEC_ALLOC_CONTEXT3 + codecContext=avcodec_alloc_context3(NULL); +#else + codecContext=avcodec_alloc_context(); +#endif //HAVE_AVCODEC_ALLOC_CONTEXT3 + //The tag is the header, initialize decoding + switch(codecID) + { + case CODEC_ID_H264: + videoCodec=H264; + break; + case CODEC_ID_FLV1: + videoCodec=H263; + break; + case CODEC_ID_VP6F: + videoCodec=VP6; + break; + default: + return; + } + AVCodec* codec=avcodec_find_decoder(codecID); +#ifdef HAVE_AVCODEC_OPEN2 + if(avcodec_open2(codecContext, codec, NULL)<0) +#else + if(avcodec_open(codecContext, codec)<0) +#endif //HAVE_AVCODEC_ALLOC_CONTEXT3 + return; + + frameRate=frameRateHint; + if(fillDataAndCheckValidity()) + status=VALID; + + frameIn=av_frame_alloc(); +} +#else FFMpegVideoDecoder::FFMpegVideoDecoder(AVCodecContext* _c, double frameRateHint): ownedContext(false),curBuffer(0),codecContext(_c),curBufferOffset(0) { @@ -216,6 +256,8 @@ frameIn=av_frame_alloc(); } +#endif + FFMpegVideoDecoder::~FFMpegVideoDecoder() { @@ -277,7 +319,16 @@ if(datalen==0) return false; int frameOk=0; -#if HAVE_AVCODEC_DECODE_VIDEO2 +#if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME + AVPacket pkt; + av_init_packet(&pkt); + pkt.data=data; + pkt.size=datalen; + int ret = avcodec_send_packet(codecContext, &pkt); + if (ret == 0) + ret = avcodec_receive_frame(codecContext,frameIn); + frameOk=1; +#elif HAVE_AVCODEC_DECODE_VIDEO2 AVPacket pkt; av_init_packet(&pkt); pkt.data=data; @@ -309,7 +360,12 @@ { int frameOk=0; -#if HAVE_AVCODEC_DECODE_VIDEO2 +#if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME + int ret = avcodec_send_packet(codecContext, pkt); + if (ret == 0) + ret = avcodec_receive_frame(codecContext,frameIn); + frameOk=1; +#elif HAVE_AVCODEC_DECODE_VIDEO2 int ret=avcodec_decode_video2(codecContext, frameIn, &frameOk, pkt); #else int ret=avcodec_decode_video(codecContext, frameIn, &frameOk, pkt->data, pkt->size); @@ -538,6 +594,32 @@ #endif } +#if LIBAVFORMAT_VERSION_MAJOR > 56 +FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecID codecID):ownedContext(true),codecContext(NULL) +{ + status=INIT; + AVCodec* codec=avcodec_find_decoder(codecID); + assert(codec); +#ifdef HAVE_AVCODEC_ALLOC_CONTEXT3 + codecContext=avcodec_alloc_context3(NULL); +#else + codecContext=avcodec_alloc_context(); +#endif //HAVE_AVCODEC_ALLOC_CONTEXT3 + +#ifdef HAVE_AVCODEC_OPEN2 + if(avcodec_open2(codecContext, codec, NULL)<0) +#else + if(avcodec_open(codecContext, codec)<0) +#endif //HAVE_AVCODEC_ALLOC_CONTEXT3 + return; + + if(fillDataAndCheckValidity()) + status=VALID; +#if HAVE_AVCODEC_DECODE_AUDIO4 + frameIn=av_frame_alloc(); +#endif +} +#else FFMpegAudioDecoder::FFMpegAudioDecoder(AVCodecContext* _c):ownedContext(false),codecContext(_c) { status=INIT; @@ -557,6 +639,7 @@ frameIn=av_frame_alloc(); #endif } +#endif FFMpegAudioDecoder::~FFMpegAudioDecoder() { @@ -616,7 +699,7 @@ { FrameSamples& curTail=samplesBuffer.acquireLast(); int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; -#if HAVE_AVCODEC_DECODE_AUDIO3 || HAVE_AVCODEC_DECODE_AUDIO4 +#if HAVE_AVCODEC_DECODE_AUDIO3 || HAVE_AVCODEC_DECODE_AUDIO4 || (HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME) AVPacket pkt; av_init_packet(&pkt); @@ -637,8 +720,20 @@ pkt.size = combinedBuffer.size(); overflowBuffer.clear(); } - -#if HAVE_AVCODEC_DECODE_AUDIO4 +#if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME + av_frame_unref(frameIn); + int ret = avcodec_send_packet(codecContext, &pkt); + if (ret == 0) + ret = avcodec_receive_frame(codecContext,frameIn); + if(ret<0) + { + LOG(LOG_ERROR,"not decoded audio:"<<ret); + } + else + { + maxLen = resampleFrameToS16(curTail); + } +#elif HAVE_AVCODEC_DECODE_AUDIO4 av_frame_unref(frameIn); int frameOk=0; int32_t ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, &pkt); @@ -687,7 +782,20 @@ FrameSamples& curTail=samplesBuffer.acquireLast(); int maxLen=AVCODEC_MAX_AUDIO_FRAME_SIZE; -#if HAVE_AVCODEC_DECODE_AUDIO4 +#if HAVE_AVCODEC_SEND_PACKET && HAVE_AVCODEC_RECEIVE_FRAME + av_frame_unref(frameIn); + int ret = avcodec_send_packet(codecContext, pkt); + if (ret == 0) + ret = avcodec_receive_frame(codecContext,frameIn); + if(ret<0) + { + LOG(LOG_ERROR,"not decoded audio:"<<ret); + } + else + { + maxLen = resampleFrameToS16(curTail); + } +#elif HAVE_AVCODEC_DECODE_AUDIO4 av_frame_unref(frameIn); int frameOk=0; int ret=avcodec_decode_audio4(codecContext, frameIn, &frameOk, pkt); @@ -872,12 +980,20 @@ LOG_CALL(_("FFMpeg found ") << formatCtx->nb_streams << _(" streams")); for(uint32_t i=0;i<formatCtx->nb_streams;i++) { +#if LIBAVFORMAT_VERSION_MAJOR > 56 + if(formatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_VIDEO && videoFound==false) +#else if(formatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO && videoFound==false) +#endif { videoFound=true; videoIndex=(int32_t)i; } +#if LIBAVFORMAT_VERSION_MAJOR > 56 + else if(formatCtx->streams[i]->codecpar->codec_type==AVMEDIA_TYPE_AUDIO && formatCtx->streams[i]->codecpar->codec_id!=CODEC_ID_NONE && audioFound==false) +#else else if(formatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO && formatCtx->streams[i]->codec->codec_id!=CODEC_ID_NONE && audioFound==false) +#endif { audioFound=true; audioIndex=(int32_t)i; @@ -894,13 +1010,21 @@ AVRational rateRational = stream->avg_frame_rate; #endif double frameRate=av_q2d(rateRational); +#if LIBAVFORMAT_VERSION_MAJOR > 56 + customVideoDecoder=new FFMpegVideoDecoder(formatCtx->streams[videoIndex]->codecpar->codec_id,frameRate); +#else customVideoDecoder=new FFMpegVideoDecoder(formatCtx->streams[videoIndex]->codec,frameRate); +#endif videoDecoder=customVideoDecoder; } if(audioFound) { +#if LIBAVFORMAT_VERSION_MAJOR > 56 + customAudioDecoder=new FFMpegAudioDecoder(formatCtx->streams[audioIndex]->codecpar->codec_id); +#else customAudioDecoder=new FFMpegAudioDecoder(formatCtx->streams[audioIndex]->codec); +#endif audioDecoder=customAudioDecoder; }
View file
lightspark.tar.xz/src/backends/decoder.h
Changed
@@ -190,7 +190,11 @@ /* Specialized constructor used by FFMpegStreamDecoder */ +#if LIBAVFORMAT_VERSION_MAJOR > 56 + FFMpegVideoDecoder(AVCodecID codecID, double frameRateHint); +#else FFMpegVideoDecoder(AVCodecContext* codecContext, double frameRateHint); +#endif ~FFMpegVideoDecoder(); /* Specialized decoding used by FFMpegStreamDecoder @@ -314,7 +318,11 @@ /* Specialized constructor used by FFMpegStreamDecoder */ +#if LIBAVFORMAT_VERSION_MAJOR > 56 + FFMpegAudioDecoder(AVCodecID codecID); +#else FFMpegAudioDecoder(AVCodecContext* codecContext); +#endif ~FFMpegAudioDecoder(); /* Specialized decoding used by FFMpegStreamDecoder
View file
lightspark.tar.xz/src/parsing/tags.cpp
Changed
@@ -261,7 +261,10 @@ LOG(LOG_ERROR,_("Error while reading tag ") << h.getTagType() << _(". Size=") << actualLen << _(" expected: ") << expectedLen); throw ParseException("Malformed SWF file"); } - root->loaderInfo->setBytesLoaded(f.tellg()); + + // don't set loaded bytes if we are at the end of the file (this is done in RootMovieClip::initFrame() ) + if (root->loaderInfo->getBytesTotal() != f.tellg()) + root->loaderInfo->setBytesLoaded(f.tellg()); return ret; }
View file
lightspark.tar.xz/src/scripting/abc_opcodes.cpp
Changed
@@ -342,7 +342,7 @@ tmpcls = tmpcls->super; } } - if(!o.isNull() && !(obj->classdef && obj->classdef->isProxy)) + if(!o.isNull() && !obj->is<Proxy>()) { o->incRef(); callImpl(th, o.getPtr(), obj, args, m, called_mi, keepReturn); @@ -350,7 +350,7 @@ else { //If the object is a Proxy subclass, try to invoke callProperty - if(obj->classdef && obj->classdef->isProxy) + if(obj->is<Proxy>()) { //Check if there is a custom caller defined, skipping implementation to avoid recursive calls multiname callPropertyName(NULL); @@ -2157,7 +2157,7 @@ targetobject = xmlObj; xmlObj->getDescendantsByQName(name->normalizedName(th->context->root->getSystemState()), ns_uri,name->isAttribute, ret); } - else if(obj->getClass()->isProxy) + else if(obj->is<Proxy>()) { multiname callPropertyName(NULL); callPropertyName.name_type=multiname::NAME_STRING; @@ -2591,9 +2591,9 @@ void ABCVm::callImpl(call_context* th, ASObject* f, ASObject* obj, ASObject** args, int m, method_info** called_mi, bool keepReturn) { - if(f->is<Function>()) + if(f->is<IFunction>()) { - IFunction* func=f->as<Function>(); + IFunction* func=f->as<IFunction>(); ASObject* ret=func->call(obj,args,m); //call getMethodInfo only after the call, so it's updated if(called_mi)
View file
lightspark.tar.xz/src/scripting/class.cpp
Changed
@@ -64,6 +64,7 @@ this->getSystemState()->customClasses.insert(this).second; assert(ret); isReusable = true; + subtype = SUBTYPE_INHERIT; } ASObject* Class_inherit::getInstance(bool construct, ASObject* const* args, const unsigned int argslen, Class_base* realClass)
View file
lightspark.tar.xz/src/scripting/flash/utils/Proxy.cpp
Changed
@@ -38,7 +38,6 @@ void Proxy::sinit(Class_base* c) { CLASS_SETUP_NO_CONSTRUCTOR(c, ASObject,CLASS_DYNAMIC_NOT_FINAL); - c->isProxy = true; c->setDeclaredMethodByQName("isAttribute","",Class<IFunction>::getFunction(c->getSystemState(),_isAttribute),NORMAL_METHOD,true); }
View file
lightspark.tar.xz/src/scripting/flash/utils/Proxy.h
Changed
@@ -32,7 +32,7 @@ private: bool proxyconstructionCompleted; public: - Proxy(Class_base* c):ASObject(c),proxyconstructionCompleted(false){} + Proxy(Class_base* c):ASObject(c,T_OBJECT,SUBTYPE_PROXY),proxyconstructionCompleted(false){} static void sinit(Class_base*); static void buildTraits(ASObject* o); // ASFUNCTION(_constructor);
View file
lightspark.tar.xz/src/scripting/toplevel/Date.cpp
Changed
@@ -27,7 +27,7 @@ using namespace std; using namespace lightspark; -Date::Date(Class_base* c):ASObject(c),extrayears(0), nan(false), datetime(NULL),datetimeUTC(NULL) +Date::Date(Class_base* c):ASObject(c,T_OBJECT,SUBTYPE_DATE),extrayears(0), nan(false), datetime(NULL),datetimeUTC(NULL) { }
View file
lightspark.tar.xz/src/scripting/toplevel/RegExp.cpp
Changed
@@ -23,12 +23,12 @@ using namespace std; using namespace lightspark; -RegExp::RegExp(Class_base* c):ASObject(c),dotall(false),global(false),ignoreCase(false), +RegExp::RegExp(Class_base* c):ASObject(c,T_OBJECT,SUBTYPE_REGEXP),dotall(false),global(false),ignoreCase(false), extended(false),multiline(false),lastIndex(0) { } -RegExp::RegExp(Class_base* c, const tiny_string& _re):ASObject(c),dotall(false),global(false),ignoreCase(false), +RegExp::RegExp(Class_base* c, const tiny_string& _re):ASObject(c,T_OBJECT,SUBTYPE_REGEXP),dotall(false),global(false),ignoreCase(false), extended(false),multiline(false),lastIndex(0),source(_re) { }
View file
lightspark.tar.xz/src/scripting/toplevel/XML.cpp
Changed
@@ -44,16 +44,16 @@ prettyPrinting = true; } -XML::XML(Class_base* c):ASObject(c),parentNode(0),nodetype((pugi::xml_node_type)0),isAttribute(false),constructed(false) +XML::XML(Class_base* c):ASObject(c,T_OBJECT,SUBTYPE_XML),parentNode(0),nodetype((pugi::xml_node_type)0),isAttribute(false),constructed(false) { } -XML::XML(Class_base* c, const std::string &str):ASObject(c),parentNode(0),nodetype((pugi::xml_node_type)0),isAttribute(false),constructed(false) +XML::XML(Class_base* c, const std::string &str):ASObject(c,T_OBJECT,SUBTYPE_XML),parentNode(0),nodetype((pugi::xml_node_type)0),isAttribute(false),constructed(false) { createTree(buildFromString(str, getParseMode()),false); } -XML::XML(Class_base* c, const pugi::xml_node& _n, XML* parent, bool fromXMLList):ASObject(c),parentNode(0),nodetype((pugi::xml_node_type)0),isAttribute(false),constructed(false) +XML::XML(Class_base* c, const pugi::xml_node& _n, XML* parent, bool fromXMLList):ASObject(c,T_OBJECT,SUBTYPE_XML),parentNode(0),nodetype((pugi::xml_node_type)0),isAttribute(false),constructed(false) { if (parent) {
View file
lightspark.tar.xz/src/scripting/toplevel/XMLList.cpp
Changed
@@ -48,26 +48,26 @@ return NULL; \ } -XMLList::XMLList(Class_base* c):ASObject(c),nodes(c->memoryAccount),constructed(false),targetobject(NULL),targetproperty(c->memoryAccount) +XMLList::XMLList(Class_base* c):ASObject(c,T_OBJECT,SUBTYPE_XMLLIST),nodes(c->memoryAccount),constructed(false),targetobject(NULL),targetproperty(c->memoryAccount) { } -XMLList::XMLList(Class_base* cb,bool c):ASObject(cb),nodes(cb->memoryAccount),constructed(c),targetobject(NULL),targetproperty(cb->memoryAccount) +XMLList::XMLList(Class_base* cb,bool c):ASObject(cb,T_OBJECT,SUBTYPE_XMLLIST),nodes(cb->memoryAccount),constructed(c),targetobject(NULL),targetproperty(cb->memoryAccount) { assert(c); } -XMLList::XMLList(Class_base* c, const std::string& str):ASObject(c),nodes(c->memoryAccount),constructed(true),targetobject(NULL),targetproperty(c->memoryAccount) +XMLList::XMLList(Class_base* c, const std::string& str):ASObject(c,T_OBJECT,SUBTYPE_XMLLIST),nodes(c->memoryAccount),constructed(true),targetobject(NULL),targetproperty(c->memoryAccount) { buildFromString(str); } XMLList::XMLList(Class_base* c, const XML::XMLVector& r): - ASObject(c),nodes(r.begin(),r.end(),c->memoryAccount),constructed(true),targetobject(NULL),targetproperty(c->memoryAccount) + ASObject(c,T_OBJECT,SUBTYPE_XMLLIST),nodes(r.begin(),r.end(),c->memoryAccount),constructed(true),targetobject(NULL),targetproperty(c->memoryAccount) { } XMLList::XMLList(Class_base* c, const XML::XMLVector& r, XMLList *targetobject, const multiname &targetproperty): - ASObject(c),nodes(r.begin(),r.end(),c->memoryAccount),constructed(true),targetobject(targetobject),targetproperty(c->memoryAccount) + ASObject(c,T_OBJECT,SUBTYPE_XMLLIST),nodes(r.begin(),r.end(),c->memoryAccount),constructed(true),targetobject(targetobject),targetproperty(c->memoryAccount) { if (targetobject) targetobject->incRef();
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.cpp
Changed
@@ -781,14 +781,14 @@ Class_base::Class_base(const QName& name, MemoryAccount* m):ASObject(Class_object::getClass(getSys()),T_CLASS),protected_ns(getSys(),"",NAMESPACE),constructor(NULL), borrowedVariables(m), - context(NULL),class_name(name),memoryAccount(m),length(1),class_index(-1),isFinal(false),isSealed(false),isInterface(false),isReusable(false),isProxy(false),use_protected(false) + context(NULL),class_name(name),memoryAccount(m),length(1),class_index(-1),isFinal(false),isSealed(false),isInterface(false),isReusable(false),use_protected(false) { setConstant(); } Class_base::Class_base(const Class_object*):ASObject((MemoryAccount*)NULL),protected_ns(getSys(),BUILTIN_STRINGS::EMPTY,NAMESPACE),constructor(NULL), borrowedVariables(NULL), - context(NULL),class_name(BUILTIN_STRINGS::STRING_CLASS,BUILTIN_STRINGS::EMPTY),memoryAccount(NULL),length(1),class_index(-1),isFinal(false),isSealed(false),isInterface(false),isReusable(false),isProxy(false),use_protected(false) + context(NULL),class_name(BUILTIN_STRINGS::STRING_CLASS,BUILTIN_STRINGS::EMPTY),memoryAccount(NULL),length(1),class_index(-1),isFinal(false),isSealed(false),isInterface(false),isReusable(false),use_protected(false) { setConstant(); type=T_CLASS; @@ -876,7 +876,6 @@ void Class_base::setSuper(Ref<Class_base> super_) { assert(!super); - isProxy = super_->isProxy; super = super_; copyBorrowedTraitsFromSuper(); } @@ -1020,7 +1019,6 @@ isFinal = false; isSealed = false; isInterface = false; - isProxy = false; use_protected = false; } @@ -2519,7 +2517,7 @@ } -ObjectConstructor::ObjectConstructor(Class_base* c,uint32_t length) : ASObject(c),_length(length) +ObjectConstructor::ObjectConstructor(Class_base* c,uint32_t length) : ASObject(c,T_OBJECT,SUBTYPE_OBJECTCONSTRUCTOR),_length(length) { Class<ASObject>::getRef(c->getSystemState())->prototype->incRef(); this->prototype = Class<ASObject>::getRef(c->getSystemState())->prototype.getPtr(); @@ -2560,7 +2558,7 @@ return prevPrototype->getObj()->getVariableByMultiname(name, opt); } -Function_object::Function_object(Class_base* c, _R<ASObject> p) : ASObject(c), functionPrototype(p) +Function_object::Function_object(Class_base* c, _R<ASObject> p) : ASObject(c,T_OBJECT,SUBTYPE_FUNCTIONOBJECT), functionPrototype(p) { traitsInitialized = true; constructIndicator = true;
View file
lightspark.tar.xz/src/scripting/toplevel/toplevel.h
Changed
@@ -213,8 +213,6 @@ // indicates if objects can be reused after they have lost their last reference bool isReusable:1; - // this is only set to true for Proxy and Proxy-derived classes - bool isProxy:1; private: //TODO: move in Class_inherit bool use_protected:1;
View file
lightspark.tar.xz/src/swf.cpp
Changed
@@ -1519,7 +1519,6 @@ if (root->loaderInfo->getBytesLoaded() != root->loaderInfo->getBytesTotal()) { LOG(LOG_NOT_IMPLEMENTED,"End of parsing, bytesLoaded != bytesTotal:"<< root->loaderInfo->getBytesLoaded()<<"/"<<root->loaderInfo->getBytesTotal()); - root->loaderInfo->setBytesLoaded(root->loaderInfo->getBytesTotal()); } LOG(LOG_TRACE,_("End of parsing")); } @@ -2010,6 +2009,9 @@ vm->buildClassAndBindTag(it->first.raw_buf(), it->second); MovieClip::initFrame(); + + if (finishedLoading && (loaderInfo->getBytesTotal() != loaderInfo->getBytesLoaded())) + loaderInfo->setBytesLoaded(loaderInfo->getBytesTotal()); } /* This is run in vm's thread context */
View file
lightspark.tar.xz/src/swftypes.h
Changed
@@ -46,6 +46,8 @@ enum SWFOBJECT_TYPE { T_OBJECT=0, T_INTEGER=1, T_NUMBER=2, T_FUNCTION=3, T_UNDEFINED=4, T_NULL=5, T_STRING=6, /*UNUSED=7,*/ T_BOOLEAN=8, T_ARRAY=9, T_CLASS=10, T_QNAME=11, T_NAMESPACE=12, T_UINTEGER=13, T_PROXY=14, T_TEMPLATE=15}; +// this is used to avoid calls to dynamic_cast when testing for some classes +enum CLASS_SUBTYPE { SUBTYPE_NOT_SET, SUBTYPE_PROXY, SUBTYPE_REGEXP, SUBTYPE_XML, SUBTYPE_XMLLIST,SUBTYPE_DATE, SUBTYPE_INHERIT, SUBTYPE_OBJECTCONSTRUCTOR,SUBTYPE_FUNCTIONOBJECT }; enum STACK_TYPE{STACK_NONE=0,STACK_OBJECT,STACK_INT,STACK_UINT,STACK_NUMBER,STACK_BOOLEAN}; inline std::ostream& operator<<(std::ostream& s, const STACK_TYPE& st)
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
.