gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash configure.ac ChangeLog plugin/plugin.cpp ...


From: Rob Savoye
Subject: [Gnash-commit] gnash configure.ac ChangeLog plugin/plugin.cpp ...
Date: Thu, 05 Oct 2006 21:06:53 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Rob Savoye <rsavoye>    06/10/05 21:06:52

Modified files:
        .              : configure.ac ChangeLog 
        plugin         : plugin.cpp plugin.h 

Log message:
                * configure.ac: Add --enable-write option to optionally write 
the
                Flash movie to disk when using the plugin.
                * plugin/plugin.h, plugin.cpp: Optionally write the streaming
                Flash movie to disk.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.122&r2=1.123
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1045&r2=1.1046
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/plugin.cpp?cvsroot=gnash&r1=1.60&r2=1.61
http://cvs.savannah.gnu.org/viewcvs/gnash/plugin/plugin.h?cvsroot=gnash&r1=1.24&r2=1.25

Patches:
Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -b -r1.122 -r1.123
--- configure.ac        3 Oct 2006 16:22:57 -0000       1.122
+++ configure.ac        5 Oct 2006 21:06:52 -0000       1.123
@@ -33,7 +33,7 @@
 dnl also makes it possible to release a modified version which carries
 dnl forward this exception.
 
-dnl $Id: configure.ac,v 1.122 2006/10/03 16:22:57 rsavoye Exp $
+dnl $Id: configure.ac,v 1.123 2006/10/05 21:06:52 rsavoye Exp $
 
 AC_PREREQ(2.50)
 AC_INIT(gnash, 0.7.1-cvs)
@@ -85,6 +85,18 @@
   AC_DEFINE([USE_FORK], [], [Fork player instead of thread])
 fi
 
+dnl Write the file to disk in the plugin, if specified.
+AC_ARG_ENABLE(write, [  --enable-write          Use a thread instead writeing 
the standalone player.],
+[case "${enableval}" in
+  yes) write=yes ;;
+  no)  write=no ;;
+  *)   AC_MSG_ERROR([bad value ${enableval} for --enable-write option]) ;;
+esac],write=no)
+
+if test x"$write" = x"yes"; then
+  AC_DEFINE([WRITE_FILE], [], [Write files while streaming])
+fi
+
 dnl Add XML support, if specified.
 AC_ARG_ENABLE(xml, [  --disable-xml           Disable support for XML and 
XMLSocket],
 [case "${enableval}" in
@@ -1012,7 +1024,7 @@
     echo "ERROR: No BOOST development package installed!\
  You need to have the BOOST development package installed\
  to compile, or install libboost-thread1.33.1-dev
- and libboost-dev (using apt-get) or libboost-thread-dev (using yum)."
+ and libboost-dev (using apt-get) or boost-devel (using yum)."
  nogo=true
 fi
 

Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1045
retrieving revision 1.1046
diff -u -b -r1.1045 -r1.1046
--- ChangeLog   5 Oct 2006 19:43:07 -0000       1.1045
+++ ChangeLog   5 Oct 2006 21:06:52 -0000       1.1046
@@ -1,5 +1,10 @@
 2006-10-05  Rob Savoye  <address@hidden>
 
+       * configure.ac: Add --enable-write option to optionally write the
+       Flash movie to disk when using the plugin.
+       * plugin/plugin.h, plugin.cpp: Optionally write the streaming
+       Flash movie to disk.
+
        * macros/boost/m4: Look for the Boost thread library using a
        variety of names.
        * macros/boost.m4: Also look for libboost_thread-mt if

Index: plugin/plugin.cpp
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- plugin/plugin.cpp   4 Oct 2006 03:38:26 -0000       1.60
+++ plugin/plugin.cpp   5 Oct 2006 21:06:52 -0000       1.61
@@ -35,13 +35,12 @@
 // 
 //
 
-/* $Id: plugin.cpp,v 1.60 2006/10/04 03:38:26 rsavoye Exp $ */
+/* $Id: plugin.cpp,v 1.61 2006/10/05 21:06:52 rsavoye Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-
 #define MIME_TYPES_HANDLED  "application/x-shockwave-flash"
 // The name must be this value to get flash movies that check the
 // plugin version to load.
@@ -248,8 +247,7 @@
     _window(0),
     _childpid(0)
 {
-       for (size_t i=0, n=data->argc; i<n; ++i)
-       {
+       for (size_t i=0, n=data->argc; i<n; ++i) {
                string name, val;
 
                if (data->argn[i]) {
@@ -405,6 +403,14 @@
 #endif
 
     // extract the parameters from the URL
+#ifdef WRITE_FILE
+    string fname;
+    end   = url.find(".swf", 0) + 4;
+    start = url.rfind("/", end) + 1;
+    fname = "/tmp/";
+    fname += url.substr(start, end - start);
+    cout << "The Flash movie name is: " << fname << endl;
+#endif
     end   = url.find(".swf", 0) + 4;
     start = url.find("?", end);
     end   = url.size();
@@ -473,6 +479,13 @@
 process:
     _swf_url = url;
 
+#ifdef WRITE_FILE
+    _filefd = open(fname.c_str(), O_CREAT | O_WRONLY, 
S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
+    if (_filefd < 0) {
+        _filefd = open(fname.c_str(), O_TRUNC | O_WRONLY, 
S_IRUSR|S_IRGRP|S_IROTH);
+    }
+#endif
+    
     startProc(_window);
 
     return NPERR_NO_ERROR;
@@ -497,6 +510,16 @@
         }
     }
 
+#ifdef WRITE_FILE
+    if (_filefd != -1) {
+        if (close(_filefd) == -1) {
+            perror(strerror(errno));
+        } else {
+            _filefd = -1;
+        }
+    }
+#endif
+
     if (waitforgdb) {
        cout << "Attach GDB to PID " << getpid() << " to debug!" << endl;
        cout << "This thread will block until then!..." << endl;
@@ -531,6 +554,9 @@
     log_msg("Reading Stream %s, offset is %d, length = %d",
       stream->url, offset, len);
 #endif
+#ifdef WRITE_FILE
+    write(_filefd, buffer, len);
+#endif
     return write(_streamfd, buffer, len);
 }
 

Index: plugin/plugin.h
===================================================================
RCS file: /sources/gnash/gnash/plugin/plugin.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- plugin/plugin.h     2 Oct 2006 12:44:05 -0000       1.24
+++ plugin/plugin.h     5 Oct 2006 21:06:52 -0000       1.25
@@ -42,7 +42,7 @@
 #include "config.h"
 #endif
 
-#include "tu_config.h"
+//#include "tu_config.h"
 
 /* Xlib/Xt stuff */
 #include <X11/Xlib.h>
@@ -112,6 +112,7 @@
     std::map<std::string, std::string> _options;
     int                                _streamfd;
     pid_t                              _childpid;
+    int                                _filefd;
 
     const char* getCurrentPageURL() const;
 };




reply via email to

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