39 lines
1.4 KiB
C++
39 lines
1.4 KiB
C++
#pragma once
|
|||
|
|
|
||
|
|
// Cloud Video Intelligence v1: videos.annotate starts a long-running
|
||
|
|
// operation (paid per minute of video and feature); operations are read,
|
||
|
|
// listed, cancelled or deleted through the project location.
|
||
|
|
|
||
|
|
#include <string>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
#include "google/cloudai/cloudai_service.h"
|
||
|
|
|
||
|
|
namespace molo::google::cloudai {
|
||
|
|
|
||
|
|
struct VideoRequest {
|
||
|
|
std::string input_uri; // gs:// video
|
||
|
|
std::string input_content_base64; // alternative, at most 10 MiB
|
||
|
|
std::vector<std::string> features; // 1..9, AnnotateVideoRequest.features enum
|
||
|
|
std::string output_uri; // optional gs:// for the JSON result
|
||
|
|
std::string location_id; // optional: us-east1, us-west1, europe-west1, asia-east1
|
||
|
|
};
|
||
|
|
|
||
|
|
class VideoIntelligence : public CloudAiService {
|
||
|
|
public:
|
||
|
|
using CloudAiService::CloudAiService;
|
||
|
|
|
||
|
|
clients::body::Json annotate_body(const VideoRequest& r) const;
|
||
|
|
// Starts the operation and answers it; never waits (videos take minutes).
|
||
|
|
Operation annotate_start(const VideoRequest& r) const;
|
||
|
|
|
||
|
|
Operation get_operation(const std::string& name) const;
|
||
|
|
clients::body::Json list_operations(const std::string& filter = "") const;
|
||
|
|
// Cancel and delete are explicit.
|
||
|
|
void cancel_operation(const std::string& name) const;
|
||
|
|
void delete_operation(const std::string& name) const;
|
||
|
|
Operation wait_operation_done(const std::string& name) const;
|
||
|
|
};
|
||
|
|
|
||
|
|
} // namespace molo::google::cloudai
|