[vlmc-devel] [PATCH 04/10] Workflow::Frame Add Frame( size_t size )

Yikai Lu luyikei.qmltu at gmail.com
Wed May 4 16:18:35 CEST 2016


---
 src/Workflow/Types.cpp | 12 ++++++++++++
 src/Workflow/Types.h   |  1 +
 2 files changed, 13 insertions(+)

diff --git a/src/Workflow/Types.cpp b/src/Workflow/Types.cpp
index 9450639..74b5ff6 100644
--- a/src/Workflow/Types.cpp
+++ b/src/Workflow/Types.cpp
@@ -50,6 +50,18 @@ Frame::Frame( quint32 width, quint32 height ) :
     m_buffer = new quint32[m_nbPixels];
 }
 
+Frame::Frame( size_t forcedSize ) :
+    OutputBuffer( VideoTrack ),
+    ptsDiff( 0 ),
+    m_width( 0 ),
+    m_height( 0 ),
+    m_size( forcedSize ),
+    m_nbPixels( 0 ),
+    m_pts( 0 )
+{
+    m_buffer = new quint32[ ( forcedSize % 4 ) ? forcedSize / 4 + 1 : forcedSize / 4 ];
+}
+
 Frame::Frame(quint32 width, quint32 height, size_t forcedSize) :
     OutputBuffer( VideoTrack ),
     ptsDiff( 0 ),
diff --git a/src/Workflow/Types.h b/src/Workflow/Types.h
index a844fe8..3baeab3 100644
--- a/src/Workflow/Types.h
+++ b/src/Workflow/Types.h
@@ -52,6 +52,7 @@ namespace   Workflow
         public:
             explicit Frame();
             Frame( quint32 width, quint32 height );
+            Frame( size_t forcedSize );
             Frame( quint32 width, quint32 height, size_t forcedSize );
             ~Frame();
             quint32         width() const;
-- 
1.9.1



More information about the Vlmc-devel mailing list