Skip to content

Commit

Permalink
Merge pull request #14 from gentoolinux/vpp_support
Browse files Browse the repository at this point in the history
Some fixes
  • Loading branch information
pesintta committed Nov 1, 2015
2 parents 8d6f914 + 75ee09b commit 4943fe5
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vdr-softhddevice-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ RDEPEND=">=media-video/vdr-2
x11-libs/xcb-util-keysyms
x11-libs/xcb-util-renderutil
alsa? ( media-libs/alsa-lib )
opengl? ( virtual/opengl )
opengl? ( virtual/opengl
virtual/glu )
vaapi? ( x11-libs/libva
virtual/ffmpeg[vaapi] )
vdpau? ( x11-libs/libvdpau
Expand Down
72 changes: 72 additions & 0 deletions video.c
Original file line number Diff line number Diff line change
Expand Up @@ -12669,7 +12669,11 @@ int VideoIsDriverVdpau(void)
int VideoIsDriverVaapi(void)
{
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
return 1;
}
#endif
Expand Down Expand Up @@ -12767,7 +12771,11 @@ void VideoSetBrightness(int brightness)
#endif

#ifdef USE_VAAPI
#ifdef USE_GLX
if ((VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) && VaapiDecoders[0]->vpp_brightness_idx >= 0) {
#else
if (VideoUsedModule == &VaapiModule && VaapiDecoders[0]->vpp_brightness_idx >= 0) {
#endif
VaapiVideoSetColorbalance(VaapiDecoders[0]->vpp_cbal_buf, VaapiDecoders[0]->vpp_brightness_idx,
VideoConfigClamp(&VaapiConfigBrightness, brightness) *
VaapiConfigBrightness.scale);
Expand All @@ -12789,7 +12797,11 @@ int VideoGetBrightnessConfig(int *minvalue, int *defvalue, int *maxvalue)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*minvalue = VaapiConfigBrightness.min_value;
*defvalue = VaapiConfigBrightness.def_value;
*maxvalue = VaapiConfigBrightness.max_value;
Expand All @@ -12814,7 +12826,11 @@ void VideoSetContrast(int contrast)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if ((VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) && VaapiDecoders[0]->vpp_contrast_idx >= 0) {
#else
if (VideoUsedModule == &VaapiModule && VaapiDecoders[0]->vpp_contrast_idx >= 0) {
#endif
VaapiVideoSetColorbalance(VaapiDecoders[0]->vpp_cbal_buf, VaapiDecoders[0]->vpp_contrast_idx,
VideoConfigClamp(&VaapiConfigContrast, contrast) *
VaapiConfigContrast.scale);
Expand All @@ -12836,7 +12852,11 @@ int VideoGetContrastConfig(int *minvalue, int *defvalue, int *maxvalue)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*minvalue = VaapiConfigContrast.min_value;
*defvalue = VaapiConfigContrast.def_value;
*maxvalue = VaapiConfigContrast.max_value;
Expand All @@ -12861,7 +12881,11 @@ void VideoSetSaturation(int saturation)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if ((VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) && VaapiDecoders[0]->vpp_saturation_idx >= 0) {
#else
if (VideoUsedModule == &VaapiModule && VaapiDecoders[0]->vpp_saturation_idx >= 0) {
#endif
VaapiVideoSetColorbalance(VaapiDecoders[0]->vpp_cbal_buf, VaapiDecoders[0]->vpp_saturation_idx,
VideoConfigClamp(&VaapiConfigSaturation, saturation) *
VaapiConfigSaturation.scale);
Expand All @@ -12883,7 +12907,11 @@ int VideoGetSaturationConfig(int *minvalue, int *defvalue, int *maxvalue)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*minvalue = VaapiConfigSaturation.min_value;
*defvalue = VaapiConfigSaturation.def_value;
*maxvalue = VaapiConfigSaturation.max_value;
Expand All @@ -12908,7 +12936,11 @@ void VideoSetHue(int hue)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if ((VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) && VaapiDecoders[0]->vpp_hue_idx >= 0) {
#else
if (VideoUsedModule == &VaapiModule && VaapiDecoders[0]->vpp_hue_idx >= 0) {
#endif
VaapiVideoSetColorbalance(VaapiDecoders[0]->vpp_cbal_buf, VaapiDecoders[0]->vpp_hue_idx,
VideoConfigClamp(&VaapiConfigHue, hue) * VaapiConfigHue.scale);
}
Expand All @@ -12929,7 +12961,11 @@ int VideoGetHueConfig(int *minvalue, int *defvalue, int *maxvalue)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*minvalue = VaapiConfigHue.min_value;
*defvalue = VaapiConfigHue.def_value;
*maxvalue = VaapiConfigHue.max_value;
Expand All @@ -12953,7 +12989,11 @@ void VideoSetSkinToneEnhancement(int stde)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
VideoSkinToneEnhancement = VideoConfigClamp(&VaapiConfigStde, stde);
}
#endif
Expand All @@ -12974,7 +13014,11 @@ int VideoGetSkinToneEnhancementConfig(int *minvalue, int *defvalue, int *maxvalu
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*minvalue = VaapiConfigStde.min_value;
*defvalue = VaapiConfigStde.def_value;
*maxvalue = VaapiConfigStde.max_value;
Expand Down Expand Up @@ -13231,7 +13275,11 @@ int VideoGetScalingModes(const char* **long_table, const char* **short_table)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*long_table = vaapi_scaling;
*short_table = vaapi_scaling_short;
return ARRAY_ELEMS(vaapi_scaling);
Expand Down Expand Up @@ -13285,7 +13333,11 @@ int VideoGetDeinterlaceModes(const char* **long_table, const char* **short_table
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
unsigned int len = VaapiDecoders[0]->MaxSupportedDeinterlacer;
*long_table = vaapi_deinterlace;
*short_table = vaapi_deinterlace_short;
Expand All @@ -13303,7 +13355,11 @@ int VideoGetDeinterlaceModes(const char* **long_table, const char* **short_table
void VideoSetDeinterlace(int mode[VideoResolutionMax])
{
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
int i;
for (i = 0; i < VideoResolutionMax; ++i) {
if (mode[i] > (int)VaapiDecoders[0]->MaxSupportedDeinterlacer)
Expand Down Expand Up @@ -13356,7 +13412,11 @@ void VideoSetDenoise(int level[VideoResolutionMax])
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
int i;
for (i = 0; i < VideoResolutionMax; ++i) {
level[i] = VideoConfigClamp(&VaapiConfigDenoise, level[i]);
Expand Down Expand Up @@ -13384,7 +13444,11 @@ int VideoGetDenoiseConfig(int *minvalue, int *defvalue, int *maxvalue)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*minvalue = VaapiConfigDenoise.min_value;
*defvalue = VaapiConfigDenoise.def_value;
*maxvalue = VaapiConfigDenoise.max_value;
Expand All @@ -13408,7 +13472,11 @@ void VideoSetSharpen(int level[VideoResolutionMax])
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
int i;
for (i = 0; i < VideoResolutionMax; ++i) {
level[i] = VideoConfigClamp(&VaapiConfigSharpen, level[i]);
Expand Down Expand Up @@ -13436,7 +13504,11 @@ int VideoGetSharpenConfig(int *minvalue, int *defvalue, int *maxvalue)
}
#endif
#ifdef USE_VAAPI
#ifdef USE_GLX
if (VideoUsedModule == &VaapiModule || VideoUsedModule == &VaapiGlxModule) {
#else
if (VideoUsedModule == &VaapiModule) {
#endif
*minvalue = VaapiConfigSharpen.min_value;
*defvalue = VaapiConfigSharpen.def_value;
*maxvalue = VaapiConfigSharpen.max_value;
Expand Down

0 comments on commit 4943fe5

Please sign in to comment.