aboutsummaryrefslogtreecommitdiff
path: root/BDInfo
diff options
context:
space:
mode:
authorstefan <stefan@hegedues.at>2018-09-12 19:26:21 +0200
committerstefan <stefan@hegedues.at>2018-09-12 19:26:21 +0200
commit48facb797ed912e4ea6b04b17d1ff190ac2daac4 (patch)
tree8dae77a31670a888d733484cb17dd4077d5444e8 /BDInfo
parentc32d8656382a0eacb301692e0084377fc433ae9b (diff)
Update to 3.5.2 and .net core 2.1
Diffstat (limited to 'BDInfo')
-rw-r--r--BDInfo/BDInfo.csproj81
-rw-r--r--BDInfo/BDInfo.nuget.targets6
-rw-r--r--BDInfo/BDROM.cs8
-rw-r--r--BDInfo/BitVector32.cs308
-rw-r--r--BDInfo/TSPlaylistFile.cs10
-rw-r--r--BDInfo/TSStreamFile.cs2
6 files changed, 19 insertions, 396 deletions
diff --git a/BDInfo/BDInfo.csproj b/BDInfo/BDInfo.csproj
index 97abe7484..f38fc8101 100644
--- a/BDInfo/BDInfo.csproj
+++ b/BDInfo/BDInfo.csproj
@@ -1,73 +1,12 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
- <PropertyGroup>
- <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProjectGuid>{88AE38DF-19D7-406F-A6A9-09527719A21E}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>BDInfo</RootNamespace>
- <AssemblyName>BDInfo</AssemblyName>
- <DefaultLanguage>en-US</DefaultLanguage>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
+<Project Sdk="Microsoft.NET.Sdk">
+
<ItemGroup>
- <Compile Include="BDInfoSettings.cs" />
- <Compile Include="BDROM.cs" />
- <Compile Include="BitVector32.cs" />
- <Compile Include="LanguageCodes.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="TSCodecAC3.cs" />
- <Compile Include="TSCodecAVC.cs" />
- <Compile Include="TSCodecDTS.cs" />
- <Compile Include="TSCodecDTSHD.cs" />
- <Compile Include="TSCodecLPCM.cs" />
- <Compile Include="TSCodecMPEG2.cs" />
- <Compile Include="TSCodecMVC.cs" />
- <Compile Include="TSCodecTrueHD.cs" />
- <Compile Include="TSCodecVC1.cs" />
- <Compile Include="TSInterleavedFile.cs" />
- <Compile Include="TSPlaylistFile.cs" />
- <Compile Include="TSStream.cs" />
- <Compile Include="TSStreamBuffer.cs" />
- <Compile Include="TSStreamClip.cs" />
- <Compile Include="TSStreamClipFile.cs" />
- <Compile Include="TSStreamFile.cs" />
+ <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
</ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
- <Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
- <Name>MediaBrowser.Model</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project> \ No newline at end of file
+
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.1</TargetFramework>
+ <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
+ </PropertyGroup>
+
+</Project>
diff --git a/BDInfo/BDInfo.nuget.targets b/BDInfo/BDInfo.nuget.targets
deleted file mode 100644
index e69ce0e64..000000000
--- a/BDInfo/BDInfo.nuget.targets
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
-<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Target Name="EmitMSBuildWarning" BeforeTargets="Build">
- <Warning Text="Packages containing MSBuild targets and props files cannot be fully installed in projects targeting multiple frameworks. The MSBuild targets and props files have been ignored." />
- </Target>
-</Project> \ No newline at end of file
diff --git a/BDInfo/BDROM.cs b/BDInfo/BDROM.cs
index d86648364..f00d9825a 100644
--- a/BDInfo/BDROM.cs
+++ b/BDInfo/BDROM.cs
@@ -57,8 +57,6 @@ namespace BDInfo
public Dictionary<string, TSInterleavedFile> InterleavedFiles =
new Dictionary<string, TSInterleavedFile>();
- private static List<string> ExcludeDirs = new List<string> { "ANY!", "AACS", "BDSVM", "ANYVM", "SLYVM" };
-
public delegate bool OnStreamClipFileScanError(
TSStreamClipFile streamClipFile, Exception ex);
@@ -77,7 +75,7 @@ namespace BDInfo
public BDROM(
string path, IFileSystem fileSystem, ITextEncoding textEncoding)
{
- if (string.IsNullOrWhiteSpace(path))
+ if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException("path");
}
@@ -336,7 +334,7 @@ namespace BDInfo
private FileSystemMetadata GetDirectoryBDMV(
string path)
{
- if (string.IsNullOrWhiteSpace(path))
+ if (string.IsNullOrEmpty(path))
{
throw new ArgumentNullException("path");
}
@@ -421,7 +419,7 @@ namespace BDInfo
return dir.Name;
}
- public static int CompareStreamFiles(
+ public int CompareStreamFiles(
TSStreamFile x,
TSStreamFile y)
{
diff --git a/BDInfo/BitVector32.cs b/BDInfo/BitVector32.cs
deleted file mode 100644
index 1ac94bfbe..000000000
--- a/BDInfo/BitVector32.cs
+++ /dev/null
@@ -1,308 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace BDInfo
-{
- using System.Diagnostics;
- using System.Text;
- using System;
-
- /// <devdoc>
- /// <para>Provides a simple light bit vector with easy integer or Boolean access to
- /// a 32 bit storage.</para>
- /// </devdoc>
- public struct BitVector32
- {
- private uint data;
-
- /// <devdoc>
- /// <para>Initializes a new instance of the BitVector32 structure with the specified internal data.</para>
- /// </devdoc>
- public BitVector32(int data)
- {
- this.data = (uint)data;
- }
-
- /// <devdoc>
- /// <para>Initializes a new instance of the BitVector32 structure with the information in the specified
- /// value.</para>
- /// </devdoc>
- public BitVector32(BitVector32 value)
- {
- this.data = value.data;
- }
-
- /// <devdoc>
- /// <para>Gets or sets a value indicating whether all the specified bits are set.</para>
- /// </devdoc>
- public bool this[int bit]
- {
- get
- {
- return (data & bit) == (uint)bit;
- }
- set
- {
- if (value)
- {
- data |= (uint)bit;
- }
- else
- {
- data &= ~(uint)bit;
- }
- }
- }
-
- /// <devdoc>
- /// <para>Gets or sets the value for the specified section.</para>
- /// </devdoc>
- public int this[Section section]
- {
- get
- {
- return (int)((data & (uint)(section.Mask << section.Offset)) >> section.Offset);
- }
- set
- {
- value <<= section.Offset;
- int offsetMask = (0xFFFF & (int)section.Mask) << section.Offset;
- data = (data & ~(uint)offsetMask) | ((uint)value & (uint)offsetMask);
- }
- }
-
- /// <devdoc>
- /// returns the raw data stored in this bit vector...
- /// </devdoc>
- public int Data
- {
- get
- {
- return (int)data;
- }
- }
-
- private static short CountBitsSet(short mask)
- {
-
- // yes, I know there are better algorithms, however, we know the
- // bits are always right aligned, with no holes (i.e. always 00000111,
- // never 000100011), so this is just fine...
- //
- short value = 0;
- while ((mask & 0x1) != 0)
- {
- value++;
- mask >>= 1;
- }
- return value;
- }
-
- /// <devdoc>
- /// <para> Creates the first mask in a series.</para>
- /// </devdoc>
- public static int CreateMask()
- {
- return CreateMask(0);
- }
-
- /// <devdoc>
- /// Creates the next mask in a series.
- /// </devdoc>
- public static int CreateMask(int previous)
- {
- if (previous == 0)
- {
- return 1;
- }
-
- if (previous == unchecked((int)0x80000000))
- {
- throw new InvalidOperationException("Bit vector full");
- }
-
- return previous << 1;
- }
-
- /// <devdoc>
- /// Given a highValue, creates the mask
- /// </devdoc>
- private static short CreateMaskFromHighValue(short highValue)
- {
- short required = 16;
- while ((highValue & 0x8000) == 0)
- {
- required--;
- highValue <<= 1;
- }
-
- ushort value = 0;
- while (required > 0)
- {
- required--;
- value <<= 1;
- value |= 0x1;
- }
-
- return unchecked((short)value);
- }
-
- /// <devdoc>
- /// <para>Creates the first section in a series, with the specified maximum value.</para>
- /// </devdoc>
- public static Section CreateSection(short maxValue)
- {
- return CreateSectionHelper(maxValue, 0, 0);
- }
-
- /// <devdoc>
- /// <para>Creates the next section in a series, with the specified maximum value.</para>
- /// </devdoc>
- public static Section CreateSection(short maxValue, Section previous)
- {
- return CreateSectionHelper(maxValue, previous.Mask, previous.Offset);
- }
-
- private static Section CreateSectionHelper(short maxValue, short priorMask, short priorOffset)
- {
- if (maxValue < 1)
- {
- throw new ArgumentOutOfRangeException("maxValue");
- }
-#if DEBUG
- int maskCheck = CreateMaskFromHighValue(maxValue);
- int offsetCheck = priorOffset + CountBitsSet(priorMask);
- Debug.Assert(maskCheck <= short.MaxValue && offsetCheck < 32, "Overflow on BitVector32");
-#endif
- short offset = (short)(priorOffset + CountBitsSet(priorMask));
- if (offset >= 32)
- {
- throw new InvalidOperationException("Bit vector full");
- }
- return new Section(CreateMaskFromHighValue(maxValue), offset);
- }
-
- public override bool Equals(object o)
- {
- if (!(o is BitVector32))
- {
- return false;
- }
-
- return data == ((BitVector32)o).data;
- }
-
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
-
- /// <devdoc>
- /// </devdoc>
- public static string ToString(BitVector32 value)
- {
- StringBuilder sb = new StringBuilder(/*"BitVector32{".Length*/12 + /*32 bits*/32 + /*"}".Length"*/1);
- sb.Append("BitVector32{");
- int locdata = (int)value.data;
- for (int i = 0; i < 32; i++)
- {
- if ((locdata & 0x80000000) != 0)
- {
- sb.Append("1");
- }
- else
- {
- sb.Append("0");
- }
- locdata <<= 1;
- }
- sb.Append("}");
- return sb.ToString();
- }
-
- /// <devdoc>
- /// </devdoc>
- public override string ToString()
- {
- return BitVector32.ToString(this);
- }
-
- /// <devdoc>
- /// <para>
- /// Represents an section of the vector that can contain a integer number.</para>
- /// </devdoc>
- public struct Section
- {
- private readonly short mask;
- private readonly short offset;
-
- internal Section(short mask, short offset)
- {
- this.mask = mask;
- this.offset = offset;
- }
-
- public short Mask
- {
- get
- {
- return mask;
- }
- }
-
- public short Offset
- {
- get
- {
- return offset;
- }
- }
-
- public override bool Equals(object o)
- {
- if (o is Section)
- return Equals((Section)o);
- else
- return false;
- }
-
- public bool Equals(Section obj)
- {
- return obj.mask == mask && obj.offset == offset;
- }
-
- public static bool operator ==(Section a, Section b)
- {
- return a.Equals(b);
- }
-
- public static bool operator !=(Section a, Section b)
- {
- return !(a == b);
- }
-
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
-
- /// <devdoc>
- /// </devdoc>
- public static string ToString(Section value)
- {
- return "Section{0x" + Convert.ToString(value.Mask, 16) + ", 0x" + Convert.ToString(value.Offset, 16) + "}";
- }
-
- /// <devdoc>
- /// </devdoc>
- public override string ToString()
- {
- return Section.ToString(this);
- }
-
- }
- }
-}
diff --git a/BDInfo/TSPlaylistFile.cs b/BDInfo/TSPlaylistFile.cs
index 46d66f513..da6fd37cc 100644
--- a/BDInfo/TSPlaylistFile.cs
+++ b/BDInfo/TSPlaylistFile.cs
@@ -954,7 +954,7 @@ namespace BDInfo
}
}
- public static int CompareVideoStreams(
+ public int CompareVideoStreams(
TSVideoStream x,
TSVideoStream y)
{
@@ -995,7 +995,7 @@ namespace BDInfo
}
}
- public static int CompareAudioStreams(
+ public int CompareAudioStreams(
TSAudioStream x,
TSAudioStream y)
{
@@ -1067,7 +1067,7 @@ namespace BDInfo
}
}
- public static int CompareTextStreams(
+ public int CompareTextStreams(
TSTextStream x,
TSTextStream y)
{
@@ -1123,7 +1123,7 @@ namespace BDInfo
}
}
- private static int CompareGraphicsStreams(
+ private int CompareGraphicsStreams(
TSGraphicsStream x,
TSGraphicsStream y)
{
@@ -1189,7 +1189,7 @@ namespace BDInfo
}
}
- private static int GetStreamTypeSortIndex(TSStreamType streamType)
+ private int GetStreamTypeSortIndex(TSStreamType streamType)
{
switch (streamType)
{
diff --git a/BDInfo/TSStreamFile.cs b/BDInfo/TSStreamFile.cs
index 31020cbf4..cfd402434 100644
--- a/BDInfo/TSStreamFile.cs
+++ b/BDInfo/TSStreamFile.cs
@@ -865,7 +865,7 @@ namespace BDInfo
k += streamInfoLength;
}
}
- catch (Exception ex)
+ catch
{
// TODO
//Console.WriteLine(ex.Message);