mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Merge pull request #2 from vladjerca/feature/configure_root_ctor
FFMpegCore: enable root configuration view ctor
Former-commit-id: 0e95615261
This commit is contained in:
commit
7c25a5e8e7
3 changed files with 30 additions and 8 deletions
|
@ -14,12 +14,27 @@ public abstract class FFBase : IDisposable
|
||||||
protected string ConfiguredRoot;
|
protected string ConfiguredRoot;
|
||||||
protected Process Process;
|
protected Process Process;
|
||||||
|
|
||||||
protected FFBase()
|
protected FFBase(FFMpegOptions opts = null)
|
||||||
{
|
{
|
||||||
ConfiguredRoot =
|
var options = opts;
|
||||||
!File.Exists(_ConfigFile) ?
|
|
||||||
_DefaultRoot :
|
if (
|
||||||
JsonConvert.DeserializeObject<Dictionary<string, string>>(File.ReadAllText(_ConfigFile))["RootDirectory"];
|
opts == null &&
|
||||||
|
File.Exists(_ConfigFile)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
options = JsonConvert.DeserializeObject<FFMpegOptions>(File.ReadAllText(_ConfigFile));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options == null)
|
||||||
|
{
|
||||||
|
options = new FFMpegOptions
|
||||||
|
{
|
||||||
|
RootDirectory = _DefaultRoot
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfiguredRoot = options.RootDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
<PackageProjectUrl>https://github.com/vladjerca/FFMpegCore</PackageProjectUrl>
|
||||||
<Copyright>Vlad Jerca</Copyright>
|
<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>
|
<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>
|
<Version>1.0.3</Version>
|
||||||
<AssemblyVersion>1.0.2.0</AssemblyVersion>
|
<AssemblyVersion>1.0.3.0</AssemblyVersion>
|
||||||
<FileVersion>1.0.2.0</FileVersion>
|
<FileVersion>1.0.3.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Reference in a new issue