The Free Software Media System - Server Backend & API
Merge branch 'master' into keyframe_extraction_v1
cviumc658a883a2bc
diff --cc Jellyfin.Api/Controllers/DynamicHlsController.csindex a6d9825526,6ef3a2ff97..674daa8d19--- a/Jellyfin.Api/Controllers/DynamicHlsController.cs+++ b/Jellyfin.Api/Controllers/DynamicHlsController.cs@@@ -1681,9 -1954,32 +1926,9 @@@ namespace Jellyfin.Api.Controllerreturn Task.CompletedTask;});- return FileStreamResponseHelpers.GetStaticFileResult(segmentPath, MimeTypes.GetMimeType(segmentPath)!, false, HttpContext);+ return FileStreamResponseHelpers.GetStaticFileResult(segmentPath, MimeTypes.GetMimeType(segmentPath), false, HttpContext);}- private long GetEndPositionTicks(StreamState state, int requestedIndex)- {- double startSeconds = 0;- var lengths = GetSegmentLengths(state);-- if (requestedIndex >= lengths.Length)- {- var msg = string.Format(- CultureInfo.InvariantCulture,- "Invalid segment index requested: {0} - Segment count: {1}",- requestedIndex,- lengths.Length);- throw new ArgumentException(msg);- }-- for (var i = 0; i <= requestedIndex; i++)- {- startSeconds += lengths[i];- }-- return TimeSpan.FromSeconds(startSeconds).Ticks;- }-private int? GetCurrentTranscodingIndex(string playlist, string segmentExtension){var job = _transcodingJobHelper.GetTranscodingJob(playlist, TranscodingJobType);@@@ -1759,8 -2055,32 +2004,8 @@@}catch (Exception ex){- _logger.LogError(ex, "Error deleting partial stream file(s) {path}", path);+ _logger.LogError(ex, "Error deleting partial stream file(s) {Path}", path);}}-- private long GetStartPositionTicks(StreamState state, int requestedIndex)- {- double startSeconds = 0;- var lengths = GetSegmentLengths(state);-- if (requestedIndex >= lengths.Length)- {- var msg = string.Format(- CultureInfo.InvariantCulture,- "Invalid segment index requested: {0} - Segment count: {1}",- requestedIndex,- lengths.Length);- throw new ArgumentException(msg);- }-- for (var i = 0; i < requestedIndex; i++)- {- startSeconds += lengths[i];- }-- var position = TimeSpan.FromSeconds(startSeconds).Ticks;- return position;- }}}diff --cc MediaBrowser.Controller/MediaEncoding/IMediaEncoder.csindex 1f4e08222b,fd3eb81056..6bf3e7b469--- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs+++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs@@@ -24,12 -25,30 +25,36 @@@ namespace MediaBrowser.Controller.Media/// <value>The encoder path.</value>string EncoderPath { get; }+ /// <summary>+ /// Gets the probe path.+ /// </summary>+ /// <value>The probe path.</value>+ string ProbePath { get; }++ /// <summary>+ /// Gets the version of encoder.+ /// </summary>+ /// <returns>The version of encoder.</returns>+ Version EncoderVersion { get; }++ /// <summary>+ /// Gets a value indicating whether the configured Vaapi device is from AMD(radeonsi/r600 Mesa driver).+ /// </summary>+ /// <value><c>true</c> if the Vaapi device is an AMD(radeonsi/r600 Mesa driver) GPU, <c>false</c> otherwise.</value>+ bool IsVaapiDeviceAmd { get; }++ /// <summary>+ /// Gets a value indicating whether the configured Vaapi device is from Intel(iHD driver).+ /// </summary>+ /// <value><c>true</c> if the Vaapi device is an Intel(iHD driver) GPU, <c>false</c> otherwise.</value>+ bool IsVaapiDeviceInteliHD { get; }++ /// <summary>+ /// Gets a value indicating whether the configured Vaapi device is from Intel(legacy i965 driver).+ /// </summary>+ /// <value><c>true</c> if the Vaapi device is an Intel(legacy i965 driver) GPU, <c>false</c> otherwise.</value>+ bool IsVaapiDeviceInteli965 { get; }+/// <summary>/// Whether given encoder codec is supported./// </summary>diff --cc MediaBrowser.MediaEncoding/Encoder/MediaEncoder.csindex eed50fe0b5,e1643ea434..c41ed20cdc--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs@@@ -91,9 -92,14 +92,17 @@@ namespace MediaBrowser.MediaEncoding.En/// <inheritdoc />public string EncoderPath => _ffmpegPath;+ /// <inheritdoc />+ public string ProbePath => _ffprobePath;++ public Version EncoderVersion => _ffmpegVersion;++ public bool IsVaapiDeviceAmd => _isVaapiDeviceAmd;++ public bool IsVaapiDeviceInteliHD => _isVaapiDeviceInteliHD;++ public bool IsVaapiDeviceInteli965 => _isVaapiDeviceInteli965;+/// <summary>/// Run at startup or if the user removes a Custom path from transcode page./// Sets global variables FFmpegPath.