gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash/server gnash.h impl.cpp movie_root.cpp mo...


From: Vitaly Alexeev
Subject: [Gnash-commit] gnash/server gnash.h impl.cpp movie_root.cpp mo...
Date: Fri, 27 Oct 2006 14:27:58 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Vitaly Alexeev <alexeev>        06/10/27 14:27:58

Modified files:
        server         : gnash.h impl.cpp movie_root.cpp movie_root.h 
                         render.cpp render.h 

Log message:
        videostream implementation

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/gnash.h?cvsroot=gnash&r1=1.68&r2=1.69
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.64&r2=1.65
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.h?cvsroot=gnash&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/gnash/server/render.cpp?cvsroot=gnash&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/gnash/server/render.h?cvsroot=gnash&r1=1.8&r2=1.9

Patches:
Index: gnash.h
===================================================================
RCS file: /sources/gnash/gnash/server/gnash.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -b -r1.68 -r1.69
--- gnash.h     26 Oct 2006 08:20:09 -0000      1.68
+++ gnash.h     27 Oct 2006 14:27:57 -0000      1.69
@@ -35,7 +35,7 @@
 // 
 //
 
-/* $Id: gnash.h,v 1.68 2006/10/26 08:20:09 udog Exp $ */
+/* $Id: gnash.h,v 1.69 2006/10/27 14:27:57 alexeev Exp $ */
 
 /// \mainpage
 ///
@@ -97,6 +97,7 @@
 class sound_handler;
 class stream;
 class URL;
+class rect;
 
 ///
 /// Log & error reporting control.
@@ -593,6 +594,39 @@
                }
 };
        
+class DSOEXPORT YUV_video : public ref_counted
+{
+
+public:
+
+       enum {Y, U, V, T, NB_TEXS};
+
+       YUV_video(int w, int h);
+       ~YUV_video();
+       unsigned int video_nlpo2(unsigned int x) const;
+       void update(uint8_t* data);
+       virtual void display(const matrix* m, const rect* bounds);
+       int size() const;
+
+protected:
+
+       uint8_t* m_data;
+       int m_width;
+       int m_height;
+       int m_size;
+
+       struct plane {
+               unsigned int w, h, p2w, p2h, offset, size;
+               int unit;
+               int id;
+               float coords[4][2];
+       } planes[4];    
+
+       const matrix* m;
+       const rect* m_bounds;
+
+};
+       
 /// Keyboard handling
 namespace key {
 enum code

Index: impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- impl.cpp    6 Oct 2006 21:20:05 -0000       1.64
+++ impl.cpp    27 Oct 2006 14:27:57 -0000      1.65
@@ -36,7 +36,7 @@
 //
 //
 
-/* $Id: impl.cpp,v 1.64 2006/10/06 21:20:05 nihilus Exp $ */
+/* $Id: impl.cpp,v 1.65 2006/10/27 14:27:57 alexeev Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -227,10 +227,9 @@
        register_tag_loader(SWF::IMPORTASSETS,  import_loader);
        // 58 - _UNKNOWN_ unimplemented
        register_tag_loader(SWF::INITACTION, do_init_action_loader);   
-       register_tag_loader(SWF::DEFINEVIDEOSTREAM, fixme_loader); // 60
-
-       register_tag_loader(SWF::VIDEOFRAME, fixme_loader); // 61
 
+       register_tag_loader(SWF::DEFINEVIDEOSTREAM, define_video_loader); // 60
+       register_tag_loader(SWF::VIDEOFRAME, video_loader); // 61
 }
 
 

Index: movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- movie_root.cpp      24 Oct 2006 09:36:05 -0000      1.20
+++ movie_root.cpp      27 Oct 2006 14:27:57 -0000      1.21
@@ -77,7 +77,8 @@
     m_on_event_xmlsocket_ondata_called(false),
     m_on_event_xmlsocket_onxml_called(false),
     m_on_event_load_progress_called(false),
-               m_active_input_text(NULL)
+               m_active_input_text(NULL),
+               m_time_remainder(0.0f)
        {
        assert(m_def != NULL);
        
@@ -464,7 +465,18 @@
                sprite_instance* current_root = m_movie.get_ptr();
                assert(current_root);
                //current_root->advance_root(delta_time);
+
+
+//             current_root->advance(delta_time);
+                       m_time_remainder += delta_time;
+                       const float     frame_time = 1.0f / get_frame_rate();
+      if (m_time_remainder >= frame_time)
+                       {
+                               m_time_remainder -= frame_time;
                current_root->advance(delta_time);
+                       }
+                       m_time_remainder = fmod(m_time_remainder, frame_time);
+
 }
 
 

Index: movie_root.h
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- movie_root.h        24 Oct 2006 09:36:05 -0000      1.21
+++ movie_root.h        27 Oct 2006 14:27:57 -0000      1.22
@@ -35,7 +35,7 @@
 // 
 //
 
-/* $Id: movie_root.h,v 1.21 2006/10/24 09:36:05 strk Exp $ */
+/* $Id: movie_root.h,v 1.22 2006/10/27 14:27:57 alexeev Exp $ */
 
 #ifndef GNASH_MOVIE_ROOT_H
 #define GNASH_MOVIE_ROOT_H
@@ -84,6 +84,7 @@
        std::vector<Timer *>    m_interval_timers;
        std::vector< as_object* >       m_keypress_listeners;
        movie*  m_active_input_text;
+       float m_time_remainder;
 
 public:
        // XXXbastiaan: make these two variables private

Index: render.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/render.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- render.cpp  7 Oct 2006 15:08:26 -0000       1.9
+++ render.cpp  27 Oct 2006 14:27:57 -0000      1.10
@@ -48,6 +48,11 @@
                        bogus_bi() {}
                };
 
+               class bogus_yuv : public YUV_video
+               {
+               public:
+                       bogus_yuv(): YUV_video(0, 0) { assert(0); }
+               };
 
                bitmap_info*    create_bitmap_info_alpha(int w, int h, unsigned 
char* data)
                {
@@ -87,6 +92,18 @@
                        if (s_render_handler) 
s_render_handler->delete_bitmap_info(bi);
                }
 
+               YUV_video*      create_YUV_video(int width, int height)
+               {
+                       if (s_render_handler) return 
s_render_handler->create_YUV_video(width, height);
+                       else return new bogus_yuv;
+               }
+
+               void    delete_YUV_video(YUV_video* yuv)
+               {
+                       if (s_render_handler) 
s_render_handler->delete_YUV_video(yuv);
+               }
+
+
                // Bracket the displaying of a frame from a movie.
                // Fill the background color, and set up default
                // transforms, etc.

Index: render.h
===================================================================
RCS file: /sources/gnash/gnash/server/render.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- render.h    7 Oct 2006 15:08:26 -0000       1.8
+++ render.h    27 Oct 2006 14:27:57 -0000      1.9
@@ -55,6 +55,9 @@
                /// Delete the given bitmap info struct.
                void    delete_bitmap_info(bitmap_info* bi);
 
+               YUV_video*      create_YUV_video(int width, int height);
+               void    delete_YUV_video(YUV_video* yuv);
+
                /// \brief
                /// Bracket the displaying of a frame from a movie.
                /// Fill the background color, and set up default




reply via email to

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