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

Commit 7de35047 authored by Ramkumar Radhakrishnan's avatar Ramkumar Radhakrishnan Committed by dhacker29
Browse files

Add support for custom buffer sizes.

Add native window properties NATIVE_WINDOW_SET_BUFFERS_SIZE to the
perform function of Surface to set the user defined size
of graphic buffers. This is needed for adding support for
the playback of interlaced content.

Change-Id: I8354c29d2ffcc03178fae86dfa449cbefd24ae55
parent b5417126
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ public:
    static void createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
            sp<IGraphicBufferConsumer>* outConsumer,
            const sp<IGraphicBufferAlloc>& allocator = NULL);

private:
    BufferQueue(); // Create through createBufferQueue
};
+8 −0
Original line number Diff line number Diff line
@@ -169,6 +169,14 @@ public:
    // handle if any.
    virtual status_t setSidebandStream(const sp<NativeHandle>& stream);

    // setBufferSize enables us to specify user defined sizes for the buffers
    // that need to be allocated by surfaceflinger for its client. This is
    // useful for cases where the client doesn't want the gralloc to calculate
    // buffer size. client should reset this value to 0, if it wants gralloc
    // to calculate the size for the buffer. this will take effect from next
    // dequeue buffer.
    virtual status_t setBuffersSize(int size);

    // See IGraphicBufferProducer::allocateBuffers
    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
            uint32_t format, uint32_t usage);
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,9 @@ public:
    virtual ~GraphicBufferAlloc();
    virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
        PixelFormat format, uint32_t usage, status_t* error);
    virtual void setGraphicBufferSize(int size);
private:
    int mBufferSize;
};


+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ public:
     */
    virtual sp<GraphicBuffer> createGraphicBuffer(uint32_t w, uint32_t h,
            PixelFormat format, uint32_t usage, status_t* error) = 0;
    virtual void setGraphicBufferSize(int size) = 0;
};

// ----------------------------------------------------------------------------
+9 −0
Original line number Diff line number Diff line
@@ -481,6 +481,15 @@ public:
    // allocated, this function has no effect.
    virtual void allocateBuffers(bool async, uint32_t width, uint32_t height,
            uint32_t format, uint32_t usage) = 0;

    // setBufferSize enables to specify the user defined size of the buffer
    // that needs to be allocated by surfaceflinger for its client. This is
    // useful for cases where the client doesn't want the gralloc to calculate
    // buffer size. client should reset this value to 0, if it wants gralloc to
    // calculate the size for the buffer. this will take effect from next
    // dequeue buffer.
    virtual status_t setBuffersSize(int size) = 0;

};

// ----------------------------------------------------------------------------
Loading