• Miguel Casas's avatar
    media/v4l2: simplify V4L2VideoDecoder::Initialize and clarify logs · bf3a3fc7
    Miguel Casas authored
    ToT V4L2VideoDecoder::Initialize() tries to Open() |device_| with both
    stateless and stateful formats -- which is fine, but log printouts are
    confusing, as they read oftentimes like:
    
      [v4l2_video_decoder.cc(166)] Initialize(): Found V4L2 device capable of stateless decoding for S264
      ...
      [v4l2_video_decoder.cc(175)] Initialize(): Failed to open device for profile: 3 fourcc: H264
    
    which seems to imply that Initialize() failed, when in reality it
    worked. Moreover, ToT code checks for |input_format_fourcc_stateful|
    and |input_format_fourcc_stateless| values and has an else() path that
    is never reached (l.218 LHS).
    
    This CL refactors that code to make evident that the stateful API takes
    precedence if present and working, sprinkles constexpr names, and takes
    the chance to improve some loggings using e.g. FourccToString() and
    GetProfileName().
    
    No new functionality intended.
    
    Bug: b/170870476
    Change-Id: I6ad00c1ce4d9b8cf2588d7a2751484a743f4225f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616881Reviewed-by: default avatarFritz Koenig <frkoenig@chromium.org>
    Commit-Queue: Miguel Casas <mcasas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#842210}
    bf3a3fc7
v4l2_device.cc 78.9 KB