• moto's avatar
    Move helper functions out of common utility for better locality (#2512) · 10ac6d2b
    moto authored
    Summary:
    This commits move helper functions/definitions around so that better locality of logics are achieved.
    
    ## Detail
    
    `ffmpeg.[h|cpp]` implements classes that convert FFmpeg structures into RAII semantics.
    Initially it these classes included the construction logic in their constructors, but such logics were
    extracted to factory functions in https://github.com/pytorch/audio/issues/2373.
    
    Now the reason why the factory functions stayed in `ffmpeg.[h|cpp]` was because the logic for
    the initialization and  clean-up of AVDictionary class was only available in `ffmpeg.cpp`.
    
    Now AVDictionary class handling is properly defined in https://github.com/pytorch/audio/issues/2507, the factory functions, which are not
    that reusable better stay with the implementation that use them.
    
    This makes `ffmpeg.h` lean and clean, makes it easier to see what can be reused.
    
    Pull Request resolved: https://github.com/pytorch/audio/pull/2512
    
    Reviewed By: hwangjeff
    
    Differential Revision: D37477592
    
    Pulled By: mthrok
    
    fbshipit-source-id: 8c1b5059ea5f44649cc0eb1f82d1a92877ef186e
    10ac6d2b
stream_reader_wrapper.h 2.37 KB