diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.co.uk> | 2011-01-21 13:08:48 +0200 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.co.uk> | 2011-01-21 13:08:48 +0200 |
commit | d9417240d0d90218e16318fd8ffad6ab77b6ff44 (patch) | |
tree | 3a822de949367c4819256be80acf7d6b2a7697ab | |
parent | 92493ca51dd59756aa8011c21b8f29c4cdb51211 (diff) |
Add QGst::Int64Range.
-rw-r--r-- | src/QGst/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/QGst/Int64Range | 1 | ||||
-rw-r--r-- | src/QGst/structs.h | 10 | ||||
-rw-r--r-- | src/QGst/value.cpp | 17 |
4 files changed, 27 insertions, 2 deletions
diff --git a/src/QGst/CMakeLists.txt b/src/QGst/CMakeLists.txt index 4e4d21f..83f6fb5 100644 --- a/src/QGst/CMakeLists.txt +++ b/src/QGst/CMakeLists.txt @@ -49,6 +49,7 @@ set(QtGStreamer_INSTALLED_HEADERS structs.h Fourcc Fraction IntRange + Int64Range DoubleRange FractionRange structure.h Structure diff --git a/src/QGst/Int64Range b/src/QGst/Int64Range new file mode 100644 index 0000000..574f2d4 --- /dev/null +++ b/src/QGst/Int64Range @@ -0,0 +1 @@ +#include "structs.h" diff --git a/src/QGst/structs.h b/src/QGst/structs.h index 59207f6..f1bf70f 100644 --- a/src/QGst/structs.h +++ b/src/QGst/structs.h @@ -83,9 +83,9 @@ QGST_REGISTER_TYPE(QGst::Fraction) namespace QGst { namespace Private { - /*! \brief Common template for QGst::IntRange, QGst::DoubleRange and QGst::FractionRange + /*! \brief Common template for IntRange, Int64Range, DoubleRange and FractionRange * \note This structure is private and should not be used directly. You should use - * QGst::IntRange, QGst::DoubleRange and QGst::FractionRange instead. + * QGst::IntRange, QGst::Int64Range, QGst::DoubleRange and QGst::FractionRange instead. */ template <typename T> struct Range @@ -105,6 +105,11 @@ namespace QGst { */ typedef Private::Range<int> IntRange; + /*! \headerfile structs.h <QGst/Int64Range> + * \brief Helper structure for accessing qint64 ranges + */ + typedef Private::Range<qint64> Int64Range; + /*! \headerfile structs.h <QGst/DoubleRange> * \brief Helper structure for accessing double ranges */ @@ -116,6 +121,7 @@ namespace QGst { typedef Private::Range<Fraction> FractionRange; } QGST_REGISTER_TYPE(QGst::IntRange) +QGST_REGISTER_TYPE(QGst::Int64Range) QGST_REGISTER_TYPE(QGst::DoubleRange) QGST_REGISTER_TYPE(QGst::FractionRange) diff --git a/src/QGst/value.cpp b/src/QGst/value.cpp index 3a26380..cd58011 100644 --- a/src/QGst/value.cpp +++ b/src/QGst/value.cpp @@ -103,6 +103,23 @@ void registerValueVTables() QGlib::Value::registerValueVTable(QGlib::GetType<IntRange>(), QGlib::ValueVTable(ValueVTable_IntRange::set, ValueVTable_IntRange::get)); + struct ValueVTable_Int64Range + { + static void get(const QGlib::Value & value, void *data) + { + reinterpret_cast<Int64Range*>(data)->start = gst_value_get_int64_range_min(value); + reinterpret_cast<Int64Range*>(data)->end = gst_value_get_int64_range_max(value); + }; + + static void set(QGlib::Value & value, const void *data) + { + gst_value_set_int64_range(value, reinterpret_cast<Int64Range const *>(data)->start, + reinterpret_cast<Int64Range const *>(data)->end); + }; + }; + QGlib::Value::registerValueVTable(QGlib::GetType<Int64Range>(), + QGlib::ValueVTable(ValueVTable_Int64Range::set, ValueVTable_Int64Range::get)); + struct ValueVTable_DoubleRange { |