+void handleVideoStream(TAG*tag, char*prefix)
+{
+ U16 id = swf_GetU16(tag);
+ U16 frames = swf_GetU16(tag);
+ U16 width = swf_GetU16(tag);
+ U16 height = swf_GetU16(tag);
+ U8 flags = swf_GetU8(tag); //5-2(videopacket 01=off 10=on)-1(smoothing 1=on)
+ U8 codec = swf_GetU8(tag);
+ printf(" (%d frames, %dx%d", frames, width, height);
+ if(flags&1)
+ printf(" smoothed");
+ if(codec == 2)
+ printf(" sorenson h.263)");
+ else
+ printf(" codec 0x%02x)", codec);
+}
+void handleVideoFrame(TAG*tag, char*prefix)
+{
+ U32 code, version, reference, sizeflags;
+ U32 width=0, height=0;
+ U8 type;
+ U16 id = swf_GetU16(tag);
+ U16 frame = swf_GetU16(tag);
+ U8 deblock,flags, tmp, bit;
+ U32 quantizer;
+ char*types[] = {"I-frame", "P-frame", "disposable P-frame", "<reserved>"};
+ printf(" (frame %d) ", frame);
+
+ /* video packet follows */
+ code = swf_GetBits(tag, 17);
+ version = swf_GetBits(tag, 5);
+ reference = swf_GetBits(tag, 8);
+
+ sizeflags = swf_GetBits(tag, 3);
+ switch(sizeflags)
+ {
+ case 0: width = swf_GetBits(tag, 8); height = swf_GetBits(tag, 8); break;
+ case 1: width = swf_GetBits(tag, 16); height = swf_GetBits(tag, 16); break;
+ case 2: width = 352; height = 288; break;
+ case 3: width = 176; height = 144; break;
+ case 4: width = 128; height = 96; break;
+ case 5: width = 320; height = 240; break;
+ case 6: width = 160; height = 120; break;
+ case 7: width = -1; height = -1;/*reserved*/ break;
+ }
+ printf("%dx%d ", width, height);
+ type = swf_GetBits(tag, 2);
+ printf("%s", types[type]);
+
+ deblock = swf_GetBits(tag, 1);
+ if(deblock)
+ printf(" deblock ", deblock);
+ quantizer = swf_GetBits(tag, 5);
+ printf(" quant: %d ", quantizer);
+}
+