gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] /srv/bzr/gnash/trunk r11337: updated testsuites and f


From: Benjamin Wolsey
Subject: Re: [Gnash-commit] /srv/bzr/gnash/trunk r11337: updated testsuites and functionality in VideoInputGst.cpp and started working with AS implementation (not final at all)
Date: Thu, 30 Jul 2009 08:12:22 +0200

> einfaches Textdokument-Anlage (r11337.diff)
> === modified file 'libcore/asobj/flash/media/Camera_as.cpp'
> --- a/libcore/asobj/flash/media/Camera_as.cpp 2009-07-29 05:40:20 +0000
> +++ b/libcore/asobj/flash/media/Camera_as.cpp 2009-07-29 22:28:58 +0000
> @@ -29,60 +29,101 @@
>  #include "smart_ptr.h" // for boost intrusive_ptr
>  #include "builtin_function.h" // need builtin_function
>  #include "Object.h" // for getObjectInterface
> +#include "gst/VideoInputGst.h"
> +

There's nothing particularly wrong with this commit, except that there
is also an ffmpeg media handler, and building it breaks badly if you
include gst stuff. I'm reverting just the Camera_as file until it's
fixed to work with both media handlers. Try adding createVideoInput (and
when the time comes) createAudioInput to MediaHandler.h. That can return
the correct type of object, while the Camera_as class should use only
the base class VideoInput.

It would save time if you have an ffmpeg build just to make sure it
compiles.

(You can get the pre-reverted copy for working on with "bzr revert -r
11337 libcore/asobj/flash/media/Camera_as.cpp").

You will then also need to handle the possibility that there is no
VideoInput object, e.g. when the media handler is ffmpeg or when no
media handling is compiled in.

> -class camera_as_object: public as_object
> +class camera_as_object: public as_object, public media::gst::VideoInputGst
>  {

This uses a particular media handler again. As a rule, you should do as
much as possible in a way that doesn't depend on the type of
camera_as_object. If you can drop the type entirely it is still better.
This is because in ActionScript object typing is much less strict.
Inheriting from VideoInput certainly makes things more complicated than
they need to be, and a VideoInput member would be an improvement.

>        
> +        //for versions lower than 8, the ctor call was get(), for 9 and 
> higher
> +        //the ctor was getCamera()

This is not correct. The difference is between AS2 and AS3, which is not
dependent on VM version. Use the function isAS3(getVM(where)) to check
whether it's AS3 or not.

> +        if (vm.getSWFVersion() <= 8) {

Please use getSWFVersion(where), not vm.getSWFVersion(). If the VM class
changes, as it well might to accommodate the AVM2 Machine, it is much
easier to change the single free function getSWFVersion(const
as_object&) than to change all VM::getSWFVersion() calls.

> +            cl = gl->createClass(&camera_get, getCameraInterface());
> +        } else {
> +            cl = gl->createClass(&camera_getCamera, getCameraInterface());
> +        }
> +        

There was also a reason for separating the prototype creation step:

as_object* proto = getCameraInterface();

Namely, that all these hundreds of interface functions need to change,
most likely to take an argument. It is much easier to do it, and doesn't
produce such enormously long lines, if they are separate.

> +#include "math.h"

No! #include <cmath>.

> +            val = ceil(webcam->_currentFormat->framerates[i].numerator /

std::ceil

--
Free Flash, use Gnash
http://www.gnu.org/software/gnash/

Benjamin Wolsey, Software Developer - http://benjaminwolsey.de

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]