remove trailing whitespace
This commit is contained in:
parent
ba1794f64b
commit
bd169e4fd4
|
@ -3,7 +3,7 @@ using System.Reflection;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("BDInfo")]
|
||||
|
@ -19,11 +19,11 @@ using System.Runtime.InteropServices;
|
|||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.1")]
|
|
@ -148,7 +148,7 @@ namespace BDInfo
|
|||
stream.IsVBR = true;
|
||||
stream.IsInitialized = true;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
stream.IsVBR = false;
|
||||
stream.IsInitialized = true;
|
||||
|
|
|
@ -22,9 +22,9 @@ namespace BDInfo
|
|||
{
|
||||
public abstract class TSCodecDTSHD
|
||||
{
|
||||
private static int[] SampleRates = new int[]
|
||||
private static int[] SampleRates = new int[]
|
||||
{ 0x1F40, 0x3E80, 0x7D00, 0x0FA00, 0x1F400, 0x5622, 0x0AC44, 0x15888, 0x2B110, 0x56220, 0x2EE0, 0x5DC0, 0x0BB80, 0x17700, 0x2EE00, 0x5DC00 };
|
||||
|
||||
|
||||
public static void Scan(
|
||||
TSAudioStream stream,
|
||||
TSStreamBuffer buffer,
|
||||
|
@ -131,7 +131,7 @@ namespace BDInfo
|
|||
else
|
||||
{
|
||||
AssetSizes[i] = buffer.ReadBits(16) + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < nuNumAssets; i++)
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ namespace BDInfo
|
|||
}
|
||||
stream.SampleRate = SampleRates[nuMaxSampleRate];
|
||||
stream.BitDepth = nuBitResolution;
|
||||
|
||||
|
||||
stream.LFE = 0;
|
||||
if ((nuSpkrActivityMask & 0x8) == 0x8)
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ namespace BDInfo
|
|||
stream.IsInitialized = true;
|
||||
}
|
||||
stream.IsInitialized = (stream.BitRate > 0 ? true : false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace BDInfo
|
|||
int pictureParse = 0;
|
||||
int sequenceHeaderParse = 0;
|
||||
int extensionParse = 0;
|
||||
int sequenceExtensionParse = 0;
|
||||
int sequenceExtensionParse = 0;
|
||||
|
||||
for (int i = 0; i < buffer.Length; i++)
|
||||
{
|
||||
|
@ -189,7 +189,7 @@ namespace BDInfo
|
|||
#if DEBUG
|
||||
if (sequenceExtensionParse == 0)
|
||||
{
|
||||
uint sequenceExtension =
|
||||
uint sequenceExtension =
|
||||
((parse & 0x8) >> 3);
|
||||
if (sequenceExtension == 0)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace BDInfo
|
|||
for (int i = 0; i < buffer.Length; i++)
|
||||
{
|
||||
sync = (sync << 8) + buffer.ReadByte();
|
||||
if (sync == 0xF8726FBA)
|
||||
if (sync == 0xF8726FBA)
|
||||
{
|
||||
syncFound = true;
|
||||
break;
|
||||
|
@ -63,7 +63,7 @@ namespace BDInfo
|
|||
int ratebits = buffer.ReadBits(4);
|
||||
if (ratebits != 0xF)
|
||||
{
|
||||
stream.SampleRate =
|
||||
stream.SampleRate =
|
||||
(((ratebits & 8) > 0 ? 44100 : 48000) << (ratebits & 7));
|
||||
}
|
||||
int temp1 = buffer.ReadBits(8);
|
||||
|
@ -149,9 +149,9 @@ namespace BDInfo
|
|||
int peak_bitrate = buffer.ReadBits(15);
|
||||
peak_bitrate = (peak_bitrate * stream.SampleRate) >> 4;
|
||||
|
||||
double peak_bitdepth =
|
||||
(double)peak_bitrate /
|
||||
(stream.ChannelCount + stream.LFE) /
|
||||
double peak_bitdepth =
|
||||
(double)peak_bitrate /
|
||||
(stream.ChannelCount + stream.LFE) /
|
||||
stream.SampleRate;
|
||||
if (peak_bitdepth > 14)
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ namespace BDInfo
|
|||
|
||||
#if DEBUG
|
||||
System.Diagnostics.Debug.WriteLine(string.Format(
|
||||
"{0}\t{1}\t{2:F2}",
|
||||
"{0}\t{1}\t{2:F2}",
|
||||
stream.PID, peak_bitrate, peak_bitdepth));
|
||||
#endif
|
||||
/*
|
||||
|
|
|
@ -50,18 +50,18 @@ namespace BDInfo
|
|||
{
|
||||
if ((parse & 0x80000000) == 0)
|
||||
{
|
||||
pictureType =
|
||||
pictureType =
|
||||
(uint)((parse & 0x78000000) >> 13);
|
||||
}
|
||||
else
|
||||
{
|
||||
pictureType =
|
||||
pictureType =
|
||||
(uint)((parse & 0x3c000000) >> 12);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pictureType =
|
||||
pictureType =
|
||||
(uint)((parse & 0xf0000000) >> 14);
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace BDInfo
|
|||
|
||||
public List<double> Chapters = new List<double>();
|
||||
|
||||
public Dictionary<ushort, TSStream> Streams =
|
||||
public Dictionary<ushort, TSStream> Streams =
|
||||
new Dictionary<ushort, TSStream>();
|
||||
public Dictionary<ushort, TSStream> PlaylistStreams =
|
||||
new Dictionary<ushort, TSStream>();
|
||||
|
@ -50,19 +50,19 @@ namespace BDInfo
|
|||
new List<TSStreamClip>();
|
||||
public List<Dictionary<ushort, TSStream>> AngleStreams =
|
||||
new List<Dictionary<ushort, TSStream>>();
|
||||
public List<Dictionary<double, TSStreamClip>> AngleClips =
|
||||
public List<Dictionary<double, TSStreamClip>> AngleClips =
|
||||
new List<Dictionary<double, TSStreamClip>>();
|
||||
public int AngleCount = 0;
|
||||
|
||||
public List<TSStream> SortedStreams =
|
||||
public List<TSStream> SortedStreams =
|
||||
new List<TSStream>();
|
||||
public List<TSVideoStream> VideoStreams =
|
||||
public List<TSVideoStream> VideoStreams =
|
||||
new List<TSVideoStream>();
|
||||
public List<TSAudioStream> AudioStreams =
|
||||
public List<TSAudioStream> AudioStreams =
|
||||
new List<TSAudioStream>();
|
||||
public List<TSTextStream> TextStreams =
|
||||
public List<TSTextStream> TextStreams =
|
||||
new List<TSTextStream>();
|
||||
public List<TSGraphicsStream> GraphicsStreams =
|
||||
public List<TSGraphicsStream> GraphicsStreams =
|
||||
new List<TSGraphicsStream>();
|
||||
|
||||
public TSPlaylistFile(
|
||||
|
@ -388,8 +388,8 @@ namespace BDInfo
|
|||
|
||||
#if DEBUG
|
||||
Debug.WriteLine(string.Format(
|
||||
"{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}",
|
||||
Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG,
|
||||
"{0} : {1} -> V:{2} A:{3} PG:{4} IG:{5} 2A:{6} 2V:{7} PIP:{8}",
|
||||
Name, streamFileName, streamCountVideo, streamCountAudio, streamCountPG, streamCountIG,
|
||||
streamCountSecondaryAudio, streamCountSecondaryVideo, streamCountPIP));
|
||||
#endif
|
||||
|
||||
|
@ -427,7 +427,7 @@ namespace BDInfo
|
|||
}
|
||||
/*
|
||||
* TODO
|
||||
*
|
||||
*
|
||||
for (int i = 0; i < streamCountPIP; i++)
|
||||
{
|
||||
TSStream stream = CreatePlaylistStream(data, ref pos);
|
||||
|
@ -955,7 +955,7 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
public int CompareVideoStreams(
|
||||
TSVideoStream x,
|
||||
TSVideoStream x,
|
||||
TSVideoStream y)
|
||||
{
|
||||
if (x == null && y == null)
|
||||
|
@ -996,7 +996,7 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
public int CompareAudioStreams(
|
||||
TSAudioStream x,
|
||||
TSAudioStream x,
|
||||
TSAudioStream y)
|
||||
{
|
||||
if (x == y)
|
||||
|
|
|
@ -109,7 +109,7 @@ namespace BDInfo
|
|||
|
||||
public TSDescriptor Clone()
|
||||
{
|
||||
TSDescriptor descriptor =
|
||||
TSDescriptor descriptor =
|
||||
new TSDescriptor(Name, (byte)Value.Length);
|
||||
Value.CopyTo(descriptor.Value, 0);
|
||||
return descriptor;
|
||||
|
@ -153,15 +153,15 @@ namespace BDInfo
|
|||
private string _LanguageCode;
|
||||
public string LanguageCode
|
||||
{
|
||||
get
|
||||
get
|
||||
{
|
||||
return _LanguageCode;
|
||||
return _LanguageCode;
|
||||
}
|
||||
set
|
||||
set
|
||||
{
|
||||
_LanguageCode = value;
|
||||
LanguageName = LanguageCodes.GetName(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsVideoStream
|
||||
|
@ -407,7 +407,7 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
public abstract TSStream Clone();
|
||||
|
||||
|
||||
protected void CopyTo(TSStream stream)
|
||||
{
|
||||
stream.PID = PID;
|
||||
|
@ -435,7 +435,7 @@ namespace BDInfo
|
|||
|
||||
public int Width;
|
||||
public int Height;
|
||||
public bool IsInterlaced;
|
||||
public bool IsInterlaced;
|
||||
public int FrameRateEnumerator;
|
||||
public int FrameRateDenominator;
|
||||
public TSAspectRatio AspectRatio;
|
||||
|
@ -581,7 +581,7 @@ namespace BDInfo
|
|||
stream.FrameRate = _FrameRate;
|
||||
stream.Width = Width;
|
||||
stream.Height = Height;
|
||||
stream.IsInterlaced = IsInterlaced;
|
||||
stream.IsInterlaced = IsInterlaced;
|
||||
stream.FrameRateEnumerator = FrameRateEnumerator;
|
||||
stream.FrameRateDenominator = FrameRateDenominator;
|
||||
stream.AspectRatio = AspectRatio;
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace BDInfo
|
|||
|
||||
byte[] fileType = new byte[8];
|
||||
Array.Copy(data, 0, fileType, 0, fileType.Length);
|
||||
|
||||
|
||||
FileType = _textEncoding.GetASCIIEncoding().GetString(fileType, 0, fileType.Length);
|
||||
if (FileType != "HDMV0100" &&
|
||||
FileType != "HDMV0200")
|
||||
|
@ -78,7 +78,7 @@ namespace BDInfo
|
|||
"Clip info file {0} has an unknown file type {1}.",
|
||||
FileInfo.Name, FileType));
|
||||
}
|
||||
#if DEBUG
|
||||
#if DEBUG
|
||||
Debug.WriteLine(string.Format(
|
||||
"\tFileType: {0}", FileType));
|
||||
#endif
|
||||
|
@ -110,9 +110,9 @@ namespace BDInfo
|
|||
TSStream stream = null;
|
||||
|
||||
ushort PID = (ushort)
|
||||
((clipData[streamOffset] << 8) +
|
||||
((clipData[streamOffset] << 8) +
|
||||
clipData[streamOffset + 1]);
|
||||
|
||||
|
||||
streamOffset += 2;
|
||||
|
||||
TSStreamType streamType = (TSStreamType)
|
||||
|
@ -240,7 +240,7 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
streamOffset += clipData[streamOffset] + 1;
|
||||
}
|
||||
}
|
||||
IsValid = true;
|
||||
}
|
||||
finally
|
||||
|
|
|
@ -391,7 +391,7 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
Dictionary<ushort, TSStream> playlistStreams = playlist.Streams;
|
||||
if (clip.AngleIndex > 0 &&
|
||||
if (clip.AngleIndex > 0 &&
|
||||
clip.AngleIndex < playlist.AngleStreams.Count + 1)
|
||||
{
|
||||
playlistStreams = playlist.AngleStreams[clip.AngleIndex - 1];
|
||||
|
@ -428,7 +428,7 @@ namespace BDInfo
|
|||
TSStream stream = Streams[PID];
|
||||
stream.PayloadBytes += streamState.WindowBytes;
|
||||
stream.PacketCount += streamState.WindowPackets;
|
||||
|
||||
|
||||
if (stream.IsVideoStream)
|
||||
{
|
||||
TSStreamDiagnostics diag = new TSStreamDiagnostics();
|
||||
|
@ -457,7 +457,7 @@ namespace BDInfo
|
|||
int dataSize = 16384;
|
||||
Stream fileStream = null;
|
||||
try
|
||||
{
|
||||
{
|
||||
string fileName;
|
||||
if (BDInfoSettings.EnableSSIF &&
|
||||
InterleavedFile != null)
|
||||
|
@ -482,13 +482,13 @@ namespace BDInfo
|
|||
StreamStates.Clear();
|
||||
StreamDiagnostics.Clear();
|
||||
|
||||
TSPacketParser parser =
|
||||
TSPacketParser parser =
|
||||
new TSPacketParser();
|
||||
|
||||
|
||||
long fileLength = (uint)fileStream.Length;
|
||||
byte[] buffer = new byte[dataSize];
|
||||
int bufferLength = 0;
|
||||
while ((bufferLength =
|
||||
while ((bufferLength =
|
||||
fileStream.Read(buffer, 0, buffer.Length)) > 0)
|
||||
{
|
||||
int offset = 0;
|
||||
|
@ -598,8 +598,8 @@ namespace BDInfo
|
|||
parser.StreamState.TransferCount++;
|
||||
|
||||
bool isFinished = ScanStream(
|
||||
parser.Stream,
|
||||
parser.StreamState,
|
||||
parser.Stream,
|
||||
parser.StreamState,
|
||||
parser.StreamState.StreamBuffer);
|
||||
|
||||
if (!isFullScan && isFinished)
|
||||
|
@ -680,10 +680,10 @@ namespace BDInfo
|
|||
for (int k = 0; k < (parser.PATOffset - 4); k += 4)
|
||||
{
|
||||
uint programNumber = (uint)
|
||||
((parser.PAT[k] << 8) +
|
||||
((parser.PAT[k] << 8) +
|
||||
parser.PAT[k + 1]);
|
||||
|
||||
ushort programPID = (ushort)
|
||||
ushort programPID = (ushort)
|
||||
(((parser.PAT[k + 2] & 0x1F) << 8) +
|
||||
parser.PAT[k + 3]);
|
||||
|
||||
|
@ -985,7 +985,7 @@ namespace BDInfo
|
|||
parser.PMTProgramDescriptorLength = buffer[i];
|
||||
parser.PMTProgramDescriptors.Add(
|
||||
new TSDescriptor(
|
||||
parser.PMTProgramDescriptor,
|
||||
parser.PMTProgramDescriptor,
|
||||
parser.PMTProgramDescriptorLength));
|
||||
break;
|
||||
}
|
||||
|
@ -998,7 +998,7 @@ namespace BDInfo
|
|||
parser.PMTProgramDescriptors.Count - 1];
|
||||
|
||||
int valueIndex =
|
||||
descriptor.Value.Length -
|
||||
descriptor.Value.Length -
|
||||
parser.PMTProgramDescriptorLength - 1;
|
||||
|
||||
descriptor.Value[valueIndex] = buffer[i];
|
||||
|
@ -1020,8 +1020,8 @@ namespace BDInfo
|
|||
parser.SyncState = false;
|
||||
}
|
||||
}
|
||||
else if (parser.Stream != null &&
|
||||
parser.StreamState != null &&
|
||||
else if (parser.Stream != null &&
|
||||
parser.StreamState != null &&
|
||||
parser.TransportScramblingControl == 0)
|
||||
{
|
||||
TSStream stream = parser.Stream;
|
||||
|
@ -1032,7 +1032,7 @@ namespace BDInfo
|
|||
|
||||
if (streamState.TransferState)
|
||||
{
|
||||
if ((bufferLength - i) >= streamState.PacketLength &&
|
||||
if ((bufferLength - i) >= streamState.PacketLength &&
|
||||
streamState.PacketLength > 0)
|
||||
{
|
||||
offset = streamState.PacketLength;
|
||||
|
@ -1085,7 +1085,7 @@ namespace BDInfo
|
|||
--parser.PacketLength;
|
||||
|
||||
bool headerFound = false;
|
||||
if (stream.IsVideoStream &&
|
||||
if (stream.IsVideoStream &&
|
||||
streamState.Parse == 0x000001FD)
|
||||
{
|
||||
headerFound = true;
|
||||
|
@ -1170,18 +1170,18 @@ namespace BDInfo
|
|||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 1:
|
||||
streamState.PESHeaderFlags =
|
||||
streamState.PESHeaderFlags =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 0:
|
||||
streamState.PESHeaderLength =
|
||||
streamState.PESHeaderLength =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
|
@ -1211,48 +1211,48 @@ namespace BDInfo
|
|||
switch (streamState.PTSParse)
|
||||
{
|
||||
case 4:
|
||||
streamState.PTSTemp =
|
||||
streamState.PTSTemp =
|
||||
((streamState.Parse & 0xE) << 29);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 3:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFF) << 22);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFE) << 14);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 1:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFF) << 7);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 0:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFE) >> 1);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
#endif
|
||||
streamState.PTS = streamState.PTSTemp;
|
||||
|
||||
if (streamState.PTS > streamState.PTSLast)
|
||||
|
@ -1260,13 +1260,13 @@ namespace BDInfo
|
|||
if (streamState.PTSLast > 0)
|
||||
{
|
||||
streamState.PTSTransfer = (streamState.PTS - streamState.PTSLast);
|
||||
}
|
||||
}
|
||||
streamState.PTSLast = streamState.PTS;
|
||||
}
|
||||
|
||||
streamState.PTSDiff = streamState.PTS - streamState.DTSPrev;
|
||||
|
||||
if (streamState.PTSCount > 0 &&
|
||||
if (streamState.PTSCount > 0 &&
|
||||
stream.IsVideoStream)
|
||||
{
|
||||
UpdateStreamBitrates(stream.PID, streamState.PTS, streamState.PTSDiff);
|
||||
|
@ -1280,7 +1280,7 @@ namespace BDInfo
|
|||
}
|
||||
Length = (double)(parser.PTSLast - parser.PTSFirst) / 90000;
|
||||
}
|
||||
|
||||
|
||||
streamState.DTSPrev = streamState.PTS;
|
||||
streamState.PTSCount++;
|
||||
if (streamState.PESHeaderLength == 0)
|
||||
|
@ -1299,46 +1299,46 @@ namespace BDInfo
|
|||
switch (streamState.DTSParse)
|
||||
{
|
||||
case 9:
|
||||
streamState.PTSTemp =
|
||||
streamState.PTSTemp =
|
||||
((streamState.Parse & 0xE) << 29);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 8:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFF) << 22);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 7:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFE) << 14);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 6:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFF) << 7);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 5:
|
||||
streamState.PTSTemp |=
|
||||
streamState.PTSTemp |=
|
||||
((streamState.Parse & 0xFE) >> 1);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
streamState.PTS = streamState.PTSTemp;
|
||||
|
@ -1347,48 +1347,48 @@ namespace BDInfo
|
|||
streamState.PTSLast = streamState.PTS;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 4:
|
||||
streamState.DTSTemp =
|
||||
streamState.DTSTemp =
|
||||
((streamState.Parse & 0xE) << 29);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 3:
|
||||
streamState.DTSTemp |=
|
||||
streamState.DTSTemp |=
|
||||
((streamState.Parse & 0xFF) << 22);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
streamState.DTSTemp |=
|
||||
streamState.DTSTemp |=
|
||||
((streamState.Parse & 0xFE) << 14);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 1:
|
||||
streamState.DTSTemp |=
|
||||
streamState.DTSTemp |=
|
||||
((streamState.Parse & 0xFF) << 7);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xFF);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case 0:
|
||||
streamState.DTSTemp |=
|
||||
streamState.DTSTemp |=
|
||||
((streamState.Parse & 0xFE) >> 1);
|
||||
#if DEBUG
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
streamState.PESHeader[streamState.PESHeaderIndex++] =
|
||||
(byte)(streamState.Parse & 0xff);
|
||||
#endif
|
||||
streamState.PTSDiff = streamState.DTSTemp - streamState.DTSPrev;
|
||||
|
@ -1482,8 +1482,8 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
private TSStream CreateStream(
|
||||
ushort streamPID,
|
||||
byte streamType,
|
||||
ushort streamPID,
|
||||
byte streamType,
|
||||
List<TSDescriptor> streamDescriptors)
|
||||
{
|
||||
TSStream stream = null;
|
||||
|
@ -1548,6 +1548,6 @@ namespace BDInfo
|
|||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace DvdLib.Ifo
|
|||
ProhibitedUserOperations = (UserOperation)br.ReadUInt32();
|
||||
AudioStreamControl = br.ReadBytes(16);
|
||||
SubpictureStreamControl = br.ReadBytes(128);
|
||||
|
||||
|
||||
_nextProgramNumber = br.ReadUInt16();
|
||||
_prevProgramNumber = br.ReadUInt16();
|
||||
_goupProgramNumber = br.ReadUInt16();
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace DvdLib.Ifo
|
|||
public ProgramChain EntryProgramChain { get; private set; }
|
||||
public readonly List<ProgramChain> ProgramChains;
|
||||
|
||||
public readonly List<Chapter> Chapters;
|
||||
public readonly List<Chapter> Chapters;
|
||||
|
||||
public Title(uint titleNum)
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Reflection;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DvdLib")]
|
||||
|
@ -19,11 +19,11 @@ using System.Runtime.InteropServices;
|
|||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.1")]
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
namespace Emby.Dlna.Common
|
||||
{
|
||||
{
|
||||
public class Argument
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
|
|
@ -77,7 +77,7 @@ namespace Emby.Dlna.ConnectionManager
|
|||
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
private ServiceAction GetCurrentConnectionInfo()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
{
|
||||
public string GetXml()
|
||||
{
|
||||
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(),
|
||||
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(),
|
||||
GetStateVariables());
|
||||
}
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ namespace Emby.Dlna.ContentDirectory
|
|||
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
private ServiceAction GetXSetBookmarkAction()
|
||||
{
|
||||
var action = new ServiceAction
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Emby.Dlna
|
|||
/// <param name="headers">The headers.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetServiceXml(IDictionary<string, string> headers);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Processes the control request.
|
||||
/// </summary>
|
||||
|
|
|
@ -75,11 +75,11 @@ namespace Emby.Dlna.Main
|
|||
IUserDataManager userDataManager,
|
||||
ILocalizationManager localizationManager,
|
||||
IMediaSourceManager mediaSourceManager,
|
||||
IDeviceDiscovery deviceDiscovery,
|
||||
IMediaEncoder mediaEncoder,
|
||||
ISocketFactory socketFactory,
|
||||
ITimerFactory timerFactory,
|
||||
IEnvironmentInfo environmentInfo,
|
||||
IDeviceDiscovery deviceDiscovery,
|
||||
IMediaEncoder mediaEncoder,
|
||||
ISocketFactory socketFactory,
|
||||
ITimerFactory timerFactory,
|
||||
IEnvironmentInfo environmentInfo,
|
||||
INetworkManager networkManager,
|
||||
IUserViewManager userViewManager,
|
||||
IXmlReaderSettingsFactory xmlReaderSettingsFactory,
|
||||
|
@ -104,19 +104,19 @@ namespace Emby.Dlna.Main
|
|||
_networkManager = networkManager;
|
||||
_logger = loggerFactory.CreateLogger("Dlna");
|
||||
|
||||
ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
|
||||
userDataManager,
|
||||
imageProcessor,
|
||||
libraryManager,
|
||||
config,
|
||||
userManager,
|
||||
_logger,
|
||||
httpClient,
|
||||
localizationManager,
|
||||
mediaSourceManager,
|
||||
ContentDirectory = new ContentDirectory.ContentDirectory(dlnaManager,
|
||||
userDataManager,
|
||||
imageProcessor,
|
||||
libraryManager,
|
||||
config,
|
||||
userManager,
|
||||
_logger,
|
||||
httpClient,
|
||||
localizationManager,
|
||||
mediaSourceManager,
|
||||
userViewManager,
|
||||
mediaEncoder,
|
||||
xmlReaderSettingsFactory,
|
||||
mediaEncoder,
|
||||
xmlReaderSettingsFactory,
|
||||
tvSeriesManager);
|
||||
|
||||
ConnectionManager = new ConnectionManager.ConnectionManager(dlnaManager, config, _logger, httpClient, xmlReaderSettingsFactory);
|
||||
|
@ -271,12 +271,12 @@ namespace Emby.Dlna.Main
|
|||
var device = new SsdpRootDevice
|
||||
{
|
||||
CacheLifetime = TimeSpan.FromSeconds(1800), //How long SSDP clients can cache this info.
|
||||
Location = uri, // Must point to the URL that serves your devices UPnP description document.
|
||||
Location = uri, // Must point to the URL that serves your devices UPnP description document.
|
||||
FriendlyName = "Jellyfin",
|
||||
Manufacturer = "Jellyfin",
|
||||
ModelName = "Jellyfin Server",
|
||||
Uuid = udn
|
||||
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
|
||||
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
|
||||
};
|
||||
|
||||
SetProperies(device, fullService);
|
||||
|
@ -297,7 +297,7 @@ namespace Emby.Dlna.Main
|
|||
Manufacturer = device.Manufacturer,
|
||||
ModelName = device.ModelName,
|
||||
Uuid = udn
|
||||
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
|
||||
// This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc.
|
||||
};
|
||||
|
||||
SetProperies(embeddedDevice, subDevice);
|
||||
|
|
|
@ -739,7 +739,7 @@ namespace Emby.Dlna.PlayTo
|
|||
|
||||
if (track == null)
|
||||
{
|
||||
//If track is null, some vendors do this, use GetMediaInfo instead
|
||||
//If track is null, some vendors do this, use GetMediaInfo instead
|
||||
return new Tuple<bool, uBaseObject>(true, null);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@ namespace Emby.Dlna.PlayTo
|
|||
_config = config;
|
||||
}
|
||||
|
||||
public async Task<XDocument> SendCommandAsync(string baseUrl,
|
||||
DeviceService service,
|
||||
string command,
|
||||
string postData,
|
||||
public async Task<XDocument> SendCommandAsync(string baseUrl,
|
||||
DeviceService service,
|
||||
string command,
|
||||
string postData,
|
||||
bool logRequest = true,
|
||||
string header = null)
|
||||
{
|
||||
|
@ -62,12 +62,12 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
|
||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||
|
||||
public async Task SubscribeAsync(string url,
|
||||
string ip,
|
||||
int port,
|
||||
string localIp,
|
||||
int eventport,
|
||||
|
||||
public async Task SubscribeAsync(string url,
|
||||
string ip,
|
||||
int port,
|
||||
string localIp,
|
||||
int eventport,
|
||||
int timeOut = 3600)
|
||||
{
|
||||
var options = new HttpRequestOptions
|
||||
|
@ -121,9 +121,9 @@ namespace Emby.Dlna.PlayTo
|
|||
}
|
||||
}
|
||||
|
||||
private Task<HttpResponseInfo> PostSoapDataAsync(string url,
|
||||
string soapAction,
|
||||
string postData,
|
||||
private Task<HttpResponseInfo> PostSoapDataAsync(string url,
|
||||
string soapAction,
|
||||
string postData,
|
||||
string header,
|
||||
bool logRequest,
|
||||
CancellationToken cancellationToken)
|
||||
|
|
|
@ -171,7 +171,7 @@ namespace Emby.Dlna.PlayTo
|
|||
if (state != null)
|
||||
{
|
||||
var sendValue = state.AllowedValues.FirstOrDefault(a => string.Equals(a, commandParameter, StringComparison.OrdinalIgnoreCase)) ??
|
||||
state.AllowedValues.FirstOrDefault() ??
|
||||
state.AllowedValues.FirstOrDefault() ??
|
||||
value;
|
||||
|
||||
return string.Format("<{0} xmlns:dt=\"urn:schemas-microsoft-com:datatypes\" dt:dt=\"{1}\">{2}</{0}>", argument.Name, state.DataType ?? "string", sendValue);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Emby.Dlna.PlayTo
|
||||
{
|
||||
public class uBaseObject
|
||||
public class uBaseObject
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Emby.Dlna.PlayTo
|
|||
|
||||
if (document == null)
|
||||
return list;
|
||||
|
||||
|
||||
var item = (from result in document.Descendants("Result") select result).FirstOrDefault();
|
||||
|
||||
if (item == null)
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Emby.Dlna.Profiles
|
|||
|
||||
EnableSingleAlbumArtLimit = true;
|
||||
EnableAlbumArtInDidl = true;
|
||||
|
||||
|
||||
TranscodingProfiles = new[]
|
||||
{
|
||||
new TranscodingProfile
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Reflection;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Emby.Dlna2")]
|
||||
|
@ -19,11 +19,11 @@ using System.Runtime.InteropServices;
|
|||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Emby.Dlna.Service
|
|||
protected BaseService(ILogger logger, IHttpClient httpClient)
|
||||
{
|
||||
Logger = logger;
|
||||
HttpClient = httpClient;
|
||||
HttpClient = httpClient;
|
||||
|
||||
EventManager = new EventManager(Logger, HttpClient);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Emby.Dlna.Service
|
|||
public class ControlErrorHandler
|
||||
{
|
||||
private const string NS_SOAPENV = "http://schemas.xmlsoap.org/soap/envelope/";
|
||||
|
||||
|
||||
public ControlResponse GetResponse(Exception ex)
|
||||
{
|
||||
var settings = new XmlWriterSettings
|
||||
|
|
|
@ -83,8 +83,8 @@ namespace Emby.Dlna.Ssdp
|
|||
{
|
||||
_deviceLocator = new SsdpDeviceLocator(_commsServer, _timerFactory);
|
||||
|
||||
// (Optional) Set the filter so we only see notifications for devices we care about
|
||||
// (can be any search target value i.e device type, uuid value etc - any value that appears in the
|
||||
// (Optional) Set the filter so we only see notifications for devices we care about
|
||||
// (can be any search target value i.e device type, uuid value etc - any value that appears in the
|
||||
// DiscoverdSsdpDevice.NotificationType property or that is used with the searchTarget parameter of the Search method).
|
||||
//_DeviceLocator.NotificationFilter = "upnp:rootdevice";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Reflection;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Emby.Drawing.Skia")]
|
||||
|
@ -19,7 +19,7 @@ using System.Runtime.InteropServices;
|
|||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
|
@ -103,7 +103,7 @@ namespace Emby.Drawing
|
|||
"crw",
|
||||
|
||||
// Remove until supported
|
||||
//"nef",
|
||||
//"nef",
|
||||
"orf",
|
||||
"pef",
|
||||
"arw",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Emby.Drawing")]
|
||||
|
@ -13,8 +13,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
|
@ -24,7 +24,7 @@ using System.Runtime.InteropServices;
|
|||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
|
@ -315,9 +315,9 @@ namespace IsoMounter
|
|||
);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
throw new ArgumentNullException(nameof(isoPath));
|
||||
|
||||
|
||||
}
|
||||
|
||||
try
|
||||
|
@ -397,9 +397,9 @@ namespace IsoMounter
|
|||
);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
throw new ArgumentNullException(nameof(mount));
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (GetUID() == 0) {
|
||||
|
@ -444,7 +444,7 @@ namespace IsoMounter
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal void OnUnmount(LinuxMount mount)
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace IsoMounter
|
|||
if (disposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (disposing) {
|
||||
|
||||
//
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Emby.Naming.AudioBook
|
|||
/// </summary>
|
||||
/// <value>The alternate versions.</value>
|
||||
public List<AudioBookFileInfo> AlternateVersions { get; set; }
|
||||
|
||||
|
||||
public AudioBookInfo()
|
||||
{
|
||||
Files = new List<AudioBookFileInfo>();
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace Emby.Naming.AudioBook
|
|||
|
||||
var parsingResult = new AudioBookFilePathParser(_options)
|
||||
.Parse(path, IsDirectory);
|
||||
|
||||
|
||||
return new AudioBookFileInfo
|
||||
{
|
||||
Path = path,
|
||||
|
|
|
@ -282,7 +282,7 @@ namespace Emby.Naming.Common
|
|||
new EpisodeExpression(@".*(\\|\/)(?<seriesname>((?![Ss]([0-9]+)[][ ._-]*[Ee]([0-9]+))[^\\\/])*)?[Ss](?<seasonnumber>[0-9]+)[][ ._-]*[Ee](?<epnumber>[0-9]+)([^\\/]*)$")
|
||||
{
|
||||
IsNamed = true
|
||||
},
|
||||
},
|
||||
// <!-- foo.ep01, foo.EP_01 -->
|
||||
new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"),
|
||||
new EpisodeExpression("([0-9]{4})[\\.-]([0-9]{2})[\\.-]([0-9]{2})", true)
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Emby.Naming.TV
|
|||
|
||||
var parsingResult = new EpisodePathParser(_options)
|
||||
.Parse(path, IsDirectory, isNamed, isOptimistic, supportsAbsoluteNumbers, fillExtendedInfo);
|
||||
|
||||
|
||||
return new EpisodeInfo
|
||||
{
|
||||
Path = path,
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace Emby.Naming.Video
|
|||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
var result = _options.CleanDateTimeRegexes.Select(i => Clean(name, i))
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace Emby.Naming.Video
|
|||
}
|
||||
stack.Files.Add(file2.FullName);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
// Sequel
|
||||
offset = 0;
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace Emby.Naming.Video
|
|||
{
|
||||
var result = new StubResult();
|
||||
var extension = Path.GetExtension(path) ?? string.Empty;
|
||||
|
||||
|
||||
if (_options.StubFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
result.IsStub = true;
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace Emby.Naming.Video
|
|||
/// Gets or sets the type of the stub.
|
||||
/// </summary>
|
||||
/// <value>The type of the stub.</value>
|
||||
public string StubType { get; set; }
|
||||
public string StubType { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the type.
|
||||
/// </summary>
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Emby.Naming.Video
|
|||
/// </summary>
|
||||
/// <value>The alternate versions.</value>
|
||||
public List<VideoFileInfo> AlternateVersions { get; set; }
|
||||
|
||||
|
||||
public VideoInfo()
|
||||
{
|
||||
Files = new List<VideoFileInfo>();
|
||||
|
|
|
@ -55,9 +55,9 @@ namespace Emby.Naming.Video
|
|||
|
||||
info.Year = info.Files.First().Year;
|
||||
|
||||
var extraBaseNames = new List<string>
|
||||
var extraBaseNames = new List<string>
|
||||
{
|
||||
stack.Name,
|
||||
stack.Name,
|
||||
Path.GetFileNameWithoutExtension(stack.Files[0])
|
||||
};
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Emby.Photos")]
|
||||
|
@ -14,8 +14,8 @@ using System.Runtime.InteropServices;
|
|||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
|
@ -25,10 +25,10 @@ using System.Runtime.InteropServices;
|
|||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
@ -1647,25 +1647,25 @@ namespace Emby.Server.Implementations
|
|||
// Gets all plugin assemblies by first reading all bytes of the .dll and calling Assembly.Load against that
|
||||
// This will prevent the .dll file from getting locked, and allow us to replace it when needed
|
||||
|
||||
// Include composable parts in the Api assembly
|
||||
// Include composable parts in the Api assembly
|
||||
list.Add(GetAssembly(typeof(ApiEntryPoint)));
|
||||
|
||||
// Include composable parts in the Dashboard assembly
|
||||
// Include composable parts in the Dashboard assembly
|
||||
list.Add(GetAssembly(typeof(DashboardService)));
|
||||
|
||||
// Include composable parts in the Model assembly
|
||||
// Include composable parts in the Model assembly
|
||||
list.Add(GetAssembly(typeof(SystemInfo)));
|
||||
|
||||
// Include composable parts in the Common assembly
|
||||
// Include composable parts in the Common assembly
|
||||
list.Add(GetAssembly(typeof(IApplicationHost)));
|
||||
|
||||
// Include composable parts in the Controller assembly
|
||||
// Include composable parts in the Controller assembly
|
||||
list.Add(GetAssembly(typeof(IServerApplicationHost)));
|
||||
|
||||
// Include composable parts in the Providers assembly
|
||||
// Include composable parts in the Providers assembly
|
||||
list.Add(GetAssembly(typeof(ProviderUtils)));
|
||||
|
||||
// Include composable parts in the Photos assembly
|
||||
// Include composable parts in the Photos assembly
|
||||
list.Add(GetAssembly(typeof(PhotoProvider)));
|
||||
|
||||
// Emby.Server implementations
|
||||
|
@ -1674,16 +1674,16 @@ namespace Emby.Server.Implementations
|
|||
// MediaEncoding
|
||||
list.Add(GetAssembly(typeof(MediaBrowser.MediaEncoding.Encoder.MediaEncoder)));
|
||||
|
||||
// Dlna
|
||||
// Dlna
|
||||
list.Add(GetAssembly(typeof(DlnaEntryPoint)));
|
||||
|
||||
// Local metadata
|
||||
// Local metadata
|
||||
list.Add(GetAssembly(typeof(BoxSetXmlSaver)));
|
||||
|
||||
// Notifications
|
||||
list.Add(GetAssembly(typeof(NotificationManager)));
|
||||
|
||||
// Xbmc
|
||||
// Xbmc
|
||||
list.Add(GetAssembly(typeof(ArtistNfoProvider)));
|
||||
|
||||
list.AddRange(GetAssembliesWithPartsInternal().Select(i => new Tuple<Assembly, string>(i, null)));
|
||||
|
@ -2219,7 +2219,7 @@ namespace Emby.Server.Implementations
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// This returns localhost in the case of no external dns, and the hostname if the
|
||||
/// This returns localhost in the case of no external dns, and the hostname if the
|
||||
/// dns is prefixed with a valid Uri prefix.
|
||||
/// </summary>
|
||||
/// <param name="externalDns">The external dns prefix to get the hostname of.</param>
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Emby.Server.Implementations.Browser
|
|||
}
|
||||
catch (NotSupportedException)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
|
|
@ -902,7 +902,7 @@ namespace Emby.Server.Implementations.Channels
|
|||
where T : BaseItem, new()
|
||||
{
|
||||
var id = _libraryManager.GetNewItemId(GetIdToHash(idString, channelName), typeof(T));
|
||||
|
||||
|
||||
T item = null;
|
||||
|
||||
try
|
||||
|
|
|
@ -70,8 +70,8 @@ namespace Emby.Server.Implementations.Channels
|
|||
/// </summary>
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
return new[] {
|
||||
|
||||
return new[] {
|
||||
|
||||
// Every so often
|
||||
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
|
||||
};
|
||||
|
|
|
@ -4038,7 +4038,7 @@ namespace Emby.Server.Implementations.Data
|
|||
|
||||
if (query.PersonIds.Length > 0)
|
||||
{
|
||||
// TODO: Should this query with CleanName ?
|
||||
// TODO: Should this query with CleanName ?
|
||||
|
||||
var clauses = new List<string>();
|
||||
var index = 0;
|
||||
|
@ -5399,7 +5399,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
|||
|
||||
var itemIdBlob = itemId.ToGuidBlob();
|
||||
|
||||
// First delete
|
||||
// First delete
|
||||
deleteAncestorsStatement.Reset();
|
||||
deleteAncestorsStatement.TryBind("@ItemId", itemIdBlob);
|
||||
deleteAncestorsStatement.MoveNext();
|
||||
|
@ -5927,7 +5927,7 @@ where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type
|
|||
|
||||
var guidBlob = itemId.ToGuidBlob();
|
||||
|
||||
// First delete
|
||||
// First delete
|
||||
db.Execute("delete from ItemValues where ItemId=@Id", guidBlob);
|
||||
|
||||
InsertItemValues(guidBlob, values, db);
|
||||
|
|
|
@ -144,7 +144,7 @@ namespace Emby.Server.Implementations.Devices
|
|||
HasUser = true
|
||||
|
||||
}).Items;
|
||||
|
||||
|
||||
// TODO: DeviceQuery doesn't seem to be used from client. Not even Swagger.
|
||||
if (query.SupportsSync.HasValue)
|
||||
{
|
||||
|
|
|
@ -471,7 +471,7 @@ namespace Emby.Server.Implementations.EntryPoints
|
|||
LibraryUpdateTimer.Dispose();
|
||||
LibraryUpdateTimer = null;
|
||||
}
|
||||
|
||||
|
||||
_libraryManager.ItemAdded -= libraryManager_ItemAdded;
|
||||
_libraryManager.ItemUpdated -= libraryManager_ItemUpdated;
|
||||
_libraryManager.ItemRemoved -= libraryManager_ItemRemoved;
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace Emby.Server.Implementations.FFMpeg
|
|||
{
|
||||
var encoderFilename = Path.GetFileName(info.EncoderPath);
|
||||
var probeFilename = Path.GetFileName(info.ProbePath);
|
||||
|
||||
|
||||
foreach (var directory in _fileSystem.GetDirectoryPaths(rootEncoderPath)
|
||||
.ToList())
|
||||
{
|
||||
|
|
|
@ -148,7 +148,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
}
|
||||
}
|
||||
|
||||
private string[] SkipLogExtensions = new string[]
|
||||
private string[] SkipLogExtensions = new string[]
|
||||
{
|
||||
".js",
|
||||
".html",
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies the request filters. Returns whether or not the request has been handled
|
||||
/// Applies the request filters. Returns whether or not the request has been handled
|
||||
/// and no more processing should be done.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
|
|
@ -265,7 +265,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the optimized result for the IRequestContext.
|
||||
/// Returns the optimized result for the IRequestContext.
|
||||
/// Does not use or store results in any cache.
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Emby.Server.Implementations.HttpServer
|
|||
/// </summary>
|
||||
/// <value>The web socket connecting.</value>
|
||||
Action<WebSocketConnectingEventArgs> WebSocketConnecting { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Starts this instance.
|
||||
/// </summary>
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace Emby.Server.Implementations.HttpServer.Security
|
|||
{
|
||||
info.Device = tokenInfo.DeviceName;
|
||||
}
|
||||
|
||||
|
||||
else if (!string.Equals(info.Device, tokenInfo.DeviceName, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (allowTokenInfoUpdate)
|
||||
|
|
|
@ -164,7 +164,7 @@ namespace Emby.Server.Implementations.IO
|
|||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
// For now swallow and log.
|
||||
// For now swallow and log.
|
||||
// Research item: If an IOException occurs, the item may be in a disconnected state (media unavailable)
|
||||
// Should we remove it from it's parent?
|
||||
Logger.LogError(ex, "Error refreshing {name}", item.Name);
|
||||
|
|
|
@ -159,7 +159,7 @@ namespace Emby.Server.Implementations.IO
|
|||
var firstChar = filePath[0];
|
||||
if (firstChar == '/')
|
||||
{
|
||||
// For this we don't really know.
|
||||
// For this we don't really know.
|
||||
return filePath;
|
||||
}
|
||||
if (firstChar == '\\') //relative path
|
||||
|
|
|
@ -818,7 +818,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
public BaseItem FindByPath(string path, bool? isFolder)
|
||||
{
|
||||
// If this returns multiple items it could be tricky figuring out which one is correct.
|
||||
// If this returns multiple items it could be tricky figuring out which one is correct.
|
||||
// In most cases, the newest one will be and the others obsolete but not yet cleaned up
|
||||
|
||||
if (string.IsNullOrEmpty(path))
|
||||
|
@ -1699,7 +1699,7 @@ namespace Emby.Server.Implementations.Library
|
|||
{
|
||||
try
|
||||
{
|
||||
// Try to resolve the path into a video
|
||||
// Try to resolve the path into a video
|
||||
video = ResolvePath(_fileSystem.GetFileSystemInfo(info.Path)) as Video;
|
||||
|
||||
if (video == null)
|
||||
|
|
|
@ -231,7 +231,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
|
|||
}
|
||||
|
||||
var firstMedia = resolvedItem.Files.First();
|
||||
|
||||
|
||||
var libraryItem = new T
|
||||
{
|
||||
Path = firstMedia.Path,
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
|
|||
{
|
||||
// Behind special folder resolver
|
||||
return ResolverPriority.Second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Audio
|
|||
{
|
||||
// Behind special folder resolver
|
||||
return ResolverPriority.Second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
|||
where TVideoType : Video, new()
|
||||
{
|
||||
var namingOptions = ((LibraryManager)LibraryManager).GetNamingOptions();
|
||||
|
||||
|
||||
// If the path is a file check for a matching extensions
|
||||
var parser = new Emby.Naming.Video.VideoResolver(namingOptions);
|
||||
|
||||
|
@ -120,7 +120,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
|||
|
||||
if (video != null)
|
||||
{
|
||||
video.Name = parseName ?
|
||||
video.Name = parseName ?
|
||||
videoInfo.Name :
|
||||
Path.GetFileName(args.Path);
|
||||
|
||||
|
@ -150,7 +150,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
|||
};
|
||||
|
||||
SetVideoType(video, videoInfo);
|
||||
|
||||
|
||||
video.Name = parseName ?
|
||||
videoInfo.Name :
|
||||
Path.GetFileNameWithoutExtension(args.Path);
|
||||
|
@ -281,7 +281,7 @@ namespace Emby.Server.Implementations.Library.Resolvers
|
|||
{
|
||||
return string.Equals(name, "video_ts.ifo", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether [is blu ray directory] [the specified directory name].
|
||||
/// </summary>
|
||||
|
|
|
@ -8,14 +8,14 @@ using MediaBrowser.Model.Entities;
|
|||
namespace Emby.Server.Implementations.Library.Resolvers.Books
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
public class BookResolver : MediaBrowser.Controller.Resolvers.ItemResolver<Book>
|
||||
{
|
||||
private readonly string[] _validExtensions = { ".pdf", ".epub", ".mobi", ".cbr", ".cbz", ".azw3" };
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
|
@ -48,7 +48,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Books
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
|
|||
get
|
||||
{
|
||||
// Give plugins a chance to catch iso's first
|
||||
// Also since we have to loop through child files looking for videos,
|
||||
// Also since we have to loop through child files looking for videos,
|
||||
// see if we can avoid some of that by letting other resolvers claim folders first
|
||||
// Also run after series resolver
|
||||
return ResolverPriority.Third;
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
|||
}
|
||||
|
||||
var season = parent as Season;
|
||||
// Just in case the user decided to nest episodes.
|
||||
// Just in case the user decided to nest episodes.
|
||||
// Not officially supported but in some cases we can handle it.
|
||||
if (season == null)
|
||||
{
|
||||
|
@ -36,8 +36,8 @@ namespace Emby.Server.Implementations.Library.Resolvers.TV
|
|||
|
||||
// If the parent is a Season or Series, then this is an Episode if the VideoResolver returns something
|
||||
// Also handle flat tv folders
|
||||
if (season != null ||
|
||||
string.Equals(args.GetCollectionType(), CollectionType.TvShows, StringComparison.OrdinalIgnoreCase) ||
|
||||
if (season != null ||
|
||||
string.Equals(args.GetCollectionType(), CollectionType.TvShows, StringComparison.OrdinalIgnoreCase) ||
|
||||
args.HasParent<Series>())
|
||||
{
|
||||
var episode = ResolveVideo<Episode>(args, false);
|
||||
|
|
|
@ -282,7 +282,7 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
if (includeItemTypes.Length == 0)
|
||||
{
|
||||
// Handle situations with the grouping setting, e.g. movies showing up in tv, etc.
|
||||
// Handle situations with the grouping setting, e.g. movies showing up in tv, etc.
|
||||
// Thanks to mixed content libraries included in the UserView
|
||||
var hasCollectionType = parents.OfType<UserView>().ToArray();
|
||||
if (hasCollectionType.Length > 0)
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace Emby.Server.Implementations.Library.Validators
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
_logger.LogInformation("Deleting dead {2} {0} {1}.", item.Id.ToString("N"), item.Name, item.GetType().Name);
|
||||
|
||||
_libraryManager.DeleteItem(item, new DeleteOptions
|
||||
|
|
|
@ -1055,7 +1055,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
{
|
||||
_logger.LogInformation("Streaming Channel " + channelId);
|
||||
|
||||
var result = string.IsNullOrEmpty(streamId) ?
|
||||
var result = string.IsNullOrEmpty(streamId) ?
|
||||
null :
|
||||
currentLiveStreams.FirstOrDefault(i => string.Equals(i.OriginalStreamId, streamId, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
|
|
|
@ -214,13 +214,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||
|
||||
var outputParam = string.Empty;
|
||||
|
||||
var commandLineArgs = string.Format("-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4}{6} -y \"{1}\"",
|
||||
inputTempFile,
|
||||
targetFile,
|
||||
videoArgs,
|
||||
GetAudioArgs(mediaSource),
|
||||
subtitleArgs,
|
||||
durationParam,
|
||||
var commandLineArgs = string.Format("-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4}{6} -y \"{1}\"",
|
||||
inputTempFile,
|
||||
targetFile,
|
||||
videoArgs,
|
||||
GetAudioArgs(mediaSource),
|
||||
subtitleArgs,
|
||||
durationParam,
|
||||
outputParam);
|
||||
|
||||
return inputModifier + " " + commandLineArgs;
|
||||
|
|
|
@ -1993,7 +1993,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
Name = program.Name,
|
||||
OfficialRating = program.OfficialRating
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (service == null)
|
||||
{
|
||||
|
|
|
@ -48,8 +48,8 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
return new[] {
|
||||
|
||||
return new[] {
|
||||
|
||||
// Every so often
|
||||
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
|
||||
};
|
||||
|
|
|
@ -275,7 +275,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|||
for (int i = 0; i < model.TunerCount; ++i)
|
||||
{
|
||||
var name = String.Format("Tuner {0}", i + 1);
|
||||
var currentChannel = "none"; /// @todo Get current channel and map back to Station Id
|
||||
var currentChannel = "none"; /// @todo Get current channel and map back to Station Id
|
||||
var isAvailable = await manager.CheckTunerAvailability(ipInfo, i, cancellationToken).ConfigureAwait(false);
|
||||
LiveTvTunerStatus status = isAvailable ? LiveTvTunerStatus.Available : LiveTvTunerStatus.LiveTv;
|
||||
tuners.Add(new LiveTvTunerInfo
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Localization
|
|||
catch (ArgumentException)
|
||||
{
|
||||
// will throw if input contains invalid unicode chars
|
||||
// https://mnaoumov.wordpress.com/2014/06/14/stripping-invalid-characters-from-utf-16-strings/
|
||||
// https://mnaoumov.wordpress.com/2014/06/14/stripping-invalid-characters-from-utf-16-strings/
|
||||
text = StripInvalidUnicodeCharacters(text);
|
||||
return Normalize(text, form, false);
|
||||
}
|
||||
|
|
|
@ -122,28 +122,28 @@ namespace System.Net
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// Reverse a Positive BigInteger ONLY
|
||||
/// Bitwise ~ operator
|
||||
///
|
||||
///
|
||||
/// Input : FF FF FF FF
|
||||
/// Width : 4
|
||||
/// Result : 00 00 00 00
|
||||
///
|
||||
///
|
||||
/// Result : 00 00 00 00
|
||||
///
|
||||
///
|
||||
/// Input : 00 00 00 00
|
||||
/// Width : 4
|
||||
/// Result : FF FF FF FF
|
||||
///
|
||||
/// Result : FF FF FF FF
|
||||
///
|
||||
/// Input : FF FF FF FF
|
||||
/// Width : 8
|
||||
/// Result : FF FF FF FF 00 00 00 00
|
||||
///
|
||||
///
|
||||
///
|
||||
///
|
||||
/// Input : 00 00 00 00
|
||||
/// Width : 8
|
||||
/// Result : FF FF FF FF FF FF FF FF
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="width"></param>
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Reflection;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Emby.Server.Implementations")]
|
||||
|
@ -19,10 +19,10 @@ using System.Runtime.InteropServices;
|
|||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
@ -35,8 +35,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||
/// </summary>
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
// Every so often
|
||||
new TaskTriggerInfo
|
||||
{
|
||||
|
|
|
@ -36,8 +36,8 @@ namespace Emby.Server.Implementations.ScheduledTasks
|
|||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
return new[] {
|
||||
|
||||
return new[] {
|
||||
|
||||
// Every so often
|
||||
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(12).Ticks}
|
||||
};
|
||||
|
|
|
@ -42,8 +42,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
return new[] {
|
||||
|
||||
return new[] {
|
||||
|
||||
// Every so often
|
||||
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
|
||||
};
|
||||
|
|
|
@ -38,8 +38,8 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
|
|||
/// <returns>IEnumerable{BaseTaskTrigger}.</returns>
|
||||
public IEnumerable<TaskTriggerInfo> GetDefaultTriggers()
|
||||
{
|
||||
return new[] {
|
||||
|
||||
return new[] {
|
||||
|
||||
// Every so often
|
||||
new TaskTriggerInfo { Type = TaskTriggerInfo.TriggerInterval, IntervalTicks = TimeSpan.FromHours(24).Ticks}
|
||||
};
|
||||
|
|
|
@ -171,7 +171,7 @@ namespace Emby.Server.Implementations.Security
|
|||
//build our array
|
||||
var lines = new List<string>
|
||||
{
|
||||
RegKey,
|
||||
RegKey,
|
||||
|
||||
// Legacy key
|
||||
string.Empty
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Emby.Server.Implementations.Services
|
|||
return deserializer(requestType, httpReq.InputStream);
|
||||
}
|
||||
}
|
||||
return Task.FromResult(host.CreateInstance(requestType));
|
||||
return Task.FromResult(host.CreateInstance(requestType));
|
||||
}
|
||||
|
||||
public static RestPath FindMatchingRestPath(string httpMethod, string pathInfo, out string contentType)
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace Emby.Server.Implementations.Services
|
|||
public int PathComponentsCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The total number of segments after subparts have been exploded ('.')
|
||||
/// The total number of segments after subparts have been exploded ('.')
|
||||
/// e.g. /path/to/here.ext == 4
|
||||
/// </summary>
|
||||
public int TotalComponentsCount { get; set; }
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Emby.Server.Implementations.Services
|
|||
/// <summary>
|
||||
/// Donated by Ivan Korneliuk from his post:
|
||||
/// http://korneliuk.blogspot.com/2012/08/servicestack-reusing-dtos.html
|
||||
///
|
||||
///
|
||||
/// Modified to only allow using routes matching the supplied HTTP Verb
|
||||
/// </summary>
|
||||
public static class UrlExtensions
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace Emby.Server.Implementations.Sorting
|
|||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Compares the specified x.
|
||||
/// </summary>
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Emby.Server.Implementations.Sorting
|
|||
/// </summary>
|
||||
/// <value>The user data repository.</value>
|
||||
public IUserDataManager UserDataRepository { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the user manager.
|
||||
/// </summary>
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Emby.Server.Implementations.Sorting
|
|||
{
|
||||
return x.PremiereDate.Value;
|
||||
}
|
||||
|
||||
|
||||
if (x.ProductionYear.HasValue)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace NLangDetect.Core.Extensions
|
|||
if (end < 0) throw new ArgumentOutOfRangeException("end", "Argument must not be negative.");
|
||||
if (end > s.Length) throw new ArgumentOutOfRangeException("end", "Argument must not be greater than the input string's length.");
|
||||
if (start > end) throw new ArgumentOutOfRangeException("start", "Argument must not be greater than the 'end' argument.");
|
||||
|
||||
|
||||
return s.Substring(start, end - start);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
namespace Emby.Server.Implementations.TextEncoding
|
||||
{
|
||||
// Copyright 2015-2016 Jonathan Bennett <jon@autoitscript.com>
|
||||
//
|
||||
// https://www.autoitscript.com
|
||||
//
|
||||
// https://www.autoitscript.com
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
@ -166,7 +166,7 @@
|
|||
return encoding;
|
||||
}
|
||||
|
||||
// Now try UTF16
|
||||
// Now try UTF16
|
||||
encoding = CheckUtf16NewlineChars(buffer, size);
|
||||
if (encoding != CharacterEncoding.None)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ using System.IO;
|
|||
namespace UniversalDetector
|
||||
{
|
||||
/// <summary>
|
||||
/// Default implementation of charset detection interface.
|
||||
/// Default implementation of charset detection interface.
|
||||
/// The detector can be fed by a System.IO.Stream:
|
||||
/// <example>
|
||||
/// <code>
|
||||
|
@ -52,9 +52,9 @@ namespace UniversalDetector
|
|||
/// Console.WriteLine("{0}, {1}", cdet.Charset, cdet.Confidence);
|
||||
/// </code>
|
||||
/// </example>
|
||||
///
|
||||
///
|
||||
/// or by a byte a array:
|
||||
///
|
||||
///
|
||||
/// <example>
|
||||
/// <code>
|
||||
/// byte[] buff = new byte[1024];
|
||||
|
@ -64,23 +64,23 @@ namespace UniversalDetector
|
|||
/// cdet.DataEnd();
|
||||
/// Console.WriteLine("{0}, {1}", cdet.Charset, cdet.Confidence);
|
||||
/// </code>
|
||||
/// </example>
|
||||
/// </summary>
|
||||
/// </example>
|
||||
/// </summary>
|
||||
public class CharsetDetector : Core.UniversalDetector, ICharsetDetector
|
||||
{
|
||||
private string charset;
|
||||
|
||||
|
||||
private float confidence;
|
||||
|
||||
|
||||
//public event DetectorFinished Finished;
|
||||
|
||||
|
||||
public CharsetDetector() : base(FILTER_ALL)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void Feed(Stream stream)
|
||||
{
|
||||
{
|
||||
byte[] buff = new byte[1024];
|
||||
int read;
|
||||
while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !done)
|
||||
|
@ -88,19 +88,19 @@ namespace UniversalDetector
|
|||
Feed(buff, 0, read);
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsDone()
|
||||
|
||||
public bool IsDone()
|
||||
{
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
this.charset = null;
|
||||
this.confidence = 0.0f;
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
|
||||
public string Charset {
|
||||
get { return charset; }
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ namespace UniversalDetector
|
|||
public float Confidence {
|
||||
get { return confidence; }
|
||||
}
|
||||
|
||||
|
||||
protected override void Report(string charset, float confidence)
|
||||
{
|
||||
this.charset = charset;
|
||||
|
@ -118,7 +118,7 @@ namespace UniversalDetector
|
|||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//public delegate void DetectorFinished(string charset, float confidence);
|
||||
|
||||
}
|
||||
|
|
|
@ -44,12 +44,12 @@ namespace UniversalDetector.Core
|
|||
private CodingStateMachine codingSM;
|
||||
private BIG5DistributionAnalyser distributionAnalyser;
|
||||
private byte[] lastChar = new byte[2];
|
||||
|
||||
|
||||
public Big5Prober()
|
||||
{
|
||||
this.codingSM = new CodingStateMachine(new BIG5SMModel());
|
||||
this.distributionAnalyser = new BIG5DistributionAnalyser();
|
||||
this.Reset();
|
||||
this.Reset();
|
||||
}
|
||||
|
||||
public override ProbingState HandleData(byte[] buf, int offset, int len)
|
||||
|
@ -73,7 +73,7 @@ namespace UniversalDetector.Core
|
|||
lastChar[1] = buf[offset];
|
||||
distributionAnalyser.HandleOneChar(lastChar, 0, charLen);
|
||||
} else {
|
||||
distributionAnalyser.HandleOneChar(buf, i-1, charLen);
|
||||
distributionAnalyser.HandleOneChar(buf, i-1, charLen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,23 +84,23 @@ namespace UniversalDetector.Core
|
|||
state = ProbingState.FoundIt;
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
codingSM.Reset();
|
||||
codingSM.Reset();
|
||||
state = ProbingState.Detecting;
|
||||
distributionAnalyser.Reset();
|
||||
}
|
||||
|
||||
|
||||
public override string GetCharsetName()
|
||||
{
|
||||
return "Big-5";
|
||||
return "Big-5";
|
||||
}
|
||||
|
||||
|
||||
public override float GetConfidence()
|
||||
{
|
||||
return distributionAnalyser.GetConfidence();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,15 +43,15 @@ namespace UniversalDetector.Core
|
|||
public static int INDEX_SHIFT_4BITS = 3;
|
||||
public static int INDEX_SHIFT_8BITS = 2;
|
||||
public static int INDEX_SHIFT_16BITS = 1;
|
||||
|
||||
|
||||
public static int SHIFT_MASK_4BITS = 7;
|
||||
public static int SHIFT_MASK_8BITS = 3;
|
||||
public static int SHIFT_MASK_16BITS = 1;
|
||||
|
||||
|
||||
public static int BIT_SHIFT_4BITS = 2;
|
||||
public static int BIT_SHIFT_8BITS = 3;
|
||||
public static int BIT_SHIFT_16BITS = 4;
|
||||
|
||||
|
||||
public static int UNIT_MASK_4BITS = 0x0000000F;
|
||||
public static int UNIT_MASK_8BITS = 0x000000FF;
|
||||
public static int UNIT_MASK_16BITS = 0x0000FFFF;
|
||||
|
@ -61,7 +61,7 @@ namespace UniversalDetector.Core
|
|||
private int bitShift;
|
||||
private int unitMask;
|
||||
private int[] data;
|
||||
|
||||
|
||||
public BitPackage(int indexShift, int shiftMask,
|
||||
int bitShift, int unitMask, int[] data)
|
||||
{
|
||||
|
@ -71,27 +71,27 @@ namespace UniversalDetector.Core
|
|||
this.unitMask = unitMask;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
||||
public static int Pack16bits(int a, int b)
|
||||
{
|
||||
return ((b << 16) | a);
|
||||
}
|
||||
|
||||
|
||||
public static int Pack8bits(int a, int b, int c, int d)
|
||||
{
|
||||
return Pack16bits((b << 8) | a, (d << 8) | c);
|
||||
}
|
||||
|
||||
public static int Pack4bits(int a, int b, int c, int d,
|
||||
|
||||
public static int Pack4bits(int a, int b, int c, int d,
|
||||
int e, int f, int g, int h)
|
||||
{
|
||||
return Pack8bits((b << 4) | a, (d << 4) | c,
|
||||
(f << 4) | e, (h << 4) | g);
|
||||
}
|
||||
|
||||
|
||||
public int Unpack(int i)
|
||||
{
|
||||
return (data[i >> indexShift] >>
|
||||
return (data[i >> indexShift] >>
|
||||
((i & shiftMask) << bitShift)) & unitMask;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Contributor(s):
|
||||
* Shy Shalom <shooshX@gmail.com>
|
||||
* Rudi Pettazzi <rudi.pettazzi@gmail.com> (C# port)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
|
@ -40,10 +40,10 @@ using System.IO;
|
|||
|
||||
namespace UniversalDetector.Core
|
||||
{
|
||||
public enum ProbingState {
|
||||
public enum ProbingState {
|
||||
Detecting = 0, // no sure answer yet, but caller can ask for confidence
|
||||
FoundIt = 1, // positive answer
|
||||
NotMe = 2 // negative answer
|
||||
NotMe = 2 // negative answer
|
||||
};
|
||||
|
||||
public abstract class CharsetProber
|
||||
|
@ -51,16 +51,16 @@ namespace UniversalDetector.Core
|
|||
protected const float SHORTCUT_THRESHOLD = 0.95F;
|
||||
|
||||
protected ProbingState state;
|
||||
|
||||
|
||||
// ASCII codes
|
||||
private const byte SPACE = 0x20;
|
||||
private const byte CAPITAL_A = 0x41;
|
||||
private const byte CAPITAL_Z = 0x5A;
|
||||
private const byte SMALL_A = 0x61;
|
||||
private const byte SMALL_Z = 0x7A;
|
||||
private const byte LESS_THAN = 0x3C;
|
||||
private const byte LESS_THAN = 0x3C;
|
||||
private const byte GREATER_THAN = 0x3E;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Feed data to the prober
|
||||
/// </summary>
|
||||
|
@ -71,44 +71,44 @@ namespace UniversalDetector.Core
|
|||
/// A <see cref="ProbingState"/>
|
||||
/// </returns>
|
||||
public abstract ProbingState HandleData(byte[] buf, int offset, int len);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Reset prober state
|
||||
/// </summary>
|
||||
public abstract void Reset();
|
||||
|
||||
public abstract string GetCharsetName();
|
||||
|
||||
|
||||
public abstract float GetConfidence();
|
||||
|
||||
|
||||
public virtual ProbingState GetState()
|
||||
{
|
||||
return state;
|
||||
}
|
||||
|
||||
public virtual void SetOption()
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void DumpStatus()
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Helper functions used in the Latin1 and Group probers
|
||||
//
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns>filtered buffer</returns>
|
||||
protected static byte[] FilterWithoutEnglishLetters(byte[] buf, int offset, int len)
|
||||
protected static byte[] FilterWithoutEnglishLetters(byte[] buf, int offset, int len)
|
||||
{
|
||||
byte[] result = null;
|
||||
|
||||
using (MemoryStream ms = new MemoryStream(buf.Length)) {
|
||||
|
||||
|
||||
bool meetMSB = false;
|
||||
int max = offset + len;
|
||||
int prev = offset;
|
||||
|
@ -140,8 +140,8 @@ namespace UniversalDetector.Core
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Do filtering to reduce load to probers (Remove ASCII symbols,
|
||||
/// collapse spaces). This filter applies to all scripts which contain
|
||||
/// Do filtering to reduce load to probers (Remove ASCII symbols,
|
||||
/// collapse spaces). This filter applies to all scripts which contain
|
||||
/// both English characters and upper ASCII characters.
|
||||
/// </summary>
|
||||
/// <returns>a filtered copy of the input buffer</returns>
|
||||
|
@ -150,16 +150,16 @@ namespace UniversalDetector.Core
|
|||
byte[] result = null;
|
||||
|
||||
using (MemoryStream ms = new MemoryStream(buf.Length)) {
|
||||
|
||||
|
||||
bool inTag = false;
|
||||
int max = offset + len;
|
||||
int prev = offset;
|
||||
int cur = offset;
|
||||
|
||||
while (cur < max) {
|
||||
|
||||
|
||||
byte b = buf[cur];
|
||||
|
||||
|
||||
if (b == GREATER_THAN)
|
||||
inTag = false;
|
||||
else if (b == LESS_THAN)
|
||||
|
@ -177,7 +177,7 @@ namespace UniversalDetector.Core
|
|||
cur++;
|
||||
}
|
||||
|
||||
// If the current segment contains more than just a symbol
|
||||
// If the current segment contains more than just a symbol
|
||||
// and it is not inside a tag then keep it.
|
||||
if (!inTag && cur > prev)
|
||||
ms.Write(buf, prev, cur - prev);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
*
|
||||
* Contributor(s):
|
||||
* Rudi Pettazzi <rudi.pettazzi@gmail.com> (C# port)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
|
@ -40,47 +40,47 @@ namespace UniversalDetector.Core
|
|||
public static class Charsets
|
||||
{
|
||||
public const string ASCII = "ASCII";
|
||||
|
||||
|
||||
public const string UTF8 = "UTF-8";
|
||||
|
||||
|
||||
public const string UTF16_LE = "UTF-16LE";
|
||||
|
||||
|
||||
public const string UTF16_BE = "UTF-16BE";
|
||||
|
||||
|
||||
public const string UTF32_BE = "UTF-32BE";
|
||||
|
||||
|
||||
public const string UTF32_LE = "UTF-32LE";
|
||||
|
||||
/// <summary>
|
||||
/// Unusual BOM (3412 order)
|
||||
/// </summary>
|
||||
public const string UCS4_3412 = "X-ISO-10646-UCS-4-3412";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Unusual BOM (2413 order)
|
||||
/// </summary>
|
||||
public const string UCS4_2413 = "X-ISO-10646-UCS-4-2413";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Cyrillic (based on bulgarian and russian data)
|
||||
/// </summary>
|
||||
public const string WIN1251 = "windows-1251";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Latin-1, almost identical to ISO-8859-1
|
||||
/// </summary>
|
||||
public const string WIN1252 = "windows-1252";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Greek
|
||||
/// </summary>
|
||||
public const string WIN1253 = "windows-1253";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Logical hebrew (includes ISO-8859-8-I and most of x-mac-hebrew)
|
||||
/// </summary>
|
||||
public const string WIN1255 = "windows-1255";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Traditional chinese
|
||||
/// </summary>
|
||||
|
@ -89,7 +89,7 @@ namespace UniversalDetector.Core
|
|||
public const string EUCKR = "EUC-KR";
|
||||
|
||||
public const string EUCJP = "EUC-JP";
|
||||
|
||||
|
||||
public const string EUCTW = "EUC-TW";
|
||||
|
||||
/// <summary>
|
||||
|
@ -98,11 +98,11 @@ namespace UniversalDetector.Core
|
|||
public const string GB18030 = "gb18030";
|
||||
|
||||
public const string ISO2022_JP = "ISO-2022-JP";
|
||||
|
||||
|
||||
public const string ISO2022_CN = "ISO-2022-CN";
|
||||
|
||||
|
||||
public const string ISO2022_KR = "ISO-2022-KR";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Simplified chinese
|
||||
/// </summary>
|
||||
|
@ -111,15 +111,15 @@ namespace UniversalDetector.Core
|
|||
public const string SHIFT_JIS = "Shift-JIS";
|
||||
|
||||
public const string MAC_CYRILLIC = "x-mac-cyrillic";
|
||||
|
||||
|
||||
public const string KOI8R = "KOI8-R";
|
||||
|
||||
|
||||
public const string IBM855 = "IBM855";
|
||||
|
||||
|
||||
public const string IBM866 = "IBM866";
|
||||
|
||||
/// <summary>
|
||||
/// East-Europe. Disabled because too similar to windows-1252
|
||||
/// East-Europe. Disabled because too similar to windows-1252
|
||||
/// (latin-1). Should use tri-grams models to discriminate between
|
||||
/// these two charsets.
|
||||
/// </summary>
|
||||
|
@ -141,9 +141,9 @@ namespace UniversalDetector.Core
|
|||
public const string ISO8859_8 = "ISO-8859-8";
|
||||
|
||||
/// <summary>
|
||||
/// Thai. This recognizer is not enabled yet.
|
||||
/// Thai. This recognizer is not enabled yet.
|
||||
/// </summary>
|
||||
public const string TIS620 = "TIS620";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* Shy Shalom <shooshX@gmail.com>
|
||||
* Kohei TAKETA <k-tak@void.in> (Java port)
|
||||
* Rudi Pettazzi <rudi.pettazzi@gmail.com> (C# port)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
|
@ -48,8 +48,8 @@ namespace UniversalDetector.Core
|
|||
private SMModel model;
|
||||
private int currentCharLen;
|
||||
private int currentBytePos;
|
||||
|
||||
public CodingStateMachine(SMModel model)
|
||||
|
||||
public CodingStateMachine(SMModel model)
|
||||
{
|
||||
this.currentState = SMModel.START;
|
||||
this.model = model;
|
||||
|
@ -57,34 +57,34 @@ namespace UniversalDetector.Core
|
|||
|
||||
public int NextState(byte b)
|
||||
{
|
||||
// for each byte we get its class, if it is first byte,
|
||||
// for each byte we get its class, if it is first byte,
|
||||
// we also get byte length
|
||||
int byteCls = model.GetClass(b);
|
||||
if (currentState == SMModel.START) {
|
||||
if (currentState == SMModel.START) {
|
||||
currentBytePos = 0;
|
||||
currentCharLen = model.charLenTable[byteCls];
|
||||
}
|
||||
|
||||
// from byte's class and stateTable, we get its next state
|
||||
|
||||
// from byte's class and stateTable, we get its next state
|
||||
currentState = model.stateTable.Unpack(
|
||||
currentState * model.ClassFactor + byteCls);
|
||||
currentBytePos++;
|
||||
return currentState;
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
currentState = SMModel.START;
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
currentState = SMModel.START;
|
||||
}
|
||||
|
||||
public int CurrentCharLen
|
||||
{
|
||||
get { return currentCharLen; }
|
||||
public int CurrentCharLen
|
||||
{
|
||||
get { return currentCharLen; }
|
||||
}
|
||||
|
||||
public string ModelName
|
||||
{
|
||||
get { return model.Name; }
|
||||
public string ModelName
|
||||
{
|
||||
get { return model.Name; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,25 +43,25 @@ namespace UniversalDetector.Core
|
|||
private EUCJPContextAnalyser contextAnalyser;
|
||||
private EUCJPDistributionAnalyser distributionAnalyser;
|
||||
private byte[] lastChar = new byte[2];
|
||||
|
||||
|
||||
public EUCJPProber()
|
||||
{
|
||||
codingSM = new CodingStateMachine(new EUCJPSMModel());
|
||||
distributionAnalyser = new EUCJPDistributionAnalyser();
|
||||
contextAnalyser = new EUCJPContextAnalyser();
|
||||
contextAnalyser = new EUCJPContextAnalyser();
|
||||
Reset();
|
||||
}
|
||||
|
||||
public override string GetCharsetName()
|
||||
public override string GetCharsetName()
|
||||
{
|
||||
return "EUC-JP";
|
||||
}
|
||||
|
||||
|
||||
public override ProbingState HandleData(byte[] buf, int offset, int len)
|
||||
{
|
||||
int codingState;
|
||||
int max = offset + len;
|
||||
|
||||
|
||||
for (int i = offset; i < max; i++) {
|
||||
codingState = codingSM.NextState(buf[i]);
|
||||
if (codingState == SMModel.ERROR) {
|
||||
|
@ -83,7 +83,7 @@ namespace UniversalDetector.Core
|
|||
distributionAnalyser.HandleOneChar(buf, i-1, charLen);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lastChar[0] = buf[max-1];
|
||||
if (state == ProbingState.Detecting)
|
||||
if (contextAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD)
|
||||
|
@ -93,18 +93,18 @@ namespace UniversalDetector.Core
|
|||
|
||||
public override void Reset()
|
||||
{
|
||||
codingSM.Reset();
|
||||
codingSM.Reset();
|
||||
state = ProbingState.Detecting;
|
||||
contextAnalyser.Reset();
|
||||
distributionAnalyser.Reset();
|
||||
}
|
||||
|
||||
|
||||
public override float GetConfidence()
|
||||
{
|
||||
float contxtCf = contextAnalyser.GetConfidence();
|
||||
float distribCf = distributionAnalyser.GetConfidence();
|
||||
return (contxtCf > distribCf ? contxtCf : distribCf);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,15 +46,15 @@ namespace UniversalDetector.Core
|
|||
public EUCKRProber()
|
||||
{
|
||||
codingSM = new CodingStateMachine(new EUCKRSMModel());
|
||||
distributionAnalyser = new EUCKRDistributionAnalyser();
|
||||
distributionAnalyser = new EUCKRDistributionAnalyser();
|
||||
Reset();
|
||||
}
|
||||
|
||||
|
||||
public override string GetCharsetName()
|
||||
{
|
||||
return "EUC-KR";
|
||||
return "EUC-KR";
|
||||
}
|
||||
|
||||
|
||||
public override ProbingState HandleData(byte[] buf, int offset, int len)
|
||||
{
|
||||
int codingState;
|
||||
|
@ -81,12 +81,12 @@ namespace UniversalDetector.Core
|
|||
}
|
||||
}
|
||||
lastChar[0] = buf[max-1];
|
||||
|
||||
|
||||
if (state == ProbingState.Detecting)
|
||||
if (distributionAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD)
|
||||
state = ProbingState.FoundIt;
|
||||
return state;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override float GetConfidence()
|
||||
|
@ -96,7 +96,7 @@ namespace UniversalDetector.Core
|
|||
|
||||
public override void Reset()
|
||||
{
|
||||
codingSM.Reset();
|
||||
codingSM.Reset();
|
||||
state = ProbingState.Detecting;
|
||||
distributionAnalyser.Reset();
|
||||
//mContextAnalyser.Reset();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* Contributor(s):
|
||||
* Shy Shalom <shooshX@gmail.com>
|
||||
* Rudi Pettazzi <rudi.pettazzi@gmail.com> (C# port)
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
|
@ -50,7 +50,7 @@ namespace UniversalDetector.Core
|
|||
this.distributionAnalyser = new EUCTWDistributionAnalyser();
|
||||
this.Reset();
|
||||
}
|
||||
|
||||
|
||||
public override ProbingState HandleData(byte[] buf, int offset, int len)
|
||||
{
|
||||
int codingState;
|
||||
|
@ -77,21 +77,21 @@ namespace UniversalDetector.Core
|
|||
}
|
||||
}
|
||||
lastChar[0] = buf[max-1];
|
||||
|
||||
|
||||
if (state == ProbingState.Detecting)
|
||||
if (distributionAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD)
|
||||
state = ProbingState.FoundIt;
|
||||
return state;
|
||||
}
|
||||
|
||||
|
||||
public override string GetCharsetName()
|
||||
{
|
||||
return "x-euc-tw";
|
||||
return "x-euc-tw";
|
||||
}
|
||||
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
codingSM.Reset();
|
||||
codingSM.Reset();
|
||||
state = ProbingState.Detecting;
|
||||
distributionAnalyser.Reset();
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ namespace UniversalDetector.Core
|
|||
{
|
||||
return distributionAnalyser.GetConfidence();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user