applied swfc .video patch from John Sullivan
authorMatthias Kramm <kramm@quiss.org>
Mon, 3 Aug 2009 17:50:50 +0000 (19:50 +0200)
committerMatthias Kramm <kramm@quiss.org>
Mon, 3 Aug 2009 17:50:50 +0000 (19:50 +0200)
lib/pdf/GFXOutputDev.cc
src/swfc.c
src/swfcombine.c

index 62aa8c7..6c4a3a9 100644 (file)
@@ -2504,8 +2504,8 @@ void addGlobalFont(const char*filename)
     memset(f, 0, sizeof(fontfile_t));
     f->filename = filename;
     int len = strlen(filename);
     memset(f, 0, sizeof(fontfile_t));
     f->filename = filename;
     int len = strlen(filename);
-    char*r1 = strrchr(filename, '/');
-    char*r2 = strrchr(filename, '\\');
+    char*r1 = strrchr((char*)filename, '/');
+    char*r2 = strrchr((char*)filename, '\\');
     if(r2>r1)
         r1 = r2;
     if(r1) {
     if(r2>r1)
         r1 = r2;
     if(r1) {
index f07d424..26e46cd 100644 (file)
@@ -1381,6 +1381,24 @@ void s_quicktime(const char*name, const char*url)
     incrementid();
 }
 
     incrementid();
 }
 
+void s_video(const char *name, int width, int height)
+{
+    SRECT r;
+
+    memset(&r, 0, sizeof(r));
+
+    tag = swf_InsertTag(tag, ST_DEFINEVIDEOSTREAM);
+    swf_SetU16(tag, id);
+    swf_SetU16(tag, 0); // numframes
+    swf_SetU16(tag, width);
+    swf_SetU16(tag, height);
+    swf_SetU8(tag, 0); // videoflags
+    swf_SetU8(tag, 0); // codecid
+
+    s_addcharacter(name, id, tag, r);
+    incrementid();
+}
+
 void s_edittext(const char*name, const char*fontname, int size, int width, int height, const char*text, RGBA*color, int maxlength, const char*variable, int flags, int align)
 {
     SWFFONT*font = 0;
 void s_edittext(const char*name, const char*fontname, int size, int width, int height, const char*text, RGBA*color, int maxlength, const char*variable, int flags, int align)
 {
     SWFFONT*font = 0;
@@ -3822,6 +3840,15 @@ static int c_quicktime(map_t*args)
     return 0;
 }
 
     return 0;
 }
 
+static int c_video(map_t*args)
+{
+    const char*name = lu(args, "name");
+    int width = parseInt(lu(args, "width"));
+    int height = parseInt(lu(args, "height"));
+    s_video(name, width, height);
+    return 0;
+}
+
 static int c_image(map_t*args)
 {
     const char*command = lu(args, "commandname");
 static int c_image(map_t*args)
 {
     const char*command = lu(args, "commandname");
@@ -4091,6 +4118,7 @@ static struct {
  {"font", c_font, "name filename glyphs="},
  {"soundtrack", c_soundtrack, "filename"},
  {"quicktime", c_quicktime, "url"},
  {"font", c_font, "name filename glyphs="},
  {"soundtrack", c_soundtrack, "filename"},
  {"quicktime", c_quicktime, "url"},
+ {"video", c_video, "name width= height="},
 
     // generators of primitives
 
 
     // generators of primitives
 
index 7ada69b..7181c5c 100644 (file)
@@ -226,7 +226,7 @@ static struct options_t options[] = {
 {"r", "rate"},
 {"X", "width"},
 {"Y", "height"},
 {"r", "rate"},
 {"X", "width"},
 {"Y", "height"},
-{"N", "local-with-networking"},
+{"N", "local-with-network"},
 {"L", "local-with-filesystem"},
 {"z", "zlib"},
 {0,0}
 {"L", "local-with-filesystem"},
 {"z", "zlib"},
 {0,0}