~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to testsuite/MovieTester.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-10-13 14:29:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081013142949-f6qdvnu4mn05ltdc
Tags: 0.8.4~~bzr9980-0ubuntu1
* new upstream release 0.8.4 (LP: #240325)
* ship new lib usr/lib/gnash/libmozsdk.so.* in mozilla-plugin-gnash
  - update debian/mozilla-plugin-gnash.install
* ship new lib usr/lib/gnash/libgnashnet.so.* in gnash-common
  - update debian/gnash-common.install
* add basic debian/build_head script to build latest CVS head packages.
  - add debian/build_head
* new sound architecture requires build depend on libsdl1.2-dev
  - update debian/control
* head build script now has been completely migrated to bzr (upstream +
  ubuntu)
  - update debian/build_head
* disable kde gui until klash/qt4 has been fixed; keep kde packages as empty
  packages for now.
  - update debian/rules
  - debian/klash.install
  - debian/klash.links
  - debian/klash.manpages
  - debian/konqueror-plugin-gnash.install
* drop libkonq5-dev build dependency accordingly
  - update debian/control
* don't install headers manually anymore. gnash doesnt provide a -dev
  package after all
  - update debian/rules
* update libs installed in gnash-common; libgnashserver-*.so is not available
  anymore (removed); in turn we add the new libgnashcore-*.so
  - update debian/gnash-common.install
* use -Os for optimization and properly pass CXXFLAGS=$(CFLAGS) to configure
  - update debian/rules
* touch firefox .autoreg in postinst of mozilla plugin
  - update debian/mozilla-plugin-gnash.postinst
* link gnash in ubufox plugins directory for the plugin alternative switcher
  - add debian/mozilla-plugin-gnash.links
* suggest ubufox accordingly
  - update debian/control
* add new required build-depends on libgif-dev
  - update debian/control
* add Xb-Npp-Description and Xb-Npp-File as new plugin database meta data
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include "render_handler_cairo.h"
42
42
#endif
43
43
 
 
44
#include "MediaHandler.h"
 
45
#ifdef USE_FFMPEG
 
46
# include "ffmpeg/MediaHandlerFfmpeg.h"
 
47
#elif defined(USE_GST)
 
48
# include "gst/MediaHandlerGst.h"
 
49
#endif
 
50
 
44
51
#include <cstdio>
45
52
#include <string>
46
53
#include <memory> // for auto_ptr
47
 
#include <cmath> // for ceil and exp2
 
54
#include <cmath> // for ceil and (possibly) exp2
48
55
#include <iostream>
49
56
 
50
57
#define SHOW_INVALIDATED_BOUNDS_ON_ADVANCE 1
73
80
 
74
81
        if ( url == "-" )
75
82
        {
76
 
                std::auto_ptr<tu_file> in (
 
83
                std::auto_ptr<IOChannel> in (
77
84
                                noseek_fd_adapter::make_stream(fileno(stdin))
78
85
                                );
79
86
                _movie_def = gnash::create_movie(in, url, false);
104
111
                throw GnashException("Could not load movie from "+url);
105
112
        }
106
113
 
 
114
        // Initialize the testing media handlers
 
115
        initTestingMediaHandlers();
 
116
 
107
117
        // Initialize the sound handler(s)
108
118
        initTestingSoundHandlers();
109
119
 
243
253
 
244
254
}
245
255
 
 
256
void
 
257
MovieTester::resizeStage(int x, int y)
 
258
{
 
259
        _movie_root->set_display_viewport(0, 0, x, y);
 
260
 
 
261
        if (_movie_root->getStageScaleMode() != movie_root::noScale )
 
262
        {
 
263
                // TODO: fix to deal with all scale modes
 
264
                //       and alignments ?
 
265
 
 
266
                // set new scale value
 
267
                float xscale = x / _movie_def->get_width_pixels();
 
268
                float yscale = y / _movie_def->get_height_pixels();
 
269
                
 
270
                if (xscale < yscale) yscale = xscale;
 
271
                if (yscale < xscale) xscale = yscale;
 
272
 
 
273
        // Scale for all renderers.
 
274
        for (TRenderers::const_iterator it=_testingRenderers.begin(), itE=_testingRenderers.end();
 
275
                                it != itE; ++it)
 
276
        {
 
277
            TestingRenderer& rend = *(*it);
 
278
            render_handler& h = rend.getRenderer();
 
279
            h.set_scale(xscale, yscale);
 
280
        }
 
281
        }
 
282
 
 
283
}
 
284
 
246
285
const character*
247
286
MovieTester::findDisplayItemByName(const sprite_instance& mc,
248
287
                const std::string& name) 
500
539
{
501
540
        if ( ! canTestSound() ) return false;
502
541
 
503
 
#ifdef USE_MAD
504
 
        // mad doesn't support video !
505
 
        return false;
506
 
#endif
507
 
 
508
542
        return true;
509
543
}
510
544
 
528
562
}
529
563
 
530
564
void
 
565
MovieTester::initTestingMediaHandlers()
 
566
{
 
567
 
 
568
        std::auto_ptr<media::MediaHandler> handler;
 
569
 
 
570
#ifdef USE_FFMPEG
 
571
        handler.reset( new gnash::media::MediaHandlerFfmpeg() );
 
572
#elif defined(USE_GST)
 
573
        handler.reset( new gnash::media::MediaHandlerGst() );
 
574
#else
 
575
        std::cerr << "Neigher SOUND_SDL nor SOUND_GST defined" << std::endl;
 
576
        return;
 
577
#endif
 
578
 
 
579
        gnash::media::MediaHandler::set(handler);
 
580
}
 
581
 
 
582
void
531
583
MovieTester::restart() 
532
584
{
533
585
        _movie_root->clear(); // restart();