gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ./ChangeLog ./README macros/libXML.m4 plu...


From: Rob Savoye
Subject: [Gnash-commit] gnash ./ChangeLog ./README macros/libXML.m4 plu...
Date: Sun, 25 Dec 2005 20:49:31 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Rob Savoye <address@hidden>     05/12/25 20:49:31

Modified files:
        .              : ChangeLog README 
        macros         : libXML.m4 
        plugin         : plugin.cpp 

Log message:
        * plugin/plugin.cpp: Fix plugin name so it's recognized correctly
        to play flash movies looking for the proprietary Flash
        player. Instead of rendering the flash movie, copy the byte stream
        to /tmp instead so we can collect more test cases.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/README.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/libXML.m4.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/plugin/plugin.cpp.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.8 gnash/ChangeLog:1.9
--- gnash/ChangeLog:1.8 Sun Dec 25 20:38:42 2005
+++ gnash/ChangeLog     Sun Dec 25 20:49:31 2005
@@ -1,5 +1,10 @@
 2005-12-25  Rob Savoye  <address@hidden>
 
+       * plugin/plugin.cpp: Fix plugin name so it's recognized correctly
+       to play flash movies looking for the proprietary Flash
+       player. Instead of rendering the flash movie, copy the byte stream
+       to /tmp instead so we can collect more test cases.
+
        * configure.ac: Fix the --disable-xml option so it actually
        works.
 
Index: gnash/README
diff -u gnash/README:1.1 gnash/README:1.2
--- gnash/README:1.1    Tue Dec 20 21:03:23 2005
+++ gnash/README        Sun Dec 25 20:49:31 2005
@@ -2,9 +2,38 @@
 Ulrich. GameSWF is the most advanced of the free flash movie player
 projects, and implements a fairly broad set of Flash Format v7
 compliance. GameSWF was unsupported public domain software though,
-and not really setup to be an industrial strength projecrt that could
+and not really setup to be an industrial strength project that could
 be used by everyone that uses Firefox.
 
   So in early December of 2005, GameSWF was forked, and the code
 rearranged in GNU project style.
 
+Building Gnash:
+---------------
+
+To build Gnash, you currently need the Mozilla or Firefox development
+packages installed. I have added the basic Mozilla SDK files, so at
+least you don't need the full Mozilla/Firefox sources. You can tell if
+you have these packages installed, because either a firefox-config or
+mozilla-config should be present. If neither of these aren't present,
+the plugin won't be part of the build. 
+
+If these are present, then when you install the plugin, it gets
+installed in the plugin directory of the same firefox that's in your
+path. 
+
+You can also specify explicit paths to the Mozilla SDK by using the
+--with-firefox, --with-firefox-libraries, or --with-firefox-headers
+options at configure time. You'll also want the OpenGL development
+package and the SDL development packages installed as well. 
+
+Currently the plugin renders a hard coded OpenGL graphic in the
+allocated window within the browers. You'll have better luck with the
+standalone version, gnash. Development of the plugin is continuing,
+however, now that much of the basic creation of this new project is
+done. 
+
+I'm using the Mozilla plugin API, so although the functionality of the
+plugin is limited at this time, it has worked in a variety of
+different versions of Mozilla and Firefox. 
+
Index: gnash/macros/libXML.m4
diff -u gnash/macros/libXML.m4:1.1 gnash/macros/libXML.m4:1.2
--- gnash/macros/libXML.m4:1.1  Tue Dec 20 21:02:51 2005
+++ gnash/macros/libXML.m4      Sun Dec 25 20:49:31 2005
@@ -20,7 +20,7 @@
 [dnl 
 dnl Get the cflags and libraries
 dnl
-AC_ARG_WITH(libxml,[  --with-libxml=PFX   Prefix where libxml++ is installed 
(optional)], libxml_prefix="$withval", libxml_prefix="")
+AC_ARG_WITH(libxml,[  --with-libxml=PFX   Prefix where libxml is installed 
(optional)], libxml_prefix="$withval", libxml_prefix="")
 AC_ARG_WITH(libxml-libraries,[  --with-libxml-libraries=DIR   Directory where 
libxml++ library is installed (optional)], libxml_libraries="$withval", 
libxml_libraries="")
 AC_ARG_WITH(libxml-includes,[  --with-libxml-includes=DIR   Directory where 
libxmlc++ header files are installed (optional)], libxml_includes="$withval", 
libxml_includes="")
 dnl AC_ARG_ENABLE(libxmltest, [  --disable-libxmltest       Do not try to 
compile and run a test libxml program],, enable_libxmltest=yes)
Index: gnash/plugin/plugin.cpp
diff -u gnash/plugin/plugin.cpp:1.3 gnash/plugin/plugin.cpp:1.4
--- gnash/plugin/plugin.cpp:1.3 Thu Dec 22 04:56:56 2005
+++ gnash/plugin/plugin.cpp     Sun Dec 25 20:49:31 2005
@@ -17,7 +17,9 @@
 
 #include "plugin.h"
 #define MIME_TYPES_HANDLED  "application/x-shockwave-flash"
-#define PLUGIN_NAME         "Flash movie player for Mozilla and Firefox"
+// The name must be this value to get flash movies that check the
+// plugin version to load.
+#define PLUGIN_NAME     "Shockwave Flash 7.0"
 #define MIME_TYPES_DESCRIPTION  MIME_TYPES_HANDLED":swf:"PLUGIN_NAME
 #define PLUGIN_DESCRIPTION  PLUGIN_NAME
 
@@ -32,13 +34,23 @@
 #include <X11/keysym.h>
 #include <X11/Sunkeysym.h>
 #include <SDL.h>
+#include <string>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+using namespace std;
 
 // This is our SDL surface
 SDL_Surface *surface;
 
+bool processing = false;
+int  streamfd = 0;
+
 const int SCREEN_WIDTH  = 640;
 const int SCREEN_HEIGHT = 480;
 const int SCREEN_BPP = 16;
+const int INBUFSIZE = 1024;
 
 int main_loop();
 void Quit(int ret);
@@ -94,15 +106,18 @@
 {
   NPError err = NPERR_NO_ERROR;
   switch (aVariable) {
-    case NPPVpluginNameString:
-      *((char **)aValue) = PLUGIN_NAME;
-      break;
-    case NPPVpluginDescriptionString:
-      *((char **)aValue) = PLUGIN_DESCRIPTION;
-      break;
-    default:
-      err = NPERR_INVALID_PARAM;
-      break;
+  case NPPVpluginNameString:
+    *((char **)aValue) = PLUGIN_NAME;
+    break;
+  case NPPVpluginDescriptionString:
+    *((char **)aValue) = PLUGIN_DESCRIPTION;
+    break;
+  case NPPVpluginTimerInterval:
+  case NPPVpluginNeedsXEmbed:
+  case NPPVpluginKeepLibraryInMemory:
+  default:
+    err = NPERR_INVALID_PARAM;
+    break;
   }
   return err;
 }
@@ -422,17 +437,42 @@
 }
 
 // Open a new incoming data stream, which is the flash movie we want to play.
+// A URL can be pretty ugly, like in this example:
+// 
http://www.shockwave.com/swf/navbar/navbar_sw.swf?atomfilms=http%3a//www.atomfilms.com/af/home/&shockwave=http%3a//www.shockwave.com&gameblast=http%3a//gameblast.shockwave.com/gb/gbHome.jsp&known=0
 NPError
 nsPluginInstance::NewStream(NPMIMEType type, NPStream * stream,
                                    NPBool seekable, uint16 * stype)
 {
   char tmp[100];
   memset(tmp, 0, 100);
-  sprintf(tmp, "Loading Shockwave file %s", stream->url);
-  printf("**********NewStream Callback %s ****************\n",
-         stream->url);
-  
+  string url = stream->url;
+  string fname;
+  int start, end;
+
+  end   = url.find(".swf", 0) + 4;
+  start = url.rfind("/", end) + 1;
+  fname = "/tmp/";
+  fname += url.substr(start, end - start);
+
+  //  printf("%s: URL is %s\n", __PRETTY_FUNCTION__, url.c_str());
+  printf("%s: Open stream for %s (%d, %d)\n", __PRETTY_FUNCTION__, 
fname.c_str(), start, end);
+
+  sprintf(tmp, "Loading Shockwave file %s", fname.c_str());
   WriteStatus(tmp);
+  
+  streamfd = open(fname.c_str(), O_CREAT | O_WRONLY, S_IRUSR|S_IRGRP|S_IROTH);
+  if (streamfd < 0) {
+    sprintf(tmp,"%s can't be opened, check your permissions!\n", 
fname.c_str());
+    WriteStatus(tmp);
+    streamfd = open(fname.c_str(), O_TRUNC | O_WRONLY, 
S_IRUSR|S_IRGRP|S_IROTH);
+    if (streamfd < 0) {
+      sprintf(tmp,"%s can't be created, check your permissions!\n", 
fname.c_str());
+      WriteStatus(tmp);
+    }
+  }
+  
+  processing = true;
+  return NPERR_NO_ERROR;
 }
 
 NPError
@@ -441,8 +481,10 @@
     int playable, all_retrieved, all_above_cache;
     char *tmp;
 
-    printf("***********NPP_DestroyStream called %i\n URL: %s\n",
-           reason, stream->url);
+    printf("%s (%i): %s\n", __PRETTY_FUNCTION__, reason, stream->url);
+    processing = false;
+    
+    SDL_Quit();
 }
 
 void
@@ -454,14 +496,17 @@
     printf("URL: %s\nReason %i\n", url, reason);
 }
 
+// Return how many bytes we can read into the buffer
 int32
 nsPluginInstance::WriteReady(NPStream * stream)
 {
   printf("%s(%d): Entering\n", __PRETTY_FUNCTION__, __LINE__);
   printf("Stream for %s is ready\n", stream->url);
-  
+
+  return INBUFSIZE;
 }
 
+// Read the daat stream from Mozilla/Firefox
 int32
 nsPluginInstance::Write(NPStream * stream, int32 offset, int32 len,
                              void *buffer)
@@ -469,6 +514,8 @@
   printf("%s(%d): Entering\n", __PRETTY_FUNCTION__, __LINE__);
   printf("Reading Stream %s, offset is %d, length = %d \n",
          stream->url, offset, len);
+
+  write(streamfd, buffer, len);
 }
 
 // function to release/destroy our resources and restoring the old desktop




reply via email to

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