mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
utils: format: drop unused helper functions.
The following helper functions are no longer used, thus are removed: - gst_vaapi_video_format_from_structure() - gst_vaapi_video_format_from_caps() - gst_vaapi_video_format_to_caps()
This commit is contained in:
parent
52b6fc57d4
commit
4902df0e40
2 changed files with 0 additions and 126 deletions
|
@ -28,7 +28,6 @@
|
|||
*/
|
||||
|
||||
#include "sysdeps.h"
|
||||
#include <gst/video/video.h>
|
||||
#include "gstvaapicompat.h"
|
||||
#include "gstvaapisurface.h"
|
||||
#include "video-format.h"
|
||||
|
@ -37,32 +36,17 @@ typedef struct
|
|||
{
|
||||
GstVideoFormat format;
|
||||
GstVaapiChromaType chroma_type;
|
||||
const gchar *caps_str;
|
||||
VAImageFormat va_format;
|
||||
} GstVideoFormatMap;
|
||||
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
# define GST_VIDEO_CAPS_MAKE_YUV(FORMAT) \
|
||||
GST_VIDEO_CAPS_MAKE(#FORMAT)
|
||||
# define GST_VIDEO_CAPS_MAKE_RGB(FORMAT) \
|
||||
GST_VIDEO_CAPS_MAKE(#FORMAT)
|
||||
#else
|
||||
# define GST_VIDEO_CAPS_MAKE_YUV(FORMAT) \
|
||||
GST_VIDEO_CAPS_YUV(#FORMAT)
|
||||
# define GST_VIDEO_CAPS_MAKE_RGB(FORMAT) \
|
||||
GST_VIDEO_CAPS_##FORMAT
|
||||
#endif
|
||||
|
||||
#define DEF_YUV(FORMAT, FOURCC, ENDIAN, BPP, SUB) \
|
||||
{ G_PASTE(GST_VIDEO_FORMAT_,FORMAT), \
|
||||
G_PASTE(GST_VAAPI_CHROMA_TYPE_YUV,SUB), \
|
||||
GST_VIDEO_CAPS_MAKE_YUV(FORMAT), \
|
||||
{ VA_FOURCC FOURCC, VA_##ENDIAN##_FIRST, BPP, }, }
|
||||
|
||||
#define DEF_RGB(FORMAT, FOURCC, ENDIAN, BPP, DEPTH, R,G,B,A) \
|
||||
{ G_PASTE(GST_VIDEO_FORMAT_,FORMAT), \
|
||||
G_PASTE(GST_VAAPI_CHROMA_TYPE_RGB,BPP), \
|
||||
GST_VIDEO_CAPS_MAKE_RGB(FORMAT), \
|
||||
{ VA_FOURCC FOURCC, VA_##ENDIAN##_FIRST, BPP, DEPTH, R,G,B,A }, }
|
||||
|
||||
/* Image formats, listed in HW order preference */
|
||||
|
@ -237,106 +221,6 @@ gst_vaapi_video_format_is_yuv (GstVideoFormat format)
|
|||
return m && va_format_is_yuv (&m->va_format);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_video_format_from_caps:
|
||||
* @caps: a #GstCaps
|
||||
*
|
||||
* Converts @caps into the corresponding #GstVideoFormat. If the
|
||||
* image format cannot be represented by #GstVideoFormat, then
|
||||
* zero is returned.
|
||||
*
|
||||
* Return value: the #GstVideoFormat describing the @caps
|
||||
*/
|
||||
GstVideoFormat
|
||||
gst_vaapi_video_format_from_caps (GstCaps * caps)
|
||||
{
|
||||
GstStructure *structure;
|
||||
|
||||
if (!caps)
|
||||
return 0;
|
||||
|
||||
structure = gst_caps_get_structure (caps, 0);
|
||||
if (!structure)
|
||||
return 0;
|
||||
return gst_vaapi_video_format_from_structure (structure);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_video_format_from_structure:
|
||||
* @structure: a #GstStructure
|
||||
*
|
||||
* Converts @structure into the corresponding #GstVideoFormat. If
|
||||
* the image format cannot be represented by #GstVideoFormat,
|
||||
* then zero is returned.
|
||||
*
|
||||
* Return value: the #GstVideoFormat describing the @structure
|
||||
*/
|
||||
GstVideoFormat
|
||||
gst_vaapi_video_format_from_structure (GstStructure * structure)
|
||||
{
|
||||
#if GST_CHECK_VERSION(1,0,0)
|
||||
const gchar *format = gst_structure_get_string (structure, "format");
|
||||
if (format)
|
||||
return gst_video_format_from_string (format);
|
||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||
#else
|
||||
const GstVideoFormatMap *m;
|
||||
VAImageFormat *va_format, va_formats[2];
|
||||
gint endian, rmask, gmask, bmask, amask = 0;
|
||||
guint32 fourcc;
|
||||
|
||||
/* Check for YUV format */
|
||||
if (gst_structure_get_fourcc (structure, "format", &fourcc))
|
||||
return gst_video_format_from_fourcc (fourcc);
|
||||
|
||||
/* Check for RGB format */
|
||||
gst_structure_get_int (structure, "endianness", &endian);
|
||||
gst_structure_get_int (structure, "red_mask", &rmask);
|
||||
gst_structure_get_int (structure, "green_mask", &gmask);
|
||||
gst_structure_get_int (structure, "blue_mask", &bmask);
|
||||
gst_structure_get_int (structure, "alpha_mask", &amask);
|
||||
|
||||
va_format = &va_formats[0];
|
||||
va_format->byte_order = endian == G_BIG_ENDIAN ? VA_MSB_FIRST : VA_LSB_FIRST;
|
||||
va_format->red_mask = rmask;
|
||||
va_format->green_mask = gmask;
|
||||
va_format->blue_mask = bmask;
|
||||
va_format->alpha_mask = amask;
|
||||
|
||||
va_format = &va_formats[1];
|
||||
va_format->byte_order = endian == G_BIG_ENDIAN ? VA_LSB_FIRST : VA_MSB_FIRST;
|
||||
va_format->red_mask = GUINT32_SWAP_LE_BE (rmask);
|
||||
va_format->green_mask = GUINT32_SWAP_LE_BE (gmask);
|
||||
va_format->blue_mask = GUINT32_SWAP_LE_BE (bmask);
|
||||
va_format->alpha_mask = GUINT32_SWAP_LE_BE (amask);
|
||||
|
||||
for (m = gst_vaapi_video_formats; m->format; m++) {
|
||||
if (va_format_is_rgb (&m->va_format) &&
|
||||
(va_format_is_same_rgb (&m->va_format, &va_formats[0]) ||
|
||||
va_format_is_same_rgb (&m->va_format, &va_formats[1])))
|
||||
return m->format;
|
||||
}
|
||||
return GST_VIDEO_FORMAT_UNKNOWN;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_video_format_to_caps:
|
||||
* @format: a #GstVideoFormat
|
||||
*
|
||||
* Converts a #GstVideoFormat into the corresponding #GstCaps. If
|
||||
* no matching caps were found, %NULL is returned.
|
||||
*
|
||||
* Return value: the newly allocated #GstCaps, or %NULL if none was found
|
||||
*/
|
||||
GstCaps *
|
||||
gst_vaapi_video_format_to_caps (GstVideoFormat format)
|
||||
{
|
||||
const GstVideoFormatMap *const m = get_map (format);
|
||||
|
||||
return m ? gst_caps_from_string (m->caps_str) : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_vaapi_video_format_from_va_fourcc:
|
||||
* @fourcc: a FOURCC value
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#ifndef GST_VAAPI_VIDEO_FORMAT_H
|
||||
#define GST_VAAPI_VIDEO_FORMAT_H
|
||||
|
||||
#include <gst/gstvalue.h>
|
||||
#include <gst/video/video.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@ -42,15 +41,6 @@ gst_vaapi_video_format_is_rgb (GstVideoFormat format);
|
|||
gboolean
|
||||
gst_vaapi_video_format_is_yuv (GstVideoFormat format);
|
||||
|
||||
GstVideoFormat
|
||||
gst_vaapi_video_format_from_structure (GstStructure * structure);
|
||||
|
||||
GstVideoFormat
|
||||
gst_vaapi_video_format_from_caps (GstCaps * caps);
|
||||
|
||||
GstCaps *
|
||||
gst_vaapi_video_format_to_caps (GstVideoFormat format);
|
||||
|
||||
GstVideoFormat
|
||||
gst_vaapi_video_format_from_va_fourcc (guint32 fourcc);
|
||||
|
||||
|
|
Loading…
Reference in a new issue