Skip to content
Snippets Groups Projects
  • Alexandre Courbot's avatar
    3db9508b
    V4L2EncodeComponent: fix build error · 3db9508b
    Alexandre Courbot authored
    Patch 0fa30254bd7e introduced a type mismatch when building for 32-bit architecture. This error is visible when running "mmm external/v4l2_codec2":
    
        external/v4l2_codec2/components/V4L2EncodeComponent.cpp:782:32: error: no matching function for call to 'max'
                int64_t newFramerate = std::max(
                                       ^~~~~~~~
        external/libcxx/include/algorithm:2529:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('long' vs. 'long long')
        max(const _Tp& __a, const _Tp& __b)
        ^
        external/libcxx/include/algorithm:2539:1: note: candidate template ignored: could not match 'initializer_list<type-parameter-0-0>' against 'long'
        max(initializer_list<_Tp> __t, _Compare __comp)
        ^
        external/libcxx/include/algorithm:2547:1: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
        max(initializer_list<_Tp> __t)
        ^
        external/libcxx/include/algorithm:2521:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
        max(const _Tp& __a, const _Tp& __b, _Compare __comp)
        ^
    
    Fix this by casting the right member of the cmp operation to int64_t.
    
    Test: mmm external/v4l2_codec2
    
    Change-Id: Id2cc220b9122eec412823f577f07ecd82bad60fc
    (cherry picked from commit a0377993b84da09547aad11f2f27560e0bf4dcd5)
    3db9508b
    History
    V4L2EncodeComponent: fix build error
    Alexandre Courbot authored
    Patch 0fa30254bd7e introduced a type mismatch when building for 32-bit architecture. This error is visible when running "mmm external/v4l2_codec2":
    
        external/v4l2_codec2/components/V4L2EncodeComponent.cpp:782:32: error: no matching function for call to 'max'
                int64_t newFramerate = std::max(
                                       ^~~~~~~~
        external/libcxx/include/algorithm:2529:1: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('long' vs. 'long long')
        max(const _Tp& __a, const _Tp& __b)
        ^
        external/libcxx/include/algorithm:2539:1: note: candidate template ignored: could not match 'initializer_list<type-parameter-0-0>' against 'long'
        max(initializer_list<_Tp> __t, _Compare __comp)
        ^
        external/libcxx/include/algorithm:2547:1: note: candidate function template not viable: requires single argument '__t', but 2 arguments were provided
        max(initializer_list<_Tp> __t)
        ^
        external/libcxx/include/algorithm:2521:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
        max(const _Tp& __a, const _Tp& __b, _Compare __comp)
        ^
    
    Fix this by casting the right member of the cmp operation to int64_t.
    
    Test: mmm external/v4l2_codec2
    
    Change-Id: Id2cc220b9122eec412823f577f07ecd82bad60fc
    (cherry picked from commit a0377993b84da09547aad11f2f27560e0bf4dcd5)