From 27e14f42607b47ac68fe2d662cfcc8d44bc706ca Mon Sep 17 00:00:00 2001 From: Marcelo Pires Date: Thu, 24 Oct 2024 13:07:34 +0100 Subject: [PATCH] Make decode codec mime backward compatible (#806) * make decode codec backward compatible even if it was unused * gen protos --- protobuf/video/sfu/models/models.pb.go | 12 ++++++------ protobuf/video/sfu/models/models.proto | 6 +++--- protobuf/video/sfu/models/models_vtproto.pb.go | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/protobuf/video/sfu/models/models.pb.go b/protobuf/video/sfu/models/models.pb.go index 29af260e..99cfde36 100644 --- a/protobuf/video/sfu/models/models.pb.go +++ b/protobuf/video/sfu/models/models.pb.go @@ -1290,9 +1290,9 @@ type Codec struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MimeType string `protobuf:"bytes,1,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` - ScalabilityMode string `protobuf:"bytes,2,opt,name=scalability_mode,json=scalabilityMode,proto3" json:"scalability_mode,omitempty"` - Fmtp string `protobuf:"bytes,3,opt,name=fmtp,proto3" json:"fmtp,omitempty"` + MimeType string `protobuf:"bytes,10,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` + ScalabilityMode string `protobuf:"bytes,11,opt,name=scalability_mode,json=scalabilityMode,proto3" json:"scalability_mode,omitempty"` + Fmtp string `protobuf:"bytes,12,opt,name=fmtp,proto3" json:"fmtp,omitempty"` } func (x *Codec) Reset() { @@ -2338,11 +2338,11 @@ var file_video_sfu_models_models_proto_rawDesc = []byte{ 0x66, 0x75, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x51, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x07, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x63, 0x0a, 0x05, 0x43, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x69, 0x6d, 0x65, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x62, 0x69, - 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x63, 0x61, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x6f, 0x64, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6d, 0x74, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6d, 0x74, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x6d, 0x74, 0x70, 0x22, 0x90, 0x01, 0x0a, 0x0a, 0x49, 0x43, 0x45, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x12, 0x3e, 0x0a, 0x09, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, diff --git a/protobuf/video/sfu/models/models.proto b/protobuf/video/sfu/models/models.proto index 904f7c05..4f50e653 100644 --- a/protobuf/video/sfu/models/models.proto +++ b/protobuf/video/sfu/models/models.proto @@ -110,9 +110,9 @@ message VideoLayer { message Codec { - string mime_type = 1; - string scalability_mode = 2; - string fmtp = 3; + string mime_type = 10; + string scalability_mode = 11; + string fmtp = 12; } message ICETrickle { diff --git a/protobuf/video/sfu/models/models_vtproto.pb.go b/protobuf/video/sfu/models/models_vtproto.pb.go index 5fd38659..9306fb15 100644 --- a/protobuf/video/sfu/models/models_vtproto.pb.go +++ b/protobuf/video/sfu/models/models_vtproto.pb.go @@ -563,21 +563,21 @@ func (m *Codec) MarshalToSizedBufferVT(dAtA []byte) (int, error) { copy(dAtA[i:], m.Fmtp) i = encodeVarint(dAtA, i, uint64(len(m.Fmtp))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x62 } if len(m.ScalabilityMode) > 0 { i -= len(m.ScalabilityMode) copy(dAtA[i:], m.ScalabilityMode) i = encodeVarint(dAtA, i, uint64(len(m.ScalabilityMode))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x5a } if len(m.MimeType) > 0 { i -= len(m.MimeType) copy(dAtA[i:], m.MimeType) i = encodeVarint(dAtA, i, uint64(len(m.MimeType))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x52 } return len(dAtA) - i, nil } @@ -3310,7 +3310,7 @@ func (m *Codec) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: Codec: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: + case 10: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field MimeType", wireType) } @@ -3342,7 +3342,7 @@ func (m *Codec) UnmarshalVT(dAtA []byte) error { } m.MimeType = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 11: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ScalabilityMode", wireType) } @@ -3374,7 +3374,7 @@ func (m *Codec) UnmarshalVT(dAtA []byte) error { } m.ScalabilityMode = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 12: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Fmtp", wireType) }