mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
glmemory: small code reformat
makes the alloc_params selections fit on a single line.
This commit is contained in:
parent
9328ec33f3
commit
3695ab353d
2 changed files with 21 additions and 26 deletions
|
@ -735,15 +735,15 @@ static GstGLMemory *
|
|||
_default_gl_tex_alloc (GstGLMemoryAllocator * allocator,
|
||||
GstGLVideoAllocationParams * params)
|
||||
{
|
||||
guint alloc_flags = params->parent.alloc_flags;
|
||||
GstGLMemory *mem;
|
||||
|
||||
g_return_val_if_fail (params->parent.
|
||||
alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO, NULL);
|
||||
g_return_val_if_fail (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO,
|
||||
NULL);
|
||||
|
||||
mem = g_new0 (GstGLMemory, 1);
|
||||
|
||||
if (params->parent.
|
||||
alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) {
|
||||
if (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) {
|
||||
mem->tex_id = params->parent.gl_handle;
|
||||
mem->texture_wrapped = TRUE;
|
||||
}
|
||||
|
@ -753,12 +753,10 @@ _default_gl_tex_alloc (GstGLMemoryAllocator * allocator,
|
|||
params->v_info, params->plane, params->valign, params->parent.user_data,
|
||||
params->parent.notify);
|
||||
|
||||
if (params->parent.
|
||||
alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) {
|
||||
if (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) {
|
||||
GST_MINI_OBJECT_FLAG_SET (mem, GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD);
|
||||
}
|
||||
if (params->parent.
|
||||
alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM) {
|
||||
if (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM) {
|
||||
mem->mem.data = params->parent.wrapped_data;
|
||||
GST_MINI_OBJECT_FLAG_SET (mem, GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD);
|
||||
}
|
||||
|
@ -1134,13 +1132,13 @@ gst_gl_memory_setup_buffer (GstGLMemoryAllocator * allocator,
|
|||
guint n_mem, i, v, views;
|
||||
|
||||
g_return_val_if_fail (params != NULL, FALSE);
|
||||
g_return_val_if_fail ((params->parent.
|
||||
alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM)
|
||||
g_return_val_if_fail ((params->
|
||||
parent.alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM)
|
||||
== 0, FALSE);
|
||||
g_return_val_if_fail ((params->parent.alloc_flags &
|
||||
GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) == 0, FALSE);
|
||||
g_return_val_if_fail (params->parent.
|
||||
alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO, FALSE);
|
||||
g_return_val_if_fail (params->
|
||||
parent.alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO, FALSE);
|
||||
|
||||
base_allocator = GST_GL_BASE_MEMORY_ALLOCATOR (allocator);
|
||||
n_mem = GST_VIDEO_INFO_N_PLANES (params->v_info);
|
||||
|
@ -1181,8 +1179,9 @@ gst_gl_memory_allocator_get_default (GstGLContext * context)
|
|||
|
||||
g_return_val_if_fail (GST_IS_GL_CONTEXT (context), NULL);
|
||||
|
||||
if (USING_OPENGL (context) || USING_OPENGL3 (context)
|
||||
|| USING_GLES3 (context)) {
|
||||
/* we can only use the pbo allocator with GL > 3.0 contexts */
|
||||
if (gst_gl_context_check_gl_version (context,
|
||||
GST_GL_API_OPENGL | GST_GL_API_OPENGL3 | GST_GL_API_GLES2, 3, 0)) {
|
||||
allocator = (GstGLMemoryAllocator *)
|
||||
gst_allocator_find (GST_GL_MEMORY_PBO_ALLOCATOR_NAME);
|
||||
} else {
|
||||
|
|
|
@ -719,15 +719,16 @@ _gl_mem_pbo_alloc (GstGLBaseMemoryAllocator * allocator,
|
|||
GstGLVideoAllocationParams * params)
|
||||
{
|
||||
GstGLMemoryPBO *mem;
|
||||
guint alloc_flags;
|
||||
|
||||
g_return_val_if_fail (params->
|
||||
parent.alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO, NULL);
|
||||
alloc_flags = params->parent.alloc_flags;
|
||||
|
||||
g_return_val_if_fail (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_VIDEO,
|
||||
NULL);
|
||||
|
||||
mem = g_new0 (GstGLMemoryPBO, 1);
|
||||
|
||||
if (params->
|
||||
parent.alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE)
|
||||
{
|
||||
if (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) {
|
||||
mem->mem.tex_id = params->parent.gl_handle;
|
||||
mem->mem.texture_wrapped = TRUE;
|
||||
}
|
||||
|
@ -737,15 +738,10 @@ _gl_mem_pbo_alloc (GstGLBaseMemoryAllocator * allocator,
|
|||
params->v_info, params->plane, params->valign, params->parent.user_data,
|
||||
params->parent.notify);
|
||||
|
||||
if (params->
|
||||
parent.alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE)
|
||||
{
|
||||
if (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_GPU_HANDLE) {
|
||||
GST_MINI_OBJECT_FLAG_SET (mem, GST_GL_BASE_MEMORY_TRANSFER_NEED_DOWNLOAD);
|
||||
}
|
||||
if (params->
|
||||
parent.alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM) {
|
||||
mem->pbo->mem.data = params->parent.wrapped_data;
|
||||
|
||||
if (alloc_flags & GST_GL_ALLOCATION_PARAMS_ALLOC_FLAG_WRAP_SYSMEM) {
|
||||
GST_MINI_OBJECT_FLAG_SET (mem, GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD);
|
||||
GST_MINI_OBJECT_FLAG_SET (mem->pbo,
|
||||
GST_GL_BASE_MEMORY_TRANSFER_NEED_UPLOAD);
|
||||
|
|
Loading…
Reference in a new issue