-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
648 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## v1.1.0 | ||
|
||
|
||
|
||
## v1.0.0 | ||
|
||
* Initial release of Video4j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.metaloom.video4j.impl; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Map.Entry; | ||
|
||
import org.opencv.core.Mat; | ||
import org.opencv.core.Scalar; | ||
|
||
public class MatProvider { | ||
|
||
public static Map<Mat, UnreleasedMatException> trackedInstances = new HashMap<>(); | ||
|
||
public static Mat mat() { | ||
Mat mat = new Mat(); | ||
track(mat); | ||
return mat; | ||
} | ||
|
||
public static void released(Mat mat) { | ||
mat.release(); | ||
trackedInstances.remove(mat); | ||
} | ||
|
||
public static boolean hasLeaks() { | ||
return !trackedInstances.isEmpty(); | ||
} | ||
|
||
public static void printLeaks() { | ||
for (Entry<Mat, UnreleasedMatException> entry : trackedInstances.entrySet()) { | ||
entry.getValue().printStackTrace(); | ||
} | ||
} | ||
|
||
public static Mat empty(Mat source) { | ||
Mat mat = new Mat(source.size(), source.type(), Scalar.all(0f)); | ||
track(mat); | ||
return mat; | ||
} | ||
|
||
private static void track(Mat mat) { | ||
trackedInstances.put(mat, new UnreleasedMatException()); | ||
} | ||
} |
Oops, something went wrong.