1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct VideoChannelSeries {
4 #[prost(string, tag = "1")]
5 pub dataset_rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub channel: ::prost::alloc::string::String,
8 #[prost(map = "string, string", tag = "3")]
9 pub tags: ::std::collections::HashMap<
10 ::prost::alloc::string::String,
11 ::prost::alloc::string::String,
12 >,
13}
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct VideoFileSource {
16 #[prost(string, tag = "1")]
17 pub video_file_rid: ::prost::alloc::string::String,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct DatasetFileSource {
21 #[prost(string, tag = "1")]
22 pub dataset_file_id: ::prost::alloc::string::String,
23 #[prost(string, tag = "2")]
24 pub dataset_rid: ::prost::alloc::string::String,
25 #[prost(message, optional, tag = "3")]
26 pub series: ::core::option::Option<VideoChannelSeries>,
27 #[prost(message, optional, tag = "4")]
28 pub normalization_options: ::core::option::Option<VideoNormalizationOptions>,
29}
30#[derive(Clone, Copy, PartialEq, ::prost::Message)]
31pub struct VideoNormalizationOptions {
32 #[prost(bool, optional, tag = "1")]
33 pub force_normalization: ::core::option::Option<bool>,
34}
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct CreateFileSegmentationRequest {
37 #[prost(string, tag = "3")]
38 pub ingest_job_rid: ::prost::alloc::string::String,
39 #[prost(bool, optional, tag = "4")]
40 pub overwrite_segments: ::core::option::Option<bool>,
41 #[prost(oneof = "create_file_segmentation_request::Source", tags = "1, 2")]
42 pub source: ::core::option::Option<create_file_segmentation_request::Source>,
43}
44pub mod create_file_segmentation_request {
46 #[derive(Clone, PartialEq, ::prost::Oneof)]
47 pub enum Source {
48 #[prost(message, tag = "1")]
49 VideoFile(super::VideoFileSource),
50 #[prost(message, tag = "2")]
51 DatasetFile(super::DatasetFileSource),
52 }
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct CreateFileSegmentationResponse {
56 #[prost(string, tag = "1")]
57 pub job_rid: ::prost::alloc::string::String,
58}
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct CreateConcatenatedFileSegmentationRequest {
61 #[prost(string, repeated, tag = "1")]
62 pub dataset_file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
63 #[prost(string, tag = "2")]
64 pub dataset_rid: ::prost::alloc::string::String,
65 #[prost(string, tag = "3")]
66 pub ingest_job_rid: ::prost::alloc::string::String,
67 #[prost(message, optional, tag = "4")]
68 pub series: ::core::option::Option<VideoChannelSeries>,
69 #[prost(bool, optional, tag = "5")]
70 pub overwrite_segments: ::core::option::Option<bool>,
71 #[prost(message, optional, tag = "6")]
72 pub normalization_options: ::core::option::Option<VideoNormalizationOptions>,
73}
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct CreateConcatenatedFileSegmentationResponse {
76 #[prost(string, tag = "1")]
77 pub job_rid: ::prost::alloc::string::String,
78}
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct CreateStreamSegmentRequest {
81 #[prost(string, tag = "3")]
82 pub stream_uuid: ::prost::alloc::string::String,
83 #[prost(string, tag = "4")]
84 pub s3_bucket: ::prost::alloc::string::String,
85 #[prost(string, tag = "5")]
86 pub s3_key: ::prost::alloc::string::String,
87 #[prost(message, optional, tag = "6")]
88 pub segment_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
89 #[prost(double, tag = "7")]
90 pub duration_seconds: f64,
91 #[prost(int64, tag = "8")]
92 pub size_bytes: i64,
93 #[prost(oneof = "create_stream_segment_request::Destination", tags = "1, 2")]
94 pub destination: ::core::option::Option<create_stream_segment_request::Destination>,
95}
96pub mod create_stream_segment_request {
98 #[derive(Clone, PartialEq, ::prost::Oneof)]
99 pub enum Destination {
100 #[prost(string, tag = "1")]
101 VideoRid(::prost::alloc::string::String),
102 #[prost(message, tag = "2")]
103 Series(super::VideoChannelSeries),
104 }
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct CreateStreamSegmentResponse {
108 #[prost(string, tag = "1")]
109 pub job_rid: ::prost::alloc::string::String,
110}
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct ExportSegment {
113 #[prost(string, tag = "1")]
114 pub s3_path: ::prost::alloc::string::String,
115 #[prost(message, optional, tag = "2")]
116 pub min_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
117 #[prost(message, optional, tag = "3")]
118 pub max_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
119 #[prost(double, tag = "4")]
120 pub duration_seconds: f64,
121 #[prost(int32, tag = "5")]
122 pub duration_frames: i32,
123}
124#[derive(Clone, Copy, PartialEq, ::prost::Message)]
125pub struct ExportTimeRange {
126 #[prost(message, optional, tag = "1")]
127 pub start: ::core::option::Option<super::super::types::time::Timestamp>,
128 #[prost(message, optional, tag = "2")]
129 pub end: ::core::option::Option<super::super::types::time::Timestamp>,
130}
131#[derive(Clone, PartialEq, ::prost::Message)]
132pub struct CreateExportRequest {
133 #[prost(string, tag = "1")]
134 pub export_id: ::prost::alloc::string::String,
135 #[prost(message, repeated, tag = "2")]
136 pub segments: ::prost::alloc::vec::Vec<ExportSegment>,
137 #[prost(int64, tag = "3")]
138 pub max_total_input_bytes: i64,
139 #[prost(message, optional, tag = "4")]
140 pub output_range: ::core::option::Option<ExportTimeRange>,
141}
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct CreateExportResponse {
144 #[prost(string, tag = "1")]
145 pub workflow_id: ::prost::alloc::string::String,
146}
147#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
148#[repr(i32)]
149pub enum VideoSegmenterError {
150 Unspecified = 0,
151 MalformedIdentifier = 1,
152 TimestampOutOfRange = 2,
153}
154impl VideoSegmenterError {
155 pub fn as_str_name(&self) -> &'static str {
160 match self {
161 Self::Unspecified => "VIDEO_SEGMENTER_ERROR_UNSPECIFIED",
162 Self::MalformedIdentifier => "VIDEO_SEGMENTER_ERROR_MALFORMED_IDENTIFIER",
163 Self::TimestampOutOfRange => "VIDEO_SEGMENTER_ERROR_TIMESTAMP_OUT_OF_RANGE",
164 }
165 }
166 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
168 match value {
169 "VIDEO_SEGMENTER_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
170 "VIDEO_SEGMENTER_ERROR_MALFORMED_IDENTIFIER" => {
171 Some(Self::MalformedIdentifier)
172 }
173 "VIDEO_SEGMENTER_ERROR_TIMESTAMP_OUT_OF_RANGE" => {
174 Some(Self::TimestampOutOfRange)
175 }
176 _ => None,
177 }
178 }
179}
180pub mod internal_video_segmenter_service_client {
182 #![allow(
183 unused_variables,
184 dead_code,
185 missing_docs,
186 clippy::wildcard_imports,
187 clippy::let_unit_value,
188 )]
189 use tonic::codegen::*;
190 use tonic::codegen::http::Uri;
191 #[derive(Debug, Clone)]
192 pub struct InternalVideoSegmenterServiceClient<T> {
193 inner: tonic::client::Grpc<T>,
194 }
195 impl InternalVideoSegmenterServiceClient<tonic::transport::Channel> {
196 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
198 where
199 D: TryInto<tonic::transport::Endpoint>,
200 D::Error: Into<StdError>,
201 {
202 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
203 Ok(Self::new(conn))
204 }
205 }
206 impl<T> InternalVideoSegmenterServiceClient<T>
207 where
208 T: tonic::client::GrpcService<tonic::body::Body>,
209 T::Error: Into<StdError>,
210 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
211 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
212 {
213 pub fn new(inner: T) -> Self {
214 let inner = tonic::client::Grpc::new(inner);
215 Self { inner }
216 }
217 pub fn with_origin(inner: T, origin: Uri) -> Self {
218 let inner = tonic::client::Grpc::with_origin(inner, origin);
219 Self { inner }
220 }
221 pub fn with_interceptor<F>(
222 inner: T,
223 interceptor: F,
224 ) -> InternalVideoSegmenterServiceClient<InterceptedService<T, F>>
225 where
226 F: tonic::service::Interceptor,
227 T::ResponseBody: Default,
228 T: tonic::codegen::Service<
229 http::Request<tonic::body::Body>,
230 Response = http::Response<
231 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
232 >,
233 >,
234 <T as tonic::codegen::Service<
235 http::Request<tonic::body::Body>,
236 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
237 {
238 InternalVideoSegmenterServiceClient::new(
239 InterceptedService::new(inner, interceptor),
240 )
241 }
242 #[must_use]
247 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
248 self.inner = self.inner.send_compressed(encoding);
249 self
250 }
251 #[must_use]
253 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
254 self.inner = self.inner.accept_compressed(encoding);
255 self
256 }
257 #[must_use]
261 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
262 self.inner = self.inner.max_decoding_message_size(limit);
263 self
264 }
265 #[must_use]
269 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
270 self.inner = self.inner.max_encoding_message_size(limit);
271 self
272 }
273 pub async fn create_file_segmentation(
274 &mut self,
275 request: impl tonic::IntoRequest<super::CreateFileSegmentationRequest>,
276 ) -> std::result::Result<
277 tonic::Response<super::CreateFileSegmentationResponse>,
278 tonic::Status,
279 > {
280 self.inner
281 .ready()
282 .await
283 .map_err(|e| {
284 tonic::Status::unknown(
285 format!("Service was not ready: {}", e.into()),
286 )
287 })?;
288 let codec = tonic::codec::ProstCodec::default();
289 let path = http::uri::PathAndQuery::from_static(
290 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateFileSegmentation",
291 );
292 let mut req = request.into_request();
293 req.extensions_mut()
294 .insert(
295 GrpcMethod::new(
296 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
297 "CreateFileSegmentation",
298 ),
299 );
300 self.inner.unary(req, path, codec).await
301 }
302 pub async fn create_concatenated_file_segmentation(
303 &mut self,
304 request: impl tonic::IntoRequest<
305 super::CreateConcatenatedFileSegmentationRequest,
306 >,
307 ) -> std::result::Result<
308 tonic::Response<super::CreateConcatenatedFileSegmentationResponse>,
309 tonic::Status,
310 > {
311 self.inner
312 .ready()
313 .await
314 .map_err(|e| {
315 tonic::Status::unknown(
316 format!("Service was not ready: {}", e.into()),
317 )
318 })?;
319 let codec = tonic::codec::ProstCodec::default();
320 let path = http::uri::PathAndQuery::from_static(
321 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateConcatenatedFileSegmentation",
322 );
323 let mut req = request.into_request();
324 req.extensions_mut()
325 .insert(
326 GrpcMethod::new(
327 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
328 "CreateConcatenatedFileSegmentation",
329 ),
330 );
331 self.inner.unary(req, path, codec).await
332 }
333 pub async fn create_stream_segment(
334 &mut self,
335 request: impl tonic::IntoRequest<super::CreateStreamSegmentRequest>,
336 ) -> std::result::Result<
337 tonic::Response<super::CreateStreamSegmentResponse>,
338 tonic::Status,
339 > {
340 self.inner
341 .ready()
342 .await
343 .map_err(|e| {
344 tonic::Status::unknown(
345 format!("Service was not ready: {}", e.into()),
346 )
347 })?;
348 let codec = tonic::codec::ProstCodec::default();
349 let path = http::uri::PathAndQuery::from_static(
350 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateStreamSegment",
351 );
352 let mut req = request.into_request();
353 req.extensions_mut()
354 .insert(
355 GrpcMethod::new(
356 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
357 "CreateStreamSegment",
358 ),
359 );
360 self.inner.unary(req, path, codec).await
361 }
362 pub async fn create_export(
363 &mut self,
364 request: impl tonic::IntoRequest<super::CreateExportRequest>,
365 ) -> std::result::Result<
366 tonic::Response<super::CreateExportResponse>,
367 tonic::Status,
368 > {
369 self.inner
370 .ready()
371 .await
372 .map_err(|e| {
373 tonic::Status::unknown(
374 format!("Service was not ready: {}", e.into()),
375 )
376 })?;
377 let codec = tonic::codec::ProstCodec::default();
378 let path = http::uri::PathAndQuery::from_static(
379 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateExport",
380 );
381 let mut req = request.into_request();
382 req.extensions_mut()
383 .insert(
384 GrpcMethod::new(
385 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
386 "CreateExport",
387 ),
388 );
389 self.inner.unary(req, path, codec).await
390 }
391 }
392}