< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.MediaEncoding.EncodingJobInfo
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 216
Coverable lines: 216
Total lines: 752
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 208
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%210%
.ctor(...)100%210%
get_TranscodeReasons()0%2040%
get_IgnoreInputDts()100%210%
get_IgnoreInputIndex()100%210%
get_GenPtsInput()100%210%
get_DiscardCorruptFramesInput()100%210%
get_EnableFastSeekInput()100%210%
get_GenPtsOutput()100%210%
get_StartTimeTicks()100%210%
get_CopyTimestamps()100%210%
get_IsSegmentedLiveStream()0%620%
get_TotalOutputBitrate()100%210%
get_OutputWidth()0%110100%
get_OutputHeight()0%110100%
get_OutputAudioSampleRate()0%7280%
get_OutputAudioBitDepth()0%4260%
get_TargetVideoLevel()0%7280%
get_TargetVideoBitDepth()0%4260%
get_TargetRefFrames()0%4260%
get_TargetFramerate()0%7280%
get_TargetTimestamp()0%2040%
get_TargetPacketLength()0%4260%
get_TargetVideoProfile()0%7280%
get_TargetVideoRangeType()0%110100%
get_TargetVideoCodecTag()0%4260%
get_IsTargetAnamorphic()0%4260%
get_ActualOutputVideoCodec()0%2040%
get_ActualOutputAudioCodec()0%2040%
get_IsTargetInterlaced()0%110100%
get_IsTargetAVC()0%4260%
get_TargetVideoStreamCount()0%620%
get_TargetAudioStreamCount()0%620%
get_EnableAudioVbrEncoding()100%210%
get_HlsListSize()100%210%
EnableBreakOnNonKeyFrames(...)0%4260%
GetMediaStreamCount(...)0%620%
GetMimeType(...)0%2040%
DeInterlace(...)0%110100%
GetRequestedProfiles(...)0%4260%
GetRequestedRangeTypes(...)0%4260%
GetRequestedCodecTags(...)0%4260%
GetRequestedLevel(...)0%2040%
GetRequestedMaxRefFrames(...)0%4260%
GetRequestedVideoBitDepth(...)0%4260%
GetRequestedAudioBitDepth(...)0%4260%
GetRequestedAudioChannels(...)0%110100%
ReportTranscodingProgress(...)100%210%

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs

#LineLine coverage
 1#nullable disable
 2
 3#pragma warning disable CS1591, SA1401
 4
 5using System;
 6using System.Collections.Generic;
 7using System.Globalization;
 8using System.Linq;
 9using Jellyfin.Data.Enums;
 10using Jellyfin.Database.Implementations.Entities;
 11using MediaBrowser.Model.Dlna;
 12using MediaBrowser.Model.Drawing;
 13using MediaBrowser.Model.Dto;
 14using MediaBrowser.Model.Entities;
 15using MediaBrowser.Model.MediaInfo;
 16using MediaBrowser.Model.Net;
 17using MediaBrowser.Model.Session;
 18
 19namespace MediaBrowser.Controller.MediaEncoding
 20{
 21    // For now, a common base class until the API and MediaEncoding classes are unified
 22    public class EncodingJobInfo
 23    {
 024        private static readonly char[] _separators = ['|', ','];
 25
 26        public int? OutputAudioBitrate;
 27        public int? OutputAudioChannels;
 28
 29        private TranscodeReason? _transcodeReasons = null;
 30
 31        public EncodingJobInfo(TranscodingJobType jobType)
 32        {
 033            TranscodingType = jobType;
 034            RemoteHttpHeaders = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
 035            SupportedAudioCodecs = Array.Empty<string>();
 036            SupportedVideoCodecs = Array.Empty<string>();
 037            SupportedSubtitleCodecs = Array.Empty<string>();
 038        }
 39
 40        public TranscodeReason TranscodeReasons
 41        {
 42            get
 43            {
 044                if (!_transcodeReasons.HasValue)
 45                {
 046                    if (BaseRequest.TranscodeReasons is null)
 47                    {
 048                        _transcodeReasons = 0;
 049                        return 0;
 50                    }
 51
 052                    _ = Enum.TryParse<TranscodeReason>(BaseRequest.TranscodeReasons, out var reason);
 053                    _transcodeReasons = reason;
 54                }
 55
 056                return _transcodeReasons.Value;
 57            }
 58        }
 59
 60        public IProgress<double> Progress { get; set; }
 61
 62        public MediaStream VideoStream { get; set; }
 63
 64        public VideoType VideoType { get; set; }
 65
 66        public Dictionary<string, string> RemoteHttpHeaders { get; set; }
 67
 68        public string OutputVideoCodec { get; set; }
 69
 70        public MediaProtocol InputProtocol { get; set; }
 71
 72        public string MediaPath { get; set; }
 73
 74        public bool IsInputVideo { get; set; }
 75
 76        public string OutputAudioCodec { get; set; }
 77
 78        public int? OutputVideoBitrate { get; set; }
 79
 80        public MediaStream SubtitleStream { get; set; }
 81
 82        public SubtitleDeliveryMethod SubtitleDeliveryMethod { get; set; }
 83
 84        public string[] SupportedSubtitleCodecs { get; set; }
 85
 86        public int InternalSubtitleStreamOffset { get; set; }
 87
 88        public MediaSourceInfo MediaSource { get; set; }
 89
 90        public User User { get; set; }
 91
 92        public long? RunTimeTicks { get; set; }
 93
 94        public bool ReadInputAtNativeFramerate { get; set; }
 95
 96        public string OutputFilePath { get; set; }
 97
 98        public string MimeType { get; set; }
 99
 0100        public bool IgnoreInputDts => MediaSource.IgnoreDts;
 101
 0102        public bool IgnoreInputIndex => MediaSource.IgnoreIndex;
 103
 0104        public bool GenPtsInput => MediaSource.GenPtsInput;
 105
 0106        public bool DiscardCorruptFramesInput => false;
 107
 0108        public bool EnableFastSeekInput => false;
 109
 0110        public bool GenPtsOutput => false;
 111
 112        public string OutputContainer { get; set; }
 113
 114        public string OutputVideoSync { get; set; }
 115
 116        public string AlbumCoverPath { get; set; }
 117
 118        public string InputAudioSync { get; set; }
 119
 120        public string InputVideoSync { get; set; }
 121
 122        public TransportStreamTimestamp InputTimestamp { get; set; }
 123
 124        public MediaStream AudioStream { get; set; }
 125
 126        public string[] SupportedAudioCodecs { get; set; }
 127
 128        public string[] SupportedVideoCodecs { get; set; }
 129
 130        public string InputContainer { get; set; }
 131
 132        public IsoType? IsoType { get; set; }
 133
 134        public BaseEncodingJobOptions BaseRequest { get; set; }
 135
 136        public bool IsVideoRequest { get; set; }
 137
 138        public TranscodingJobType TranscodingType { get; set; }
 139
 0140        public long? StartTimeTicks => BaseRequest.StartTimeTicks;
 141
 0142        public bool CopyTimestamps => BaseRequest.CopyTimestamps;
 143
 144        public bool IsSegmentedLiveStream
 0145            => TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
 146
 0147        public int? TotalOutputBitrate => (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0);
 148
 149        public int? OutputWidth
 150        {
 151            get
 152            {
 0153                if (VideoStream is not null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
 154                {
 0155                    var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
 156
 0157                    var newSize = DrawingUtils.Resize(
 0158                        size,
 0159                        BaseRequest.Width ?? 0,
 0160                        BaseRequest.Height ?? 0,
 0161                        BaseRequest.MaxWidth ?? 0,
 0162                        BaseRequest.MaxHeight ?? 0);
 163
 0164                    return newSize.Width;
 165                }
 166
 0167                if (!IsVideoRequest)
 168                {
 0169                    return null;
 170                }
 171
 0172                return BaseRequest.MaxWidth ?? BaseRequest.Width;
 173            }
 174        }
 175
 176        public int? OutputHeight
 177        {
 178            get
 179            {
 0180                if (VideoStream is not null && VideoStream.Width.HasValue && VideoStream.Height.HasValue)
 181                {
 0182                    var size = new ImageDimensions(VideoStream.Width.Value, VideoStream.Height.Value);
 183
 0184                    var newSize = DrawingUtils.Resize(
 0185                        size,
 0186                        BaseRequest.Width ?? 0,
 0187                        BaseRequest.Height ?? 0,
 0188                        BaseRequest.MaxWidth ?? 0,
 0189                        BaseRequest.MaxHeight ?? 0);
 190
 0191                    return newSize.Height;
 192                }
 193
 0194                if (!IsVideoRequest)
 195                {
 0196                    return null;
 197                }
 198
 0199                return BaseRequest.MaxHeight ?? BaseRequest.Height;
 200            }
 201        }
 202
 203        public int? OutputAudioSampleRate
 204        {
 205            get
 206            {
 0207                if (BaseRequest.Static
 0208                    || EncodingHelper.IsCopyCodec(OutputAudioCodec))
 209                {
 0210                    if (AudioStream is not null)
 211                    {
 0212                        return AudioStream.SampleRate;
 213                    }
 214                }
 0215                else if (BaseRequest.AudioSampleRate.HasValue)
 216                {
 217                    // Don't exceed what the encoder supports
 218                    // Seeing issues of attempting to encode to 88200
 0219                    return BaseRequest.AudioSampleRate.Value;
 220                }
 221
 0222                return null;
 223            }
 224        }
 225
 226        public int? OutputAudioBitDepth
 227        {
 228            get
 229            {
 0230                if (BaseRequest.Static
 0231                    || EncodingHelper.IsCopyCodec(OutputAudioCodec))
 232                {
 0233                    if (AudioStream is not null)
 234                    {
 0235                        return AudioStream.BitDepth;
 236                    }
 237                }
 238
 0239                return null;
 240            }
 241        }
 242
 243        /// <summary>
 244        /// Gets the target video level.
 245        /// </summary>
 246        public double? TargetVideoLevel
 247        {
 248            get
 249            {
 0250                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 251                {
 0252                    return VideoStream?.Level;
 253                }
 254
 0255                var level = GetRequestedLevel(ActualOutputVideoCodec);
 0256                if (double.TryParse(level, CultureInfo.InvariantCulture, out var result))
 257                {
 0258                    return result;
 259                }
 260
 0261                return null;
 262            }
 263        }
 264
 265        /// <summary>
 266        /// Gets the target video bit depth.
 267        /// </summary>
 268        public int? TargetVideoBitDepth
 269        {
 270            get
 271            {
 0272                if (BaseRequest.Static
 0273                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 274                {
 0275                    return VideoStream?.BitDepth;
 276                }
 277
 0278                return null;
 279            }
 280        }
 281
 282        /// <summary>
 283        /// Gets the target reference frames.
 284        /// </summary>
 285        /// <value>The target reference frames.</value>
 286        public int? TargetRefFrames
 287        {
 288            get
 289            {
 0290                if (BaseRequest.Static
 0291                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 292                {
 0293                    return VideoStream?.RefFrames;
 294                }
 295
 0296                return null;
 297            }
 298        }
 299
 300        /// <summary>
 301        /// Gets the target framerate.
 302        /// </summary>
 303        public float? TargetFramerate
 304        {
 305            get
 306            {
 0307                if (BaseRequest.Static
 0308                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 309                {
 0310                    return VideoStream?.ReferenceFrameRate;
 311                }
 312
 0313                return BaseRequest.MaxFramerate ?? BaseRequest.Framerate;
 314            }
 315        }
 316
 317        public TransportStreamTimestamp TargetTimestamp
 318        {
 319            get
 320            {
 0321                if (BaseRequest.Static)
 322                {
 0323                    return InputTimestamp;
 324                }
 325
 0326                return string.Equals(OutputContainer, "m2ts", StringComparison.OrdinalIgnoreCase) ?
 0327                    TransportStreamTimestamp.Valid :
 0328                    TransportStreamTimestamp.None;
 329            }
 330        }
 331
 332        /// <summary>
 333        /// Gets the target packet length.
 334        /// </summary>
 335        public int? TargetPacketLength
 336        {
 337            get
 338            {
 0339                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 340                {
 0341                    return VideoStream?.PacketLength;
 342                }
 343
 0344                return null;
 345            }
 346        }
 347
 348        /// <summary>
 349        /// Gets the target video profile.
 350        /// </summary>
 351        public string TargetVideoProfile
 352        {
 353            get
 354            {
 0355                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 356                {
 0357                    return VideoStream?.Profile;
 358                }
 359
 0360                var requestedProfile = GetRequestedProfiles(ActualOutputVideoCodec).FirstOrDefault();
 0361                if (!string.IsNullOrEmpty(requestedProfile))
 362                {
 0363                    return requestedProfile;
 364                }
 365
 0366                return null;
 367            }
 368        }
 369
 370        /// <summary>
 371        /// Gets the target video range type.
 372        /// </summary>
 373        public VideoRangeType TargetVideoRangeType
 374        {
 375            get
 376            {
 0377                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 378                {
 0379                    return VideoStream?.VideoRangeType ?? VideoRangeType.Unknown;
 380                }
 381
 0382                if (Enum.TryParse(GetRequestedRangeTypes(ActualOutputVideoCodec).FirstOrDefault() ?? "Unknown", true, ou
 383                {
 0384                    return requestedRangeType;
 385                }
 386
 0387                return VideoRangeType.Unknown;
 388            }
 389        }
 390
 391        public string TargetVideoCodecTag
 392        {
 393            get
 394            {
 0395                if (BaseRequest.Static
 0396                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 397                {
 0398                    return VideoStream?.CodecTag;
 399                }
 400
 0401                return null;
 402            }
 403        }
 404
 405        public bool? IsTargetAnamorphic
 406        {
 407            get
 408            {
 0409                if (BaseRequest.Static
 0410                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 411                {
 0412                    return VideoStream?.IsAnamorphic;
 413                }
 414
 0415                return false;
 416            }
 417        }
 418
 419        public string ActualOutputVideoCodec
 420        {
 421            get
 422            {
 0423                if (VideoStream is null)
 424                {
 0425                    return null;
 426                }
 427
 0428                if (EncodingHelper.IsCopyCodec(OutputVideoCodec))
 429                {
 0430                    return VideoStream.Codec;
 431                }
 432
 0433                return OutputVideoCodec;
 434            }
 435        }
 436
 437        public string ActualOutputAudioCodec
 438        {
 439            get
 440            {
 0441                if (AudioStream is null)
 442                {
 0443                    return null;
 444                }
 445
 0446                if (EncodingHelper.IsCopyCodec(OutputAudioCodec))
 447                {
 0448                    return AudioStream.Codec;
 449                }
 450
 0451                return OutputAudioCodec;
 452            }
 453        }
 454
 455        public bool? IsTargetInterlaced
 456        {
 457            get
 458            {
 0459                if (BaseRequest.Static
 0460                    || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 461                {
 0462                    return VideoStream?.IsInterlaced;
 463                }
 464
 0465                if (DeInterlace(ActualOutputVideoCodec, true))
 466                {
 0467                    return false;
 468                }
 469
 0470                return VideoStream?.IsInterlaced;
 471            }
 472        }
 473
 474        public bool? IsTargetAVC
 475        {
 476            get
 477            {
 0478                if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
 479                {
 0480                    return VideoStream?.IsAVC;
 481                }
 482
 0483                return false;
 484            }
 485        }
 486
 487        public int? TargetVideoStreamCount
 488        {
 489            get
 490            {
 0491                if (BaseRequest.Static)
 492                {
 0493                    return GetMediaStreamCount(MediaStreamType.Video, int.MaxValue);
 494                }
 495
 0496                return GetMediaStreamCount(MediaStreamType.Video, 1);
 497            }
 498        }
 499
 500        public int? TargetAudioStreamCount
 501        {
 502            get
 503            {
 0504                if (BaseRequest.Static)
 505                {
 0506                    return GetMediaStreamCount(MediaStreamType.Audio, int.MaxValue);
 507                }
 508
 0509                return GetMediaStreamCount(MediaStreamType.Audio, 1);
 510            }
 511        }
 512
 0513        public bool EnableAudioVbrEncoding => BaseRequest.EnableAudioVbrEncoding;
 514
 0515        public int HlsListSize => 0;
 516
 517        public bool EnableBreakOnNonKeyFrames(string videoCodec)
 518        {
 0519            if (TranscodingType != TranscodingJobType.Progressive)
 520            {
 0521                if (IsSegmentedLiveStream)
 522                {
 0523                    return false;
 524                }
 525
 0526                return BaseRequest.BreakOnNonKeyFrames && EncodingHelper.IsCopyCodec(videoCodec);
 527            }
 528
 0529            return false;
 530        }
 531
 532        private int? GetMediaStreamCount(MediaStreamType type, int limit)
 533        {
 0534            var count = MediaSource.GetStreamCount(type);
 535
 0536            if (count.HasValue)
 537            {
 0538                count = Math.Min(count.Value, limit);
 539            }
 540
 0541            return count;
 542        }
 543
 544        public string GetMimeType(string outputPath, bool enableStreamDefault = true)
 545        {
 0546            if (!string.IsNullOrEmpty(MimeType))
 547            {
 0548                return MimeType;
 549            }
 550
 0551            if (enableStreamDefault)
 552            {
 0553                return MimeTypes.GetMimeType(outputPath);
 554            }
 555
 0556            return MimeTypes.GetMimeType(outputPath, null);
 557        }
 558
 559        public bool DeInterlace(string videoCodec, bool forceDeinterlaceIfSourceIsInterlaced)
 560        {
 0561            var videoStream = VideoStream;
 0562            var isInputInterlaced = videoStream is not null && videoStream.IsInterlaced;
 563
 0564            if (!isInputInterlaced)
 565            {
 0566                return false;
 567            }
 568
 569            // Support general param
 0570            if (BaseRequest.DeInterlace)
 571            {
 0572                return true;
 573            }
 574
 0575            if (!string.IsNullOrEmpty(videoCodec))
 576            {
 0577                if (string.Equals(BaseRequest.GetOption(videoCodec, "deinterlace"), "true", StringComparison.OrdinalIgno
 578                {
 0579                    return true;
 580                }
 581            }
 582
 0583            return forceDeinterlaceIfSourceIsInterlaced;
 584        }
 585
 586        public string[] GetRequestedProfiles(string codec)
 587        {
 0588            if (!string.IsNullOrEmpty(BaseRequest.Profile))
 589            {
 0590                return BaseRequest.Profile.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
 591            }
 592
 0593            if (!string.IsNullOrEmpty(codec))
 594            {
 0595                var profile = BaseRequest.GetOption(codec, "profile");
 596
 0597                if (!string.IsNullOrEmpty(profile))
 598                {
 0599                    return profile.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
 600                }
 601            }
 602
 0603            return Array.Empty<string>();
 604        }
 605
 606        public string[] GetRequestedRangeTypes(string codec)
 607        {
 0608            if (!string.IsNullOrEmpty(BaseRequest.VideoRangeType))
 609            {
 0610                return BaseRequest.VideoRangeType.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
 611            }
 612
 0613            if (!string.IsNullOrEmpty(codec))
 614            {
 0615                var rangetype = BaseRequest.GetOption(codec, "rangetype");
 616
 0617                if (!string.IsNullOrEmpty(rangetype))
 618                {
 0619                    return rangetype.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
 620                }
 621            }
 622
 0623            return Array.Empty<string>();
 624        }
 625
 626        public string[] GetRequestedCodecTags(string codec)
 627        {
 0628            if (!string.IsNullOrEmpty(BaseRequest.CodecTag))
 629            {
 0630                return BaseRequest.CodecTag.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
 631            }
 632
 0633            if (!string.IsNullOrEmpty(codec))
 634            {
 0635                var codectag = BaseRequest.GetOption(codec, "codectag");
 636
 0637                if (!string.IsNullOrEmpty(codectag))
 638                {
 0639                    return codectag.Split(_separators, StringSplitOptions.RemoveEmptyEntries);
 640                }
 641            }
 642
 0643            return Array.Empty<string>();
 644        }
 645
 646        public string GetRequestedLevel(string codec)
 647        {
 0648            if (!string.IsNullOrEmpty(BaseRequest.Level))
 649            {
 0650                return BaseRequest.Level;
 651            }
 652
 0653            if (!string.IsNullOrEmpty(codec))
 654            {
 0655                return BaseRequest.GetOption(codec, "level");
 656            }
 657
 0658            return null;
 659        }
 660
 661        public int? GetRequestedMaxRefFrames(string codec)
 662        {
 0663            if (BaseRequest.MaxRefFrames.HasValue)
 664            {
 0665                return BaseRequest.MaxRefFrames;
 666            }
 667
 0668            if (!string.IsNullOrEmpty(codec))
 669            {
 0670                var value = BaseRequest.GetOption(codec, "maxrefframes");
 0671                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 672                {
 0673                    return result;
 674                }
 675            }
 676
 0677            return null;
 678        }
 679
 680        public int? GetRequestedVideoBitDepth(string codec)
 681        {
 0682            if (BaseRequest.MaxVideoBitDepth.HasValue)
 683            {
 0684                return BaseRequest.MaxVideoBitDepth;
 685            }
 686
 0687            if (!string.IsNullOrEmpty(codec))
 688            {
 0689                var value = BaseRequest.GetOption(codec, "videobitdepth");
 0690                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 691                {
 0692                    return result;
 693                }
 694            }
 695
 0696            return null;
 697        }
 698
 699        public int? GetRequestedAudioBitDepth(string codec)
 700        {
 0701            if (BaseRequest.MaxAudioBitDepth.HasValue)
 702            {
 0703                return BaseRequest.MaxAudioBitDepth;
 704            }
 705
 0706            if (!string.IsNullOrEmpty(codec))
 707            {
 0708                var value = BaseRequest.GetOption(codec, "audiobitdepth");
 0709                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 710                {
 0711                    return result;
 712                }
 713            }
 714
 0715            return null;
 716        }
 717
 718        public int? GetRequestedAudioChannels(string codec)
 719        {
 0720            if (!string.IsNullOrEmpty(codec))
 721            {
 0722                var value = BaseRequest.GetOption(codec, "audiochannels");
 0723                if (int.TryParse(value, CultureInfo.InvariantCulture, out var result))
 724                {
 0725                    return result;
 726                }
 727            }
 728
 0729            if (BaseRequest.MaxAudioChannels.HasValue)
 730            {
 0731                return BaseRequest.MaxAudioChannels;
 732            }
 733
 0734            if (BaseRequest.AudioChannels.HasValue)
 735            {
 0736                return BaseRequest.AudioChannels;
 737            }
 738
 0739            if (BaseRequest.TranscodingMaxAudioChannels.HasValue)
 740            {
 0741                return BaseRequest.TranscodingMaxAudioChannels;
 742            }
 743
 0744            return null;
 745        }
 746
 747        public virtual void ReportTranscodingProgress(TimeSpan? transcodingPosition, float? framerate, double? percentCo
 748        {
 0749            Progress.Report(percentComplete.Value);
 0750        }
 751    }
 752}

Methods/Properties

.cctor()
.ctor(MediaBrowser.Controller.MediaEncoding.TranscodingJobType)
get_TranscodeReasons()
get_IgnoreInputDts()
get_IgnoreInputIndex()
get_GenPtsInput()
get_DiscardCorruptFramesInput()
get_EnableFastSeekInput()
get_GenPtsOutput()
get_StartTimeTicks()
get_CopyTimestamps()
get_IsSegmentedLiveStream()
get_TotalOutputBitrate()
get_OutputWidth()
get_OutputHeight()
get_OutputAudioSampleRate()
get_OutputAudioBitDepth()
get_TargetVideoLevel()
get_TargetVideoBitDepth()
get_TargetRefFrames()
get_TargetFramerate()
get_TargetTimestamp()
get_TargetPacketLength()
get_TargetVideoProfile()
get_TargetVideoRangeType()
get_TargetVideoCodecTag()
get_IsTargetAnamorphic()
get_ActualOutputVideoCodec()
get_ActualOutputAudioCodec()
get_IsTargetInterlaced()
get_IsTargetAVC()
get_TargetVideoStreamCount()
get_TargetAudioStreamCount()
get_EnableAudioVbrEncoding()
get_HlsListSize()
EnableBreakOnNonKeyFrames(System.String)
GetMediaStreamCount(MediaBrowser.Model.Entities.MediaStreamType,System.Int32)
GetMimeType(System.String,System.Boolean)
DeInterlace(System.String,System.Boolean)
GetRequestedProfiles(System.String)
GetRequestedRangeTypes(System.String)
GetRequestedCodecTags(System.String)
GetRequestedLevel(System.String)
GetRequestedMaxRefFrames(System.String)
GetRequestedVideoBitDepth(System.String)
GetRequestedAudioBitDepth(System.String)
GetRequestedAudioChannels(System.String)
ReportTranscodingProgress(System.Nullable`1<System.TimeSpan>,System.Nullable`1<System.Single>,System.Nullable`1<System.Double>,System.Nullable`1<System.Int64>,System.Nullable`1<System.Int32>)