[vlmc-devel] ClipWorkflow: Add type() fucntion to return its TrackType to be used
Yikai Lu
git at videolan.org
Wed Jun 1 18:14:46 CEST 2016
vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue May 3 12:39:56 2016 +0900| [d8e7058a41d0a4e153ad210622102ae5a970cf58] | committer: Hugo Beauzée-Luyssen
ClipWorkflow: Add type() fucntion to return its TrackType to be used
We have to know which tracks should be used to give buffers to a getOutput function with a certain TrackType.
> https://code.videolan.org/videolan/vlmc/commit/d8e7058a41d0a4e153ad210622102ae5a970cf58
---
src/Workflow/AudioClipWorkflow.cpp | 6 ++++++
src/Workflow/AudioClipWorkflow.h | 1 +
src/Workflow/ClipWorkflow.h | 1 +
src/Workflow/ImageClipWorkflow.cpp | 6 ++++++
src/Workflow/ImageClipWorkflow.h | 1 +
src/Workflow/VideoClipWorkflow.cpp | 6 ++++++
src/Workflow/VideoClipWorkflow.h | 1 +
7 files changed, 22 insertions(+)
diff --git a/src/Workflow/AudioClipWorkflow.cpp b/src/Workflow/AudioClipWorkflow.cpp
index 5130bff..c3649ff 100644
--- a/src/Workflow/AudioClipWorkflow.cpp
+++ b/src/Workflow/AudioClipWorkflow.cpp
@@ -95,6 +95,12 @@ AudioClipWorkflow::getOutput( ClipWorkflow::GetMode mode, qint64 )
return buff;
}
+Workflow::TrackType
+AudioClipWorkflow::type() const
+{
+ return Workflow::AudioTrack;
+}
+
void AudioClipWorkflow::initializeInternals()
{
m_renderer->setName( qPrintable( QString("AudioClipWorkflow " % m_clipHelper->uuid().toString() ) ) );
diff --git a/src/Workflow/AudioClipWorkflow.h b/src/Workflow/AudioClipWorkflow.h
index 71453b6..0b76cfa 100644
--- a/src/Workflow/AudioClipWorkflow.h
+++ b/src/Workflow/AudioClipWorkflow.h
@@ -40,6 +40,7 @@ class AudioClipWorkflow : public ClipWorkflow
public:
AudioClipWorkflow( ClipHelper* ch );
virtual Workflow::OutputBuffer *getOutput( ClipWorkflow::GetMode mode, qint64 currentFrame );
+ virtual Workflow::TrackType type() const;
protected:
virtual quint32 getNbComputedBuffers() const;
virtual quint32 getMaxComputedBuffers() const;
diff --git a/src/Workflow/ClipWorkflow.h b/src/Workflow/ClipWorkflow.h
index 2e9247c..5419a23 100644
--- a/src/Workflow/ClipWorkflow.h
+++ b/src/Workflow/ClipWorkflow.h
@@ -98,6 +98,7 @@ class ClipWorkflow : public EffectUser
* of the rendering process advancement.
*/
virtual Workflow::OutputBuffer *getOutput( ClipWorkflow::GetMode mode, qint64 currentFrame ) = 0;
+ virtual Workflow::TrackType type() const = 0;
void postGetOutput();
/**
* @brief Initialize base variables for the SourceRenderer.
diff --git a/src/Workflow/ImageClipWorkflow.cpp b/src/Workflow/ImageClipWorkflow.cpp
index eae9ef0..7e1ac7d 100644
--- a/src/Workflow/ImageClipWorkflow.cpp
+++ b/src/Workflow/ImageClipWorkflow.cpp
@@ -86,6 +86,12 @@ ImageClipWorkflow::getOutput( ClipWorkflow::GetMode, qint64 currentFrame )
return m_buffer;
}
+Workflow::TrackType
+ImageClipWorkflow::type() const
+{
+ return Workflow::VideoTrack;
+}
+
void
ImageClipWorkflow::lock(void *data, uint8_t **pp_ret, size_t )
{
diff --git a/src/Workflow/ImageClipWorkflow.h b/src/Workflow/ImageClipWorkflow.h
index 6b988c6..9a36115 100644
--- a/src/Workflow/ImageClipWorkflow.h
+++ b/src/Workflow/ImageClipWorkflow.h
@@ -34,6 +34,7 @@ class ImageClipWorkflow : public ClipWorkflow
~ImageClipWorkflow();
virtual Workflow::OutputBuffer *getOutput( ClipWorkflow::GetMode mode, qint64 currentFrame );
+ virtual Workflow::TrackType type() const;
/**
* \brief Deactivate time seeking in an ImageClipWorkflow
*/
diff --git a/src/Workflow/VideoClipWorkflow.cpp b/src/Workflow/VideoClipWorkflow.cpp
index b90f241..a86310f 100644
--- a/src/Workflow/VideoClipWorkflow.cpp
+++ b/src/Workflow/VideoClipWorkflow.cpp
@@ -121,6 +121,12 @@ VideoClipWorkflow::getOutput( ClipWorkflow::GetMode mode, qint64 currentFrame )
return buff;
}
+Workflow::TrackType
+VideoClipWorkflow::type() const
+{
+ return Workflow::VideoTrack;
+}
+
void
VideoClipWorkflow::lock( void *data, uint8_t** p_buffer, size_t size )
{
diff --git a/src/Workflow/VideoClipWorkflow.h b/src/Workflow/VideoClipWorkflow.h
index f62e662..5e24644 100644
--- a/src/Workflow/VideoClipWorkflow.h
+++ b/src/Workflow/VideoClipWorkflow.h
@@ -37,6 +37,7 @@ class VideoClipWorkflow : public ClipWorkflow
public:
VideoClipWorkflow( ClipHelper* ch );
virtual Workflow::OutputBuffer *getOutput( ClipWorkflow::GetMode mode, qint64 currentFrame );
+ virtual Workflow::TrackType type() const;
static const quint32 nbBuffers = 3 * 30; //3 seconds with an average fps of 30
More information about the Vlmc-devel
mailing list