mfxFrameAllocResponse *alloc_response;
GstMsdkMemoryType memory_type;
gboolean add_videometa;
+ gboolean need_alignment;
+ GstVideoAlignment alignment;
+
};
#define gst_msdk_buffer_pool_parent_class parent_class
priv->add_videometa = gst_buffer_pool_config_has_option (config,
GST_BUFFER_POOL_OPTION_VIDEO_META);
- if (priv->add_videometa && gst_buffer_pool_config_has_option (config,
- GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT)) {
- GstVideoAlignment alignment;
+ priv->need_alignment = gst_buffer_pool_config_has_option (config,
+ GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
- gst_msdk_set_video_alignment (&video_info, 0, 0, &alignment);
- gst_video_info_align (&video_info, &alignment);
- gst_buffer_pool_config_set_video_alignment (config, &alignment);
+ if (priv->add_videometa && priv->need_alignment) {
+ gst_msdk_set_video_alignment (&video_info, 0, 0, &priv->alignment);
+ gst_video_info_align (&video_info, &priv->alignment);
+ gst_buffer_pool_config_set_video_alignment (config, &priv->alignment);
}
priv->memory_type = _msdk_get_memory_type (config);
GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info),
GST_VIDEO_INFO_N_PLANES (info), info->offset, info->stride);
+ if (priv->need_alignment) {
+ if (!gst_video_meta_set_alignment (vmeta, priv->alignment)) {
+ GST_ERROR_OBJECT (pool, "failed to set alignment");
+ return GST_FLOW_ERROR;
+ }
+ }
+
if (priv->memory_type == GST_MSDK_MEMORY_TYPE_VIDEO) {
vmeta->map = gst_video_meta_map_msdk_memory;
vmeta->unmap = gst_video_meta_unmap_msdk_memory;