mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-03 10:21:11 +00:00
glupload: rename GstGLUploadDrmFormatFlags -> GstGLDrmFormatFlags
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
This commit is contained in:
parent
75848859f1
commit
57f36ed9d9
1 changed files with 23 additions and 21 deletions
|
@ -719,9 +719,9 @@ static const UploadMethod _gl_memory_upload = {
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
INCLUDE_EXTERNAL = 1 << 1,
|
GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL = 1 << 1,
|
||||||
LINEAR_ONLY = 2 << 1,
|
GST_GL_DRM_FORMAT_LINEAR_ONLY = 2 << 1,
|
||||||
} GstGLUploadDrmFormatFlags;
|
} GstGLDrmFormatFlags;
|
||||||
|
|
||||||
typedef struct _GstEGLImageCacheEntry
|
typedef struct _GstEGLImageCacheEntry
|
||||||
{
|
{
|
||||||
|
@ -876,7 +876,7 @@ _dma_buf_upload_new (GstGLUpload * upload)
|
||||||
/* Append all drm format strings to drm_formats array. */
|
/* Append all drm format strings to drm_formats array. */
|
||||||
static void
|
static void
|
||||||
_append_drm_formats_from_video_format (GstGLContext * context,
|
_append_drm_formats_from_video_format (GstGLContext * context,
|
||||||
GstVideoFormat format, GstGLUploadDrmFormatFlags flags,
|
GstVideoFormat format, GstGLDrmFormatFlags flags,
|
||||||
GPtrArray * drm_formats)
|
GPtrArray * drm_formats)
|
||||||
{
|
{
|
||||||
gint32 i, fourcc;
|
gint32 i, fourcc;
|
||||||
|
@ -901,10 +901,10 @@ _append_drm_formats_from_video_format (GstGLContext * context,
|
||||||
for (i = 0; i < dma_modifiers->len; i++) {
|
for (i = 0; i < dma_modifiers->len; i++) {
|
||||||
GstGLDmaModifier *mod = &g_array_index (dma_modifiers, GstGLDmaModifier, i);
|
GstGLDmaModifier *mod = &g_array_index (dma_modifiers, GstGLDmaModifier, i);
|
||||||
|
|
||||||
if (!(flags & INCLUDE_EXTERNAL) && mod->external_only)
|
if (!(flags & GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL) && mod->external_only)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (flags & LINEAR_ONLY && mod->modifier != DRM_FORMAT_MOD_LINEAR)
|
if (flags & GST_GL_DRM_FORMAT_LINEAR_ONLY && mod->modifier != DRM_FORMAT_MOD_LINEAR)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
drm_format = gst_video_dma_drm_fourcc_to_string (fourcc, mod->modifier);
|
drm_format = gst_video_dma_drm_fourcc_to_string (fourcc, mod->modifier);
|
||||||
|
@ -916,7 +916,7 @@ _append_drm_formats_from_video_format (GstGLContext * context,
|
||||||
drm formats to dst GValue. Return FALSE if no valid drm formats found. */
|
drm formats to dst GValue. Return FALSE if no valid drm formats found. */
|
||||||
static gboolean
|
static gboolean
|
||||||
_dma_buf_transform_gst_formats_to_drm_formats (GstGLContext * context,
|
_dma_buf_transform_gst_formats_to_drm_formats (GstGLContext * context,
|
||||||
const GValue * video_value, GstGLUploadDrmFormatFlags flags,
|
const GValue * video_value, GstGLDrmFormatFlags flags,
|
||||||
GValue * drm_value)
|
GValue * drm_value)
|
||||||
{
|
{
|
||||||
GstVideoFormat gst_format;
|
GstVideoFormat gst_format;
|
||||||
|
@ -1021,7 +1021,7 @@ _set_default_formats_list (GstStructure * structure)
|
||||||
|
|
||||||
static GstVideoFormat
|
static GstVideoFormat
|
||||||
_get_video_format_from_drm_format (GstGLContext * context,
|
_get_video_format_from_drm_format (GstGLContext * context,
|
||||||
const gchar * drm_format, GstGLUploadDrmFormatFlags flags)
|
const gchar * drm_format, GstGLDrmFormatFlags flags)
|
||||||
{
|
{
|
||||||
GstVideoFormat gst_format;
|
GstVideoFormat gst_format;
|
||||||
guint32 fourcc;
|
guint32 fourcc;
|
||||||
|
@ -1031,14 +1031,14 @@ _get_video_format_from_drm_format (GstGLContext * context,
|
||||||
if (fourcc == DRM_FORMAT_INVALID)
|
if (fourcc == DRM_FORMAT_INVALID)
|
||||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||||
|
|
||||||
if (flags & LINEAR_ONLY && modifier != DRM_FORMAT_MOD_LINEAR)
|
if (flags & GST_GL_DRM_FORMAT_LINEAR_ONLY && modifier != DRM_FORMAT_MOD_LINEAR)
|
||||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||||
|
|
||||||
gst_format = gst_video_dma_drm_fourcc_to_format (fourcc);
|
gst_format = gst_video_dma_drm_fourcc_to_format (fourcc);
|
||||||
if (gst_format == GST_VIDEO_FORMAT_UNKNOWN)
|
if (gst_format == GST_VIDEO_FORMAT_UNKNOWN)
|
||||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||||
|
|
||||||
if (!_check_modifier (context, fourcc, modifier, flags & INCLUDE_EXTERNAL))
|
if (!_check_modifier (context, fourcc, modifier, flags & GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL))
|
||||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||||
|
|
||||||
return gst_format;
|
return gst_format;
|
||||||
|
@ -1048,7 +1048,7 @@ _get_video_format_from_drm_format (GstGLContext * context,
|
||||||
gst formats to dst GValue. Return FALSE if no valid drm formats found. */
|
gst formats to dst GValue. Return FALSE if no valid drm formats found. */
|
||||||
static gboolean
|
static gboolean
|
||||||
_dma_buf_transform_drm_formats_to_gst_formats (GstGLContext * context,
|
_dma_buf_transform_drm_formats_to_gst_formats (GstGLContext * context,
|
||||||
const GValue * drm_value, GstGLUploadDrmFormatFlags flags,
|
const GValue * drm_value, GstGLDrmFormatFlags flags,
|
||||||
GValue * video_value)
|
GValue * video_value)
|
||||||
{
|
{
|
||||||
GstVideoFormat gst_format;
|
GstVideoFormat gst_format;
|
||||||
|
@ -1109,7 +1109,7 @@ _dma_buf_transform_drm_formats_to_gst_formats (GstGLContext * context,
|
||||||
static gboolean
|
static gboolean
|
||||||
_dma_buf_convert_format_field_in_structure (GstGLContext * context,
|
_dma_buf_convert_format_field_in_structure (GstGLContext * context,
|
||||||
GstStructure * structure, GstPadDirection direction,
|
GstStructure * structure, GstPadDirection direction,
|
||||||
GstGLUploadDrmFormatFlags flags)
|
GstGLDrmFormatFlags flags)
|
||||||
{
|
{
|
||||||
const GValue *val;
|
const GValue *val;
|
||||||
|
|
||||||
|
@ -1259,7 +1259,7 @@ _dma_buf_check_formats_in_structure (GstGLContext * context,
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
_dma_buf_upload_transform_caps_common (GstCaps * caps,
|
_dma_buf_upload_transform_caps_common (GstCaps * caps,
|
||||||
GstGLContext * context, GstPadDirection direction,
|
GstGLContext * context, GstPadDirection direction,
|
||||||
GstGLUploadDrmFormatFlags flags,
|
GstGLDrmFormatFlags flags,
|
||||||
GstGLTextureTarget target_mask,
|
GstGLTextureTarget target_mask,
|
||||||
const gchar * from_feature, const gchar * to_feature)
|
const gchar * from_feature, const gchar * to_feature)
|
||||||
{
|
{
|
||||||
|
@ -1320,7 +1320,7 @@ _dma_buf_upload_transform_caps_common (GstCaps * caps,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!_dma_buf_check_formats_in_structure (context, s,
|
if (!_dma_buf_check_formats_in_structure (context, s,
|
||||||
flags & INCLUDE_EXTERNAL)) {
|
flags & GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL)) {
|
||||||
gst_structure_free (s);
|
gst_structure_free (s);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1377,7 +1377,8 @@ _dma_buf_upload_transform_caps (gpointer impl, GstGLContext * context,
|
||||||
g_assert (dmabuf->target == GST_GL_TEXTURE_TARGET_2D);
|
g_assert (dmabuf->target == GST_GL_TEXTURE_TARGET_2D);
|
||||||
|
|
||||||
if (direction == GST_PAD_SINK) {
|
if (direction == GST_PAD_SINK) {
|
||||||
GstGLUploadDrmFormatFlags flags = INCLUDE_EXTERNAL | LINEAR_ONLY;
|
GstGLDrmFormatFlags flags =
|
||||||
|
GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL | GST_GL_DRM_FORMAT_LINEAR_ONLY;
|
||||||
|
|
||||||
ret = _dma_buf_upload_transform_caps_common (caps, context, direction,
|
ret = _dma_buf_upload_transform_caps_common (caps, context, direction,
|
||||||
flags, 1 << dmabuf->target, GST_CAPS_FEATURE_MEMORY_DMABUF,
|
flags, 1 << dmabuf->target, GST_CAPS_FEATURE_MEMORY_DMABUF,
|
||||||
|
@ -1406,11 +1407,12 @@ _dma_buf_upload_transform_caps (gpointer impl, GstGLContext * context,
|
||||||
gint i, n;
|
gint i, n;
|
||||||
|
|
||||||
ret = _dma_buf_upload_transform_caps_common (caps, context, direction,
|
ret = _dma_buf_upload_transform_caps_common (caps, context, direction,
|
||||||
INCLUDE_EXTERNAL | LINEAR_ONLY, 1 << dmabuf->target,
|
GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL | GST_GL_DRM_FORMAT_LINEAR_ONLY,
|
||||||
GST_CAPS_FEATURE_MEMORY_GL_MEMORY, GST_CAPS_FEATURE_MEMORY_DMABUF);
|
1 << dmabuf->target, GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
|
||||||
|
GST_CAPS_FEATURE_MEMORY_DMABUF);
|
||||||
tmp = _dma_buf_upload_transform_caps_common (caps, context, direction,
|
tmp = _dma_buf_upload_transform_caps_common (caps, context, direction,
|
||||||
INCLUDE_EXTERNAL | LINEAR_ONLY, 1 << dmabuf->target,
|
GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL | GST_GL_DRM_FORMAT_LINEAR_ONLY,
|
||||||
GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
|
1 << dmabuf->target, GST_CAPS_FEATURE_MEMORY_GL_MEMORY,
|
||||||
GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
|
GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
ret = tmp;
|
ret = tmp;
|
||||||
|
@ -1744,10 +1746,10 @@ _direct_dma_buf_upload_transform_caps (gpointer impl, GstGLContext * context,
|
||||||
{
|
{
|
||||||
struct DmabufUpload *dmabuf = impl;
|
struct DmabufUpload *dmabuf = impl;
|
||||||
GstCaps *ret, *tmp;
|
GstCaps *ret, *tmp;
|
||||||
GstGLUploadDrmFormatFlags flags = 0;
|
GstGLDrmFormatFlags flags = 0;
|
||||||
|
|
||||||
if (dmabuf->target == GST_GL_TEXTURE_TARGET_EXTERNAL_OES)
|
if (dmabuf->target == GST_GL_TEXTURE_TARGET_EXTERNAL_OES)
|
||||||
flags |= INCLUDE_EXTERNAL;
|
flags |= GST_GL_DRM_FORMAT_INCLUDE_EXTERNAL;
|
||||||
|
|
||||||
if (context) {
|
if (context) {
|
||||||
const GstGLFuncs *gl = context->gl_vtable;
|
const GstGLFuncs *gl = context->gl_vtable;
|
||||||
|
|
Loading…
Reference in a new issue