abhiTronix / deffcode

A cross-platform High-performance FFmpeg based Real-time Video Frames Decoder in Pure Python 🎞️⚡
https://abhitronix.github.io/deffcode
Apache License 2.0
178 stars 3 forks source link

[BUG] Fix Context Manager methods in FFdecoder API #25

Closed abhiTronix closed 2 years ago

abhiTronix commented 2 years ago

Brief Description

As mentioned in PEP 343, Context managers provide __enter__() and __exit__() methods that are invoked on entry to and exit from the body of the with statement. Currently, these context managers methods are completely unusable in FFdecoder API, and need rework. Plus related docs and unittest are missing .

Acknowledgment

Current Environment

Expected Behavior

Must be able to use context manager methods using ‘with’ and ‘as’ keywords in FFdecoder API

Actual Behavior

Unusable and throws NameError

Miscellaneous

https://peps.python.org/pep-0343/