Skip to content

Commit

Permalink
fix: build for iOS and Android
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed Mar 7, 2021
1 parent 353e642 commit 7a815f9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override void Initialize() {
public override Status StartRun() {
#if UNITY_IOS
// On iOS, it's faster to get output packets synchronously than asynchronously.
outputStreamPoller = graph.AddOutputStreamPoller<ImageFrame>(outputStream).ConsumeValueOrDie();
outputStreamPoller = graph.AddOutputStreamPoller<ImageFrame>(outputStream).Value();
outputPacket = new ImageFramePacket();
#elif UNITY_EDITOR || !UNITY_ANDROID
graph.ObserveOutputStream<ImageFramePacket, ImageFrame>(outputStream, OutputVideoCallback, out outputVideoCallbackHandle).AssertOk();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void isDisposed_ShouldReturnTrue_When_AlreadyDisposed() {

#region #Value
[Test, GpuOnly]
public void ConsumeValueOrDie_ShouldReturnGpuResources_When_StatusIsOk() {
public void Value_ShouldReturnGpuResources_When_StatusIsOk() {
var statusOrGpuResources = GpuResources.Create();
Assert.True(statusOrGpuResources.ok);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void isDisposed_ShouldReturnTrue_When_AlreadyDisposed() {

#region #Value
[Test]
public void ConsumeValueOrDie_ShouldReturnImageFrame_When_StatusIsOk() {
public void Value_ShouldReturnImageFrame_When_StatusIsOk() {
var statusOrImageFrame = InitializeSubject();
Assert.True(statusOrImageFrame.ok);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ EOF
"@com_google_mediapipe//mediapipe/framework:calculator_java_proto_lite",
"@com_google_mediapipe//mediapipe/framework:calculator_profile_java_proto_lite",
"@com_google_mediapipe//mediapipe/framework/tool:calculator_graph_template_java_proto_lite",
"@com_google_protobuf//:protobuf_javalite",
"//third_party:androidx_annotation",
"//third_party:androidx_appcompat",
"//third_party:androidx_core",
Expand Down
18 changes: 18 additions & 0 deletions C/third_party/mediapipe_android.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/mediapipe/calculators/tensor/BUILD b/mediapipe/calculators/tensor/BUILD
index 5a06310..400e537 100644
--- a/mediapipe/calculators/tensor/BUILD
+++ b/mediapipe/calculators/tensor/BUILD
@@ -87,7 +87,12 @@ cc_library(
"@org_tensorflow//tensorflow/lite/delegates/gpu/gl:gl_buffer",
"@org_tensorflow//tensorflow/lite/delegates/gpu/gl:gl_program",
"@org_tensorflow//tensorflow/lite/delegates/gpu/gl:gl_shader",
- ],
+ ] + select({
+ "//mediapipe:android": [
+ "//mediapipe/util/android/file/base",
+ ],
+ "//conditions:default": [],
+ }),
alwayslink = 1,
)

0 comments on commit 7a815f9

Please sign in to comment.