• Miguel Casas-Sanchez's avatar
    vaapi: minor style cleanup of inner classes · d30df395
    Miguel Casas-Sanchez authored
    This CL updates code in a few locations in vaapi_decode_accelerator.cc:
    - inlines the ctor and emtpy destructor of Vaapi{H264,VP8,VP9}Picture
     because, since they're in a .cc file anyway, separating declaration
     and definition is unnecessary.
    - makes some members const in VaapiDecodeSurface.
    - makes ctors explicit and uses scoped_refptr (and not const&), see
    [1] and the discussion in [2]:
    
    "If the function (at least sometimes) takes a ref on a refcounted
    object, declare the param as scoped_refptr<T>. The caller can
    decide whether it wishes to transfer ownership (by calling
    std::move(t) when passing t) or retain its ref (by simply passing
    t directly)."
    "A great deal of Chromium code predates the above rules. In
    particular, some functions take ownership of params passed as T*,
    or take const scoped_refptr<T>& instead of T*, [...]. Try to clean
    up such code when you find it"
    
    [1] https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md#object-ownership-and-calling-conventions
    [2] https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/TlL1D-Djta0
    
    TEST= **No new code intended**. Compiled simplechrome and
    loaded on Soraka, then played videos making sure (via
    chrome://media-internals) that GpuVideoDecoder was used.
    
    
    Bug: 717265
    Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
    Change-Id: I6006fb23325d23841c8613fa41d65f8707a5446c
    Reviewed-on: https://chromium-review.googlesource.com/746369Reviewed-by: default avatarKuang-che Wu <kcwu@chromium.org>
    Commit-Queue: Miguel Casas <mcasas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#513108}
    d30df395
vaapi_video_decode_accelerator.cc 66.2 KB