Esempio n. 1
0
 public void flushWriterTest()
 {
     YuvVideoHandler yvh = new YuvVideoHandler();
     YuvVideoInfo info = new YuvVideoInfo(readPath);
     info.width = 352;
     info.height = 240;
     info.yuvFormat = YuvFormat.YUV420_IYUV;
     yvh.setReadContext(readPath, info); // write context cannot be set without a valid read context
     writePath = sampleVideosPath + "\\americanFootball_352x240_125_Copy.yuv";
     YuvVideoInfo writeinfo = new YuvVideoInfo();
     writeinfo.path = writePath;
     writeinfo.width = 352;
     writeinfo.height = 240;
     writeinfo.yuvFormat = YuvFormat.YUV420_IYUV;
     yvh.setWriteContext(writePath, writeinfo);
     int oldFrameByteSize = yvh.frameByteSize;
     yvh.flushWriter();
     Assert.AreEqual(oldFrameByteSize, yvh.frameByteSize);
     Assert.AreEqual(0, yvh.positionReader);
     System.Drawing.Bitmap testframe = yvh.getFrame();
     System.Drawing.Bitmap[] frames = new System.Drawing.Bitmap[1];
     frames[0] = testframe;
     yvh.writeFrames(4, frames);
     yvh.flushWriter();
     yvh.writeFrames(4, frames);
 }