mm-video-v4l2: Fix to pass CVP metadata payload to Video FW
Fix to pass CVP metadata payload provided by camera, from Video
driver to Video firmware for camcorder usecase.
Change-Id: I8d234861c6c935d25425e02f257c01257a00e31f
diff --git a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
index ea9940a..41d2f24 100644
--- a/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
@@ -670,14 +670,17 @@
if (m_cvp_meta_enabled && cvpMetadata.size == CVP_METADATA_SIZE) {
packet_size = sizeof(struct msm_vidc_extradata_header) - sizeof(unsigned int)
- + sizeof(struct msm_vidc_enc_cvp_metadata_payload);
+ + cvpMetadata.size;
if (filled_len + packet_size <= input_extradata_info.buffer_size) {
+ struct msm_vidc_enc_cvp_metadata_payload *payload_cvp;
data->nSize = ALIGN(packet_size, 4);
data->nVersion.nVersion = OMX_SPEC_VERSION;
data->nPortIndex = PORT_INDEX_IN;
data->eType = (OMX_EXTRADATATYPE)MSM_VIDC_EXTRADATA_CVP_METADATA;
- data->nDataSize = sizeof(struct msm_vidc_enc_cvp_metadata_payload);
+ data->nDataSize = cvpMetadata.size;
+ payload_cvp = (struct msm_vidc_enc_cvp_metadata_payload *)(data->data);
+ memcpy(payload_cvp->data, cvpMetadata.payload, cvpMetadata.size);
filled_len += data->nSize;
data = (OMX_OTHER_EXTRADATATYPE *)((char *)data + data->nSize);
} else {