~ubuntu-branches/ubuntu/karmic/gnash/karmic

« back to all changes in this revision

Viewing changes to libcore/video_stream_instance.h

  • 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:
 
1
// 
 
2
//   Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
3
// 
 
4
// This program is free software; you can redistribute it and/or modify
 
5
// it under the terms of the GNU General Public License as published by
 
6
// the Free Software Foundation; either version 3 of the License, or
 
7
// (at your option) any later version.
 
8
// 
 
9
// This program is distributed in the hope that it will be useful,
 
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
// GNU General Public License for more details.
 
13
// 
 
14
// You should have received a copy of the GNU General Public License
 
15
// along with this program; if not, write to the Free Software
 
16
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 
 
18
// 
 
19
 
 
20
#ifndef GNASH_VIDEO_STREAM_INSTANCE_H
 
21
#define GNASH_VIDEO_STREAM_INSTANCE_H
 
22
 
 
23
#include "character.h" // for inheritance
 
24
#include "video_stream_def.h"
 
25
#include "snappingrange.h"
 
26
 
 
27
// Forward declarations
 
28
namespace gnash {
 
29
        class NetStream;
 
30
}
 
31
 
 
32
namespace gnash {
 
33
 
 
34
/// VideoStream ActionScript object
 
35
//
 
36
/// A VideoStream provides audio/video frames either
 
37
/// embedded into the SWF itself or loaded from the
 
38
/// network using an associated NetStream object.
 
39
///
 
40
class video_stream_instance : public character
 
41
{
 
42
 
 
43
public:
 
44
 
 
45
        boost::intrusive_ptr<video_stream_definition>   m_def;
 
46
        
 
47
        video_stream_instance(video_stream_definition* def,
 
48
                        character* parent, int id);
 
49
 
 
50
        ~video_stream_instance();
 
51
 
 
52
        virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const
 
53
        {
 
54
                // video character shape is always a rectangle..
 
55
                return pointInBounds(x, y);
 
56
        }
 
57
 
 
58
        rect getBounds() const;
 
59
 
 
60
        /// We use the call to ::advance to properly set invalidated status
 
61
        virtual void    advance();
 
62
 
 
63
        /// Register this video instance as a live character
 
64
        virtual void stagePlacementCallback();
 
65
 
 
66
        void    display();
 
67
 
 
68
        // For sure isActionScriptReferenceable...
 
69
        bool wantsInstanceName() const
 
70
        {
 
71
                return true; // text fields can be referenced 
 
72
        }       
 
73
 
 
74
        void add_invalidated_bounds(InvalidatedRanges& ranges, bool force);
 
75
 
 
76
        /// Set the input stream for this video
 
77
        void setStream(boost::intrusive_ptr<NetStream> ns);
 
78
 
 
79
protected:
 
80
 
 
81
#ifdef GNASH_USE_GC
 
82
        /// Mark video-specific reachable resources and invoke
 
83
        /// the parent's class version (markCharacterReachable)
 
84
        //
 
85
        /// video-specific reachable resources are:
 
86
        ///     - Associated NetStream if any (_ns) 
 
87
        ///
 
88
        virtual void markReachableResources() const;
 
89
#endif // GNASH_USE_GC
 
90
 
 
91
private:
 
92
 
 
93
        /// Initialize decoder for embedded video 
 
94
        //
 
95
        /// Call only if given a non-null video definition.
 
96
        ///
 
97
        void initializeDecoder();
 
98
 
 
99
        /// Get video frame to be displayed
 
100
        image::ImageBase* getVideoFrame();
 
101
 
 
102
        // m_video_source - A Camera object that is capturing video data or a NetStream object.
 
103
        // To drop the connection to the Video object, pass null for source.
 
104
        // FIXME: don't use as_object, but a more meaningful type
 
105
        //as_object* m_video_source;
 
106
 
 
107
        // Who owns this ? Should it be an intrusive ptr ?
 
108
        boost::intrusive_ptr<NetStream> _ns;
 
109
 
 
110
        /// Playing an embbeded video stream ?
 
111
        bool _embeddedStream;
 
112
 
 
113
        /// Last decoded frame number
 
114
        boost::int32_t _lastDecodedVideoFrameNum;
 
115
 
 
116
        /// Last decoded frame 
 
117
        std::auto_ptr<image::ImageBase> _lastDecodedVideoFrame;
 
118
 
 
119
        /// The decoder used to decode the video frames
 
120
        std::auto_ptr<media::VideoDecoder> _decoder;
 
121
};
 
122
 
 
123
void video_class_init(as_object& global);
 
124
 
 
125
}       // end namespace gnash
 
126
 
 
127
 
 
128
#endif // GNASH_VIDEO_STREAM_INSTANCE_H