From a2c7f853d1c86a42d403ed02aa4d0e06393b47ec Mon Sep 17 00:00:00 2001 From: wang-bin Date: Sat, 2 Nov 2013 22:55:04 +0800 Subject: [PATCH 1/6] remove dead code. the can keep in 1.2 branch --- src/AVOutput.cpp | 4 ---- src/AVPlayer.cpp | 23 ----------------------- src/EventFilter.cpp | 7 ------- src/Filter.cpp | 25 ------------------------- src/VideoThread.cpp | 30 ------------------------------ 5 files changed, 89 deletions(-) diff --git a/src/AVOutput.cpp b/src/AVOutput.cpp index a609c703..4c646ffd 100644 --- a/src/AVOutput.cpp +++ b/src/AVOutput.cpp @@ -84,10 +84,6 @@ void AVOutput::pause(bool p) if (d.paused == p) return; d.paused = p; -#if V1_2 - if (!d.paused) - d.cond.wakeAll(); -#endif //V1_2 } bool AVOutput::isPaused() const diff --git a/src/AVPlayer.cpp b/src/AVPlayer.cpp index 60087815..8f38c4ed 100644 --- a/src/AVPlayer.cpp +++ b/src/AVPlayer.cpp @@ -149,20 +149,6 @@ void AVPlayer::clearVideoRenderers() void AVPlayer::setRenderer(VideoRenderer *r) { qDebug(">>>>>>>>>>%s", __FUNCTION__); -#if V1_2 - if (_renderer && r) { - VideoRenderer::OutAspectRatioMode oar = _renderer->outAspectRatioMode(); - r->setOutAspectRatioMode(oar); - if (oar == VideoRenderer::CustomAspectRation) { - r->setOutAspectRatio(_renderer->outAspectRatio()); - } - } - setAVOutput(_renderer, r, video_thread); - if (_renderer) { - qDebug("resizeRenderer after setRenderer"); - _renderer->resizeRenderer(_renderer->rendererSize()); //IMPORTANT: the swscaler will resize - } -#else VideoRenderer *vo = renderer(); if (vo && r) { VideoRenderer::OutAspectRatioMode oar = vo->outAspectRatioMode(); @@ -178,20 +164,14 @@ void AVPlayer::setRenderer(VideoRenderer *r) r->setStatistics(&mStatistics); clearVideoRenderers(); addVideoRenderer(r); - -#endif //V1_2 } VideoRenderer *AVPlayer::renderer() { -#if V1_2 - return _renderer; -#else //QList assert empty in debug mode if (mpVOSet->outputs().isEmpty()) return 0; return static_cast(mpVOSet->outputs().last()); -#endif //V1_2 } QList AVPlayer::videoOutputs() @@ -947,9 +927,6 @@ bool AVPlayer::setupVideoThread() } } } -#if V1_2 - setRenderer(_renderer); -#endif int queue_min = 0.61803*qMax(24.0, mStatistics.video.fps); int queue_max = int(1.61803*(qreal)queue_min); //about 1 second video_thread->packetQueue()->setThreshold(queue_min); diff --git a/src/EventFilter.cpp b/src/EventFilter.cpp index 38582313..ab531a38 100644 --- a/src/EventFilter.cpp +++ b/src/EventFilter.cpp @@ -110,18 +110,11 @@ bool EventFilter::eventFilter(QObject *watched, QEvent *event) AVPlayer *player = static_cast(parent()); if (!player) return false; -#if 0 //TODO: why crash on close? - if (player->renderer()->widget() != watched - && (QGraphicsObject*)player->renderer()->graphicsItem() != watched) { - return false; - } -#else #ifndef QT_NO_DYNAMIC_CAST //dynamic_cast is defined as a macro to force a compile error if (player->renderer() != dynamic_cast(watched)) { return false; } #endif -#endif //0 QEvent::Type type = event->type(); switch (type) { case QEvent::KeyPress: { diff --git a/src/Filter.cpp b/src/Filter.cpp index 923bb5f1..a2c4cd6e 100644 --- a/src/Filter.cpp +++ b/src/Filter.cpp @@ -55,30 +55,6 @@ Filter::~Filter() void Filter::process(FilterContext *&context, Statistics *statistics, QByteArray* data) { DPTR_D(Filter); -#if V1_2 - if (!context || context->type() != contextType()) { - if (context) { - qDebug("incompatible context type"); - //we don't delete it because the context MUST be used by other filters - //TODO: How to release them at the end? refcount? - } else { - qDebug("null context"); - } - //use internal context - if (d.context) { - qDebug("replace context with internal one"); - context = d.context; - } else { - context = FilterContext::create(contextType()); - qDebug("new filter context=%p, type=%d", context, contextType()); - context->video_width = statistics->video_only.width; - context->video_height = statistics->video_only.height; - } - } - //if (data) - context->initializeOnData(data); - d.context = context; -#else if (!d.context) { d.context = FilterContext::create(contextType()); d.context->video_width = statistics->video_only.width; @@ -97,7 +73,6 @@ void Filter::process(FilterContext *&context, Statistics *statistics, QByteArray d.context->shareFrom(context); d.context->initializeOnData(data); context->shareFrom(d.context); -#endif //V1_2 d.statistics = statistics; process(); } diff --git a/src/VideoThread.cpp b/src/VideoThread.cpp index 15fa3d94..afb59920 100644 --- a/src/VideoThread.cpp +++ b/src/VideoThread.cpp @@ -86,13 +86,8 @@ void VideoThread::run() { DPTR_D(VideoThread); //TODO: no d.writer is ok, just a audio player -#if V1_2 - if (!d.dec || !d.dec->isAvailable() || !d.writer)// || !d.conv) - return; -#else if (!d.dec || !d.dec->isAvailable() || !d.outputSet)// || !d.conv) return; -#endif //V1_2 resetState(); Q_ASSERT(d.clock != 0); VideoDecoder *dec = static_cast(d.dec); @@ -159,19 +154,6 @@ void VideoThread::run() } } d.clock->updateVideoPts(pkt.pts); //here? -#if V1_2 - //DO NOT decode and convert if vo is not available or null! - //NOTE: vo may changes dymanically. we need check it every time we use it. decoder and other components should do this too - VideoRenderer* vo = static_cast(d.writer); - bool vo_ok = vo && vo->isAvailable(); - if (vo_ok) { - //use the last size first then update the last size so that decoder(converter) can update output size - if (vo->lastWidth() > 0 && vo->lastHeight() > 0 && !vo->scaleInRenderer()) - dec->resizeVideoFrame(vo->lastSize()); - else - vo->setInSize(dec->width(), dec->height()); //setLastSize(). optimize: set only when changed - } -#else if (need_update_vo_parameters || !d.update_outputs.isEmpty()) { //lock is important when iterating d.outputSet->lock(); @@ -194,7 +176,6 @@ void VideoThread::run() } QMutexLocker locker(&d.mutex); Q_UNUSED(locker); -#endif //V1_2 //still decode, we may need capture. TODO: decode only if existing a capture request if no vo if (dec->decode(pkt.data)) { d.pts = pkt.pts; @@ -219,11 +200,6 @@ void VideoThread::run() } } } -#if V1_2 - if (vo_ok) { - vo->writeData(data); - } -#else //while can pause, processNextTask, not call outset.puase which is deperecated while (d.outputSet->canPauseThread()) { if (d.stop) { @@ -239,13 +215,7 @@ void VideoThread::run() break; } d.outputSet->sendData(data); -#endif //V1_2 } -#if V1_2 - //use the last size first then update the last size so that decoder(converter) can update output size - if (vo_ok && !vo->scaleInRenderer()) - vo->setInSize(vo->rendererSize());//out size? -#endif //V1_2 } qDebug("Video thread stops running..."); } From 0cc359a5210bee6dd02c220fb69d718636cf8318 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Sun, 3 Nov 2013 15:04:11 +0800 Subject: [PATCH 2/6] player: online tv list widget --- examples/player/MainWindow.cpp | 55 ++++++-------- examples/player/MainWindow.h | 4 +- examples/player/StatisticsView.cpp | 38 +++------- examples/player/StatisticsView.h | 4 +- examples/player/TVView.cpp | 71 ++++++++++++++++++ examples/player/TVView.h | 29 ++++++++ examples/player/player.pro | 6 +- examples/player/res/tv.ini | 113 ++++++++++++++++++----------- 8 files changed, 213 insertions(+), 107 deletions(-) create mode 100644 examples/player/TVView.cpp create mode 100644 examples/player/TVView.h diff --git a/examples/player/MainWindow.cpp b/examples/player/MainWindow.cpp index 81c221ff..69b46681 100644 --- a/examples/player/MainWindow.cpp +++ b/examples/player/MainWindow.cpp @@ -5,8 +5,6 @@ #include #include #include -#include -#include #include #include #include @@ -23,6 +21,7 @@ #include "ClickableMenu.h" #include "Slider.h" #include "StatisticsView.h" +#include "TVView.h" /* *TODO: @@ -211,33 +210,7 @@ void MainWindow::setupUi() */ mpMenu = new QMenu(mpMenuBtn); mpMenu->addAction(tr("Open Url"), this, SLOT(openUrl())); - QMenu *subMenu = new QMenu(tr("Online channels")); - connect(subMenu, SIGNAL(triggered(QAction*)), SLOT(playOnlineVideo(QAction*))); - QFile tv_file(qApp->applicationDirPath() + "/tv.ini"); - if (!tv_file.exists()) - tv_file.setFileName(":/tv.ini"); - if (tv_file.open(QIODevice::ReadOnly)) { - QTextStream ts(&tv_file); - ts.setCodec("UTF-8"); - QString line; - while (!ts.atEnd()) { - line = ts.readLine(); - if (line.isEmpty() || line.startsWith("#") || !line.contains("=")) - continue; - QString key = line.section('=', 0, 0); - QString value = line.section('=', 1); - subMenu->addAction(key)->setData(value); - } - } -/* - //codec problem - QSettings tv(qApp->applicationDirPath() + "/tv.ini", QSettings::IniFormat); - tv.setIniCodec("UTF-8"); - foreach (QString key, tv.allKeys()) { - subMenu->addAction(key)->setData(tv.value(key).toString()); - } -*/ - mpMenu->addMenu(subMenu); + mpMenu->addAction(tr("Online channels"), this, SLOT(onTVMenuClick())); mpMenu->addSeparator(); mpMenu->addAction(tr("Setup"), this, SLOT(setup()))->setEnabled(false); mpMenu->addAction(tr("Report"))->setEnabled(false); //report bug, suggestions etc. using maillist? @@ -248,7 +221,7 @@ void MainWindow::setupUi() mpMenuBtn->setMenu(mpMenu); mpMenu->addSeparator(); - subMenu = new QMenu(tr("Speed")); + QMenu *subMenu = new QMenu(tr("Speed")); mpMenu->addMenu(subMenu); QDoubleSpinBox *pSpeedBox = new QDoubleSpinBox(0); pSpeedBox->setRange(0.01, 20); @@ -800,6 +773,21 @@ void MainWindow::playOnlineVideo(QAction *action) play(action->data().toString()); } +void MainWindow::onTVMenuClick() +{ + static TVView *tvv = new TVView; + tvv->show(); + connect(tvv, SIGNAL(clicked(QString,QString)), SLOT(onPlayListClick(QString,QString))); + tvv->setMaximumHeight(qApp->desktop()->height()); + tvv->setMinimumHeight(tvv->width()*2); +} + +void MainWindow::onPlayListClick(const QString &key, const QString &value) +{ + mTitle = key; + play(value); +} + void MainWindow::tryHideControlBar() { if (mShowControl > 0) { @@ -846,8 +834,9 @@ bool MainWindow::winEvent(MSG *message, long *result) void MainWindow::showInfo() { - static StatisticsView sv; + // why crash if on stack + static StatisticsView *sv = new StatisticsView; if (mpPlayer) - sv.setStatistics(mpPlayer->statistics()); - sv.show(); + sv->setStatistics(mpPlayer->statistics()); + sv->show(); } diff --git a/examples/player/MainWindow.h b/examples/player/MainWindow.h index 3650d20f..92843f61 100644 --- a/examples/player/MainWindow.h +++ b/examples/player/MainWindow.h @@ -47,7 +47,9 @@ private slots: void changeVO(QAction* action); void changeChannel(QAction* action); void changeAudioTrack(QAction* action); - void playOnlineVideo(QAction* action); + void onTVMenuClick(); + void playOnlineVideo(QAction *action); + void onPlayListClick(const QString& key, const QString& value); void processPendingActions(); void initPlayer(); void setupUi(); diff --git a/examples/player/StatisticsView.cpp b/examples/player/StatisticsView.cpp index 1c7ef1c0..7ff7eeaf 100644 --- a/examples/player/StatisticsView.cpp +++ b/examples/player/StatisticsView.cpp @@ -103,8 +103,8 @@ StatisticsView::StatisticsView(QWidget *parent) : mpView->setColumnCount(2); initBaseItems(&mBaseItems); mpView->addTopLevelItems(mBaseItems); - mpView->addTopLevelItem(initVideoItems(&mVideoItems)); - mpView->addTopLevelItem(initAudioItems(&mAudioItems)); + mpView->addTopLevelItem(createNodeWithItems(mpView, QObject::tr("Video"), getVideoInfoKeys(), &mVideoItems)); + mpView->addTopLevelItem(createNodeWithItems(mpView, QObject::tr("Audio"), getAudioInfoKeys(), &mAudioItems)); mpView->resizeColumnToContents(0); //call this after content is done QPushButton *btn = new QPushButton(QObject::tr("Ok")); @@ -157,32 +157,18 @@ void StatisticsView::initBaseItems(QList *items) } } -QTreeWidgetItem* StatisticsView::initVideoItems(QList *items) +QTreeWidgetItem* StatisticsView::createNodeWithItems(QTreeWidget *view, const QString &name, const QStringList &itemNames, QList *items) { - QTreeWidgetItem *videoItem = new QTreeWidgetItem(mpView); - videoItem->setData(0, Qt::DisplayRole, QObject::tr("Video")); + QTreeWidgetItem *nodeItem = new QTreeWidgetItem(view); + nodeItem->setData(0, Qt::DisplayRole, name); QTreeWidgetItem *item = 0; - foreach(QString key, getVideoInfoKeys()) { - item = new QTreeWidgetItem(videoItem); + foreach(QString key, itemNames) { + item = new QTreeWidgetItem(nodeItem); item->setData(0, Qt::DisplayRole, key); - items->append(item); + nodeItem->addChild(item); + if (items) + items->append(item); } - videoItem->addChildren(*items); - videoItem->setExpanded(true); - return videoItem; -} - -QTreeWidgetItem* StatisticsView::initAudioItems(QList *items) -{ - QTreeWidgetItem *audioItem = new QTreeWidgetItem(mpView); - audioItem->setData(0, Qt::DisplayRole, QObject::tr("Audio")); - QTreeWidgetItem *item = 0; - foreach(QString key, getAudioInfoKeys()) { - item = new QTreeWidgetItem(audioItem); - item->setData(0, Qt::DisplayRole, key); - items->append(item); - } - audioItem->addChildren(*items); - audioItem->setExpanded(true); - return audioItem; + nodeItem->setExpanded(true); + return nodeItem; } diff --git a/examples/player/StatisticsView.h b/examples/player/StatisticsView.h index b62c7d2b..9388bb99 100644 --- a/examples/player/StatisticsView.h +++ b/examples/player/StatisticsView.h @@ -21,8 +21,7 @@ public slots: private: void initBaseItems(QList* items); - QTreeWidgetItem* initVideoItems(QList* items); - QTreeWidgetItem* initAudioItems(QList* items); + QTreeWidgetItem* createNodeWithItems(QTreeWidget* view, const QString& name, const QStringList& itemNames, QList* items = 0); QTreeWidget *mpView; QList mBaseItems; @@ -30,7 +29,6 @@ private: //TODO: multiple streams QList mAudioItems; Statistics mStatistics; - }; #endif // STATISTICSVIEW_H diff --git a/examples/player/TVView.cpp b/examples/player/TVView.cpp new file mode 100644 index 00000000..3369e534 --- /dev/null +++ b/examples/player/TVView.cpp @@ -0,0 +1,71 @@ +#include "TVView.h" +#include +#include +#include +#include +#include +#include +#include +#include + +TVView::TVView(QWidget *parent) : + QWidget(parent) +{ + setWindowTitle(tr("Online TV channels")); + setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); + mpView = new QTreeWidget(); + mpView->setHeaderHidden(true); + mpView->setColumnCount(1); + connect(mpView, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), SLOT(onItemDoubleClick (QTreeWidgetItem*,int))); + QVBoxLayout *vl = new QVBoxLayout(); + vl->addWidget(mpView); + setLayout(vl); + QTimer::singleShot(0, this, SLOT(load())); +} + +void TVView::load() +{ + /* + //codec problem + QSettings tv(qApp->applicationDirPath() + "/tv.ini", QSettings::IniFormat); + tv.setIniCodec("UTF-8"); + foreach (QString key, tv.allKeys()) { + subMenu->addAction(key)->setData(tv.value(key).toString()); + } + */ + QFile tv_file(qApp->applicationDirPath() + "/tv.ini"); + if (!tv_file.exists()) + tv_file.setFileName(":/tv.ini"); + if (!tv_file.open(QIODevice::ReadOnly)) + return; + qDebug("tv.ini: %s", tv_file.fileName().toAscii().constData()); + QTextStream ts(&tv_file); + ts.setCodec("UTF-8"); + QTreeWidgetItem *nodeItem = new QTreeWidgetItem(mpView); + nodeItem->setData(0, Qt::DisplayRole, ""); + mpView->addTopLevelItem(nodeItem); + nodeItem->setExpanded(true); + QString line; + while (!ts.atEnd()) { + line = ts.readLine(); + if (line.isEmpty() || line.startsWith("#")) + continue; + if (!line.contains("=")) { + nodeItem = new QTreeWidgetItem(mpView); + nodeItem->setData(0, Qt::DisplayRole, line); + mpView->addTopLevelItem(nodeItem); + continue; + } + QString key = line.section('=', 0, 0); + QString value = line.section('=', 1); + QTreeWidgetItem *item = new QTreeWidgetItem(nodeItem); + item->setData(0, Qt::DisplayRole, key); + item->setData(1, Qt::EditRole, value); + } + mpView->resizeColumnToContents(0); //call this after content is done +} + +void TVView::onItemDoubleClick(QTreeWidgetItem *item, int column) +{ + emit clicked(item->data(0, Qt::DisplayRole).toString(), item->data(1, Qt::EditRole).toString()); +} diff --git a/examples/player/TVView.h b/examples/player/TVView.h new file mode 100644 index 00000000..ec926140 --- /dev/null +++ b/examples/player/TVView.h @@ -0,0 +1,29 @@ +#ifndef TVVIEW_H +#define TVVIEW_H + +#include + + +class QTreeWidget; +class QTreeWidgetItem; + +class TVView : public QWidget +{ + Q_OBJECT +public: + explicit TVView(QWidget *parent = 0); + +signals: + void clicked(const QString& key, const QString& value); + +private slots: + void load(); + void onItemDoubleClick( QTreeWidgetItem * item, int column); +private: + QTreeWidgetItem* createNodeWithItems(QTreeWidget* view, const QString& name, const QStringList& itemNames, QList* items = 0); + + QTreeWidget *mpView; + +}; + +#endif // TVVIEW_H diff --git a/examples/player/player.pro b/examples/player/player.pro index 7c0d41e3..fc561f73 100644 --- a/examples/player/player.pro +++ b/examples/player/player.pro @@ -16,7 +16,8 @@ SOURCES += main.cpp \ ClickableMenu.cpp \ ScreenSaver.cpp \ StatisticsView.cpp \ - Slider.cpp + Slider.cpp \ + TVView.cpp HEADERS += \ MainWindow.h \ @@ -24,7 +25,8 @@ HEADERS += \ ClickableMenu.h \ ScreenSaver.h \ StatisticsView.h \ - Slider.h + Slider.h \ + TVView.h tv.files = res/tv.ini BIN_INSTALLS += tv diff --git a/examples/player/res/tv.ini b/examples/player/res/tv.ini index 070a9a24..d007677e 100644 --- a/examples/player/res/tv.ini +++ b/examples/player/res/tv.ini @@ -1,6 +1,7 @@ #http://mraandtux.github.io/tv/ #m3u8: http://blog.csdn.net/perfect_promise/article/details/9713663 #CUTV: http://5mu5.com/forum.php?mod=viewthread&tid=6565 +CCTV CCTV-1 HD=rtsp://l.m.cztv.com:554/hdmi/cctv1hd.stream CCTV-1=http://live.gslb.letv.com/gslb?stream_id=cctv1&tag=live&ext=m3u8 CCTV-2=http://live.gslb.letv.com/gslb?stream_id=cctv2&tag=live&ext=m3u8 @@ -20,7 +21,13 @@ CCTV-Music=http://live.gslb.letv.com/gslb?stream_id=cctvmusic&tag=live&ext=m3u8& CCTV-风云足球=http://live.gslb.letv.com/gslb?stream_id=fyzq&tag=live&ext=m3u8&sign=live_ipad CCTV-风云音乐=http://live.gslb.letv.com/gslb?stream_id=fyyy&tag=live&ext=m3u8&sign=live_ipad 怀旧剧场=http://live.gslb.letv.com/gslb?stream_id=hjjc&tag=live&ext=m3u8&sign=live_ipad +#CCTV1=rtsp://122.192.35.80:554/live/tv14 +#CCTV3=rtsp://122.192.35.80:554/live/tv30 +#CCTV4=rtsp://122.192.35.80:554/live/tv07 +#CCTV6=rtsp://122.192.35.80:554/live/tv31 + +卫视 #北京卫视=http://live.gslb.letv.com/gslb?stream_id=bjws&tag=live&ext=m3u8&sign=live_ipad 山东卫视=http://live.gslb.letv.com/gslb?stream_id=shandong&tag=live&ext=m3u8&sign=live_ipad 东南卫视=http://live.gslb.letv.com/gslb?stream_id=dongnan&tag=live&ext=m3u8&sign=live_ipad @@ -30,7 +37,9 @@ CCTV-风云音乐=http://live.gslb.letv.com/gslb?stream_id=fyyy&tag=live&ext=m3u 江西卫视=http://live.gslb.letv.com/gslb?stream_id=jiangxi&tag=live&ext=m3u8&sign=live_ipad 湖北卫视=http://live.gslb.letv.com/gslb?stream_id=hubei&tag=live&ext=m3u8&sign=live_ipad #广西卫视=http://live.gslb.letv.com/gslb?stream_id=guangxi&tag=live&ext=m3u8&sign=live_ipad +广西卫视=http://qqlive.dnion.com:1863/974433428.flv 甘肃卫视=http://live.gslb.letv.com/gslb?stream_id=gansu&tag=live&ext=m3u8&sign=live_ipad +云南卫视=http://qqlive.dnion.com:1863/708402866.flv 云南卫视=http://live.gslb.letv.com/gslb?stream_id=yunnan&tag=live&ext=m3u8&sign=live_ipad #辽宁卫视=http://live.gslb.letv.com/gslb?stream_id=liaoning&tag=live&ext=m3u8&sign=live_ipad 贵州卫视=http://live.gslb.letv.com/gslb?stream_id=guizhou&tag=live&ext=m3u8&sign=live_ipad @@ -41,22 +50,28 @@ CCTV-风云音乐=http://live.gslb.letv.com/gslb?stream_id=fyyy&tag=live&ext=m3u 深圳卫视=http://live.gslb.letv.com/gslb?stream_id=shenzhen&tag=live&ext=m3u8&sign=live_ipad 南方卫视=http://live.gslb.letv.com/gslb?stream_id=nanfang&tag=live&ext=m3u8&sign=live_ipad #内蒙古卫视=http://live.gslb.letv.com/gslb?stream_id=neimenggu&tag=live&ext=m3u8&sign=live_ipad +内蒙古卫视=http://qqlive.dnion.com:1863/2342060367.flv 黑龙江卫视=http://live.gslb.letv.com/gslb?stream_id=heilongjiang&tag=live&ext=m3u8&sign=live_ipad + +Other 金鹰卡通=http://live.gslb.letv.com/gslb?stream_id=jykt&tag=live&ext=m3u8&sign=live_ipad 炫动卡通=http://live.gslb.letv.com/gslb?stream_id=xdkt&tag=live&ext=m3u8&sign=live_ipad 卡酷动画=http://live.gslb.letv.com/gslb?stream_id=bjkaku&tag=live&ext=m3u8&sign=live_ipad -山东教育=http://live.gslb.letv.com/gslb?stream_id=sdjy&tag=live&ext=m3u8&sign=live_ipad -广东体育=http://live.gslb.letv.com/gslb?stream_id=guangdongtiyu&tag=live&ext=m3u8&sign=live_ipad 天元围棋=http://live.gslb.letv.com/gslb?stream_id=tywq&tag=live&ext=m3u8&sign=live_ipad -北京体育=http://live.gslb.letv.com/gslb?stream_id=btv6_800&tag=live&ext=m3u8 乐视体育=http://live.gslb.letv.com/gslb?stream_id=sportlive&tag=live&ext=m3u8 乐视盛典=http://live.gslb.letv.com/gslb?stream_id=shengdian&tag=live&ext=m3u8 - -KBS=http://news24kbs-2.gscdn.com/news24_300/_definst_/news24_300.stream/playlist.m3u8 - 澳亚卫视=http://tsl4.hls.cutv.com/cutvlive/AJ9m0cd/hls/live_sd.m3u8 + 台湾-好消息1=http://210.59.248.53/hls-live/livepkgr/_definst_/liveevent/live-ch1-3.m3u8 台湾-好消息2=http://210.59.248.53/hls-live/livepkgr/_definst_/liveevent/live-ch2-3.m3u8 + +旅游卫视=rtsp://122.192.35.80:554/live/tv08 +#NJTV新闻综合=rtsp://122.192.35.80:554/live/tv08 +MursTv=rtsp://122.192.35.80:554/live/tv20 +NBS新闻综合=rtsp://122.192.35.80:554/live/tv09 +靓妆=rtsp://122.192.35.80:554/live/tv50 + +KBS=http://news24kbs-2.gscdn.com/news24_300/_definst_/news24_300.stream/playlist.m3u8 Korea Lady TV=http://ladytv.tv/channels/1111/800.flv/live Korea Movies=http://ladytv.tv/channels/39/800.flv/live @@ -97,6 +112,7 @@ Disney=http://94.242.221.141/hls/a-lo/stream127.m3u8 Diva Universal=http://94.242.221.141/hls/a-lo/stream137.m3u8 141 (Arab)=http://94.242.221.141/hls/a-lo/stream141.m3u8 +浙江 #浙江卫视 HD=rtsp://l.m.cztv.com:554/hdmi/zjtv1hd.stream 浙江卫视=http://zb.v.qq.com:1863/?progid=1975434150 浙江钱江=http://v2.cztv.com/channels/102/500.flv/live @@ -109,17 +125,22 @@ Diva Universal=http://94.242.221.141/hls/a-lo/stream137.m3u8 浙江国际=http://v11.cztv.com/channels/110/500.flv/live 浙江网络=http://c7.cztv.com/channels/304/512.flv/live 留学世界=http://v9.cztv.com/channels/109/500.flv/live + +绍兴影视娱乐=http://tsl4.hls.cutv.com/cutvlive/24yG85b/hls/live_sd.m3u8 +绍兴公共=http://tsl4.hls.cutv.com/cutvlive/kSpsAae/hls/live_sd.m3u8 +绍兴新闻综合=http://tsl4.hls.cutv.com/cutvliv + +宁波 宁波新闻综合=http://ming-live.nbtv.cn/channels/nbtv/nbtv1/flv:sd1/live 宁波社会生活=http://ming-live.nbtv.cn/channels/nbtv/nbtv2/flv:sd/live 宁波文化娱乐=http://ming-live.nbtv.cn/channels/nbtv/nbtv3/flv:sd/live 宁波电视剧=http://ming-live.nbtv.cn/channels/nbtv/nbtv4/flv:sd/live 宁波少儿=http://ming-live.nbtv.cn/channels/nbtv/nbtv5/flv:sd/live -绍兴影视娱乐=http://tsl4.hls.cutv.com/cutvlive/24yG85b/hls/live_sd.m3u8 -绍兴公共=http://tsl4.hls.cutv.com/cutvlive/kSpsAae/hls/live_sd.m3u8 -绍兴新闻综合=http://tsl4.hls.cutv.com/cutvlive/4IzgShp/hls/live_sd.m3u8 +上海 东方卫视 HD=rtsp://l.m.cztv.com:554/hdmi/dftv1hd.stream 东方卫视=http://qqlive.dnion.com:1863/3900155972.flv +#东方卫视=rtsp://122.192.35.80:554/live/tv11 #东方卫视qq=http://zb.v.qq.com:1863/?progid=3900155972 上海新闻综合=http://live-cdn1.smgbb.tv/channels/bbtv/xwzh/flv:sd/live 上海星尚=http://live-cdn1.smgbb.tv/channels/bbtv/shss/flv:sd/live @@ -136,8 +157,11 @@ Diva Universal=http://94.242.221.141/hls/a-lo/stream137.m3u8 看看新闻网=http://live-cdn1.smgbb.tv/channels/bbtv/kkxww/flv:sd/live 魅力音乐=http://tvie01.ucatv.com.cn/channels/xjyx/MeiLiYinYue-Suma/flv:500k_flv +河北 北京卫视 HD=rtsp://l.m.cztv.com:554/hdmi/bjtv1hd.stream 北京卫视=http://qqlive.dnion.com:1863/1039787969.flv +北京体育=http://live.gslb.letv.com/gslb?stream_id=btv6_800&tag=live&ext=m3u8 +档案(北京)=rtsp://122.192.35.80:554/live/tv12 河北经济=http://live01.hebtv.com/channels/hebtv/video_channel_02/flv:800k/live 河北都市=http://live01.hebtv.com/channels/hebtv/video_channel_01/flv:800k/live 河北影视=http://live01.hebtv.com/channels/hebtv/video_channel_06/flv:800k/live @@ -149,6 +173,11 @@ Diva Universal=http://94.242.221.141/hls/a-lo/stream137.m3u8 石家庄生活=http://live.sjzntv.cn/channels/sjzntv/video_channel_03/flv:800k/live 石家庄都市=http://live.sjzntv.cn/channels/sjzntv/video_channel_04/flv:800k/live +山东 +山东教育=http://live.gslb.letv.com/gslb?stream_id=sdjy&tag=live&ext=m3u8&sign=live_ipad +烟台新闻综合=http://tsl2.hls.cutv.com/cutvlive/rL8910q/hls/live_sd.m3u8 + +黑龙江 黑龙江卫视 HD=rtsp://l.m.cztv.com:554/hdmi/hljtv1hd.stream 黑龙江影视=http://live2.hljtv.com/channels/hljtv/yspd/flv:hd/live 黑龙江文艺=http://live2.hljtv.com/channels/hljtv/wypd/flv:hd/live @@ -159,11 +188,16 @@ Diva Universal=http://94.242.221.141/hls/a-lo/stream137.m3u8 黑龙江导视=http://live2.hljtv.com/channels/hljtv/daoshi/flv:hd/live 黑龙江考试=http://live2.hljtv.com/channels/hljtv/kspd/flv:hd/live +新疆 新疆教育=http://tvie01.ucatv.com.cn/channels/xjyx/XETV-Envivio/flv:500k_rtmp 乌鲁木齐新闻(汉语)=http://tvie01.ucatv.com.cn/channels/xjyx/UTV1-Envivio/flv:500k_rtmp -内蒙古卫视=http://qqlive.dnion.com:1863/2342060367.flv -广西卫视=http://qqlive.dnion.com:1863/974433428.flv 雪梨TV=http://live.sjzntv.cn/channels/sjzntv/vChannel1/flv:vChannel1/live + +湖南 +湖南卫视=rtsp://122.192.35.80:554/live/tv10 +湖南卫视 HD=rtsp://l.m.cztv.com:554/hdmi/hntv1hd.stream + +湖北 湖北综合=http://live9.hbtv.com.cn/channels/zbk/hbtv/flv:sd/live 湖北经济=http://live9.hbtv.com.cn/channels/zbk/jingshi2/flv:sd/live 湖北公共=http://live9.hbtv.com.cn/channels/zbk/hbgg/flv:sd/live @@ -173,6 +207,7 @@ Diva Universal=http://94.242.221.141/hls/a-lo/stream137.m3u8 湖北教育=http://live9.hbtv.com.cn/channels/zbk/hbjy/flv:sd/live 孕育指南=http://live9.hbtv.com.cn/channels/zbk/yyzl/flv:sd/live +河南 河南都市=http://live.hntv.tv/channels/tvie/video_channel_02/flv:hntv2_apple_200k/live 河南民生=http://live.hntv.tv/channels/tvie/video_channel_03/flv:hntv3_apple_200k/live 河南法制=http://live.hntv.tv/channels/tvie/video_channel_04/flv:hntv4_apple_200k/live @@ -181,29 +216,32 @@ Diva Universal=http://94.242.221.141/hls/a-lo/stream137.m3u8 河南商务=http://live.hntv.tv/channels/tvie/video_channel_07/flv:hntv7_apple_200k/live 河南公共=http://live.hntv.tv/channels/tvie/video_channel_08/flv:hntv8_apple_200k/live +四川 四川卫视=http://qqlive.dnion.com:1863/2453801339.flv 雅安新闻综合=http://yatv.tv/tvstm/tv/live/yaan01/yaan01-300.m3u8 -云南卫视=http://qqlive.dnion.com:1863/708402866.flv +辽宁 辽宁卫视=http://qqlive.dnion.com:1863/3006271240.flv 辽宁经济=http://streamer.csytv.com/live/2?fmt=H264_800K_FLV 辽宁公共=http://streamer.csytv.com/live/3?fmt=H264_800K_FLV 沈阳新闻=http://streamer.csytv.com/live/1?fmt=H264_800K_FLV +大连新闻综合=http://tsl2.hls.cutv.com/cutvlive/Wrezdc5/hls/live_sd.m3u8 +#辽宁卫视=rtsp://122.192.35.80:554/live/tv16 - -湖南卫视=rtsp://122.192.35.80:554/live/tv10 -湖南卫视 HD=rtsp://l.m.cztv.com:554/hdmi/hntv1hd.stream +广东 广东卫视 HD=rtsp://l.m.cztv.com:554/hdmi/gdtv1hd.stream 广东卫视 qq=http://zb.v.qq.com:1863/?progid=857894899 广东公共=http://qqlive.dnion.com:1863/4035478592.flv 广东新闻=http://qqlive.dnion.com:1863/2631736979.flv 广东珠江=http://qqlive.dnion.com:1863/1926463423.flv +广东体育=http://live.gslb.letv.com/gslb?stream_id=guangdongtiyu&tag=live&ext=m3u8&sign=live_ipad 珠江卡通=http://qqlive.dnion.com:1863/1249794075.flv 深圳卫视 HD=rtsp://l.m.cztv.com:554/hdmi/sztv1hd.stream 深圳卫视 qq=http://zb.v.qq.com:1863/?progid=2220552576 TGA游戏直播=http://qqlive.dnion.com:1863/3956944389.flv +安徽 安徽卫视=http://livecdn.ahtv.cn/channels/1501/500.flv/live 安徽影视=http://livecdn.ahtv.cn/channels/1502/500.flv/live 合肥新闻=http://live2.hfbtv.com/channels/hftv/hfxw/flv:sd/live @@ -213,12 +251,16 @@ TGA游戏直播=http://qqlive.dnion.com:1863/3956944389.flv 芜湖生活=http://live.wuhubtv.com/channels/1532/500.flv/live 芜湖公共=http://live.wuhubtv.com/channels/1533/500.flv/live + +江苏 江苏城市=rtsp://122.192.35.80:554/live/tv01 江苏卫视=rtsp://122.192.35.80:554/live/tv02 江苏卫视 HD=rtsp://l.m.cztv.com:554/hdmi/jstv1hd.stream 江苏综艺=rtsp://122.192.35.80:554/live/tv03 江苏公共=rtsp://122.192.35.80:554/live/tv51 江苏体育休闲=rtsp://122.192.35.80:554/live/tv28 +#江苏城市=rtsp://122.192.35.80:554/live/tv01 +#江苏卫视=rtsp://122.192.35.80:554/live/tv02 南京新闻综合=http://live.xwei.tv/channels/njtv/video_xwzh/flv:500k/live 南京科教=http://live.xwei.tv/channels/njtv/video_kj/flv:500k/live 南京生活=http://live.xwei.tv/channels/njtv/video_shh/flv:500k/live @@ -229,6 +271,10 @@ TGA游戏直播=http://qqlive.dnion.com:1863/3956944389.flv 扬州城市=http://livemedia.yzntv.com/channels/tvie/41/flv:400k/live 扬州生活=http://livemedia.yzntv.com/channels/tvie/42/flv:400k/live 扬州移动=http://livemedia.yzntv.com/channels/tvie/52/flv:52/live +南通综合=http://tsl3.hls.cutv.com/cutvlive/h1cvpVx/hls/live_sd.m3u8 +南通社教=http://tsl3.hls.cutv.com/cutvlive/18Vmk78/hls/live_sd.m3u8 +南通生活=http://tsl3.hls.cutv.com/cutvlive/SQ5Wj2s/hls/live_sd.m3u8 +南通信息=http://tsl3.hls.cutv.com/cutvlive/48zw6yd/hls/live_sd.m3u8 南通新闻综合=http://media.ntjoy.com/channels/nttv/news/flv:TV1SD/live 南通社教=http://media.ntjoy.com/channels/nttv/society/flv:TV2SD/live 南通生活=http://media.ntjoy.com/channels/nttv/life/flv:TV3SD/live @@ -246,34 +292,12 @@ TGA游戏直播=http://qqlive.dnion.com:1863/3956944389.flv 盐城城市公共=http://live.0515yc.tv/channels/yctv/yc3/flv:sd/live 昆山新闻综合=http://stream.ksntv.com.cn/live/pc1?fmt=H264_450K_FLV -中央电台中国之声=mms://cdnmms.cnr.cn/cnr001 -中央电台音乐之声=mms://cdnmms.cnr.cn/cnr003 -中国国际电台Hit FM=mms://live.hitfm.cn/fm887 -香港电台第一台=http://202.177.192.119/radio1 -香港电台第二台=http://202.177.192.119/radio2 -旅游卫视=rtsp://122.192.35.80:554/live/tv08 -#NJTV新闻综合=rtsp://122.192.35.80:554/live/tv08 -#东方卫视=rtsp://122.192.35.80:554/live/tv11 -档案(北京)=rtsp://122.192.35.80:554/live/tv12 -#辽宁卫视=rtsp://122.192.35.80:554/live/tv16 -MursTv=rtsp://122.192.35.80:554/live/tv20 -#江苏城市=rtsp://122.192.35.80:554/live/tv01 -#江苏卫视=rtsp://122.192.35.80:554/live/tv02 -NBS新闻综合=rtsp://122.192.35.80:554/live/tv09 -#CCTV1=rtsp://122.192.35.80:554/live/tv14 -#CCTV3=rtsp://122.192.35.80:554/live/tv30 -#CCTV4=rtsp://122.192.35.80:554/live/tv07 -#CCTV6=rtsp://122.192.35.80:554/live/tv31 -靓妆=rtsp://122.192.35.80:554/live/tv50 - - +陕西 西安文化影视=http://tsl3.hls.cutv.com/cutvlive/rd6s5B7/hls/live_sd.m3u8 西安健康快乐=http://tsl3.hls.cutv.com/cutvlive/q0zMo5g/hls/live_sd.m3u8 西安音乐综艺=http://tsl3.hls.cutv.com/cutvlive/xpw85wp/hls/live_sd.m3u8 -南通综合=http://tsl3.hls.cutv.com/cutvlive/h1cvpVx/hls/live_sd.m3u8 -南通社教=http://tsl3.hls.cutv.com/cutvlive/18Vmk78/hls/live_sd.m3u8 -南通生活=http://tsl3.hls.cutv.com/cutvlive/SQ5Wj2s/hls/live_sd.m3u8 -南通信息=http://tsl3.hls.cutv.com/cutvlive/48zw6yd/hls/live_sd.m3u8 + +广西 南宁影视娱乐=http://tsl4.hls.cutv.com/cutvlive/1r8OKpx/hls/live_sd.m3u8 南宁新闻综合=http://tsl4.hls.cutv.com/cutvlive/hGhh54l/hls/live_sd.m3u8 南宁公共=http://tsl4.hls.cutv.com/cutvlive/U1kGA08/hls/live_sd.m3u8 @@ -281,5 +305,10 @@ NBS新闻综合=rtsp://122.192.35.80:554/live/tv09 柳州新闻=http://tsl4.hls.cutv.com/cutvlive/mA0cbYv/hls/live_sd.m3u8 柳州科教=http://tsl4.hls.cutv.com/cutvlive/2Lie8os/hls/live_sd.m3u8 柳州公共=http://tsl4.hls.cutv.com/cutvlive/R0Sqiur/hls/live_sd.m3u8 -大连新闻综合=http://tsl2.hls.cutv.com/cutvlive/Wrezdc5/hls/live_sd.m3u8 -烟台新闻综合=http://tsl2.hls.cutv.com/cutvlive/rL8910q/hls/live_sd.m3u8 + +Radio +中央电台中国之声=mms://cdnmms.cnr.cn/cnr001 +中央电台音乐之声=mms://cdnmms.cnr.cn/cnr003 +中国国际电台Hit FM=mms://live.hitfm.cn/fm887 +香港电台第一台=http://202.177.192.119/radio1 +香港电台第二台=http://202.177.192.119/radio2 From 3bc6b2683d665242906f59c2b9bd080896804c5a Mon Sep 17 00:00:00 2001 From: wang-bin Date: Sun, 3 Nov 2013 17:25:28 +0800 Subject: [PATCH 3/6] player: translation. lager toolbar size --- examples/player/MainWindow.cpp | 4 +- examples/player/res/player_zh_CN.qm | Bin 3279 -> 3302 bytes examples/player/res/player_zh_CN.ts | 99 ++++++++++++++++------------ 3 files changed, 59 insertions(+), 44 deletions(-) diff --git a/examples/player/MainWindow.cpp b/examples/player/MainWindow.cpp index 69b46681..c5665e0c 100644 --- a/examples/player/MainWindow.cpp +++ b/examples/player/MainWindow.cpp @@ -111,7 +111,7 @@ void MainWindow::setupUi() mpPlayerLayout = new QVBoxLayout(); mpControl = new QWidget(this); - mpControl->setMaximumHeight(22); + mpControl->setMaximumHeight(28); mpTimeSlider = new Slider(mpControl); mpTimeSlider->setDisabled(true); @@ -149,7 +149,7 @@ void MainWindow::setupUi() qDebug("%d x %d", mPlayPixmap.width(), mPlayPixmap.height()); mpPlayPauseBtn = new Button(mpControl); int a = qMin(w/2, h); - const int kMaxButtonIconWidth = 18; + const int kMaxButtonIconWidth = 20; const int kMaxButtonIconMargin = kMaxButtonIconWidth/3; a = qMin(a, kMaxButtonIconWidth); mpPlayPauseBtn->setIconWithSates(mPlayPixmap); diff --git a/examples/player/res/player_zh_CN.qm b/examples/player/res/player_zh_CN.qm index 8e86f44eddc7e7b3b367e189be5828c288cc25a7..7582cc572b2e680e2380235b2577249ab75438d2 100644 GIT binary patch delta 627 zcmX|7T}V@57=F*$cmCGgY7ELi8bve+%CJdEL`3Cq7YbXmt&NyE?c_KK)6|PvRz|@o zrMXdb5&d}Ox>_Rrpt6<}78z7@*HV;%(M2{S>F*hW2M*6U@ALCM-}knBp?q*d{5X+f zC31U+WH(VzClWrapm9I3LM0L3L&Em=z&j+gjuRPbNVqG&m!;ZNj!KW~$v+}7M|FV= zk@T95{rO46o|1oh5_#(=(EbRxmjdYl;0OhmCxA;7jF&!)A!^f|FuJ&^eYX)e%1!Sn z5^-5x3A{sajNf5GDJ9AO_;LdLWqvVz9RXoO%-@gVgNCV|7Vx{-w&54}pJnNh5d1}! z>)ndt^=zi`F>+k&W8xC{Q|!~l=fGz|yu)({fqp@62f`d{Fl-X5*WyMD zGvcJb01QjB8h&Cl(&@iMHjJvmF35OVgAy5 zzVj&bqPf4}J_7EUlNAbrYb{luPs4w~;^7{kNQ)(v#Uh$hF)SpOxlraTzr@+RJG&e* z<|LNh!&KoE;l;P lO>{Z0POS>9^;%TbB6hFO-h48wX_075D(&(5d}^ed`w#EzqeK7z delta 585 zcmX|8Pe>F|9R6nJy_tF2y4zpMqE2N|5xYs^p~G5Xp|C}(*iI{zm7BO_(I0~jo0ed- zSurU^9gOl)Ylp@z9c-x#LL!2U$U~b@NJvB)kreg8f`{Q7-uL_d{NDRg{JQwcqV#sa z&;Yp`P$6L3S^#mNItJKHKq3Q}%L?dAKumB(KMA?!E%6p);~@187mE!@{SM2&b1&C3^hjYvd!)YEMw!=whFY{*#iRmX4L<;CTgJfm{g^gP2#+$So z)rQM|0@}E)oHv}is;~2pFwoO~eA+`kt50UT=yT6F9`9iB2gZxj2gvUfEBl6s5ZU|n zEWAX#bI+6S6z|VHBYu$Sqp>YCNXtw!32{MYPF*8Dl)cdvG>pr9b&`RH%(B_M3FEt& zi%$^Stg*%2fN#C6hd;BZrRr`l*cea^<|Cd9mDQdu1f4InI z-=*uEvqA@F?XT=(lX?ECSDP5@_&c-T*tD{Mc12NJYLdpwi}HiNc|H_4d!m+eC4r6| zcW96cbT3sjJRB_j*uvo6U`)HqjoX7gPZ^*ozM*f#o!08-h=xc~*(?QR)(uPK=!^=OM5Hs*V}EYs)4YNM-X7&F#%BLSo diff --git a/examples/player/res/player_zh_CN.ts b/examples/player/res/player_zh_CN.ts index c262fb61..b4f8848c 100644 --- a/examples/player/res/player_zh_CN.ts +++ b/examples/player/res/player_zh_CN.ts @@ -4,183 +4,190 @@ MainWindow - + Click black area to use shortcut(see right click menu) 点击黑色区域以使用快捷键(见右键菜单) - + Current time 播放时间 - + Duration 视频时长 - + Render engine 渲染引擎 - + Speed. Ctrl+Up/Down 速度. Ctrl+上/下 - + Open 打开 - + Capture video frame 视频截图 - + Save to 保存至 - + Open Url 打开 Url - + Online channels 在线频道 - + Setup 设置 - + Report 反馈 - + About 关于 - + Help 帮助 - + About Qt 关于 Qt - + Speed 速度 - + Repeat 重复 - + + Enable + 启用 + + + + infinity + 无限 + + No - 否 + 否 - Single - 单个 + 单个 - All - 所有 + 所有 - - + + Aspect ratio 比例 - + Video 视频 - + Window 窗口 - + Custom 自定义 - + Audio track 音轨 - + Channel 声道 - + As input 同输入 - + Stero 立体声 - + Mono (center) 单声道 (中央) - + Left 左声道 - + Right 右声道 - + Renderer 渲染引擎 - + not availabe on your platform! 你的平台上不可使用! - + Open a media file 打开媒体文件 - + Open an url 打开 url - + Url @@ -295,12 +302,12 @@ 确定 - + Video 视频 - + Audio 音频 @@ -313,4 +320,12 @@ 媒体信息 + + TVView + + + Online TV channels + 在线电视 + + From 691b972096ed266793cf123c7d7d16c1196fdc24 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Sun, 3 Nov 2013 18:29:32 +0800 Subject: [PATCH 4/6] more renderer related controls in VideoOutputEventFilter --- src/EventFilter.cpp | 5 ----- src/VideoOutputEventFilter.cpp | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/EventFilter.cpp b/src/EventFilter.cpp index ab531a38..3993126c 100644 --- a/src/EventFilter.cpp +++ b/src/EventFilter.cpp @@ -125,11 +125,6 @@ bool EventFilter::eventFilter(QObject *watched, QEvent *event) case Qt::Key_C: //capture player->captureVideo(); break; - case Qt::Key_I: { //Interpolation - VideoRenderer *renderer = player->renderer(); - renderer->setQuality(VideoRenderer::Quality(((int)renderer->quality()+1)%3)); - } - break; case Qt::Key_N: //check playing? player->playNextFrame(); break; diff --git a/src/VideoOutputEventFilter.cpp b/src/VideoOutputEventFilter.cpp index 65eeadb0..66be17cb 100644 --- a/src/VideoOutputEventFilter.cpp +++ b/src/VideoOutputEventFilter.cpp @@ -71,6 +71,23 @@ bool VideoOutputEventFilter::eventFilter(QObject *watched, QEvent *event) case Qt::Key_F: switchFullScreen(); break; + case Qt::Key_I: + mpRenderer->setQuality(VideoRenderer::Quality(((int)mpRenderer->quality()+1)%3)); + break; + case Qt::Key_T: { + QWidget *w = mpRenderer->widget()->window(); + Qt::WindowFlags wf = w->windowFlags(); + if (wf & Qt::WindowStaysOnTopHint) { + qDebug("Window not stays on top"); + w->setWindowFlags(wf & ~Qt::WindowStaysOnTopHint); + } else { + qDebug("Window stays on top"); + w->setWindowFlags(wf | Qt::WindowStaysOnTopHint); + } + //call setParent() when changing the flags, causing the widget to be hidden + w->show(); + } + break; } } break; From 07ce96c3faad4dd045c65d6ea0f4cec36d1398d8 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Sun, 3 Nov 2013 22:05:46 +0800 Subject: [PATCH 5/6] misc --- examples/player/MainWindow.cpp | 2 +- examples/player/TVView.cpp | 1 - examples/videogroup/videogroup.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/player/MainWindow.cpp b/examples/player/MainWindow.cpp index c5665e0c..9e1fc026 100644 --- a/examples/player/MainWindow.cpp +++ b/examples/player/MainWindow.cpp @@ -111,7 +111,7 @@ void MainWindow::setupUi() mpPlayerLayout = new QVBoxLayout(); mpControl = new QWidget(this); - mpControl->setMaximumHeight(28); + mpControl->setMaximumHeight(25); mpTimeSlider = new Slider(mpControl); mpTimeSlider->setDisabled(true); diff --git a/examples/player/TVView.cpp b/examples/player/TVView.cpp index 3369e534..53fe469e 100644 --- a/examples/player/TVView.cpp +++ b/examples/player/TVView.cpp @@ -38,7 +38,6 @@ void TVView::load() tv_file.setFileName(":/tv.ini"); if (!tv_file.open(QIODevice::ReadOnly)) return; - qDebug("tv.ini: %s", tv_file.fileName().toAscii().constData()); QTextStream ts(&tv_file); ts.setCodec("UTF-8"); QTreeWidgetItem *nodeItem = new QTreeWidgetItem(mpView); diff --git a/examples/videogroup/videogroup.cpp b/examples/videogroup/videogroup.cpp index 882bdfc1..80e3c744 100644 --- a/examples/videogroup/videogroup.cpp +++ b/examples/videogroup/videogroup.cpp @@ -40,7 +40,7 @@ VideoGroup::VideoGroup(QObject *parent) : , vid("qpainter") { mpPlayer = new AVPlayer(this); - mpPlayer->setPlayerEventFilter(0); + //mpPlayer->setPlayerEventFilter(0); mpBar = new QWidget(0, Qt::WindowStaysOnTopHint); mpBar->setMaximumSize(400, 60); From ddebb180ebdab1ad1274444fd10d6ba70e937199 Mon Sep 17 00:00:00 2001 From: wang-bin Date: Thu, 7 Nov 2013 00:30:10 +0800 Subject: [PATCH 6/6] player: tooltip show correct capture dir --- examples/player/MainWindow.cpp | 2 +- src/VideoCapture.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/player/MainWindow.cpp b/examples/player/MainWindow.cpp index 9e1fc026..cac85dc2 100644 --- a/examples/player/MainWindow.cpp +++ b/examples/player/MainWindow.cpp @@ -88,6 +88,7 @@ void MainWindow::initPlayer() mpPlayer = new AVPlayer(this); mIsReady = true; qDebug("player created"); + mpCaptureBtn->setToolTip(tr("Capture video frame") + "\n" + tr("Save to") + ": " + mpPlayer->videoCapture()->captureDir()); connect(mpStopBtn, SIGNAL(clicked()), mpPlayer, SLOT(stop())); connect(mpForwardBtn, SIGNAL(clicked()), mpPlayer, SLOT(seekForward())); connect(mpBackwardBtn, SIGNAL(clicked()), mpPlayer, SLOT(seekBackward())); @@ -182,7 +183,6 @@ void MainWindow::setupUi() mpCaptureBtn->setIconWithSates(QPixmap(":/theme/screenshot.png")); mpCaptureBtn->setIconSize(QSize(a, a)); mpCaptureBtn->setMaximumSize(a+kMaxButtonIconMargin+2, a+kMaxButtonIconMargin); - mpCaptureBtn->setToolTip(tr("Capture video frame") + "\n" + tr("Save to") + ": capture"); mpVolumeBtn = new Button(); mpVolumeBtn->setIconWithSates(QPixmap(":/theme/button-max-volume.png")); mpVolumeBtn->setIconSize(QSize(a, a)); diff --git a/src/VideoCapture.cpp b/src/VideoCapture.cpp index 68bfb8af..53d850e0 100644 --- a/src/VideoCapture.cpp +++ b/src/VideoCapture.cpp @@ -60,7 +60,7 @@ public: #endif QString path(dir + "/" + name + "." + format.toLower()); qDebug("Saving capture to %s", qPrintable(path)); - bool ok = image.save(path, format.toLatin1().constData(), quality); + bool ok = image.save(path, format.toLatin1().constData(), quality); if (!ok) { cap->error = VideoCapture::SaveError; qWarning("Failed to save capture");