How to force Kodi to play certain videos with Mediacodec and others with another
#1
Hi

What do you change in Kodi source code to
force eg. videos over 1080p like 4K videos to use Mediacodec Surface rendering instead of like AMCodec or another codec but still play all other videos with AMCodec(AmLogic)?
or force eg. videos over 1080p like 4K videos to use AMCodec rendering instead of MediaCodec Surface Rendering or another codec but still play all other videos with Mediacodec Surface rendering?

I know what to change to
eg. force a certain codec at certain resolution to play with Software instead of Mediacodec and the rest still with Mediacodec but not sure about the reverse.
Reply
#2
https://github.com/xbmc/xbmc/blob/master...c.cpp#L216
Reply
#3
(2015-11-27, 16:24)Koying Wrote: https://github.com/xbmc/xbmc/blob/master...c.cpp#L216

Eg.
Code:
#if defined(TARGET_ANDROID)
  if (!hint.software && CSettings::GetInstance().GetBool(CSettings::SETTING_VIDEOPLAYER_USEMEDIACODECSURFACE))
  {
    switch(hint.codec)
    {
      case AV_CODEC_ID_MPEG4:
      case AV_CODEC_ID_MSMPEG4V2:
      case AV_CODEC_ID_MSMPEG4V3:
      case AV_CODEC_ID_MPEG1VIDEO:
      case AV_CODEC_ID_MPEG2VIDEO:
        // Avoid h/w decoder for SD; Those files might use features
        // not supported and can easily be soft-decoded
        if (hint.width <= 800)
          break;
      default:
        CLog::Log(LOGINFO, "MediaCodec (Surface) Video Decoder...");
        if ( (pCodec = OpenCodec(new CDVDVideoCodecAndroidMediaCodec(true), hint, options)) ) return pCodec;
    }
  }
I want to have ' if (hint.width > 1988)'
for AV_CODEC_ID_H264
then not to use MediaCodecSurface and rather use AMCodec if MediaCodecSurface is selected in Android Settings instead of then using software video playback.
What is the correct code and where to put it?
Also what does this mean 'switch(hint.codec)'?
I want Mediacodec to return false if width of H264 is higher than 1988 but then to use AMCodec not software '(pCodec = OpenCodec(new CDVDVideoCodecAndroidMediaCodec(true), hint, options)) ) return pCodec;'

Any help will be appreciated since it's difficult for me to add something if you don't understand the code fully.
Reply

Logout Mark Read Team Forum Stats Members Help
How to force Kodi to play certain videos with Mediacodec and others with another0