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

mediacodec: add rotation support for opaque

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent daaa3c65
......@@ -506,6 +506,27 @@ static int OpenDecoder(vlc_object_t *p_this)
attached to the JNI. */
p_sys->direct_rendering = jni_IsVideoPlayerActivityCreated() && var_InheritBool(p_dec, CFG_PREFIX "dr");
if (p_sys->direct_rendering) {
if (p_dec->fmt_in.video.orientation != ORIENT_NORMAL) {
int i_angle;
switch (p_dec->fmt_in.video.orientation) {
case ORIENT_ROTATED_90:
i_angle = 90;
break;
case ORIENT_ROTATED_180:
i_angle = 180;
break;
case ORIENT_ROTATED_270:
i_angle = 270;
break;
default:
i_angle = 0;
}
(*env)->CallVoidMethod(env, format, p_sys->set_integer,
(*env)->NewStringUTF(env, "rotation-degrees"),
i_angle);
}
jobject surf = jni_LockAndGetAndroidJavaSurface();
if (surf) {
// Configure MediaCodec with the Android surface.
......
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