GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA,
GST_VIDEO_INFO_WIDTH (&convert->in_info),
GST_VIDEO_INFO_HEIGHT (&convert->in_info),
- GST_VIDEO_INFO_WIDTH (&convert->in_info));
+ GST_VIDEO_INFO_PLANE_STRIDE (&convert->in_info, 0));
break;
case GST_VIDEO_FORMAT_NV12:
info->frag_prog = g_strdup_printf (frag_NV12_NV21_to_RGB, 'r', 'a',
GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA,
GST_VIDEO_INFO_WIDTH (&convert->in_info),
GST_VIDEO_INFO_HEIGHT (&convert->in_info),
- GST_VIDEO_INFO_WIDTH (&convert->in_info));
+ GST_VIDEO_INFO_PLANE_STRIDE (&convert->in_info, 0));
break;
default:
break;
GST_MAP_WRITE | GST_MAP_GL);
gst_gl_memory_copy_into_texture (convert->priv->out_temp[i],
gl_mem->tex_id, gl_mem->tex_type, gl_mem->width, gl_mem->height,
- FALSE);
+ gl_mem->stride, FALSE);
gst_memory_unmap ((GstMemory *) gl_mem, &to_info);
gst_memory_unmap ((GstMemory *) convert->priv->out_temp[i], &from_info);
} else {
if (convert->priv->scratch) {
gst_gl_memory_copy_into_texture (convert->in_tex[0],
convert->priv->scratch->tex_id, convert->priv->scratch->tex_type,
- convert->priv->scratch->width, convert->priv->scratch->height, TRUE);
+ convert->priv->scratch->width, convert->priv->scratch->height,
+ convert->priv->scratch->stride, TRUE);
}
gl->BindFramebuffer (GL_FRAMEBUFFER, convert->fbo);
GstGLMemory *src;
GstVideoGLTextureType out_format;
guint out_width, out_height;
+ guint out_stride;
gboolean respecify;
/* inout */
guint tex_id;
GstGLMemory *src;
guint tex_id;
GLuint fboId;
- gsize out_width, out_height;
+ gsize out_width, out_height, out_stride;
GLuint out_gl_format, out_gl_type;
GLuint in_gl_format, in_gl_type;
gsize in_size, out_size;
tex_id = copy_params->tex_id;
out_width = copy_params->out_width;
out_height = copy_params->out_height;
+ out_stride = copy_params->out_stride;
gl = src->context->gl_vtable;
out_gl_format = _gst_gl_format_from_gl_texture_type (copy_params->out_format);
goto error;
}
- in_size = _gl_format_type_n_bytes (in_gl_format, in_gl_type) * src->width *
- src->height;
- out_size = _gl_format_type_n_bytes (out_gl_format, out_gl_type) * out_width *
- out_height;
+ in_size = src->height * src->stride;
+ out_size = out_height * out_stride;
if (copy_params->respecify) {
if (in_size != out_size) {
copy_params.out_format = src->tex_type;
copy_params.out_width = src->width;
copy_params.out_height = src->height;
+ copy_params.out_stride = src->height;
copy_params.respecify = FALSE;
gst_gl_context_thread_add (src->context, _gl_mem_copy_thread, ©_params);
* gst_gl_memory_copy_into_texture:
* @gl_mem:a #GstGLMemory
* @tex_id:OpenGL texture id
- * @tex_type: a #GstVIdeoGLTextureType
+ * @tex_type: a #GstVideoGLTextureType
* @width: width of @tex_id
* @height: height of @tex_id
+ * @stride: stride of the backing texture data
* @respecify: whether to copy the data or copy per texel
*
* Copies @gl_mem into the texture specfified by @tex_id. The format of @tex_id
*/
gboolean
gst_gl_memory_copy_into_texture (GstGLMemory * gl_mem, guint tex_id,
- GstVideoGLTextureType tex_type, gint width, gint height, gboolean respecify)
+ GstVideoGLTextureType tex_type, gint width, gint height, gint stride,
+ gboolean respecify)
{
GstGLMemoryCopyParams copy_params;
copy_params.out_format = tex_type;
copy_params.out_width = width;
copy_params.out_height = height;
+ copy_params.out_stride = stride;
copy_params.respecify = respecify;
gst_gl_context_thread_add (gl_mem->context, _gl_mem_copy_thread,
gboolean gst_gl_memory_copy_into_texture (GstGLMemory *gl_mem, guint tex_id,
GstVideoGLTextureType tex_type,
- gint width, gint height, gboolean respecify);
+ gint width, gint height, gint stride,
+ gboolean respecify);
gboolean gst_gl_memory_setup_buffer (GstGLContext * context, GstVideoInfo * info,
GstBuffer * buffer);
upload->out_tex = (GstGLMemory *) gst_gl_memory_alloc (upload->context,
GST_VIDEO_GL_TEXTURE_TYPE_RGBA, GST_VIDEO_INFO_WIDTH (&upload->in_info),
GST_VIDEO_INFO_HEIGHT (&upload->in_info),
- GST_VIDEO_INFO_WIDTH (&upload->in_info));
+ GST_VIDEO_INFO_PLANE_STRIDE (&upload->in_info, 0));
GST_LOG_OBJECT (upload, "Attempting upload with GstGLMemory");
for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&upload->in_info); i++) {