From 2def5aecabca7e55caa47e69724a74decdee9609 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Mon, 1 Dec 2014 04:05:44 +0000 Subject: [PATCH] cedarv: build error. qobj property --- src/VideoThread.cpp | 2 +- src/codec/video/VideoDecoderCedarv.cpp | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/VideoThread.cpp b/src/VideoThread.cpp index c35d04a3..a02b5585 100644 --- a/src/VideoThread.cpp +++ b/src/VideoThread.cpp @@ -272,7 +272,7 @@ void VideoThread::run() d.delay = 0; else d.delay -= kSyncThreshold; - d.delay = qMax(0.0, qMin(d.delay, pts - d.clock->value())); + d.delay = qMax(0.0, qMin(d.delay, qreal(pts - d.clock->value()))); processNextTask(); } if (d.delay > 0) diff --git a/src/codec/video/VideoDecoderCedarv.cpp b/src/codec/video/VideoDecoderCedarv.cpp index bc8e1a27..8980212d 100644 --- a/src/codec/video/VideoDecoderCedarv.cpp +++ b/src/codec/video/VideoDecoderCedarv.cpp @@ -292,7 +292,8 @@ namespace QtAV { class VideoDecoderCedarvPrivate; class VideoDecoderCedarv : public VideoDecoder { - DPTR_DECLARE_PRIVATE(VideoDecoderCedarv) + Q_OBJECT + DPTR_DECLARE_PRIVATE(VideoDecoderCedarv) #ifndef NO_NEON_OPT //Don't HAVE_NEON Q_PROPERTY(bool neon READ neon WRITE setNeon NOTIFY neonChanged) #endif @@ -300,7 +301,7 @@ public: VideoDecoderCedarv(); virtual VideoDecoderId id() const; virtual QString description() const{ - return "Allwinner CedarX video hardware acceleration"; + return "Allwinner A10 CedarX video hardware acceleration"; } bool prepare(); bool decode(const QByteArray &encoded) Q_DECL_FINAL; @@ -310,6 +311,8 @@ public: //properties void setNeon(bool value); bool neon() const; +Q_SIGNALS: + void neonChanged(); }; extern VideoDecoderId VideoDecoderId_Cedarv; @@ -357,20 +360,22 @@ void VideoDecoderCedarv::setNeon(bool value) { if (value == neon()) return; + DPTR_D(VideoDecoderCedarv); if (value) { #ifndef NO_NEON_OPT //Don't HAVE_NEON - map_y = map32x32_to_yuv_Y_neon; - map_c = map32x32_to_yuv_C_neon; + d.map_y = map32x32_to_yuv_Y_neon; + d.map_c = map32x32_to_yuv_C_neon; #endif } else { - map_y = map32x32_to_yuv_Y; - map_c = map32x32_to_yuv_C; + d.map_y = map32x32_to_yuv_Y; + d.map_c = map32x32_to_yuv_C; } + emit neonChanged(); } bool VideoDecoderCedarv::neon() const { - return map_y != map32x32_to_yuv_Y; + return d_func().map_y != map32x32_to_yuv_Y; } bool VideoDecoderCedarv::prepare() @@ -517,8 +522,8 @@ VideoFrame VideoDecoderCedarv::frame() int bitsPerLine_Y = d.cedarPicture.size_y / d.cedarPicture.height; int bitsPerRow_Y = d.cedarPicture.size_y / bitsPerLine_Y; - map_y(d.cedarPicture.y, dst + offset_y, bitsPerLine_Y, bitsPerRow_Y); - map_c(d.cedarPicture.u, dst + offset_u, dst + offset_v, bitsPerLine_Y / 2, bitsPerRow_Y / 2); + d.map_y(d.cedarPicture.y, dst + offset_y, bitsPerLine_Y, bitsPerRow_Y); + d.map_c(d.cedarPicture.u, dst + offset_u, dst + offset_v, bitsPerLine_Y / 2, bitsPerRow_Y / 2); uint8_t *pp_plane[3]; pp_plane[0] = dst + offset_y; @@ -540,3 +545,5 @@ VideoFrame VideoDecoderCedarv::frame() } // namespace QtAV + +#include "VideoDecoderCedarv.moc"