Repository: xbmc/xbmc
File: xbmc/cores/VideoPlayer/MediaPipelineWebOS.cpp (C++)

Code before:
        videoHint.cryptoSession ? "all" : "clear"; //"bl", "el", "all"
    contents["DolbyHdrInfo"]["profileId"] = videoHint.dovi.dv_profile;
    contents["DolbyHdrInfo"]["trackType"] = videoHint.dovi.el_present_flag ? "dual" : "single";
  }

  using namespace KODI::WINDOWING::WAYLAND;
  const auto winSystem = dynamic_cast<CWinSystemWaylandWebOS*>(CServiceBroker::GetWinSystem());
  if (winSystem->SupportsExportedWindow())
  {
    p["option"]["windowId"] = winSystem->GetExportedWindowName();
  }
  else
  {
    auto buffer = static_cast<CStarfishVideoBuffer*>(m_picture.videoBuffer);
    const std::unique_ptr<AcbHandle>& acb = buffer->CreateAcbHandle();
    if (acb->Id())
    {
      if (!AcbAPI_initialize(acb->Id(), PLAYER_TYPE_MSE, getenv("APPID"), &AcbCallback))
      {
        buffer->ResetAcbHandle();
      }
    }
  }

  p["option"]["appId"] = CCompileInfo::GetPackage();
  contents["codec"]["video"] = ms_codecMap.at(videoHint.codec).name.data();

  if (audioHint.codec == AV_CODEC_ID_NONE)
  {
    m_audioCodec = nullptr;
    m_audioEncoder = nullptr;
    m_audioResample = nullptr;
    m_encoderBuffers = nullptr;
    p["option"]["needAudio"] = false;
  }
  else
  {
    contents["codec"]["audio"] = SetupAudio(audioHint, contents);
  }

  if (audioHint.codec == AV_CODEC_ID_EAC3 && audioHint.profile == AV_PROFILE_EAC3_DDP_ATMOS)
    contents["immersive"] = "ATMOS";

  contents["format"] = "RAW";
  p["mediaTransportType"] = "BUFFERSTREAM";
  contents["provider"] = CCompileInfo::GetPackage();
  p["option"]["transmission"]["contentsType"] = "LIVE";
  p["option"]["transmission"]["trickType"] = "client-side";
  p["option"]["seekMode"] = "keep-rate";
  p["option"]["useDroppedFrameEvent"] = true;
  p["option"]["externalStreamingInfo"]["streamQualityInfo"] = true;

Review comment (suggestion):
```suggestion
  contents["codec"]["video"] = std::string(ms_codecMap.at(videoHint.codec).name);
```

Code after:
  else
  {
    contents["codec"]["audio"] = SetupAudio(audioHint, contents);
  }

  if (audioHint.codec == AV_CODEC_ID_EAC3 && audioHint.profile == AV_PROFILE_EAC3_DDP_ATMOS)
    contents["immersive"] = "ATMOS";

  contents["format"] = "RAW";
  p["mediaTransportType"] = "BUFFERSTREAM";
  contents["provider"] = CCompileInfo::GetPackage();
  p["option"]["transmission"]["contentsType"] = "LIVE";
  p["option"]["transmission"]["trickType"] = "client-side";
  p["option"]["seekMode"] = "keep-rate";
  p["option"]["useDroppedFrameEvent"] = true;
  p["option"]["externalStreamingInfo"]["streamQualityInfo"] = true;
  p["option"]["externalStreamingInfo"]["streamQualityInfoNonFlushable"] = true;
  p["option"]["externalStreamingInfo"]["streamQualityInfoCorruptedFrame"] = true;

  CVariant& esInfo = contents["esInfo"];
  esInfo["pauseAtDecodeTime"] = true;
  esInfo["seperatedPTS"] = true;
  esInfo["ptsToDecode"] = m_pts.load().count();
  esInfo["videoWidth"] = videoHint.width;
  esInfo["videoHeight"] = videoHint.height;
  if (videoHint.fpsrate && videoHint.fpsscale)
  {
    esInfo["videoFpsValue"] = videoHint.fpsrate;
    esInfo["videoFpsScale"] = videoHint.fpsscale;
  }

  CVariant& bufferingCtrInfo = p["option"]["externalStreamingInfo"]["bufferingCtrInfo"];
  bufferingCtrInfo["preBufferByte"] = PRE_BUFFER_BYTES;
  bufferingCtrInfo["bufferMinLevel"] = MIN_BUFFER_LEVEL;
  bufferingCtrInfo["bufferMaxLevel"] = MAX_BUFFER_LEVEL;
  bufferingCtrInfo["qBufferLevelVideo"] = MAX_QUEUE_BUFFER_LEVEL;
  bufferingCtrInfo["srcBufferLevelVideo"]["minimum"] = MIN_SRC_BUFFER_LEVEL_VIDEO;
  bufferingCtrInfo["srcBufferLevelVideo"]["maximum"] = MAX_SRC_BUFFER_LEVEL_VIDEO;
  bufferingCtrInfo["qBufferLevelAudio"] = MAX_QUEUE_BUFFER_LEVEL;
  bufferingCtrInfo["srcBufferLevelAudio"]["minimum"] = MIN_SRC_BUFFER_LEVEL_AUDIO;
  bufferingCtrInfo["srcBufferLevelAudio"]["maximum"] = MAX_SRC_BUFFER_LEVEL_AUDIO;

  int32_t maxWidth = 0;
  int32_t maxHeight = 0;
  int32_t maxFramerate = 0;
  smp::util::getMaxVideoResolution(ms_codecMap.at(videoHint.codec).name.data(), &maxWidth,
                                   &maxHeight, &maxFramerate);
  p["option"]["adaptiveStreaming"]["adaptiveResolution"] = true;
  p["option"]["adaptiveStreaming"]["maxWidth"] = maxWidth;
  p["option"]["adaptiveStreaming"]["maxHeight"] = maxHeight;
  p["option"]["adaptiveStreaming"]["maxFrameRate"] = maxFramerate;