diff options
author | Deva Ramasubramanian <dramasub@codeaurora.org> | 2014-07-17 14:23:35 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-27 23:31:32 -0800 |
commit | eb8193226e6cf972364a4eafd0c92f592276f73b (patch) | |
tree | 31fc7d88fa5f5016c365c53dc111af7b42eedb52 | |
parent | e971c533a52bb43b6fe189fc08b5294106826c5f (diff) | |
download | android_hardware_qcom_media-eb8193226e6cf972364a4eafd0c92f592276f73b.tar.gz android_hardware_qcom_media-eb8193226e6cf972364a4eafd0c92f592276f73b.tar.bz2 android_hardware_qcom_media-eb8193226e6cf972364a4eafd0c92f592276f73b.zip |
mm-video: vidc: Make buffer state bitmap 64 bits
Previously the buffer state bitmap (which indicates if the given buffer
at an index is free or allocated) was unsigned int, which was typically
32 bits. However if the client wants more than 32 buffers, the state
can't be held within the 32-bit bitmap. Hence change it to uint64_t.
Change-Id: I8403c1331352bb96570577362a46444600d88448
-rw-r--r-- | mm-video-v4l2/vidc/vdec/inc/omx_vdec.h | 12 | ||||
-rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp | 5 |
2 files changed, 10 insertions, 7 deletions
diff --git a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h index 31b4f589..de31f637 100644 --- a/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h +++ b/mm-video-v4l2/vidc/vdec/inc/omx_vdec.h @@ -149,10 +149,10 @@ class VideoHeap : public MemoryHeapBase (unsigned)((OMX_BUFFERHEADERTYPE *)bufHdr)->nTimeStamp) // BitMask Management logic -#define BITS_PER_BYTE 32 -#define BITMASK_SIZE(mIndex) (((mIndex) + BITS_PER_BYTE - 1)/BITS_PER_BYTE) -#define BITMASK_OFFSET(mIndex) ((mIndex)/BITS_PER_BYTE) -#define BITMASK_FLAG(mIndex) (1 << ((mIndex) % BITS_PER_BYTE)) +#define BITS_PER_INDEX 64 +#define BITMASK_SIZE(mIndex) (((mIndex) + BITS_PER_INDEX - 1)/BITS_PER_INDEX) +#define BITMASK_OFFSET(mIndex) ((mIndex)/BITS_PER_INDEX) +#define BITMASK_FLAG(mIndex) ((uint64_t)1 << ((mIndex) % BITS_PER_INDEX)) #define BITMASK_CLEAR(mArray,mIndex) (mArray)[BITMASK_OFFSET(mIndex)] \ &= ~(BITMASK_FLAG(mIndex)) #define BITMASK_SET(mArray,mIndex) (mArray)[BITMASK_OFFSET(mIndex)] \ @@ -804,9 +804,9 @@ class omx_vdec: public qc_omx_component int pending_input_buffers; int pending_output_buffers; // bitmask array size for output side - unsigned int m_out_bm_count; + uint64_t m_out_bm_count; // bitmask array size for input side - unsigned int m_inp_bm_count; + uint64_t m_inp_bm_count; //Input port Populated OMX_BOOL m_inp_bPopulated; //Output port Populated diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp index 3fb8029a..f75f59e9 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_msm8974.cpp @@ -39,6 +39,9 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Include Files ////////////////////////////////////////////////////////////////////////////// +#define __STDC_FORMAT_MACROS +#include <inttypes.h> + #include <string.h> #include <pthread.h> #include <sys/prctl.h> @@ -8246,7 +8249,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_headers() sizeof(OMX_BUFFERHEADERTYPE), nPMEMInfoSize, nPlatformListSize); - DEBUG_PRINT_LOW("PE %d bmSize %d",nPlatformEntrySize, + DEBUG_PRINT_LOW("PE %d bmSize %"PRId64, nPlatformEntrySize, m_out_bm_count); m_out_mem_ptr = (OMX_BUFFERHEADERTYPE *)calloc(nBufHdrSize,1); // Alloc mem for platform specific info |