aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/MediaInfo
diff options
context:
space:
mode:
authorAndrew Rabert <ar@nullsum.net>2018-12-27 18:27:57 -0500
committerAndrew Rabert <ar@nullsum.net>2018-12-27 18:27:57 -0500
commita86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 (patch)
treea74f6ea4a8abfa1664a605d31d48bc38245ccf58 /MediaBrowser.Model/MediaInfo
parent9bac3ac616b01f67db98381feb09d34ebe821f9a (diff)
Add GPL modules
Diffstat (limited to 'MediaBrowser.Model/MediaInfo')
-rw-r--r--MediaBrowser.Model/MediaInfo/AudioCodec.cs26
-rw-r--r--MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs37
-rw-r--r--MediaBrowser.Model/MediaInfo/Container.cs9
-rw-r--r--MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs16
-rw-r--r--MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs47
-rw-r--r--MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs9
-rw-r--r--MediaBrowser.Model/MediaInfo/MediaInfo.cs68
-rw-r--r--MediaBrowser.Model/MediaInfo/MediaProtocol.cs13
-rw-r--r--MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs50
-rw-r--r--MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs32
-rw-r--r--MediaBrowser.Model/MediaInfo/SubtitleFormat.cs13
-rw-r--r--MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs11
-rw-r--r--MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs14
-rw-r--r--MediaBrowser.Model/MediaInfo/TransportStreamTimestamp.cs9
-rw-r--r--MediaBrowser.Model/MediaInfo/VideoCodec.cs14
15 files changed, 368 insertions, 0 deletions
diff --git a/MediaBrowser.Model/MediaInfo/AudioCodec.cs b/MediaBrowser.Model/MediaInfo/AudioCodec.cs
new file mode 100644
index 000000000..93aba2f43
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/AudioCodec.cs
@@ -0,0 +1,26 @@
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class AudioCodec
+ {
+ public const string AAC = "aac";
+ public const string MP3 = "mp3";
+ public const string AC3 = "ac3";
+
+ public static string GetFriendlyName(string codec)
+ {
+ if (string.IsNullOrEmpty(codec)) return "";
+
+ switch (codec.ToLower())
+ {
+ case "ac3":
+ return "Dolby Digital";
+ case "eac3":
+ return "Dolby Digital+";
+ case "dca":
+ return "DTS";
+ default:
+ return codec.ToUpper();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
new file mode 100644
index 000000000..1b573fba7
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs
@@ -0,0 +1,37 @@
+using MediaBrowser.Model.Entities;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ /// <summary>
+ /// Represents the result of BDInfo output
+ /// </summary>
+ public class BlurayDiscInfo
+ {
+ /// <summary>
+ /// Gets or sets the media streams.
+ /// </summary>
+ /// <value>The media streams.</value>
+ public MediaStream[] MediaStreams { get; set; }
+
+ /// <summary>
+ /// Gets or sets the run time ticks.
+ /// </summary>
+ /// <value>The run time ticks.</value>
+ public long? RunTimeTicks { get; set; }
+
+ /// <summary>
+ /// Gets or sets the files.
+ /// </summary>
+ /// <value>The files.</value>
+ public string[] Files { get; set; }
+
+ public string PlaylistName { get; set; }
+
+ /// <summary>
+ /// Gets or sets the chapters.
+ /// </summary>
+ /// <value>The chapters.</value>
+ public double[] Chapters { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/Container.cs b/MediaBrowser.Model/MediaInfo/Container.cs
new file mode 100644
index 000000000..3762edf9f
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/Container.cs
@@ -0,0 +1,9 @@
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class Container
+ {
+ public const string MP4 = "mp4";
+ public const string MKV = "mkv";
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs b/MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs
new file mode 100644
index 000000000..78d5b197f
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/IBlurayExaminer.cs
@@ -0,0 +1,16 @@
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ /// <summary>
+ /// Interface IBlurayExaminer
+ /// </summary>
+ public interface IBlurayExaminer
+ {
+ /// <summary>
+ /// Gets the disc info.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns>BlurayDiscInfo.</returns>
+ BlurayDiscInfo GetDiscInfo(string path);
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs
new file mode 100644
index 000000000..d36aa9944
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/LiveStreamRequest.cs
@@ -0,0 +1,47 @@
+using MediaBrowser.Model.Dlna;
+using System;
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class LiveStreamRequest
+ {
+ public string OpenToken { get; set; }
+ public Guid UserId { get; set; }
+ public string PlaySessionId { get; set; }
+ public long? MaxStreamingBitrate { get; set; }
+ public long? StartTimeTicks { get; set; }
+ public int? AudioStreamIndex { get; set; }
+ public int? SubtitleStreamIndex { get; set; }
+ public int? MaxAudioChannels { get; set; }
+ public Guid ItemId { get; set; }
+ public DeviceProfile DeviceProfile { get; set; }
+
+ public bool EnableDirectPlay { get; set; }
+ public bool EnableDirectStream { get; set; }
+ public MediaProtocol[] DirectPlayProtocols { get; set; }
+
+ public LiveStreamRequest()
+ {
+ EnableDirectPlay = true;
+ EnableDirectStream = true;
+ DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
+ }
+
+ public LiveStreamRequest(AudioOptions options)
+ {
+ MaxStreamingBitrate = options.MaxBitrate;
+ ItemId = options.ItemId;
+ DeviceProfile = options.Profile;
+ MaxAudioChannels = options.MaxAudioChannels;
+
+ DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
+
+ VideoOptions videoOptions = options as VideoOptions;
+ if (videoOptions != null)
+ {
+ AudioStreamIndex = videoOptions.AudioStreamIndex;
+ SubtitleStreamIndex = videoOptions.SubtitleStreamIndex;
+ }
+ }
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs b/MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs
new file mode 100644
index 000000000..e79e37a71
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/LiveStreamResponse.cs
@@ -0,0 +1,9 @@
+using MediaBrowser.Model.Dto;
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class LiveStreamResponse
+ {
+ public MediaSourceInfo MediaSource { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/MediaInfo.cs b/MediaBrowser.Model/MediaInfo/MediaInfo.cs
new file mode 100644
index 000000000..55545e23a
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/MediaInfo.cs
@@ -0,0 +1,68 @@
+using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Entities;
+using System;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class MediaInfo : MediaSourceInfo, IHasProviderIds
+ {
+ private static readonly string[] EmptyStringArray = new string[] {};
+
+ public ChapterInfo[] Chapters { get; set; }
+
+ /// <summary>
+ /// Gets or sets the album.
+ /// </summary>
+ /// <value>The album.</value>
+ public string Album { get; set; }
+ /// <summary>
+ /// Gets or sets the artists.
+ /// </summary>
+ /// <value>The artists.</value>
+ public string[] Artists { get; set; }
+ /// <summary>
+ /// Gets or sets the album artists.
+ /// </summary>
+ /// <value>The album artists.</value>
+ public string[] AlbumArtists { get; set; }
+ /// <summary>
+ /// Gets or sets the studios.
+ /// </summary>
+ /// <value>The studios.</value>
+ public string[] Studios { get; set; }
+ public string[] Genres { get; set; }
+ public int? IndexNumber { get; set; }
+ public int? ParentIndexNumber { get; set; }
+ public int? ProductionYear { get; set; }
+ public DateTime? PremiereDate { get; set; }
+ public BaseItemPerson[] People { get; set; }
+ public Dictionary<string, string> ProviderIds { get; set; }
+ /// <summary>
+ /// Gets or sets the official rating.
+ /// </summary>
+ /// <value>The official rating.</value>
+ public string OfficialRating { get; set; }
+ /// <summary>
+ /// Gets or sets the official rating description.
+ /// </summary>
+ /// <value>The official rating description.</value>
+ public string OfficialRatingDescription { get; set; }
+ /// <summary>
+ /// Gets or sets the overview.
+ /// </summary>
+ /// <value>The overview.</value>
+ public string Overview { get; set; }
+
+ public MediaInfo()
+ {
+ Chapters = new ChapterInfo[] { };
+ Artists = new string[] {};
+ AlbumArtists = EmptyStringArray;
+ Studios = new string[] {};
+ Genres = new string[] {};
+ People = new BaseItemPerson[] { };
+ ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
+ }
+ }
+} \ No newline at end of file
diff --git a/MediaBrowser.Model/MediaInfo/MediaProtocol.cs b/MediaBrowser.Model/MediaInfo/MediaProtocol.cs
new file mode 100644
index 000000000..5882ecde0
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/MediaProtocol.cs
@@ -0,0 +1,13 @@
+namespace MediaBrowser.Model.MediaInfo
+{
+ public enum MediaProtocol
+ {
+ File = 0,
+ Http = 1,
+ Rtmp = 2,
+ Rtsp = 3,
+ Udp = 4,
+ Rtp = 5,
+ Ftp = 6
+ }
+} \ No newline at end of file
diff --git a/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs
new file mode 100644
index 000000000..c68c047f6
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/PlaybackInfoRequest.cs
@@ -0,0 +1,50 @@
+using MediaBrowser.Model.Dlna;
+using System.Collections.Generic;
+using System;
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class PlaybackInfoRequest
+ {
+ public Guid Id { get; set; }
+
+ public Guid UserId { get; set; }
+
+ public long? MaxStreamingBitrate { get; set; }
+
+ public long? StartTimeTicks { get; set; }
+
+ public int? AudioStreamIndex { get; set; }
+
+ public int? SubtitleStreamIndex { get; set; }
+
+ public int? MaxAudioChannels { get; set; }
+
+ public string MediaSourceId { get; set; }
+
+ public string LiveStreamId { get; set; }
+
+ public DeviceProfile DeviceProfile { get; set; }
+
+ public bool EnableDirectPlay { get; set; }
+ public bool EnableDirectStream { get; set; }
+ public bool EnableTranscoding { get; set; }
+ public bool AllowVideoStreamCopy { get; set; }
+ public bool AllowAudioStreamCopy { get; set; }
+ public bool IsPlayback { get; set; }
+ public bool AutoOpenLiveStream { get; set; }
+
+ public MediaProtocol[] DirectPlayProtocols { get; set; }
+
+ public PlaybackInfoRequest()
+ {
+ EnableDirectPlay = true;
+ EnableDirectStream = true;
+ EnableTranscoding = true;
+ AllowVideoStreamCopy = true;
+ AllowAudioStreamCopy = true;
+ IsPlayback = true;
+ DirectPlayProtocols = new MediaProtocol[] { MediaProtocol.Http };
+ }
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs b/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
new file mode 100644
index 000000000..b38fec7d4
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/PlaybackInfoResponse.cs
@@ -0,0 +1,32 @@
+using MediaBrowser.Model.Dlna;
+using MediaBrowser.Model.Dto;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class PlaybackInfoResponse
+ {
+ /// <summary>
+ /// Gets or sets the media sources.
+ /// </summary>
+ /// <value>The media sources.</value>
+ public MediaSourceInfo[] MediaSources { get; set; }
+
+ /// <summary>
+ /// Gets or sets the play session identifier.
+ /// </summary>
+ /// <value>The play session identifier.</value>
+ public string PlaySessionId { get; set; }
+
+ /// <summary>
+ /// Gets or sets the error code.
+ /// </summary>
+ /// <value>The error code.</value>
+ public PlaybackErrorCode? ErrorCode { get; set; }
+
+ public PlaybackInfoResponse()
+ {
+ MediaSources = new MediaSourceInfo[] { };
+ }
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs
new file mode 100644
index 000000000..60b0bb54d
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/SubtitleFormat.cs
@@ -0,0 +1,13 @@
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class SubtitleFormat
+ {
+ public const string SRT = "srt";
+ public const string SSA = "ssa";
+ public const string ASS = "ass";
+ public const string VTT = "vtt";
+ public const string SUB = "sub";
+ public const string SMI = "smi";
+ public const string TTML = "ttml";
+ }
+} \ No newline at end of file
diff --git a/MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs b/MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs
new file mode 100644
index 000000000..b4ab6ed97
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/SubtitleTrackEvent.cs
@@ -0,0 +1,11 @@
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class SubtitleTrackEvent
+ {
+ public string Id { get; set; }
+ public string Text { get; set; }
+ public long StartPositionTicks { get; set; }
+ public long EndPositionTicks { get; set; }
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs b/MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs
new file mode 100644
index 000000000..d3a3bb1d0
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/SubtitleTrackInfo.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class SubtitleTrackInfo
+ {
+ public SubtitleTrackEvent[] TrackEvents { get; set; }
+
+ public SubtitleTrackInfo()
+ {
+ TrackEvents = new SubtitleTrackEvent[] { };
+ }
+ }
+}
diff --git a/MediaBrowser.Model/MediaInfo/TransportStreamTimestamp.cs b/MediaBrowser.Model/MediaInfo/TransportStreamTimestamp.cs
new file mode 100644
index 000000000..4c808a8dc
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/TransportStreamTimestamp.cs
@@ -0,0 +1,9 @@
+namespace MediaBrowser.Model.MediaInfo
+{
+ public enum TransportStreamTimestamp
+ {
+ None,
+ Zero,
+ Valid
+ }
+} \ No newline at end of file
diff --git a/MediaBrowser.Model/MediaInfo/VideoCodec.cs b/MediaBrowser.Model/MediaInfo/VideoCodec.cs
new file mode 100644
index 000000000..81755dac9
--- /dev/null
+++ b/MediaBrowser.Model/MediaInfo/VideoCodec.cs
@@ -0,0 +1,14 @@
+namespace MediaBrowser.Model.MediaInfo
+{
+ public class VideoCodec
+ {
+ public const string H263 = "h263";
+ public const string H264 = "h264";
+ public const string H265 = "h265";
+ public const string MPEG4 = "mpeg4";
+ public const string MPEG1 = "mpeg1video";
+ public const string MPEG2 = "mpeg2video";
+ public const string MSMPEG4 = "msmpeg4";
+ public const string VC1 = "vc1";
+ }
+} \ No newline at end of file