[vlc-commits] [Git][videolan/vlc][master] mediacodec: set low-latency in case of "low-delay"

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Apr 12 08:49:33 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
3f3b98b6 by Thomas Guillem at 2023-04-12T08:05:47+00:00
mediacodec: set low-latency in case of "low-delay"

Available since API level 30.

This won't have any effects before API level 30.

- - - - -


4 changed files:

- modules/codec/omxil/mediacodec.c
- modules/codec/omxil/mediacodec.h
- modules/codec/omxil/mediacodec_jni.c
- modules/codec/omxil/mediacodec_ndk.c


Changes:

=====================================
modules/codec/omxil/mediacodec.c
=====================================
@@ -470,6 +470,7 @@ static int StartMediaCodec(decoder_t *p_dec)
         if (p_sys->b_adaptive)
             msg_Dbg(p_dec, "mediacodec configured for adaptative playback");
         args.video.b_adaptive_playback = p_sys->b_adaptive;
+        args.video.b_low_latency = var_InheritBool(p_dec, "low-delay");
     }
     else
     {


=====================================
modules/codec/omxil/mediacodec.h
=====================================
@@ -99,6 +99,7 @@ union mc_api_args
         int i_angle;
         bool b_tunneled_playback;
         bool b_adaptive_playback;
+        bool b_low_latency;
     } video;
     struct
     {


=====================================
modules/codec/omxil/mediacodec_jni.c
=====================================
@@ -589,6 +589,9 @@ static int ConfigureDecoder(mc_api *api, union mc_api_args* p_args)
         if (p_args->video.i_angle != 0)
             SET_INTEGER(jformat, "rotation-degrees", p_args->video.i_angle);
 
+        if (p_args->video.b_low_latency)
+            SET_INTEGER(jformat, "low-latency", 1);
+
         if (b_direct_rendering)
         {
             /* feature-tunneled-playback available since API 21 */


=====================================
modules/codec/omxil/mediacodec_ndk.c
=====================================
@@ -266,6 +266,8 @@ static int ConfigureDecoder(mc_api *api, union mc_api_args *p_args)
         return MC_API_ERROR;
     }
 
+    if (p_args->video.b_low_latency)
+        syms.AMediaFormat.setInt32(p_sys->p_format, "low-latency", 1);
     syms.AMediaFormat.setInt32(p_sys->p_format, "encoder", 0);
     syms.AMediaFormat.setString(p_sys->p_format, "mime", api->psz_mime);
     /* No limits for input size */



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3f3b98b6517eb9119e77f3b8b2e64947b64d2ad3

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/3f3b98b6517eb9119e77f3b8b2e64947b64d2ad3
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