• Moto Hira's avatar
    Abstract away AVFormatContext from StreamReader/Writer constructor (#3007) · 7ea69e61
    Moto Hira authored
    Summary:
    Pull Request resolved: https://github.com/pytorch/audio/pull/3007
    
    Simplify the construction of StreamReader/Writer in C++.
    
    Currently these classes require client code to build AVFormatContext
    manually. This is tedious and not user freindly.
    
    Some client code actually uses the same helper function that
    TorchAudio codebase uses.
    
    This commit moves the helper logic inside of the constructor of
    StreamReader/Writer, so that the signatures of these constructors
    are easy to use and similar to Python interface.
    
    Reviewed By: xiaohui-zhang
    
    Differential Revision: D42662520
    
    fbshipit-source-id: d95e5236810c48d7d9bd2d89c05d4f60a44b3ba1
    7ea69e61
stream_writer.cpp 1.5 KB