streaming_resources.proto 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.visionai.v1alpha1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/protobuf/duration.proto";
  19. import "google/protobuf/struct.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1";
  22. option go_package = "google.golang.org/genproto/googleapis/cloud/visionai/v1alpha1;visionai";
  23. option java_multiple_files = true;
  24. option java_outer_classname = "StreamingResourcesProto";
  25. option java_package = "com.google.cloud.visionai.v1alpha1";
  26. option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1";
  27. option ruby_package = "Google::Cloud::VisionAI::V1alpha1";
  28. // The descriptor for a gstreamer buffer payload.
  29. message GstreamerBufferDescriptor {
  30. // The caps string of the payload.
  31. string caps_string = 1;
  32. // Whether the buffer is a key frame.
  33. bool is_key_frame = 2;
  34. // PTS of the frame.
  35. google.protobuf.Timestamp pts_time = 3;
  36. // DTS of the frame.
  37. google.protobuf.Timestamp dts_time = 4;
  38. // Duration of the frame.
  39. google.protobuf.Duration duration = 5;
  40. }
  41. // The descriptor for a raw image.
  42. message RawImageDescriptor {
  43. // Raw image format. Its possible values are: "srgb".
  44. string format = 1;
  45. // The height of the image.
  46. int32 height = 2;
  47. // The width of the image.
  48. int32 width = 3;
  49. }
  50. // The message that represents the data type of a packet.
  51. message PacketType {
  52. // The message that fully specifies the type of the packet.
  53. message TypeDescriptor {
  54. // Detailed information about the type.
  55. //
  56. // It is non-empty only for specific type class codecs. Needed only when the
  57. // type string alone is not enough to disambiguate the specific type.
  58. oneof type_details {
  59. // GstreamerBufferDescriptor is the descriptor for gstreamer buffer type.
  60. GstreamerBufferDescriptor gstreamer_buffer_descriptor = 2;
  61. // RawImageDescriptor is the descriptor for the raw image type.
  62. RawImageDescriptor raw_image_descriptor = 3;
  63. }
  64. // The type of the packet. Its possible values is codec dependent.
  65. //
  66. // The fully qualified type name is always the concatenation of the
  67. // value in `type_class` together with the value in `type`, separated by a
  68. // '/'.
  69. //
  70. // Note that specific codecs can define their own type hierarchy, and so the
  71. // type string here can in fact be separated by multiple '/'s of its own.
  72. //
  73. // Please see the open source SDK for specific codec documentation.
  74. string type = 1;
  75. }
  76. // The type class of the packet. Its possible values are:
  77. // "gst", "protobuf", and "string".
  78. string type_class = 1;
  79. // The type descriptor.
  80. TypeDescriptor type_descriptor = 2;
  81. }
  82. // The message that represents server metadata.
  83. message ServerMetadata {
  84. // The offset position for the packet in its stream.
  85. int64 offset = 1;
  86. // The timestamp at which the stream server receives this packet. This is
  87. // based on the local clock of on the server side. It is guaranteed to be
  88. // monotonically increasing for the packets within each session; however
  89. // this timestamp is not comparable across packets sent to the same stream
  90. // different sessions. Session here refers to one individual gRPC streaming
  91. // request to the stream server.
  92. google.protobuf.Timestamp ingest_time = 2;
  93. }
  94. // The message that represents series metadata.
  95. message SeriesMetadata {
  96. // Series name. It's in the format of
  97. // "projects/{project}/locations/{location}/clusters/{cluster}/series/{stream}".
  98. string series = 1 [(google.api.resource_reference) = {
  99. type: "visionai.googleapis.com/Series"
  100. }];
  101. }
  102. // The message that represents packet header.
  103. message PacketHeader {
  104. // Input only. The capture time of the packet.
  105. google.protobuf.Timestamp capture_time = 1 [(google.api.field_behavior) = INPUT_ONLY];
  106. // Input only. Immutable. The type of the payload.
  107. PacketType type = 2 [
  108. (google.api.field_behavior) = INPUT_ONLY,
  109. (google.api.field_behavior) = IMMUTABLE
  110. ];
  111. // Input only. This field is for users to attach user managed metadata.
  112. google.protobuf.Struct metadata = 3 [(google.api.field_behavior) = INPUT_ONLY];
  113. // Output only. Metadata that the server appends to each packet before sending
  114. // it to receivers. You don't need to set a value for this field when sending
  115. // packets.
  116. ServerMetadata server_metadata = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  117. // Input only. Immutable. Metadata that the server needs to know where to
  118. // write the packets to. It's only required for the first packet.
  119. SeriesMetadata series_metadata = 5 [
  120. (google.api.field_behavior) = INPUT_ONLY,
  121. (google.api.field_behavior) = IMMUTABLE
  122. ];
  123. // Immutable. Packet flag set. SDK will set the flag automatically.
  124. int32 flags = 6 [(google.api.field_behavior) = IMMUTABLE];
  125. // Immutable. Header string for tracing across services. It should be set when the packet
  126. // is first arrived in the stream server.
  127. //
  128. // The input format is a lowercase hex string:
  129. // - version_id: 1 byte, currently must be zero - hex encoded (2 characters)
  130. // - trace_id: 16 bytes (opaque blob) - hex encoded (32 characters)
  131. // - span_id: 8 bytes (opaque blob) - hex encoded (16 characters)
  132. // - trace_options: 1 byte (LSB means tracing enabled) - hex encoded (2
  133. // characters)
  134. // Example: "00-404142434445464748494a4b4c4d4e4f-6162636465666768-01"
  135. // v trace_id span_id options
  136. string trace_context = 7 [(google.api.field_behavior) = IMMUTABLE];
  137. }
  138. // The quanta of datum that the series accepts.
  139. message Packet {
  140. // The packet header.
  141. PacketHeader header = 1;
  142. // The payload of the packet.
  143. bytes payload = 2;
  144. }