Skip to content

Commit

Permalink
Improved stability on mips generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed Apr 14, 2024
1 parent 075a59e commit a712106
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 5 additions & 4 deletions FlashCap.V4L2Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ private enum FieldTypes
private static void GenerateInteropCode(
string structureDumperJsonFileName,
string basePath,
bool isBase)
bool isBase,
string dateTime)
{
var root = LoadMembersJson(structureDumperJsonFileName);
if (root == null)
Expand All @@ -408,7 +409,7 @@ private static void GenerateInteropCode(
tw.WriteLine($"// {root.Label}");
tw.WriteLine($"// {root.ClangVersion}");
tw.WriteLine($"// {root.GccVersion}");
tw.WriteLine($"// {DateTimeOffset.Now:R}");
tw.WriteLine($"// {dateTime}");
tw.WriteLine();

tw.WriteLine("using System;");
Expand Down Expand Up @@ -673,12 +674,12 @@ public static void Main(string[] args)
break;
case 2:
Console.Write(" Generating C# source code ...");
GenerateInteropCode(args[1], args[2], false);
GenerateInteropCode(args[1], args[2], false, args[3]);
Console.WriteLine(" done.");
break;
case 3:
Console.Write(" Generating C# base class source code ...");
GenerateInteropCode(args[1], args[2], true);
GenerateInteropCode(args[1], args[2], true, args[3]);
Console.WriteLine(" done.");
break;
}
Expand Down
6 changes: 4 additions & 2 deletions FlashCap.V4L2Generator/dumper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Configuration=Debug; export Configuration

#===============================================================

Timestamp=`date`; export Timestamp

$Clang -v |& head -n 1 > clang_version.txt
gcc -v |& tail -n 1 > gcc_version.txt

Expand All @@ -25,10 +27,10 @@ gcc -o videodev2.dumper videodev2.dumper.cpp
./videodev2.dumper > videodev2.h.members.json

echo "Step 4: Generate interop code."
mono bin/$Configuration/mono/FlashCap.V4L2Generator.exe 2 videodev2.h.members.json ../FlashCap.Core/Internal/V4L2/
mono bin/$Configuration/mono/FlashCap.V4L2Generator.exe 2 videodev2.h.members.json ../FlashCap.Core/Internal/V4L2/ "$Timestamp"

echo "Step 5: Generate base interop code."
mono bin/$Configuration/mono/FlashCap.V4L2Generator.exe 3 videodev2.h.members.json .
mono bin/$Configuration/mono/FlashCap.V4L2Generator.exe 3 videodev2.h.members.json . "$Timestamp"

echo ""
echo "Done, you have to check './NativeMethods_V4L2_Interop.cs' to merge manually some symbols into '../FlashCap.Core/Internal/V4L2/NativeMethods_V4L2_Interop.cs'."
Expand Down

0 comments on commit a712106

Please sign in to comment.