[vlmc-devel] [PATCH 03/10] Workflow::Frame Add pts() and setPts()

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


---
 src/Workflow/Types.cpp | 21 ++++++++++++++++++---
 src/Workflow/Types.h   | 11 +++++++++++
 2 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/src/Workflow/Types.cpp b/src/Workflow/Types.cpp
index 86bbad5..9450639 100644
--- a/src/Workflow/Types.cpp
+++ b/src/Workflow/Types.cpp
@@ -33,7 +33,8 @@ Frame::Frame() :
         m_height( 0 ),
         m_buffer( 0 ),
         m_size( 0 ),
-        m_nbPixels( 0 )
+        m_nbPixels( 0 ),
+        m_pts( 0 )
 {
 }
 
@@ -41,7 +42,8 @@ Frame::Frame( quint32 width, quint32 height ) :
         OutputBuffer( VideoTrack ),
         ptsDiff( 0 ),
         m_width( width ),
-        m_height( height )
+        m_height( height ),
+        m_pts( 0 )
 {
     m_nbPixels = width * height;
     m_size = m_nbPixels * Depth;
@@ -52,7 +54,8 @@ Frame::Frame(quint32 width, quint32 height, size_t forcedSize) :
     OutputBuffer( VideoTrack ),
     ptsDiff( 0 ),
     m_width( width ),
-    m_height( height )
+    m_height( height ),
+    m_pts( 0 )
 {
     m_nbPixels = width * height;
     m_size = forcedSize;
@@ -99,6 +102,18 @@ Frame::nbPixels() const
     return m_nbPixels;
 }
 
+qint64
+Frame::pts() const
+{
+    return m_pts;
+}
+
+void
+Frame::setPts( qint64 pts )
+{
+    m_pts = pts;
+}
+
 size_t Frame::Size(quint32 width, quint32 height)
 {
     return width * height * Depth;
diff --git a/src/Workflow/Types.h b/src/Workflow/Types.h
index 5fa13c3..a844fe8 100644
--- a/src/Workflow/Types.h
+++ b/src/Workflow/Types.h
@@ -85,6 +85,16 @@ namespace   Workflow
              */
             quint32         nbPixels() const;
             /**
+             *  \brief      Get pts.
+             *
+             */
+            qint64          pts() const;
+            /**
+             *  \brief      Set pts.
+             *
+             */
+            void           setPts( qint64 pts );
+            /**
              *  \warning    Terrible hack !
              *
              *  Remove this ASAP !!
@@ -105,6 +115,7 @@ namespace   Workflow
             quint32     *m_buffer;
             size_t      m_size;
             quint32     m_nbPixels;
+            qint64      m_pts;
     };
     class  AudioSample : public OutputBuffer
     {
-- 
1.9.1



More information about the Vlmc-devel mailing list