summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-16 16:56:36 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.co.uk>2011-01-16 17:24:58 +0200
commitccebff59866cad0938fb2432b8ecb5df02e2b20e (patch)
treeb2b9658a2422ba520b2287e212fa8ccaa542ee91
parentc4be24c1040e228c31338503dc3fecdf6a10fee1 (diff)
Re-enable and fix the dateTime/setDateTime TagList functions.
-rw-r--r--src/QGst/taglist.cpp23
-rw-r--r--src/QGst/taglist.h2
-rw-r--r--tests/auto/taglisttest.cpp5
3 files changed, 7 insertions, 23 deletions
diff --git a/src/QGst/taglist.cpp b/src/QGst/taglist.cpp
index c153456..4905d9f 100644
--- a/src/QGst/taglist.cpp
+++ b/src/QGst/taglist.cpp
@@ -1059,32 +1059,17 @@ void TagList::setApplicationData(const BufferPtr & value)
GST_TAG_APPLICATION_DATA, QGlib::Value::create(value));
}
-/*
QDateTime TagList::dateTime() const
{
- GstDateTime * value;
- if (gst_tag_list_get_date_time(d->taglist, GST_TAG_DATE_TIME, &value)) {
- QDateTime ret(QDate(gst_date_time_get_year(value),
- gst_date_time_get_month(value),
- gst_date_time_get_day(value)),
- QTime(gst_date_time_get_hour(value),
- gst_date_time_get_minute(value),
- gst_date_time_get_second(value),
- gst_date_time_get_microsecond(value)*1000), Qt::LocalTime);
- gst_date_time_unref(value);
- return ret;
- }
- return QDateTime();
+ return tagValue(GST_TAG_DATE_TIME).get<QDateTime>();
}
void TagList::setDateTime(const QDateTime & value)
{
- GstDateTime * datetime = gst_date_time_new_local_time(value.date().year(),
- value.date().month(), value.date().day(), value.time().hour(),
- value.time().minute(),value.time().second()+(value.time().msec()/1000.0));
- gst_tag_list_add (d->taglist, GST_TAG_MERGE_REPLACE_ALL, GST_TAG_DATE_TIME, datetime, NULL);
+ gst_tag_list_add_value(d->taglist, GST_TAG_MERGE_REPLACE_ALL,
+ GST_TAG_DATE_TIME, QGlib::Value::create(value));
}
-*/
+
QDebug operator<<(QDebug debug, const TagList & taglist)
{
diff --git a/src/QGst/taglist.h b/src/QGst/taglist.h
index e160ca2..a06e629 100644
--- a/src/QGst/taglist.h
+++ b/src/QGst/taglist.h
@@ -329,10 +329,8 @@ public:
BufferPtr applicationData() const;
void setApplicationData(const BufferPtr & value);
- /*
QDateTime dateTime() const;
void setDateTime(const QDateTime & value);
- */
double geoLocationHorizontalError() const;
void setGeoLocationHorizontalError(double value);
diff --git a/tests/auto/taglisttest.cpp b/tests/auto/taglisttest.cpp
index aeef08e..d55249b 100644
--- a/tests/auto/taglisttest.cpp
+++ b/tests/auto/taglisttest.cpp
@@ -83,20 +83,21 @@ void TagListTest::dateTest()
void TagListTest::dateTimeTest()
{
- /*
QGst::TagList tl;
+ QCOMPARE(tl.dateTime(), QDateTime());
+
QDate date(1969, 8, 4);
QTime time(1, 10, 15, 432);
QDateTime dateTime(date, time);
tl.setDateTime(dateTime);
QCOMPARE(tl.dateTime(), dateTime);
+
//replace and retest
QDate date2(100, 12, 30);
QTime time2(14, 50, 38, 0);
QDateTime dateTime2(date2, time2);
tl.setDateTime(dateTime2);
QCOMPARE(tl.dateTime(), dateTime2);
- */
}
void TagListTest::copyTest()