gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/parser/video_stream_def....


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/parser/video_stream_def....
Date: Sat, 08 Sep 2007 11:19:51 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  07/09/08 11:19:50

Modified files:
        .              : ChangeLog 
        server/parser  : video_stream_def.cpp video_stream_def.h 

Log message:
                * server/parser/video_stream_def.h: document class members,
                  add some notes or todo items
                * server/parser/video_stream_def.cpp (read): add a TODO item
                  as I think we're misreading the VIDEOFRAME tag.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4253&r2=1.4254
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/video_stream_def.cpp?cvsroot=gnash&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/video_stream_def.h?cvsroot=gnash&r1=1.8&r2=1.9

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4253
retrieving revision 1.4254
diff -u -b -r1.4253 -r1.4254
--- ChangeLog   7 Sep 2007 22:24:40 -0000       1.4253
+++ ChangeLog   8 Sep 2007 11:19:49 -0000       1.4254
@@ -1,3 +1,10 @@
+2007-09-08 Sandro Santilli <address@hidden>
+
+       * server/parser/video_stream_def.h: document class members,
+         add some notes or todo items
+       * server/parser/video_stream_def.cpp (read): add a TODO item
+         as I think we're misreading the VIDEOFRAME tag.
+
 2007-09-07 Sandro Santilli <address@hidden>
 
        * server/video_stream_instance.h: keep definition by 

Index: server/parser/video_stream_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/video_stream_def.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- server/parser/video_stream_def.cpp  7 Sep 2007 22:24:41 -0000       1.13
+++ server/parser/video_stream_def.cpp  8 Sep 2007 11:19:50 -0000       1.14
@@ -16,7 +16,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 // 
-// $Id: video_stream_def.cpp,v 1.13 2007/09/07 22:24:41 strk Exp $
+// $Id: video_stream_def.cpp,v 1.14 2007/09/08 11:19:50 strk Exp $
 
 #include "video_stream_def.h"
 #include "video_stream_instance.h"
@@ -74,6 +74,10 @@
        }
        else if (tag == SWF::VIDEOFRAME)
        {
+               // TODO: do *not* skip the frame number !
+               //       The SWF may not contain a video frame for
+               //       each SWF frame, in which case we make a mess
+               //
                in->skip_bytes(2); //int frameNum = in->read_u16();
 
                // We need to make the buffer a bit bigger than the data

Index: server/parser/video_stream_def.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/video_stream_def.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- server/parser/video_stream_def.h    9 Jul 2007 13:33:30 -0000       1.8
+++ server/parser/video_stream_def.h    8 Sep 2007 11:19:50 -0000       1.9
@@ -16,7 +16,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 // 
-// $Id: video_stream_def.h,v 1.8 2007/07/09 13:33:30 strk Exp $
+// $Id: video_stream_def.h,v 1.9 2007/09/08 11:19:50 strk Exp $
 
 #ifndef GNASH_VIDEO_STREAM_DEF_H
 #define GNASH_VIDEO_STREAM_DEF_H
@@ -40,11 +40,37 @@
 {
 public:
 
+       /// Construct a video stream definition with given ID
+       //
+       /// NOTE: for dynamically created definitions (ActionScript Video class 
instances)
+       ///       you can use an id of -1. See character_def constructor, as 
that's the
+       ///       one which will eventually get passed the id.
+       ///
        video_stream_definition(uint16_t char_id);
+
        ~video_stream_definition();
 
 
        character* create_character_instance(character* parent, int id);
+
+       /// Read tag SWF::DEFINEVIDEOSTREAM or SWF::VIDEOFRAME
+       //
+       /// For DEFINEVIDEOSTREAM tag, the character_id is assumed to have been
+       /// already read by caller.
+       ///
+       /// For VIDEOFRAME, again, the character_id (which contains association
+       /// between the VIDEOFRAME tag and the VIDEOSTREAM defined before) is
+       /// assumed to have been already read.
+       ///
+       /// For clarity, a *single* instance of this class should theoretically
+       /// read a DEFINEVIDEOSTREAM on first call and zero or more VIDEOFRAME
+       /// tags.
+       ///
+       /// TODO: separate the two reader functions, provide a constructor
+       ///       reading the DEFINEVIDEOSTREAM and only expose the parser
+       ///       for VIDEOFRAME (to ensure, at C++ level, that we won't
+       ///       parse DEFINEVIDEOSTREAM twice).
+       ///
        void    read(stream* in, SWF::tag_type tag, movie_definition* m);
 
        /// Return local video bounds in twips
@@ -68,43 +94,82 @@
        ///
        std::auto_ptr<embedVideoDecoder> get_decoder();
 
+       /// Get the Video frame associated with the given SWF frame number
+       //
+       /// @param frameNum
+       ///     0-based SWF frame number of which we want to fetch associated 
Video frame.
+       ///
+       /// @param data
+       ///     Output parameter. If a video frame is available for the 
specified SWF frame,
+       ///     then the given pointer (*data) will be set to point to a memory 
buffer owned
+       ///     by this instance; otherwise (no video frame available) the 
given pointer will
+       ///     be set to zero.
+       ///
+       /// @param size
+       ///     Output parameter. If a video frame is available for the 
specified SWF frame,
+       ///     then the given integer (*size) will be set to the size of the 
memory buffer
+       ///     returned in the data parameter; otherwise (no video frame 
available) the given
+       ///     integer will be set to zero.
+       ///
+       /// TODO: return pointer (possibly NULL) to a structure with data&size 
? (simpler)
+       ///
        void get_frame_data(int frameNum, uint8_t** data, int* size);
 
 private:
 
-       // TODO: drop, use m_bound
-       //uint16_t m_width;
-
-       // TODO: drop, use m_bound
-       //uint16_t m_height;
-
-
+       /// Id of this character definition, set by constructor.
+       ///
+       /// The id is currently set to -1 when the definition is actually
+       /// created dynamically (instantiating the ActionScript Video class)
+       ///
        uint16_t m_char_id;
+
+       /// Reserved flags read from DEFINEVIDEOSTREAM tag
        uint8_t m_reserved_flags;
+
+       /// Flags read from DEFINEVIDEOSTREAM tag
        uint8_t m_deblocking_flags;
+
+       /// Smoothing flag, as read from DEFINEVIDEOSTREAM tag
        bool m_smoothing_flags;
 
+       /// Frame in which the DEFINEVIDEOSTREAM was found
        uint16_t m_start_frame;
-       uint16_t m_num_frames;
 
-       // 0: extern file
-       // 2: H.263
-       // 3: screen video (Flash 7+ only)
-       // 4: VP6
-       uint8_t m_codec_id;
+       /// Number of frames in the embedded video, as reported
+       /// by the DEFINEVIDEOSTREAM tag
+       ///
+       uint16_t m_num_frames;
 
-       /// Bounds of the video.
+       /// Codec ID as read from DEFINEVIDEOSTREAM tag
        //
-       /// This is actually a duplication of m_width, m_height
-       /// members, which are not yet private so we can switch.
+       /// 0: extern file
+       /// 2: H.263
+       /// 3: screen video (Flash 7+ only)
+       /// 4: VP6
+       ///
+       /// TODO: define an enumeration for the above values
        ///
+       uint8_t m_codec_id;
+
+       /// Bounds of the video, as read from the DEFINEVIDEOSTREAM tag.
        rect m_bound;
 
-       /// The undecoded video frames
-       std::vector<uint8_t*>   m_video_frames;
+       /// The undecoded video frames associated with frames starting at 
m_start_frame
+       //
+       /// Elements of this vector are owned by this instance, and will be 
deleted 
+       /// at instance destruction time.
+       ///
+       /// TODO: encode size with each video frame instead (use a vector of 
vectors ?)
+       ///
+       std::vector<uint8_t *> m_video_frames;
 
-       /// Size the undecoded video frames
+       /// Size of each element of m_video_frames above
+       //
+       /// TODO: encode size with each video frame instead (use a vector of 
vectors ?)
+       ///
        std::vector<int>        m_video_frames_size;
+
 };
 
 }      // end namespace gnash




reply via email to

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