Commit 4f486e17 authored by Thomas Guillem's avatar Thomas Guillem Committed by Jean-Baptiste Kempf

mediacodec: fix rotation before API 21

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent d7eb695d
...@@ -541,6 +541,17 @@ loopclean: ...@@ -541,6 +541,17 @@ loopclean:
direct rendering should be disabled since no surface will be direct rendering should be disabled since no surface will be
attached to the JNI. */ attached to the JNI. */
p_sys->direct_rendering = jni_IsVideoPlayerActivityCreated() && var_InheritBool(p_dec, CFG_PREFIX "dr"); p_sys->direct_rendering = jni_IsVideoPlayerActivityCreated() && var_InheritBool(p_dec, CFG_PREFIX "dr");
/* There is no way to rotate the video using direct rendering (and using a
* SurfaceView) before API 21 (Lollipop). Therefore, we deactivate direct
* rendering if video doesn't have a normal rotation and if
* get_input_buffer method is not present (This method exists since API
* 21). */
if (p_sys->direct_rendering
&& p_dec->fmt_in.video.orientation != ORIENT_NORMAL
&& !p_sys->get_input_buffer)
p_sys->direct_rendering = false;
if (p_sys->direct_rendering) { if (p_sys->direct_rendering) {
if (p_dec->fmt_in.video.orientation != ORIENT_NORMAL) { if (p_dec->fmt_in.video.orientation != ORIENT_NORMAL) {
int i_angle; int i_angle;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment