mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-01-18 12:36:44 +00:00
Merge pull request #2 from vladjerca/feature/configure_root_ctor
FFMpegCore: enable root configuration view ctor
This commit is contained in:
commit
0e95615261
3 changed files with 30 additions and 8 deletions
|
@ -14,12 +14,27 @@ public abstract class FFBase : IDisposable
|
|||
protected string ConfiguredRoot;
|
||||
protected Process Process;
|
||||
|
||||
protected FFBase()
|
||||
protected FFBase(FFMpegOptions opts = null)
|
||||
{
|
||||
ConfiguredRoot =
|
||||
!File.Exists(_ConfigFile) ?
|
||||
_DefaultRoot :
|
||||
JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(_ConfigFile))["RootDirectory"];
|
||||
var options = opts;
|
||||
|
||||
if (
|
||||
opts == null &&
|
||||
File.Exists(_ConfigFile)
|
||||
)
|
||||
{
|
||||
options = JsonConvert.DeserializeObject<FFMpegOptions>(File.ReadAllText(_ConfigFile));
|
||||
}
|
||||
|
||||
if (options == null)
|
||||
{
|
||||
options = new FFMpegOptions
|
||||
{
|
||||
RootDirectory = _DefaultRoot
|
||||
};
|
||||
}
|
||||
|
||||
ConfiguredRoot = options.RootDirectory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
7
FFMpegCore/FFMPEG/FFMpegOptions.cs
Normal file
7
FFMpegCore/FFMPEG/FFMpegOptions.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace FFMpegCore.FFMPEG
|
||||
{
|
||||
public class FFMpegOptions
|
||||
{
|
||||
public string RootDirectory { get; set; }
|
||||
}
|
||||
}
|
|
@ -7,9 +7,9 @@
|
|||
<PackageProjectUrl>https://github.com/vladjerca/FFMpegCore</PackageProjectUrl>
|
||||
<Copyright>Vlad Jerca</Copyright>
|
||||
<Description>A great way to use FFMpeg encoding when writing video applications, client-side and server-side. It has wrapper methods that allow conversion to all web formats: MP4, OGV, TS and methods of capturing screens from the videos.</Description>
|
||||
<Version>1.0.2</Version>
|
||||
<AssemblyVersion>1.0.2.0</AssemblyVersion>
|
||||
<FileVersion>1.0.2.0</FileVersion>
|
||||
<Version>1.0.3</Version>
|
||||
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
||||
<FileVersion>1.0.3.0</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue