break;
case VA_FOURCC_ARGB:
data->Pitch = mem_id->image.pitches[0];
- data->R = buf + mem_id->image.offsets[0];
- data->G = data->R + 1;
- data->B = data->R + 2;
- data->A = data->R + 3;
+ data->B = buf + mem_id->image.offsets[0];
+ data->G = data->B + 1;
+ data->R = data->B + 2;
+ data->A = data->B + 3;
break;
#if (MFX_VERSION >= 1028)
case VA_FOURCC_RGB565:
mem->surface->Data.Pitch = mem->destination_pitches[0];
break;
case GST_VIDEO_FORMAT_BGRA:
- mem->surface->Data.R = mem->cached_data[0];
- mem->surface->Data.G = mem->surface->Data.R + 1;
- mem->surface->Data.B = mem->surface->Data.R + 2;
+ mem->surface->Data.B = mem->cached_data[0];
+ mem->surface->Data.G = mem->surface->Data.B + 1;
+ mem->surface->Data.R = mem->surface->Data.B + 2;
+ mem->surface->Data.A = mem->surface->Data.B + 3;
mem->surface->Data.Pitch = mem->destination_pitches[0];
break;
#if (MFX_VERSION >= 1028)
return NULL;
}
- /* The first channel in memory is V for MFX_FOURCC_AYUV (GST_VIDEO_FORMAT_VUYA) format */
- if (mem->surface->Info.FourCC == MFX_FOURCC_AYUV)
- return mem->surface->Data.V;
+ switch (mem->surface->Info.FourCC) {
+ case MFX_FOURCC_RGB4:
+ return mem->surface->Data.B; /* The first channel is B */
+
+ /* The first channel in memory is V for MFX_FOURCC_AYUV (GST_VIDEO_FORMAT_VUYA) format */
+ case MFX_FOURCC_AYUV:
+ return mem->surface->Data.V;
+
#if (MFX_VERSION >= 1027)
- else if (mem->surface->Info.FourCC == MFX_FOURCC_Y410)
- return mem->surface->Data.U; /* Data.Y410 */
+ case MFX_FOURCC_Y410:
+ return mem->surface->Data.U; /* Data.Y410 */
#endif
- else
- return mem->surface->Data.Y;
+
+ default:
+ return mem->surface->Data.Y;
+ }
}
static void
pitch = mem_id->pitch;
#endif
- /* The first channel in memory is V for GST_VIDEO_FORMAT_VUYA */
- if (meta->format == GST_VIDEO_FORMAT_VUYA)
- *data = mem->surface->Data.V + offset;
- else if (meta->format == GST_VIDEO_FORMAT_Y410)
- *data = mem->surface->Data.U + offset; /* Data.Y410 */
- else
- *data = mem->surface->Data.Y + offset;
- *stride = pitch;
+ switch (meta->format) {
+ case GST_VIDEO_FORMAT_BGRA:
+ *data = mem->surface->Data.B + offset;
+ break;
+
+ /* The first channel in memory is V for GST_VIDEO_FORMAT_VUYA */
+ case GST_VIDEO_FORMAT_VUYA:
+ *data = mem->surface->Data.V + offset;
+ break;
+
+ case GST_VIDEO_FORMAT_Y410:
+ *data = mem->surface->Data.U + offset; /* Data.Y410 */
+ break;
+
+ default:
+ *data = mem->surface->Data.Y + offset;
+ break;
+ }
+ *stride = pitch;
info->flags = flags;
ret = (*data != NULL);
gst_msdk_frame_lock (msdk_video_allocator->context, mem->surface->Data.MemId,
&mem->surface->Data);
- return mem->surface->Data.Y;
+
+ switch (mem->surface->Info.FourCC) {
+ case MFX_FOURCC_RGB4:
+ return mem->surface->Data.B; /* The first channel is B */
+
+ /* The first channel in memory is V for MFX_FOURCC_AYUV (GST_VIDEO_FORMAT_VUYA) format */
+ case MFX_FOURCC_AYUV:
+ return mem->surface->Data.V;
+
+#if (MFX_VERSION >= 1027)
+ case MFX_FOURCC_Y410:
+ return mem->surface->Data.U; /* Data.Y410 */
+#endif
+
+ default:
+ return mem->surface->Data.Y;
+ }
}
static void