@@ -199,7 +199,7 @@ def convert(
199
199
return VideoFrame ._from_owned_info (resp .video_convert .buffer )
200
200
201
201
def __repr__ (self ) -> str :
202
- return f"rtc.VideoFrame(width={ self .width } , height={ self .height } , type={ self .type } )"
202
+ return f"rtc.VideoFrame(width={ self .width } , height={ self .height } , type={ proto_video . VideoBufferType . Name ( self .type ) } )"
203
203
204
204
@classmethod
205
205
def __get_pydantic_core_schema__ (cls , * _ : Any ):
@@ -217,7 +217,7 @@ def validate_video_frame(value: Any) -> "VideoFrame":
217
217
return VideoFrame (
218
218
width = value ["width" ],
219
219
height = value ["height" ],
220
- type = proto_video .VideoBufferType .ValueType (value ["type" ]),
220
+ type = proto_video .VideoBufferType .Value (value ["type" ]),
221
221
data = base64 .b64decode (value ["data" ]),
222
222
)
223
223
@@ -230,7 +230,7 @@ def validate_video_frame(value: Any) -> "VideoFrame":
230
230
{
231
231
"width" : core_schema .model_field (core_schema .int_schema ()),
232
232
"height" : core_schema .model_field (core_schema .int_schema ()),
233
- "type" : core_schema .model_field (core_schema .int_schema ()),
233
+ "type" : core_schema .model_field (core_schema .str_schema ()),
234
234
"data" : core_schema .model_field (core_schema .str_schema ()),
235
235
},
236
236
),
@@ -242,7 +242,7 @@ def validate_video_frame(value: Any) -> "VideoFrame":
242
242
lambda instance : {
243
243
"width" : instance .width ,
244
244
"height" : instance .height ,
245
- "type" : instance .type ,
245
+ "type" : proto_video . VideoBufferType . Name ( instance .type ) ,
246
246
"data" : base64 .b64encode (instance .data ).decode ("utf-8" ),
247
247
}
248
248
),
0 commit comments