Skip to content

Commit a712106

Browse files
committed
Improved stability on mips generation.
1 parent 075a59e commit a712106

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

FlashCap.V4L2Generator/Program.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,8 @@ private enum FieldTypes
389389
private static void GenerateInteropCode(
390390
string structureDumperJsonFileName,
391391
string basePath,
392-
bool isBase)
392+
bool isBase,
393+
string dateTime)
393394
{
394395
var root = LoadMembersJson(structureDumperJsonFileName);
395396
if (root == null)
@@ -408,7 +409,7 @@ private static void GenerateInteropCode(
408409
tw.WriteLine($"// {root.Label}");
409410
tw.WriteLine($"// {root.ClangVersion}");
410411
tw.WriteLine($"// {root.GccVersion}");
411-
tw.WriteLine($"// {DateTimeOffset.Now:R}");
412+
tw.WriteLine($"// {dateTime}");
412413
tw.WriteLine();
413414

414415
tw.WriteLine("using System;");
@@ -673,12 +674,12 @@ public static void Main(string[] args)
673674
break;
674675
case 2:
675676
Console.Write(" Generating C# source code ...");
676-
GenerateInteropCode(args[1], args[2], false);
677+
GenerateInteropCode(args[1], args[2], false, args[3]);
677678
Console.WriteLine(" done.");
678679
break;
679680
case 3:
680681
Console.Write(" Generating C# base class source code ...");
681-
GenerateInteropCode(args[1], args[2], true);
682+
GenerateInteropCode(args[1], args[2], true, args[3]);
682683
Console.WriteLine(" done.");
683684
break;
684685
}

FlashCap.V4L2Generator/dumper.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Configuration=Debug; export Configuration
1111

1212
#===============================================================
1313

14+
Timestamp=`date`; export Timestamp
15+
1416
$Clang -v |& head -n 1 > clang_version.txt
1517
gcc -v |& tail -n 1 > gcc_version.txt
1618

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

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

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

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

0 commit comments

Comments
 (0)