[vlc-commits] [Git][videolan/vlc][master] 2 commits: mediacodec: enable direct rendering without a subtitle surface

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed May 17 07:11:27 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
a70e0b30 by Thomas Guillem at 2023-05-17T06:42:19+00:00
mediacodec: enable direct rendering without a subtitle surface

The most important check is `AWindowHandler_canSetVideoLayout()` that
assure that the LibVLC user set up callbacks to handle crop/scale.

- - - - -
66eb9670 by Thomas Guillem at 2023-05-17T06:42:19+00:00
android: display: do not force subtitles usage

No need to double the check for choosing direct or opengl rendering. It
is previously done in the mediacodec module.

- - - - -


2 changed files:

- modules/codec/omxil/mediacodec.c
- modules/video_output/android/display.c


Changes:

=====================================
modules/codec/omxil/mediacodec.c
=====================================
@@ -661,19 +661,15 @@ CreateVideoContext(decoder_t *p_dec)
     assert(dec_dev->opaque);
     AWindowHandler *awh = dec_dev->opaque;
 
-    const bool has_subtitle_surface =
-        AWindowHandler_getANativeWindow(awh, AWindow_Subtitles) != NULL;
-
     /* Force OpenGL interop (via AWindow_SurfaceTexture) if there is a
      * projection or an orientation to handle, if the Surface owner is not able
-     * to modify its layout, or if there is no external subtitle surfaces. */
+     * to modify its layout. */
 
     p_sys->video.surfacetexture = NULL;
     bool use_surfacetexture =
         p_dec->fmt_out.video.projection_mode != PROJECTION_MODE_RECTANGULAR
      || (!p_sys->api.b_support_rotation && p_dec->fmt_out.video.orientation != ORIENT_NORMAL)
-     || !AWindowHandler_canSetVideoLayout(awh)
-     || !has_subtitle_surface;
+     || !AWindowHandler_canSetVideoLayout(awh);
 
     if (!use_surfacetexture)
     {


=====================================
modules/video_output/android/display.c
=====================================
@@ -501,13 +501,23 @@ static int Open(vout_display_t *vd,
         return VLC_EGENERIC;
     }
 
-    int ret = subpicture_OpenDisplay(vd);
-    if (ret != 0 && !vd->obj.force)
+    const bool has_subtitle_surface =
+        AWindowHandler_getANativeWindow(sys->awh, AWindow_Subtitles) != NULL;
+    if (has_subtitle_surface)
     {
-        msg_Warn(vd, "cannot blend subtitle with an opaque surface, "
-                     "trying next vout");
-        free(sys);
-        return VLC_EGENERIC;
+        int ret = subpicture_OpenDisplay(vd);
+        if (ret != 0 && !vd->obj.force)
+        {
+            msg_Warn(vd, "cannot blend subtitle with an opaque surface, "
+                         "trying next vout");
+            free(sys);
+            return VLC_EGENERIC;
+        }
+    }
+    else
+    {
+        msg_Warn(vd, "using android display without subtitles support");
+        sys->sub.window = NULL;
     }
 
     video_format_t rot_fmt;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/363d06f3e852732ceb2a841c6804765599af48f9...66eb96707f170390daf7de51807e22511009c2bf

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/363d06f3e852732ceb2a841c6804765599af48f9...66eb96707f170390daf7de51807e22511009c2bf
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list