Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix VAAPI compilation
Compilation would fail if VAAPI was active, but OpenGL video was disabled
  • Loading branch information
jyavenard committed Apr 14, 2012
1 parent ce56ef0 commit 79527b1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
10 changes: 6 additions & 4 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -53,10 +53,12 @@ extern "C" {
#include "videoout_d3d.h"
#endif

#ifdef USING_VAAPI
#ifdef USING_GLVAAPI
#include "videoout_openglvaapi.h"
#endif // USING_GLVAAPI
#ifdef USING_VAAPI
#include "vaapicontext.h"
#endif // USING_VAAPI
#endif

extern "C" {
#include "libavutil/avutil.h"
Expand Down Expand Up @@ -1845,7 +1847,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
video_codec_id = vdpau_mcid;
}
#endif // USING_VDPAU
#ifdef USING_VAAPI
#ifdef USING_GLVAAPI
MythCodecID vaapi_mcid;
PixelFormat pix_fmt = PIX_FMT_YUV420P;
vaapi_mcid = VideoOutputOpenGLVAAPI::GetBestSupportedCodec(
Expand All @@ -1862,7 +1864,7 @@ int AvFormatDecoder::ScanStreams(bool novideo)
enc->pix_fmt = pix_fmt;
}
}
#endif // USING_VAAPI
#endif // USING_GLVAAPI
#ifdef USING_DXVA2
MythCodecID dxva2_mcid;
PixelFormat pix_fmt = PIX_FMT_YUV420P;
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/libmythtv.pro
Expand Up @@ -407,6 +407,7 @@ using_frontend {
LIBS += -lva -lva-x11 -lva-glx
using_opengl_video:HEADERS += videoout_openglvaapi.h
using_opengl_video:SOURCES += videoout_openglvaapi.cpp
using_opengl_video:DEFINES += USING_GLVAAPI
}

# Misc. frontend
Expand Down
20 changes: 12 additions & 8 deletions mythtv/libs/libmythtv/videooutbase.cpp
Expand Up @@ -38,10 +38,11 @@
#endif

#ifdef USING_VAAPI
#include "videoout_openglvaapi.h"
#include "videoout_nullvaapi.h"
#endif

#ifdef USING_GLVAAPI
#include "videoout_openglvaapi.h"
#endif
#include "videoout_null.h"
#include "dithertable.h"

Expand Down Expand Up @@ -96,9 +97,11 @@ void VideoOutput::GetRenderOptions(render_opts &opts)
#endif // USING_VDPAU

#ifdef USING_VAAPI
VideoOutputOpenGLVAAPI::GetRenderOptions(opts);
VideoOutputNullVAAPI::GetRenderOptions(opts);
#endif // USING_VAAPI
#ifdef USING_GLVAAPI
VideoOutputOpenGLVAAPI::GetRenderOptions(opts);
#endif // USING_GLVAAPI
}

/**
Expand Down Expand Up @@ -161,9 +164,9 @@ VideoOutput *VideoOutput::Create(
renderers += VideoOutputVDPAU::GetAllowedRenderers(codec_id, video_dim);
#endif // USING_VDPAU

#ifdef USING_VAAPI
#ifdef USING_GLVAAPI
renderers += VideoOutputOpenGLVAAPI::GetAllowedRenderers(codec_id, video_dim);
#endif // USING_VAAPI
#endif // USING_GLVAAPI
}

LOG(VB_PLAYBACK, LOG_INFO, LOC + "Allowed renderers: " +
Expand Down Expand Up @@ -226,12 +229,13 @@ VideoOutput *VideoOutput::Create(
#endif // USING_VDPAU

#ifdef USING_VAAPI
if (renderer == "openglvaapi")
vo = new VideoOutputOpenGLVAAPI();
if (renderer == "nullvaapi")
vo = new VideoOutputNullVAAPI();
#endif // USING_VAAPI

#ifdef USING_GLVAAPI
if (renderer == "openglvaapi")
vo = new VideoOutputOpenGLVAAPI();
#endif // USING_GLVAAPI
#ifdef USING_XV
if (xvlist.contains(renderer))
vo = new VideoOutputXv();
Expand Down

0 comments on commit 79527b1

Please sign in to comment.