[vlmc-devel] IInput: Add aspectRatio()

Yikai Lu git at videolan.org
Sun Jul 24 11:54:45 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Jul 24 18:21:07 2016 +0900| [68eb2c0fbd3da02c96a22d1b914f60e214b789fc] | committer: Yikai Lu

IInput: Add aspectRatio()

> https://code.videolan.org/videolan/vlmc/commit/68eb2c0fbd3da02c96a22d1b914f60e214b789fc
---

 src/Backend/IInput.h         | 1 +
 src/Backend/MLT/MLTInput.cpp | 6 ++++++
 src/Backend/MLT/MLTInput.h   | 1 +
 3 files changed, 8 insertions(+)

diff --git a/src/Backend/IInput.h b/src/Backend/IInput.h
index 0a2831b..730c583 100644
--- a/src/Backend/IInput.h
+++ b/src/Backend/IInput.h
@@ -88,6 +88,7 @@ namespace Backend
         virtual uint8_t*        image( uint32_t width, uint32_t height ) const = 0;
 
         virtual double          fps() const = 0;
+        virtual double          aspectRatio() const = 0;
         virtual int             width() const = 0;
         virtual int             height() const = 0;
         virtual bool            hasVideo() const = 0;
diff --git a/src/Backend/MLT/MLTInput.cpp b/src/Backend/MLT/MLTInput.cpp
index 23b130e..aed117c 100644
--- a/src/Backend/MLT/MLTInput.cpp
+++ b/src/Backend/MLT/MLTInput.cpp
@@ -272,6 +272,12 @@ MLTInput::fps() const
     return producer()->get_fps();
 }
 
+double
+MLTInput::aspectRatio() const
+{
+    return producer()->get_double( "aspect_ratio" );
+}
+
 int
 MLTInput::width() const
 {
diff --git a/src/Backend/MLT/MLTInput.h b/src/Backend/MLT/MLTInput.h
index 9a57e60..ce25d49 100644
--- a/src/Backend/MLT/MLTInput.h
+++ b/src/Backend/MLT/MLTInput.h
@@ -90,6 +90,7 @@ class MLTInput : virtual public IInput, public MLTService
         virtual uint8_t*        image( uint32_t width, uint32_t height ) const override;
 
         virtual double          fps() const override;
+        virtual double          aspectRatio() const override;
         virtual int             width() const override;
         virtual int             height() const override;
         virtual bool            hasVideo() const override;



More information about the Vlmc-devel mailing list