commonMain.media.Codec.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-entities Show documentation
Show all versions of proto-entities Show documentation
KMP package which exports compiled protobuf entities to be used by other repos
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: media.Codec in media/common.proto
package media
import com.squareup.wire.FieldEncoding
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.ProtoReader
import com.squareup.wire.ProtoWriter
import com.squareup.wire.ReverseProtoWriter
import com.squareup.wire.Syntax.PROTO_3
import com.squareup.wire.WireField
import com.squareup.wire.`internal`.sanitize
import kotlin.Any
import kotlin.AssertionError
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.DeprecationLevel
import kotlin.Int
import kotlin.Long
import kotlin.Nothing
import kotlin.String
import kotlin.Unit
import okio.ByteString
public class Codec(
/**
* Only for Audio
*/
@field:WireField(
tag = 1,
adapter = "com.squareup.wire.ProtoAdapter#INT32",
)
public val channels: Int? = null,
@field:WireField(
tag = 2,
adapter = "com.squareup.wire.ProtoAdapter#INT32",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "clockRate",
)
public val clock_rate: Int = 0,
@field:WireField(
tag = 3,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
label = WireField.Label.OMIT_IDENTITY,
jsonName = "mimeType",
)
public val mime_type: String = "",
@field:WireField(
tag = 4,
adapter = "com.squareup.wire.ProtoAdapter#STRING",
jsonName = "sdpFmtpLine",
)
public val sdp_fmtp_line: String? = null,
unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
@Deprecated(
message = "Shouldn't be used in Kotlin",
level = DeprecationLevel.HIDDEN,
)
public override fun newBuilder(): Nothing = throw
AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin")
public override fun equals(other: Any?): Boolean {
if (other === this) return true
if (other !is Codec) return false
if (unknownFields != other.unknownFields) return false
if (channels != other.channels) return false
if (clock_rate != other.clock_rate) return false
if (mime_type != other.mime_type) return false
if (sdp_fmtp_line != other.sdp_fmtp_line) return false
return true
}
public override fun hashCode(): Int {
var result = super.hashCode
if (result == 0) {
result = unknownFields.hashCode()
result = result * 37 + (channels?.hashCode() ?: 0)
result = result * 37 + clock_rate.hashCode()
result = result * 37 + mime_type.hashCode()
result = result * 37 + (sdp_fmtp_line?.hashCode() ?: 0)
super.hashCode = result
}
return result
}
public override fun toString(): String {
val result = mutableListOf()
if (channels != null) result += """channels=$channels"""
result += """clock_rate=$clock_rate"""
result += """mime_type=${sanitize(mime_type)}"""
if (sdp_fmtp_line != null) result += """sdp_fmtp_line=${sanitize(sdp_fmtp_line)}"""
return result.joinToString(prefix = "Codec{", separator = ", ", postfix = "}")
}
public fun copy(
channels: Int? = this.channels,
clock_rate: Int = this.clock_rate,
mime_type: String = this.mime_type,
sdp_fmtp_line: String? = this.sdp_fmtp_line,
unknownFields: ByteString = this.unknownFields,
): Codec = Codec(channels, clock_rate, mime_type, sdp_fmtp_line, unknownFields)
public companion object {
public val ADAPTER: ProtoAdapter = object : ProtoAdapter(
FieldEncoding.LENGTH_DELIMITED,
Codec::class,
"type.googleapis.com/media.Codec",
PROTO_3,
null,
"media/common.proto"
) {
public override fun encodedSize(`value`: Codec): Int {
var size = value.unknownFields.size
size += ProtoAdapter.INT32.encodedSizeWithTag(1, value.channels)
if (value.clock_rate != 0) size += ProtoAdapter.INT32.encodedSizeWithTag(2,
value.clock_rate)
if (value.mime_type != "") size += ProtoAdapter.STRING.encodedSizeWithTag(3,
value.mime_type)
size += ProtoAdapter.STRING.encodedSizeWithTag(4, value.sdp_fmtp_line)
return size
}
public override fun encode(writer: ProtoWriter, `value`: Codec): Unit {
ProtoAdapter.INT32.encodeWithTag(writer, 1, value.channels)
if (value.clock_rate != 0) ProtoAdapter.INT32.encodeWithTag(writer, 2, value.clock_rate)
if (value.mime_type != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.mime_type)
ProtoAdapter.STRING.encodeWithTag(writer, 4, value.sdp_fmtp_line)
writer.writeBytes(value.unknownFields)
}
public override fun encode(writer: ReverseProtoWriter, `value`: Codec): Unit {
writer.writeBytes(value.unknownFields)
ProtoAdapter.STRING.encodeWithTag(writer, 4, value.sdp_fmtp_line)
if (value.mime_type != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.mime_type)
if (value.clock_rate != 0) ProtoAdapter.INT32.encodeWithTag(writer, 2, value.clock_rate)
ProtoAdapter.INT32.encodeWithTag(writer, 1, value.channels)
}
public override fun decode(reader: ProtoReader): Codec {
var channels: Int? = null
var clock_rate: Int = 0
var mime_type: String = ""
var sdp_fmtp_line: String? = null
val unknownFields = reader.forEachTag { tag ->
when (tag) {
1 -> channels = ProtoAdapter.INT32.decode(reader)
2 -> clock_rate = ProtoAdapter.INT32.decode(reader)
3 -> mime_type = ProtoAdapter.STRING.decode(reader)
4 -> sdp_fmtp_line = ProtoAdapter.STRING.decode(reader)
else -> reader.readUnknownField(tag)
}
}
return Codec(
channels = channels,
clock_rate = clock_rate,
mime_type = mime_type,
sdp_fmtp_line = sdp_fmtp_line,
unknownFields = unknownFields
)
}
public override fun redact(`value`: Codec): Codec = value.copy(
unknownFields = ByteString.EMPTY
)
}
private const val serialVersionUID: Long = 0L
}
}