Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0fcedb6 authored by Jamie Gennis's avatar Jamie Gennis Committed by Android (Google) Code Review
Browse files

Merge "Stop using OMX_COLOR_FormatAndroidPrivateStart."

parents 7d041488 044ace6b
Loading
Loading
Loading
Loading
+4 −14
Original line number Diff line number Diff line
@@ -37,11 +37,11 @@ namespace android {
// buffers.  This is the mode that will be used when CPU access to the buffer is
// required.
//
// When Android native buffer use has been enabled, the OMX node must support
// only color formats in the range [OMX_COLOR_FormatAndroidPrivateStart,
// OMX_COLOR_FormatAndroidPrivateEnd).  The node should then expect to receive
// When Android native buffer use has been enabled for a given port, the video
// color format for the port is to be interpreted as an Android pixel format
// rather than an OMX color format.  The node should then expect to receive
// UseAndroidNativeBuffer calls (via OMX_SetParameter) rather than UseBuffer
// calls.
// calls for that port.
struct EnableAndroidNativeBuffersParams {
    OMX_U32 nSize;
    OMX_VERSIONTYPE nVersion;
@@ -75,16 +75,6 @@ struct StoreMetaDataInBuffersParams {
    OMX_BOOL bStoreMetaData;
};

// Color formats in the range [OMX_COLOR_FormatAndroidPrivateStart,
// OMX_COLOR_FormatAndroidPrivateEnd) will be converted to a gralloc pixel
// format when used to allocate Android native buffers via gralloc.  The
// conversion is done by subtracting OMX_COLOR_FormatAndroidPrivateStart from
// the color format reported by the codec.
enum {
    OMX_COLOR_FormatAndroidPrivateStart = 0xA0000000,
    OMX_COLOR_FormatAndroidPrivateEnd = 0xB0000000,
};

// A pointer to this struct is passed to OMX_SetParameter when the extension
// index for the 'OMX.google.android.index.useAndroidNativeBuffer' extension is
// given.  This call will only be performed if a prior call was made with the
+1 −6
Original line number Diff line number Diff line
@@ -1710,16 +1710,11 @@ status_t OMXCodec::allocateOutputBuffersFromNativeWindow() {
        return err;
    }

    // Check that the color format is in the correct range.
    CHECK(OMX_COLOR_FormatAndroidPrivateStart <= def.format.video.eColorFormat);
    CHECK(def.format.video.eColorFormat < OMX_COLOR_FormatAndroidPrivateEnd);

    err = native_window_set_buffers_geometry(
            mNativeWindow.get(),
            def.format.video.nFrameWidth,
            def.format.video.nFrameHeight,
            def.format.video.eColorFormat
                - OMX_COLOR_FormatAndroidPrivateStart);
            def.format.video.eColorFormat);

    if (err != 0) {
        LOGE("native_window_set_buffers_geometry failed: %s (%d)",