2727class FallbackInfo :
2828 """Information about decoder fallback status.
2929
30- This class tracks whether hardware-accelerated decoding failed and the decoder
31- fell back to software decoding.
30+ This class tracks whether the decoder fell back to CPU decoding.
3231
3332 Usage:
34- - Use ``str(fallback_info)`` or ``print(fallback_info)`` to see the fallback status
33+ - Use ``str(fallback_info)`` or ``print(fallback_info)`` to see the cpu fallback status
3534 - Use ``bool(fallback_info)`` to check if any fallback occurred
3635
3736 Attributes:
@@ -44,13 +43,13 @@ def __init__(self):
4443 self .__video_not_supported = False
4544
4645 def __bool__ (self ):
47- """Returns True if fallback occurred (and status is known) ."""
46+ """Returns True if fallback occurred."""
4847 return self .status_known and (
4948 self .__nvcuvid_unavailable or self .__video_not_supported
5049 )
5150
5251 def __str__ (self ):
53- """Returns a human-readable string representation of the fallback status."""
52+ """Returns a human-readable string representation of the cpu fallback status."""
5453 if not self .status_known :
5554 return "Fallback status: Unknown"
5655
@@ -223,24 +222,15 @@ def __init__(
223222 custom_frame_mappings = custom_frame_mappings_data ,
224223 )
225224
226- # Initialize fallback info
227225 self ._fallback_info = FallbackInfo ()
228226
229227 def __len__ (self ) -> int :
230228 return self ._num_frames
231229
232230 @property
233231 def cpu_fallback (self ) -> FallbackInfo :
234- """Get information about decoder fallback status.
235-
236- Returns:
237- FallbackInfo: Information about whether hardware-accelerated decoding
238- failed and the decoder fell back to software decoding.
239-
240- Note:
241- The fallback status is only determined after the first frame access.
242- Before that, the status will be "Unknown".
243- """
232+ # We can only determine whether fallback to CPU is happening after
233+ # the first frame access. Before that, the status will be "Unknown".
244234 return self ._fallback_info
245235
246236 def _update_cpu_fallback (self ):
0 commit comments