pCtx->bStreamonInbuf = VIDEO_FALSE;
pCtx->bStreamonOutbuf = VIDEO_FALSE;
+ pCtx->nMemoryType = V4L2_MEMORY_DMABUF;
+
pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
if (pMutex == NULL) {
ALOGE("%s: Failed to allocate mutex about input buffer", __func__);
goto EXIT_QUERYCAP_FAIL;
}
-
if (pthread_mutex_init(pMutex, NULL) != 0) {
free(pMutex);
goto EXIT_QUERYCAP_FAIL;
ALOGE("%s: Failed to allocate mutex about output buffer", __func__);
goto EXIT_QUERYCAP_FAIL;
}
-
if (pthread_mutex_init(pMutex, NULL) != 0) {
free(pMutex);
goto EXIT_QUERYCAP_FAIL;
req.count = nBufferCount;
if (pCtx->bShareInbuf == VIDEO_TRUE)
- req.memory = V4L2_MEMORY_DMABUF;
+ req.memory = pCtx->nMemoryType;
else
req.memory = V4L2_MEMORY_MMAP;
req.count = nBufferCount;
if (pCtx->bShareOutbuf == VIDEO_TRUE)
- req.memory = V4L2_MEMORY_DMABUF;
+ req.memory = pCtx->nMemoryType;
else
req.memory = V4L2_MEMORY_MMAP;
buf.index = index;
if (pCtx->bShareInbuf == VIDEO_TRUE) {
- buf.memory = V4L2_MEMORY_DMABUF;
+ buf.memory = pCtx->nMemoryType;
for (i = 0; i < nPlanes; i++) {
buf.m.planes[i].m.fd = pCtx->pInbuf[index].planes[i].fd;
buf.m.planes[i].length = pCtx->pInbuf[index].planes[i].allocSize;
buf.index = index;
if (pCtx->bShareOutbuf == VIDEO_TRUE) {
- buf.memory = V4L2_MEMORY_DMABUF;
+ buf.memory = pCtx->nMemoryType;
for (i = 0; i < nPlanes; i++) {
buf.m.planes[i].m.fd = pCtx->pOutbuf[index].planes[i].fd;
buf.m.planes[i].length = pCtx->pOutbuf[index].planes[i].allocSize;
buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
if (pCtx->bShareInbuf == VIDEO_TRUE)
- buf.memory = V4L2_MEMORY_DMABUF;
+ buf.memory = pCtx->nMemoryType;
else
buf.memory = V4L2_MEMORY_MMAP;
}
memset(&buf, 0, sizeof(buf));
-
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
if (pCtx->bShareOutbuf == VIDEO_TRUE)
- buf.memory = V4L2_MEMORY_DMABUF;
+ buf.memory = pCtx->nMemoryType;
else
buf.memory = V4L2_MEMORY_MMAP;
{
ExynosVideoEncContext *pCtx = NULL;
pthread_mutex_t *pMutex = NULL;
-
int needCaps = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING);
pCtx = (ExynosVideoEncContext *)malloc(sizeof(*pCtx));
pCtx->bStreamonInbuf = VIDEO_FALSE;
pCtx->bStreamonOutbuf = VIDEO_FALSE;
+ pCtx->nMemoryType = V4L2_MEMORY_DMABUF;
+
pMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
if (pMutex == NULL) {
ALOGE("%s: Failed to allocate mutex about input buffer", __func__);
req.count = nBufferCount;
if (pCtx->bShareInbuf == VIDEO_TRUE)
- req.memory = V4L2_MEMORY_USERPTR;
+ req.memory = pCtx->nMemoryType;
else
req.memory = V4L2_MEMORY_MMAP;
req.count = nBufferCount;
if (pCtx->bShareOutbuf == VIDEO_TRUE)
- req.memory = V4L2_MEMORY_USERPTR;
+ req.memory = pCtx->nMemoryType;
else
req.memory = V4L2_MEMORY_MMAP;
buf.index = index;
if (pCtx->bShareInbuf == VIDEO_TRUE) {
- buf.memory = V4L2_MEMORY_USERPTR;
+ buf.memory = pCtx->nMemoryType;
for (i = 0; i < nPlanes; i++) {
buf.m.planes[i].m.userptr = (unsigned long)pBuffer[i];
buf.m.planes[i].length = pCtx->pInbuf[index].planes[i].allocSize;
buf.index = index;
if (pCtx->bShareOutbuf == VIDEO_TRUE) {
- buf.memory = V4L2_MEMORY_USERPTR;
+ buf.memory = pCtx->nMemoryType;
for (i = 0; i < nPlanes; i++) {
buf.m.planes[i].m.userptr = pCtx->pOutbuf[index].planes[i].addr;
buf.m.planes[i].length = pCtx->pOutbuf[index].planes[i].allocSize;
buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
if (pCtx->bShareInbuf == VIDEO_TRUE)
- buf.memory = V4L2_MEMORY_USERPTR;
+ buf.memory = pCtx->nMemoryType;
else
buf.memory = V4L2_MEMORY_MMAP;
buf.length = 1;
if (pCtx->bShareOutbuf == VIDEO_TRUE)
- buf.memory = V4L2_MEMORY_USERPTR;
+ buf.memory = pCtx->nMemoryType;
else
buf.memory = V4L2_MEMORY_MMAP;