資源簡介
QT5 簡易多媒體播放器,支持進度拖拽、快進等功能。

代碼片段和文件信息
/****************************************************************************
**
**?Copyright?(C)?2015?The?Qt?Company?Ltd.
**?Contact:?http://www.qt.io/licensing/
**
**?This?file?is?part?of?the?examples?of?the?Qt?Toolkit.
**
**?$QT_BEGIN_LICENSE:BSD$
**?You?may?use?this?file?under?the?terms?of?the?BSD?license?as?follows:
**
**?“Redistribution?and?use?in?source?and?binary?forms?with?or?without
**?modification?are?permitted?provided?that?the?following?conditions?are
**?met:
**???*?Redistributions?of?source?code?must?retain?the?above?copyright
**?????notice?this?list?of?conditions?and?the?following?disclaimer.
**???*?Redistributions?in?binary?form?must?reproduce?the?above?copyright
**?????notice?this?list?of?conditions?and?the?following?disclaimer?in
**?????the?documentation?and/or?other?materials?provided?with?the
**?????distribution.
**???*?Neither?the?name?of?The?Qt?Company?Ltd?nor?the?names?of?its
**?????contributors?may?be?used?to?endorse?or?promote?products?derived
**?????from?this?software?without?specific?prior?written?permission.
**
**
**?THIS?SOFTWARE?IS?PROVIDED?BY?THE?COPYRIGHT?HOLDERS?AND?CONTRIBUTORS
**?“AS?IS“?AND?ANY?EXPRESS?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT
**?LIMITED?TO?THE?IMPLIED?WARRANTIES?OF?MERCHANTABILITY?AND?FITNESS?FOR
**?A?PARTICULAR?PURPOSE?ARE?DISCLAIMED.?IN?NO?EVENT?SHALL?THE?COPYRIGHT
**?OWNER?OR?CONTRIBUTORS?BE?LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL
**?SPECIAL?EXEMPLARY?OR?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT
**?LIMITED?TO?PROCUREMENT?OF?SUBSTITUTE?GOODS?OR?SERVICES;?LOSS?OF?USE
**?DATA?OR?PROFITS;?OR?BUSINESS?INTERRUPTION)?HOWEVER?CAUSED?AND?ON?ANY
**?THEORY?OF?LIABILITY?WHETHER?IN?CONTRACT?STRICT?LIABILITY?OR?TORT
**?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)?ARISING?IN?ANY?WAY?OUT?OF?THE?USE
**?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY?OF?SUCH?DAMAGE.“
**
**?$QT_END_LICENSE$
**
****************************************************************************/
#include?“histogramwidget.h“
#include?
HistogramWidget::HistogramWidget(QWidget?*parent)
????:?QWidget(parent)
?????m_levels(128)
?????m_isBusy(false)
{
????m_processor.moveToThread(&m_processorThread);
????qRegistermetaType?>(“QVector“);
????connect(&m_processor?SIGNAL(histogramReady(QVector))?SLOT(setHistogram(QVector)));
????m_processorThread.start(QThread::LowestPriority);
}
HistogramWidget::~HistogramWidget()
{
????m_processorThread.quit();
????m_processorThread.wait(10000);
}
void?HistogramWidget::processframe(QVideoframe?frame)
{
????if?(m_isBusy)
????????return;?//drop?frame
????m_isBusy?=?true;
????Qmetaobject::invokeMethod(&m_processor?“processframe“
??????????????????????????????Qt::QueuedConnection?Q_ARG(QVideoframe?frame)?Q_ARG(int?m_levels));
}
void?HistogramWidget::setHistogram(QVector?histogram)
{
????m_isBusy?=?false;
????m_histogram?=?histogram;
????update();
}
void?HistogramWidget::paintEvent(QPaintEvent?*event)
{
????Q_UNUSED(event);
????QP
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5557??2015-06-30?04:53??pla
?????文件???????2782??2015-06-30?04:53??pla
?????文件???????2263??2015-06-30?04:53??pla
?????文件??????14809??2015-06-30?04:53??pla
?????文件???????3806??2015-06-30?04:53??pla
?????文件????????500??2015-06-30?04:53??pla
?????文件??????33957??2017-02-03?16:37??pla
?????文件???????6343??2015-06-30?04:53??pla
?????文件???????3157??2015-06-30?04:53??pla
?????文件???????5241??2015-06-30?04:53??pla
?????文件???????3145??2015-06-30?04:53??pla
?????文件???????2906??2015-06-30?04:53??pla
?????文件???????2308??2015-06-30?04:53??pla
?????目錄??????????0??2017-02-03?16:37??pla
-----------?---------??----------?-----??----
????????????????86774????????????????????14
評論
共有 條評論