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

Commit 88653078 authored by Pannag Sanketi's avatar Pannag Sanketi
Browse files

Default W, H allowed in SurfaceMediaSource dequeue

The client does not have to send (w, h) = (0,0) in dequeuebuffer. It can
set the same w, h as the default width and height.

Change-Id: I8202f90261ccaebbd35ea28c153a7472f01912f1
parent defa12e9
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -179,10 +179,12 @@ status_t SurfaceMediaSource::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
    // TODO: Currently just uses mDefaultWidth/Height. In the future
    // TODO: Currently just uses mDefaultWidth/Height. In the future
    // we might declare mHeight and mWidth and check against those here.
    // we might declare mHeight and mWidth and check against those here.
    if ((w != 0) || (h != 0)) {
    if ((w != 0) || (h != 0)) {
        if ((w != mDefaultWidth) || (h != mDefaultHeight)) {
            LOGE("dequeuebuffer: invalid buffer size! Req: %dx%d, Found: %dx%d",
            LOGE("dequeuebuffer: invalid buffer size! Req: %dx%d, Found: %dx%d",
                    mDefaultWidth, mDefaultHeight, w, h);
                    mDefaultWidth, mDefaultHeight, w, h);
            return BAD_VALUE;
            return BAD_VALUE;
        }
        }
    }


    Mutex::Autolock lock(mMutex);
    Mutex::Autolock lock(mMutex);