remove MediaInfo
This commit is contained in:
parent
be664f93c6
commit
6414fc9486
|
@ -99,10 +99,6 @@
|
|||
<Project>{17e1f4e6-8abd-4fe5-9ecf-43d4b6087ba2}</Project>
|
||||
<Name>MediaBrowser.Controller</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MediaBrowser.MediaInfo\MediaBrowser.MediaInfo.csproj">
|
||||
<Project>{6e4145e4-c6d4-4e4d-94f2-87188db6e239}</Project>
|
||||
<Name>MediaBrowser.MediaInfo</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj">
|
||||
<Project>{7eeeb4bb-f3e8-48fc-b4c5-70f0fff8329b}</Project>
|
||||
<Name>MediaBrowser.Model</Name>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.MediaInfo;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
@ -26,7 +25,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public Model.MediaInfo.MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType videoType, bool isAudio, string path, MediaProtocol protocol)
|
||||
public MediaInfo GetMediaInfo(InternalMediaInfoResult data, VideoType videoType, bool isAudio, string path, MediaProtocol protocol)
|
||||
{
|
||||
var info = new Model.MediaInfo.MediaInfo
|
||||
{
|
||||
|
@ -109,7 +108,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
|
||||
if (videoStream != null && videoType == VideoType.VideoFile)
|
||||
{
|
||||
UpdateFromMediaInfo(info, videoStream);
|
||||
DetectInterlaced(info, videoStream);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -934,29 +933,18 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|||
return TransportStreamTimestamp.None;
|
||||
}
|
||||
|
||||
private void UpdateFromMediaInfo(MediaSourceInfo video, MediaStream videoStream)
|
||||
private void DetectInterlaced(MediaSourceInfo video, MediaStream videoStream)
|
||||
{
|
||||
if (video.Protocol == MediaProtocol.File && videoStream != null)
|
||||
if (video.Protocol != MediaProtocol.File || videoStream == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
_logger.Debug("Running MediaInfo against {0}", video.Path);
|
||||
return;
|
||||
}
|
||||
|
||||
var result = new MediaInfoLib().GetVideoInfo(video.Path);
|
||||
|
||||
videoStream.IsCabac = result.IsCabac ?? videoStream.IsCabac;
|
||||
videoStream.IsInterlaced = result.IsInterlaced ?? videoStream.IsInterlaced;
|
||||
videoStream.BitDepth = result.BitDepth ?? videoStream.BitDepth;
|
||||
videoStream.RefFrames = result.RefFrames ?? videoStream.RefFrames;
|
||||
}
|
||||
catch (TypeLoadException)
|
||||
// Take a shortcut and limit this to containers that are likely to have interlaced content
|
||||
if (!string.Equals(video.Container, "ts", StringComparison.OrdinalIgnoreCase) &&
|
||||
!string.Equals(video.Container, "wtv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// This is non-essential. Don't spam the log
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Error running MediaInfo on {0}", ex, video.Path);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.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>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MediaBrowser.MediaInfo</RootNamespace>
|
||||
<AssemblyName>MediaBrowser.MediaInfo</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</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>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\SharedVersion.cs">
|
||||
<Link>Properties\SharedVersion.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="MediaInfoLib.cs" />
|
||||
<Compile Include="Native.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.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>
|
|
@ -1,65 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.MediaInfo
|
||||
{
|
||||
public class MediaInfoLib
|
||||
{
|
||||
public MediaInfoResult GetVideoInfo(string path)
|
||||
{
|
||||
var lib = new MediaInfo();
|
||||
|
||||
lib.Open(path);
|
||||
|
||||
var result = new MediaInfoResult();
|
||||
|
||||
// TODO: Don't hardcode
|
||||
var videoStreamIndex = 0;
|
||||
|
||||
var text = GetValue(lib, videoStreamIndex, new[] { "ScanType", "Scan type", "ScanType/String" });
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
result.IsInterlaced = text.IndexOf("interlac", StringComparison.OrdinalIgnoreCase) != -1;
|
||||
}
|
||||
|
||||
text = GetValue(lib, videoStreamIndex, new[] { "Format_Settings_CABAC", "Format_Settings_CABAC/String" });
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
result.IsCabac = string.Equals(text, "yes", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
int bitDepth;
|
||||
text = GetValue(lib, videoStreamIndex, new[] { "BitDepth", "BitDepth/String" });
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(text) && int.TryParse(text.Split(' ').First(), NumberStyles.Any, CultureInfo.InvariantCulture, out bitDepth))
|
||||
{
|
||||
result.BitDepth = bitDepth;
|
||||
}
|
||||
|
||||
int refFrames;
|
||||
text = GetValue(lib, videoStreamIndex, new[] { "Format_Settings_RefFrames", "Format_Settings_RefFrames/String" });
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(text) && int.TryParse(text.Split(' ').First(), NumberStyles.Any, CultureInfo.InvariantCulture, out refFrames))
|
||||
{
|
||||
result.RefFrames = refFrames;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private string GetValue(MediaInfo lib, int index, IEnumerable<string> names)
|
||||
{
|
||||
return names.Select(i => lib.Get(StreamKind.Video, index, i)).FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
|
||||
}
|
||||
}
|
||||
|
||||
public class MediaInfoResult
|
||||
{
|
||||
public bool? IsCabac { get; set; }
|
||||
public bool? IsInterlaced { get; set; }
|
||||
public int? BitDepth { get; set; }
|
||||
public int? RefFrames { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,275 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace MediaBrowser.MediaInfo
|
||||
{
|
||||
public enum StreamKind
|
||||
{
|
||||
General,
|
||||
Video,
|
||||
Audio,
|
||||
Text,
|
||||
Other,
|
||||
Image,
|
||||
Menu,
|
||||
}
|
||||
|
||||
public enum InfoKind
|
||||
{
|
||||
Name,
|
||||
Text,
|
||||
Measure,
|
||||
Options,
|
||||
NameText,
|
||||
MeasureText,
|
||||
Info,
|
||||
HowTo
|
||||
}
|
||||
|
||||
public enum InfoOptions
|
||||
{
|
||||
ShowInInform,
|
||||
Support,
|
||||
ShowInSupported,
|
||||
TypeOfValue
|
||||
}
|
||||
|
||||
public enum InfoFileOptions
|
||||
{
|
||||
FileOption_Nothing = 0x00,
|
||||
FileOption_NoRecursive = 0x01,
|
||||
FileOption_CloseAll = 0x02,
|
||||
FileOption_Max = 0x04
|
||||
};
|
||||
|
||||
public enum Status
|
||||
{
|
||||
None = 0x00,
|
||||
Accepted = 0x01,
|
||||
Filled = 0x02,
|
||||
Updated = 0x04,
|
||||
Finalized = 0x08,
|
||||
}
|
||||
|
||||
public class MediaInfo
|
||||
{
|
||||
//Import of DLL functions. DO NOT USE until you know what you do (MediaInfo DLL do NOT use CoTaskMemAlloc to allocate memory)
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_New();
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern void MediaInfo_Delete(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Open(IntPtr Handle, [MarshalAs(UnmanagedType.LPWStr)] string FileName);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_Open(IntPtr Handle, IntPtr FileName);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Open_Buffer_Init(IntPtr Handle, Int64 File_Size, Int64 File_Offset);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_Open(IntPtr Handle, Int64 File_Size, Int64 File_Offset);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Open_Buffer_Continue(IntPtr Handle, IntPtr Buffer, IntPtr Buffer_Size);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_Open_Buffer_Continue(IntPtr Handle, Int64 File_Size, byte[] Buffer, IntPtr Buffer_Size);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern Int64 MediaInfo_Open_Buffer_Continue_GoTo_Get(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern Int64 MediaInfoA_Open_Buffer_Continue_GoTo_Get(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Open_Buffer_Finalize(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_Open_Buffer_Finalize(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern void MediaInfo_Close(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Inform(IntPtr Handle, IntPtr Reserved);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_Inform(IntPtr Handle, IntPtr Reserved);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_GetI(IntPtr Handle, IntPtr StreamKind, IntPtr StreamNumber, IntPtr Parameter, IntPtr KindOfInfo);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_GetI(IntPtr Handle, IntPtr StreamKind, IntPtr StreamNumber, IntPtr Parameter, IntPtr KindOfInfo);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Get(IntPtr Handle, IntPtr StreamKind, IntPtr StreamNumber, [MarshalAs(UnmanagedType.LPWStr)] string Parameter, IntPtr KindOfInfo, IntPtr KindOfSearch);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_Get(IntPtr Handle, IntPtr StreamKind, IntPtr StreamNumber, IntPtr Parameter, IntPtr KindOfInfo, IntPtr KindOfSearch);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Option(IntPtr Handle, [MarshalAs(UnmanagedType.LPWStr)] string Option, [MarshalAs(UnmanagedType.LPWStr)] string Value);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoA_Option(IntPtr Handle, IntPtr Option, IntPtr Value);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_State_Get(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfo_Count_Get(IntPtr Handle, IntPtr StreamKind, IntPtr StreamNumber);
|
||||
|
||||
//MediaInfo class
|
||||
public MediaInfo()
|
||||
{
|
||||
try
|
||||
{
|
||||
Handle = MediaInfo_New();
|
||||
}
|
||||
catch
|
||||
{
|
||||
Handle = (IntPtr)0;
|
||||
}
|
||||
if (Environment.OSVersion.ToString().IndexOf("Windows") == -1)
|
||||
MustUseAnsi = true;
|
||||
else
|
||||
MustUseAnsi = false;
|
||||
}
|
||||
~MediaInfo() { if (Handle == (IntPtr)0) return; MediaInfo_Delete(Handle); }
|
||||
public int Open(String FileName)
|
||||
{
|
||||
if (Handle == (IntPtr)0)
|
||||
return 0;
|
||||
if (MustUseAnsi)
|
||||
{
|
||||
IntPtr FileName_Ptr = Marshal.StringToHGlobalAnsi(FileName);
|
||||
int ToReturn = (int)MediaInfoA_Open(Handle, FileName_Ptr);
|
||||
Marshal.FreeHGlobal(FileName_Ptr);
|
||||
return ToReturn;
|
||||
}
|
||||
else
|
||||
return (int)MediaInfo_Open(Handle, FileName);
|
||||
}
|
||||
public int Open_Buffer_Init(Int64 File_Size, Int64 File_Offset)
|
||||
{
|
||||
if (Handle == (IntPtr)0) return 0; return (int)MediaInfo_Open_Buffer_Init(Handle, File_Size, File_Offset);
|
||||
}
|
||||
public int Open_Buffer_Continue(IntPtr Buffer, IntPtr Buffer_Size)
|
||||
{
|
||||
if (Handle == (IntPtr)0) return 0; return (int)MediaInfo_Open_Buffer_Continue(Handle, Buffer, Buffer_Size);
|
||||
}
|
||||
public Int64 Open_Buffer_Continue_GoTo_Get()
|
||||
{
|
||||
if (Handle == (IntPtr)0) return 0; return (Int64)MediaInfo_Open_Buffer_Continue_GoTo_Get(Handle);
|
||||
}
|
||||
public int Open_Buffer_Finalize()
|
||||
{
|
||||
if (Handle == (IntPtr)0) return 0; return (int)MediaInfo_Open_Buffer_Finalize(Handle);
|
||||
}
|
||||
public void Close() { if (Handle == (IntPtr)0) return; MediaInfo_Close(Handle); }
|
||||
public String Inform()
|
||||
{
|
||||
if (Handle == (IntPtr)0)
|
||||
return "Unable to load MediaInfo library";
|
||||
if (MustUseAnsi)
|
||||
return Marshal.PtrToStringAnsi(MediaInfoA_Inform(Handle, (IntPtr)0));
|
||||
else
|
||||
return Marshal.PtrToStringUni(MediaInfo_Inform(Handle, (IntPtr)0));
|
||||
}
|
||||
public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch)
|
||||
{
|
||||
if (Handle == (IntPtr)0)
|
||||
return "Unable to load MediaInfo library";
|
||||
if (MustUseAnsi)
|
||||
{
|
||||
IntPtr Parameter_Ptr = Marshal.StringToHGlobalAnsi(Parameter);
|
||||
String ToReturn = Marshal.PtrToStringAnsi(MediaInfoA_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter_Ptr, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
|
||||
Marshal.FreeHGlobal(Parameter_Ptr);
|
||||
return ToReturn;
|
||||
}
|
||||
else
|
||||
return Marshal.PtrToStringUni(MediaInfo_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch));
|
||||
}
|
||||
public String Get(StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo)
|
||||
{
|
||||
if (Handle == (IntPtr)0)
|
||||
return "Unable to load MediaInfo library";
|
||||
if (MustUseAnsi)
|
||||
return Marshal.PtrToStringAnsi(MediaInfoA_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
|
||||
else
|
||||
return Marshal.PtrToStringUni(MediaInfo_GetI(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo));
|
||||
}
|
||||
public String Option(String Option, String Value)
|
||||
{
|
||||
if (Handle == (IntPtr)0)
|
||||
return "Unable to load MediaInfo library";
|
||||
if (MustUseAnsi)
|
||||
{
|
||||
IntPtr Option_Ptr = Marshal.StringToHGlobalAnsi(Option);
|
||||
IntPtr Value_Ptr = Marshal.StringToHGlobalAnsi(Value);
|
||||
String ToReturn = Marshal.PtrToStringAnsi(MediaInfoA_Option(Handle, Option_Ptr, Value_Ptr));
|
||||
Marshal.FreeHGlobal(Option_Ptr);
|
||||
Marshal.FreeHGlobal(Value_Ptr);
|
||||
return ToReturn;
|
||||
}
|
||||
else
|
||||
return Marshal.PtrToStringUni(MediaInfo_Option(Handle, Option, Value));
|
||||
}
|
||||
public int State_Get() { if (Handle == (IntPtr)0) return 0; return (int)MediaInfo_State_Get(Handle); }
|
||||
public int Count_Get(StreamKind StreamKind, int StreamNumber) { if (Handle == (IntPtr)0) return 0; return (int)MediaInfo_Count_Get(Handle, (IntPtr)StreamKind, (IntPtr)StreamNumber); }
|
||||
private IntPtr Handle;
|
||||
private bool MustUseAnsi;
|
||||
|
||||
//Default values, if you know how to set default values in C#, say me
|
||||
public String Get(StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo) { return Get(StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name); }
|
||||
public String Get(StreamKind StreamKind, int StreamNumber, String Parameter) { return Get(StreamKind, StreamNumber, Parameter, InfoKind.Text, InfoKind.Name); }
|
||||
public String Get(StreamKind StreamKind, int StreamNumber, int Parameter) { return Get(StreamKind, StreamNumber, Parameter, InfoKind.Text); }
|
||||
public String Option(String Option_) { return Option(Option_, ""); }
|
||||
public int Count_Get(StreamKind StreamKind) { return Count_Get(StreamKind, -1); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class MediaInfoList
|
||||
{
|
||||
//Import of DLL functions. DO NOT USE until you know what you do (MediaInfo DLL do NOT use CoTaskMemAlloc to allocate memory)
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_New();
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern void MediaInfoList_Delete(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_Open(IntPtr Handle, [MarshalAs(UnmanagedType.LPWStr)] string FileName, IntPtr Options);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern void MediaInfoList_Close(IntPtr Handle, IntPtr FilePos);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_Inform(IntPtr Handle, IntPtr FilePos, IntPtr Reserved);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_GetI(IntPtr Handle, IntPtr FilePos, IntPtr StreamKind, IntPtr StreamNumber, IntPtr Parameter, IntPtr KindOfInfo);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_Get(IntPtr Handle, IntPtr FilePos, IntPtr StreamKind, IntPtr StreamNumber, [MarshalAs(UnmanagedType.LPWStr)] string Parameter, IntPtr KindOfInfo, IntPtr KindOfSearch);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_Option(IntPtr Handle, [MarshalAs(UnmanagedType.LPWStr)] string Option, [MarshalAs(UnmanagedType.LPWStr)] string Value);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_State_Get(IntPtr Handle);
|
||||
[DllImport("MediaInfo")]
|
||||
private static extern IntPtr MediaInfoList_Count_Get(IntPtr Handle, IntPtr FilePos, IntPtr StreamKind, IntPtr StreamNumber);
|
||||
|
||||
//MediaInfo class
|
||||
public MediaInfoList() { Handle = MediaInfoList_New(); }
|
||||
~MediaInfoList() { MediaInfoList_Delete(Handle); }
|
||||
public int Open(String FileName, InfoFileOptions Options) { return (int)MediaInfoList_Open(Handle, FileName, (IntPtr)Options); }
|
||||
public void Close(int FilePos) { MediaInfoList_Close(Handle, (IntPtr)FilePos); }
|
||||
public String Inform(int FilePos) { return Marshal.PtrToStringUni(MediaInfoList_Inform(Handle, (IntPtr)FilePos, (IntPtr)0)); }
|
||||
public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo, InfoKind KindOfSearch) { return Marshal.PtrToStringUni(MediaInfoList_Get(Handle, (IntPtr)FilePos, (IntPtr)StreamKind, (IntPtr)StreamNumber, Parameter, (IntPtr)KindOfInfo, (IntPtr)KindOfSearch)); }
|
||||
public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, int Parameter, InfoKind KindOfInfo) { return Marshal.PtrToStringUni(MediaInfoList_GetI(Handle, (IntPtr)FilePos, (IntPtr)StreamKind, (IntPtr)StreamNumber, (IntPtr)Parameter, (IntPtr)KindOfInfo)); }
|
||||
public String Option(String Option, String Value) { return Marshal.PtrToStringUni(MediaInfoList_Option(Handle, Option, Value)); }
|
||||
public int State_Get() { return (int)MediaInfoList_State_Get(Handle); }
|
||||
public int Count_Get(int FilePos, StreamKind StreamKind, int StreamNumber) { return (int)MediaInfoList_Count_Get(Handle, (IntPtr)FilePos, (IntPtr)StreamKind, (IntPtr)StreamNumber); }
|
||||
private IntPtr Handle;
|
||||
|
||||
//Default values, if you know how to set default values in C#, say me
|
||||
public void Open(String FileName) { Open(FileName, 0); }
|
||||
public void Close() { Close(-1); }
|
||||
public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter, InfoKind KindOfInfo) { return Get(FilePos, StreamKind, StreamNumber, Parameter, KindOfInfo, InfoKind.Name); }
|
||||
public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, String Parameter) { return Get(FilePos, StreamKind, StreamNumber, Parameter, InfoKind.Text, InfoKind.Name); }
|
||||
public String Get(int FilePos, StreamKind StreamKind, int StreamNumber, int Parameter) { return Get(FilePos, StreamKind, StreamNumber, Parameter, InfoKind.Text); }
|
||||
public String Option(String Option_) { return Option(Option_, ""); }
|
||||
public int Count_Get(int FilePos, StreamKind StreamKind) { return Count_Get(FilePos, StreamKind, -1); }
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 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("MediaBrowser.MediaInfo")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("MediaBrowser.MediaInfo")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[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
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("8ef5ed2a-0460-4fb4-ba3f-fc2ba057f009")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
|
@ -1,4 +0,0 @@
|
|||
<configuration>
|
||||
<dllmap dll="MediaInfo" target="./MediaInfo/osx/libmediainfo.dylib" os="osx"/>
|
||||
<dllmap dll="MediaInfo" target="libmediainfo.so" os="linux"/>
|
||||
</configuration>
|
|
@ -144,10 +144,6 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\ThirdParty\MediaInfo\osx\libmediainfo.dylib">
|
||||
<Link>MediaInfo\osx\libmediainfo.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="..\ThirdParty\SQLite3\osx\libsqlite3.0.dylib">
|
||||
<Link>libsqlite3.0.dylib</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
@ -160,9 +156,6 @@
|
|||
<None Include="ImageMagickSharp.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="MediaBrowser.MediaInfo.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="packages.config" />
|
||||
<None Include="System.Data.SQLite.dll.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
|
|
@ -176,10 +176,6 @@
|
|||
<Link>x86\SQLite.Interop.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\MediaInfo\windows\x86\MediaInfo.dll">
|
||||
<Link>MediaInfo.dll</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="CORE_RL_bzlib_.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
|
|
|
@ -55,8 +55,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.XbmcMetadata",
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.LocalMetadata", "MediaBrowser.LocalMetadata\MediaBrowser.LocalMetadata.csproj", "{7EF9F3E0-697D-42F3-A08F-19DEB5F84392}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.MediaInfo", "MediaBrowser.MediaInfo\MediaBrowser.MediaInfo.csproj", "{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Mono", "MediaBrowser.Server.Mono\MediaBrowser.Server.Mono.csproj", "{175A9388-F352-4586-A6B4-070DED62B644}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Server.Startup.Common", "MediaBrowser.Server.Startup.Common\MediaBrowser.Server.Startup.Common.csproj", "{B90AB8F2-1BFF-4568-A3FD-2A338A435A75}"
|
||||
|
@ -450,27 +448,6 @@ Global
|
|||
{7EF9F3E0-697D-42F3-A08F-19DEB5F84392}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{7EF9F3E0-697D-42F3-A08F-19DEB5F84392}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{7EF9F3E0-697D-42F3-A08F-19DEB5F84392}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Debug|Win32.ActiveCfg = Debug|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release Mono|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release Mono|Any CPU.Build.0 = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release Mono|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release Mono|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release Mono|Win32.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release Mono|x64.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release Mono|x86.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release|Win32.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{6E4145E4-C6D4-4E4D-94F2-87188DB6E239}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{175A9388-F352-4586-A6B4-070DED62B644}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||
{175A9388-F352-4586-A6B4-070DED62B644}.Debug|Any CPU.Build.0 = Debug|x86
|
||||
{175A9388-F352-4586-A6B4-070DED62B644}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
|
||||
|
|
Loading…
Reference in New Issue
Block a user