MCPcopy Create free account
hub / github.com/apache/fory / from_pb_media

Function from_pb_media

benchmarks/python/benchmark.py:542–557  ·  view source on GitHub ↗
(pb_obj)

Source from the content-addressed store, hash-verified

540
541
542def from_pb_media(pb_obj) -> Media:
543 title = pb_obj.title if pb_obj.HasField("title") else ""
544 return Media(
545 uri=pb_obj.uri,
546 title=title,
547 width=pb_obj.width,
548 height=pb_obj.height,
549 format=pb_obj.format,
550 duration=pb_obj.duration,
551 size=pb_obj.size,
552 bitrate=pb_obj.bitrate,
553 has_bitrate=pb_obj.has_bitrate,
554 persons=list(pb_obj.persons),
555 player=Player(pb_obj.player),
556 copyright=pb_obj.copyright,
557 )
558
559
560def to_pb_mediacontent(bench_pb2, obj: MediaContent):

Callers 1

from_pb_mediacontentFunction · 0.70

Calls 3

MediaClass · 0.70
PlayerClass · 0.70
listFunction · 0.50

Tested by

no test coverage detected