omxh265: fix enum casting when using Allegro HEVC extensions

Allegro's HEVC implementation defines a superset of the profiles and
enums from the Android implementation.
Properly cast to fix -Wenum-conversion warnings from clang.

https://bugzilla.gnome.org/show_bug.cgi?id=789057
This commit is contained in:
Guillaume Desmottes 2017-10-16 13:26:38 +02:00 committed by Sebastian Dröge
parent cc0e3c8320
commit 2da61ef2bf
2 changed files with 12 additions and 3 deletions

View file

@ -268,9 +268,18 @@ update_param_hevc (GstOMXH265Enc * self,
} }
if (profile != OMX_VIDEO_HEVCProfileUnknown) if (profile != OMX_VIDEO_HEVCProfileUnknown)
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
param.eProfile = (OMX_ALG_VIDEO_HEVCPROFILETYPE) profile;
#else
param.eProfile = profile; param.eProfile = profile;
#endif
if (level != OMX_VIDEO_HEVCLevelUnknown) if (level != OMX_VIDEO_HEVCLevelUnknown)
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
param.eLevel = (OMX_ALG_VIDEO_HEVCLEVELTYPE) level;
#else
param.eLevel = level; param.eLevel = level;
#endif
/* GOP pattern */ /* GOP pattern */
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS #ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS

View file

@ -34,11 +34,11 @@ gst_omx_h265_utils_get_profile_from_str (const gchar * profile)
return OMX_VIDEO_HEVCProfileMain10; return OMX_VIDEO_HEVCProfileMain10;
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS #ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS
} else if (g_str_equal (profile, "main-still-picture")) { } else if (g_str_equal (profile, "main-still-picture")) {
return OMX_ALG_VIDEO_HEVCProfileMainStill; return (OMX_VIDEO_HEVCPROFILETYPE) OMX_ALG_VIDEO_HEVCProfileMainStill;
} else if (g_str_equal (profile, "main422")) { } else if (g_str_equal (profile, "main422")) {
return OMX_ALG_VIDEO_HEVCProfileMain422; return (OMX_VIDEO_HEVCPROFILETYPE) OMX_ALG_VIDEO_HEVCProfileMain422;
} else if (g_str_equal (profile, "main422-10")) { } else if (g_str_equal (profile, "main422-10")) {
return OMX_ALG_VIDEO_HEVCProfileMain422_10; return (OMX_VIDEO_HEVCPROFILETYPE) OMX_ALG_VIDEO_HEVCProfileMain422_10;
#endif #endif
} }
return OMX_VIDEO_HEVCProfileUnknown; return OMX_VIDEO_HEVCProfileUnknown;