mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-26 10:44:50 +03:00
added media stream helpers
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.MediaInfo;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -14,9 +16,9 @@ namespace MediaBrowser.Model.Dto
|
||||
public long? Size { get; set; }
|
||||
|
||||
public LocationType LocationType { get; set; }
|
||||
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
public long? RunTimeTicks { get; set; }
|
||||
|
||||
public VideoType? VideoType { get; set; }
|
||||
@@ -24,19 +26,61 @@ namespace MediaBrowser.Model.Dto
|
||||
public IsoType? IsoType { get; set; }
|
||||
|
||||
public Video3DFormat? Video3DFormat { get; set; }
|
||||
|
||||
|
||||
public List<MediaStream> MediaStreams { get; set; }
|
||||
|
||||
public List<string> Formats { get; set; }
|
||||
|
||||
|
||||
public int? Bitrate { get; set; }
|
||||
|
||||
public TransportStreamTimestamp? Timestamp { get; set; }
|
||||
|
||||
|
||||
public MediaSourceInfo()
|
||||
{
|
||||
Formats = new List<string>();
|
||||
MediaStreams = new List<MediaStream>();
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public MediaStream DefaultAudioStream
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Audio && i.IsDefault)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Audio)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
[IgnoreDataMember]
|
||||
public MediaStream VideoStream
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (MediaStream i in MediaStreams)
|
||||
{
|
||||
if (i.Type == MediaStreamType.Video && (i.Codec ?? string.Empty).IndexOf("jpeg", StringComparison.OrdinalIgnoreCase) == -1)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user