Write header giving image height, width, and frame rate in .yuv output.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 25 Oct 2007 23:30:03 +0000 (23:30 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 25 Oct 2007 23:30:03 +0000 (23:30 +0000)
git-svn-id: http://svn.voria.com/code@980 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/mod_yuv420p/trgt_yuv.cpp
synfig-core/trunk/src/modules/mod_yuv420p/trgt_yuv.h

index 81482c9..d45f8ad 100644 (file)
@@ -76,6 +76,18 @@ yuv::~yuv()
 }
 
 bool
+yuv::init()
+{
+       if (!file)
+               return false;
+
+       fprintf(file.get(), "YUV4MPEG2 W%d H%d F%d:1 Ip\n",
+                       desc.get_w(), desc.get_h(),
+                       round_to_int(desc.get_frame_rate()));
+       return true;
+}
+
+bool
 yuv::set_rend_desc(RendDesc *given_desc)
 {
        given_desc->clear_flags();
@@ -95,6 +107,7 @@ yuv::set_rend_desc(RendDesc *given_desc)
 bool
 yuv::start_frame(synfig::ProgressCallback */*callback*/)
 {
+       fprintf(file.get(), "FRAME\n");
        return static_cast<bool>(file);
 }
 
index a796425..7ed9ee5 100644 (file)
@@ -56,6 +56,7 @@ public:
        yuv(const char *filename);
        virtual ~yuv();
 
+       virtual bool init();
        virtual bool set_rend_desc(synfig::RendDesc *desc);
        virtual bool start_frame(synfig::ProgressCallback *cb);
        virtual void end_frame();