Skip to content

Commit 7a71c6d

Browse files
gguusschingor13
authored andcommitted
samples: Upgrades client to 0.20.1 and addresses changes to long running operations
1 parent f3c73d9 commit 7a71c6d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

video/src/main/java/com/example/video/Detect.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.example.video;
1818

1919
import com.google.api.gax.grpc.OperationFuture;
20+
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
2021
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
2122
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
2223
import com.google.cloud.videointelligence.v1beta1.FaceAnnotation;
@@ -111,7 +112,7 @@ public static void analyzeFaces(String gcsUri) throws ExecutionException,
111112
.addFeatures(Feature.FACE_DETECTION)
112113
.build();
113114

114-
OperationFuture<AnnotateVideoResponse> operation =
115+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
115116
client.annotateVideoAsync(request);
116117

117118
System.out.println("Waiting for operation to complete...");
@@ -151,7 +152,7 @@ public static void analyzeLabels(String gcsUri) throws
151152
.addFeatures(Feature.LABEL_DETECTION)
152153
.build();
153154

154-
OperationFuture<AnnotateVideoResponse> operation =
155+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
155156
client.annotateVideoAsync(request);
156157

157158
System.out.println("Waiting for operation to complete...");
@@ -199,7 +200,7 @@ public static void analyzeLabelsFile(String filePath) throws
199200
.addFeatures(Feature.LABEL_DETECTION)
200201
.build();
201202

202-
OperationFuture<AnnotateVideoResponse> operation =
203+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
203204
client.annotateVideoAsync(request);
204205

205206
System.out.println("Waiting for operation to complete...");
@@ -244,7 +245,7 @@ public static void analyzeShots(String gcsUri)
244245
.addFeatures(Feature.SHOT_CHANGE_DETECTION)
245246
.build();
246247

247-
OperationFuture<AnnotateVideoResponse> operation =
248+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
248249
client.annotateVideoAsync(request);
249250

250251
System.out.println("Waiting for operation to complete...");
@@ -284,7 +285,7 @@ public static void analyzeSafeSearch(String gcsUri)
284285
.addFeatures(Feature.SAFE_SEARCH_DETECTION)
285286
.build();
286287

287-
OperationFuture<AnnotateVideoResponse> operation =
288+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
288289
client.annotateVideoAsync(request);
289290

290291
System.out.println("Waiting for operation to complete...");

video/src/main/java/com/example/video/QuickstartSample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
// [START videointelligence_quickstart]
2020
import com.google.api.gax.grpc.OperationFuture;
21+
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
2122
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
2223
import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
2324
import com.google.cloud.videointelligence.v1beta1.Feature;
@@ -48,7 +49,7 @@ public static void main(String[] args) throws
4849
.addFeatures(Feature.LABEL_DETECTION)
4950
.build();
5051

51-
OperationFuture<AnnotateVideoResponse> operation =
52+
OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation =
5253
client.annotateVideoAsync(request);
5354

5455
System.out.println("Waiting for operation to complete...");

0 commit comments

Comments
 (0)