Skip to content

Commit

Permalink
fix vaapi load and qml on ubuntu1404
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Oct 3, 2015
1 parent 992d3de commit 844b2dd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions examples/QMLPlayer/qml/QMLPlayer/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Rectangle {
}

MultiPointTouchArea {
mouseEnabled: true
//mouseEnabled: true //not available on qt5.2(ubuntu14.04)
anchors.fill: parent
onGestureStarted: {
if (player.playbackState == MediaPlayer.StoppedState)
Expand Down Expand Up @@ -396,11 +396,11 @@ Rectangle {
metaData: player.metaData
}
}
if (typeof(item.internalAudioTracks) != "undefined")
if (item.hasOwnProperty("internalAudioTracks"))
item.internalAudioTracks = player.internalAudioTracks
if (typeof(item.externalAudioTracks) != "undefined")
item.externalAudioTracks = player.externalAudioTracks
if (typeof(item.internalSubtitleTracks) != "undefined")
if ("internalSubtitleTracks" in item)
item.internalSubtitleTracks = player.internalSubtitleTracks
}
}
Expand Down
24 changes: 19 additions & 5 deletions src/vaapi/vaapi_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ inline VAStatus vaCreateSurfaces(VADisplay dpy, unsigned int format, unsigned in
return __VA_ARGS__; \
} \
} while(0)

#define VA_ENSURE(...) VA_ENSURE_TRUE(__VA_ARGS__)
#define VAWARN(a) \
do { \
VAStatus res = a; \
Expand Down Expand Up @@ -85,7 +85,7 @@ class X11_API : protected dll_helper {
typedef Display* XOpenDisplay_t(const char* name);
typedef int XCloseDisplay_t(Display* dpy);
typedef int XInitThreads_t();
X11_API(): dll_helper(QString::fromLatin1("X11")) {
X11_API(): dll_helper(QString::fromLatin1("X11"),6) {
fp_XOpenDisplay = (XOpenDisplay_t*)resolve("XOpenDisplay");
fp_XCloseDisplay = (XCloseDisplay_t*)resolve("XCloseDisplay");
fp_XInitThreads = (XInitThreads_t*)resolve("XInitThreads");
Expand All @@ -108,7 +108,7 @@ class X11_API : protected dll_helper {
XInitThreads_t* fp_XInitThreads;
};

class VAAPI_DRM : public dll_helper {
class VAAPI_DRM : protected dll_helper {
public:
typedef VADisplay vaGetDisplayDRM_t(int fd);
VAAPI_DRM(): dll_helper(QString::fromLatin1("va-drm"),1) {
Expand All @@ -121,7 +121,7 @@ class VAAPI_DRM : public dll_helper {
private:
vaGetDisplayDRM_t* fp_vaGetDisplayDRM;
};
class VAAPI_X11 : public dll_helper {
class VAAPI_X11 : protected dll_helper {
public:
typedef unsigned long Drawable;
typedef VADisplay vaGetDisplay_t(Display *);
Expand Down Expand Up @@ -151,8 +151,22 @@ class VAAPI_X11 : public dll_helper {
vaGetDisplay_t* fp_vaGetDisplay;
vaPutSurface_t* fp_vaPutSurface;
};

typedef void* EGLClientBuffer;
class VAAPI_EGL : protected dll_helper { //not implemented
typedef VAStatus vaGetEGLClientBufferFromSurface_t(VADisplay dpy, VASurfaceID surface, EGLClientBuffer *buffer/* out*/);
vaGetEGLClientBufferFromSurface_t* fp_vaGetEGLClientBufferFromSurface;
public:
VAAPI_EGL(): dll_helper(QString::fromLatin1("va-egl"),1) {
fp_vaGetEGLClientBufferFromSurface = (vaGetEGLClientBufferFromSurface_t*)resolve("vaGetEGLClientBufferFromSurface");
}
VAStatus vaGetEGLClientBufferFromSurface(VADisplay dpy, VASurfaceID surface, EGLClientBuffer *buffer/* out*/) {
assert(fp_vaGetEGLClientBufferFromSurface);
return fp_vaGetEGLClientBufferFromSurface(dpy, surface, buffer);
}
};
#ifndef QT_NO_OPENGL
class VAAPI_GLX : public dll_helper {
class VAAPI_GLX : protected dll_helper {
public:
typedef VADisplay vaGetDisplayGLX_t(Display *);
typedef VAStatus vaCreateSurfaceGLX_t(VADisplay, GLenum, GLuint, void **);
Expand Down

0 comments on commit 844b2dd

Please sign in to comment.