Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Apr 20, 2014
1 parent 8a84dbc commit 8d5f6e6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
5 changes: 0 additions & 5 deletions examples/player/EventFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,6 @@ bool EventFilter::eventFilter(QObject *watched, QEvent *event)
showMenu(e->globalPos());
}
break;
case QEvent::WindowStateChange: {
qDebug("WindowStateChange: %d", player->renderer()->widget()->windowState());
//player->renderer()->widget()->update();
}
break;
default:
return false;
}
Expand Down
37 changes: 22 additions & 15 deletions examples/player/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <QtAV/AVPlayer.h>
#include <QtAV/VideoRendererTypes.h>
#include <QtAV/VideoOutput.h>
#include <QtAV/OSDFilter.h>

#include "MainWindow.h"
Expand Down Expand Up @@ -127,24 +128,30 @@ int main(int argc, char *argv[])
if (vo != "gl" && vo != "d2d" && vo != "gdi" && vo != "xv" && vo != "qt")
vo = "gl";
QString title = "QtAV " /*+ vo + " "*/ + QtAV_Version_String_Long() + " [email protected]";
VideoRenderer *renderer = 0;
if (vo == "gl") {
renderer = VideoRendererFactory::create(VideoRendererId_GLWidget);
} else if (vo == "d2d") {
renderer = VideoRendererFactory::create(VideoRendererId_Direct2D);
} else if (vo == "gdi") {
renderer = VideoRendererFactory::create(VideoRendererId_GDI);
} else if (vo == "xv") {
renderer = VideoRendererFactory::create(VideoRendererId_XV);
} else if (vo == "qt") {
renderer = VideoRendererFactory::create(VideoRendererId_Widget);
} else {
#ifndef QT_NO_OPENGL
renderer = VideoRendererFactory::create(VideoRendererId_GLWidget);
VideoRendererId vid = VideoRendererId_GLWidget;
#else
renderer = VideoRendererFactory::create(VideoRendererId_Widget);
#endif //QT_NO_OPENGL
VideoRendererId vid = VideoRendererId_Widget;
#endif
// TODO: move to VideoRendererTypes or factory to query name
struct {
const char* name;
VideoRendererId id;
} vid_map[] = {
{ "gl", VideoRendererId_GLWidget },
{ "d2d", VideoRendererId_Direct2D },
{ "gdi", VideoRendererId_GDI },
{ "xv", VideoRendererId_XV },
{ "qt", VideoRendererId_Widget },
{ 0, 0 }
};
for (int i = 0; vid_map[i].name; ++i) {
if (vo == vid_map[i].name) {
vid = vid_map[i].id;
break;
}
}
VideoOutput *renderer = new VideoOutput(vid); //or VideoRenderer
if (!renderer) {
QMessageBox::critical(0, "QtAV", "vo '" + vo + "' not supported");
return 1;
Expand Down
2 changes: 1 addition & 1 deletion qml/QmlAV/QmlAVPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class QMLAV_EXPORT QmlAVPlayer : public QObject
bool autoPlay() const;
void setAutoPlay(bool autoplay);

// "FFmpeg", "DXVA", "VAAPI" etc
// "FFmpeg", "CUDA", "DXVA", "VAAPI" etc
QStringList videoCodecs() const;
QStringList videoCodecPriority() const;
void setVideoCodecPriority(const QStringList& p);
Expand Down

0 comments on commit 8d5f6e6

Please sign in to comment.