|
16 | 16 |
|
17 | 17 | package com.example.video;
|
18 | 18 |
|
19 |
| -import com.google.api.gax.grpc.OperationFuture; |
| 19 | +import com.google.api.gax.rpc.OperationFuture; |
20 | 20 | import com.google.cloud.videointelligence.v1beta1.AnnotateVideoProgress;
|
21 | 21 | import com.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest;
|
22 | 22 | import com.google.cloud.videointelligence.v1beta1.AnnotateVideoResponse;
|
|
30 | 30 | import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceClient;
|
31 | 31 | import com.google.cloud.videointelligence.v1beta1.VideoIntelligenceServiceSettings;
|
32 | 32 | import com.google.cloud.videointelligence.v1beta1.VideoSegment;
|
33 |
| -import org.apache.commons.codec.binary.Base64; |
34 |
| - |
| 33 | +import com.google.longrunning.Operation; |
35 | 34 | import java.io.IOException;
|
36 | 35 | import java.nio.file.Files;
|
37 | 36 | import java.nio.file.Path;
|
38 | 37 | import java.nio.file.Paths;
|
39 | 38 | import java.util.concurrent.ExecutionException;
|
| 39 | +import org.apache.commons.codec.binary.Base64; |
40 | 40 |
|
41 | 41 |
|
42 | 42 | public class Detect {
|
@@ -112,7 +112,7 @@ public static void analyzeFaces(String gcsUri) throws ExecutionException,
|
112 | 112 | .addFeatures(Feature.FACE_DETECTION)
|
113 | 113 | .build();
|
114 | 114 |
|
115 |
| - OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation = |
| 115 | + OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation = |
116 | 116 | client.annotateVideoAsync(request);
|
117 | 117 |
|
118 | 118 | System.out.println("Waiting for operation to complete...");
|
@@ -152,7 +152,7 @@ public static void analyzeLabels(String gcsUri) throws
|
152 | 152 | .addFeatures(Feature.LABEL_DETECTION)
|
153 | 153 | .build();
|
154 | 154 |
|
155 |
| - OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation = |
| 155 | + OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation = |
156 | 156 | client.annotateVideoAsync(request);
|
157 | 157 |
|
158 | 158 | System.out.println("Waiting for operation to complete...");
|
@@ -200,7 +200,7 @@ public static void analyzeLabelsFile(String filePath) throws
|
200 | 200 | .addFeatures(Feature.LABEL_DETECTION)
|
201 | 201 | .build();
|
202 | 202 |
|
203 |
| - OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation = |
| 203 | + OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation = |
204 | 204 | client.annotateVideoAsync(request);
|
205 | 205 |
|
206 | 206 | System.out.println("Waiting for operation to complete...");
|
@@ -245,7 +245,7 @@ public static void analyzeShots(String gcsUri)
|
245 | 245 | .addFeatures(Feature.SHOT_CHANGE_DETECTION)
|
246 | 246 | .build();
|
247 | 247 |
|
248 |
| - OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation = |
| 248 | + OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation = |
249 | 249 | client.annotateVideoAsync(request);
|
250 | 250 |
|
251 | 251 | System.out.println("Waiting for operation to complete...");
|
@@ -285,7 +285,7 @@ public static void analyzeSafeSearch(String gcsUri)
|
285 | 285 | .addFeatures(Feature.SAFE_SEARCH_DETECTION)
|
286 | 286 | .build();
|
287 | 287 |
|
288 |
| - OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress> operation = |
| 288 | + OperationFuture<AnnotateVideoResponse, AnnotateVideoProgress, Operation> operation = |
289 | 289 | client.annotateVideoAsync(request);
|
290 | 290 |
|
291 | 291 | System.out.println("Waiting for operation to complete...");
|
|
0 commit comments