• Dean Liao's avatar
    media/gpu: Obtain V4L2ImageProcessor object via factory method. · cca42a8b
    Dean Liao authored
    We used to get V4L2ImageProcessor instance from constructor and perform
    initialization later. And Initialize() set several data members which
    are not changed after Initialize(). With factory method, Create(), we
    can perform Initialize() before constructing V4L2ImageProcessor instance.
    And those data members set by Initialize() can be const-qualified.
    
    This commit is a leading commit for using VideoFrameLayout to
    encapsulate input/output format and size. Because VideoFrameLayout
    is a const object, the input/output VideoFrameLayout variables for
    creating V4L2ImageProcessor should be determined before calling
    constructor. Thus factory method becomes a natural design choice.
    
    BUG=b:110815424,b:73752373
    TEST=Run VEA VDA unittest on devices (peach_pit and elm)
    VEA:
    video_encode_accelerator_unittest \
    --test_stream_data=bear-320x180.yuv:320:180:1:bear.mp4:100000:30 \
    --disable_flush --single-process-tests -v=0
    
    VDA:
    video_decode_accelerator_unittest \
    --test_stream_data=/usr/local/video/test-25fps.h264:320:240:250:258:\
    35:150:1 -v=0 --disable_flush --single-process-tests --ozone-platform=gbm
    
    Change-Id: I6909b2c1dbe5eda5845681a51af9e3d1c88d89ec
    Reviewed-on: https://chromium-review.googlesource.com/c/1339084
    Commit-Queue: Shuo-Peng Liao <deanliao@google.com>
    Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
    Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#609201}
    cca42a8b
image_processor.h 2.34 KB