mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 05:59:10 +00:00
format: Allow GST_AUDIO/VIDEO_FORMAT_UNKNOWN in _to_string() function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6630>
This commit is contained in:
parent
b46383bf5e
commit
686f74e4a4
9 changed files with 89 additions and 75 deletions
|
@ -794,6 +794,11 @@ format.</doc>
|
||||||
</parameter>
|
</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
</function-macro>
|
</function-macro>
|
||||||
|
<constant name="AUDIO_FORMAT_LAST" value="32" c:type="GST_AUDIO_FORMAT_LAST" version="1.26">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.h">Number of audio formats in #GstAudioFormat.</doc>
|
||||||
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.h"/>
|
||||||
|
<type name="gint" c:type="gint"/>
|
||||||
|
</constant>
|
||||||
<function-macro name="AUDIO_INFO_BPF" c:identifier="GST_AUDIO_INFO_BPF" introspectable="0">
|
<function-macro name="AUDIO_INFO_BPF" c:identifier="GST_AUDIO_INFO_BPF" introspectable="0">
|
||||||
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-info.h"/>
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-info.h"/>
|
||||||
<parameters>
|
<parameters>
|
||||||
|
@ -6413,12 +6418,18 @@ string is not a known format.</doc>
|
||||||
</parameters>
|
</parameters>
|
||||||
</function>
|
</function>
|
||||||
<function name="to_string" c:identifier="gst_audio_format_to_string">
|
<function name="to_string" c:identifier="gst_audio_format_to_string">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.c">Returns a string containing a descriptive name for the #GstAudioFormat.
|
||||||
|
|
||||||
|
Since 1.26 this can also be used with %GST_AUDIO_FORMAT_UNKNOWN, previous
|
||||||
|
versions were printing a critical warning and returned %NULL.</doc>
|
||||||
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.h"/>
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.h"/>
|
||||||
<return-value transfer-ownership="none">
|
<return-value transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.c">the name corresponding to @format</doc>
|
||||||
<type name="utf8" c:type="const gchar*"/>
|
<type name="utf8" c:type="const gchar*"/>
|
||||||
</return-value>
|
</return-value>
|
||||||
<parameters>
|
<parameters>
|
||||||
<parameter name="format" transfer-ownership="none">
|
<parameter name="format" transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.c">a #GstAudioFormat audio format</doc>
|
||||||
<type name="AudioFormat" c:type="GstAudioFormat"/>
|
<type name="AudioFormat" c:type="GstAudioFormat"/>
|
||||||
</parameter>
|
</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
|
@ -10919,12 +10930,18 @@ string is not a known format.</doc>
|
||||||
</return-value>
|
</return-value>
|
||||||
</function>
|
</function>
|
||||||
<function name="audio_format_to_string" c:identifier="gst_audio_format_to_string" moved-to="AudioFormat.to_string">
|
<function name="audio_format_to_string" c:identifier="gst_audio_format_to_string" moved-to="AudioFormat.to_string">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.c">Returns a string containing a descriptive name for the #GstAudioFormat.
|
||||||
|
|
||||||
|
Since 1.26 this can also be used with %GST_AUDIO_FORMAT_UNKNOWN, previous
|
||||||
|
versions were printing a critical warning and returned %NULL.</doc>
|
||||||
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.h"/>
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.h"/>
|
||||||
<return-value transfer-ownership="none">
|
<return-value transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.c">the name corresponding to @format</doc>
|
||||||
<type name="utf8" c:type="const gchar*"/>
|
<type name="utf8" c:type="const gchar*"/>
|
||||||
</return-value>
|
</return-value>
|
||||||
<parameters>
|
<parameters>
|
||||||
<parameter name="format" transfer-ownership="none">
|
<parameter name="format" transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/audio/audio-format.c">a #GstAudioFormat audio format</doc>
|
||||||
<type name="AudioFormat" c:type="GstAudioFormat"/>
|
<type name="AudioFormat" c:type="GstAudioFormat"/>
|
||||||
</parameter>
|
</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
|
|
|
@ -3403,6 +3403,11 @@ Return the width of one tile in pixels, zero if its not an integer.</doc>
|
||||||
</parameter>
|
</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
</function-macro>
|
</function-macro>
|
||||||
|
<constant name="VIDEO_FORMAT_LAST" value="134" c:type="GST_VIDEO_FORMAT_LAST" version="1.26">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h">Number of video formats in #GstVideoFormat.</doc>
|
||||||
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h"/>
|
||||||
|
<type name="gint" c:type="gint"/>
|
||||||
|
</constant>
|
||||||
<constant name="VIDEO_FPS_RANGE" value="(fraction) [ 0, max ]" c:type="GST_VIDEO_FPS_RANGE">
|
<constant name="VIDEO_FPS_RANGE" value="(fraction) [ 0, max ]" c:type="GST_VIDEO_FPS_RANGE">
|
||||||
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h"/>
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h"/>
|
||||||
<type name="utf8" c:type="gchar*"/>
|
<type name="utf8" c:type="gchar*"/>
|
||||||
|
@ -10414,8 +10419,10 @@ no corresponding FOURCC value, 0 is returned.</doc>
|
||||||
</parameters>
|
</parameters>
|
||||||
</function>
|
</function>
|
||||||
<function name="to_string" c:identifier="gst_video_format_to_string">
|
<function name="to_string" c:identifier="gst_video_format_to_string">
|
||||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">Returns a string containing a descriptive name for
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">Returns a string containing a descriptive name for the #GstVideoFormat.
|
||||||
the #GstVideoFormat if there is one, or NULL otherwise.</doc>
|
|
||||||
|
Since 1.26 this can also be used with %GST_VIDEO_FORMAT_UNKNOWN, previous
|
||||||
|
versions were printing a critical warning and returned %NULL.</doc>
|
||||||
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h"/>
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h"/>
|
||||||
<return-value transfer-ownership="none">
|
<return-value transfer-ownership="none">
|
||||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">the name corresponding to @format</doc>
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">the name corresponding to @format</doc>
|
||||||
|
@ -18669,8 +18676,10 @@ no corresponding FOURCC value, 0 is returned.</doc>
|
||||||
</parameters>
|
</parameters>
|
||||||
</function>
|
</function>
|
||||||
<function name="video_format_to_string" c:identifier="gst_video_format_to_string" moved-to="VideoFormat.to_string">
|
<function name="video_format_to_string" c:identifier="gst_video_format_to_string" moved-to="VideoFormat.to_string">
|
||||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">Returns a string containing a descriptive name for
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">Returns a string containing a descriptive name for the #GstVideoFormat.
|
||||||
the #GstVideoFormat if there is one, or NULL otherwise.</doc>
|
|
||||||
|
Since 1.26 this can also be used with %GST_VIDEO_FORMAT_UNKNOWN, previous
|
||||||
|
versions were printing a critical warning and returned %NULL.</doc>
|
||||||
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h"/>
|
<source-position filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.h"/>
|
||||||
<return-value transfer-ownership="none">
|
<return-value transfer-ownership="none">
|
||||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">the name corresponding to @format</doc>
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-base/gst-libs/gst/video/video-format.c">the name corresponding to @format</doc>
|
||||||
|
|
|
@ -424,11 +424,23 @@ gst_audio_format_from_string (const gchar * format)
|
||||||
return GST_AUDIO_FORMAT_UNKNOWN;
|
return GST_AUDIO_FORMAT_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_audio_format_to_string:
|
||||||
|
* @format: a #GstAudioFormat audio format
|
||||||
|
*
|
||||||
|
* Returns a string containing a descriptive name for the #GstAudioFormat.
|
||||||
|
*
|
||||||
|
* Since 1.26 this can also be used with %GST_AUDIO_FORMAT_UNKNOWN, previous
|
||||||
|
* versions were printing a critical warning and returned %NULL.
|
||||||
|
*
|
||||||
|
* Returns: the name corresponding to @format
|
||||||
|
*/
|
||||||
const gchar *
|
const gchar *
|
||||||
gst_audio_format_to_string (GstAudioFormat format)
|
gst_audio_format_to_string (GstAudioFormat format)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (format != GST_AUDIO_FORMAT_UNKNOWN, NULL);
|
g_return_val_if_fail ((gint) format < G_N_ELEMENTS (formats), NULL);
|
||||||
|
|
||||||
|
/* In case glib checks are disabled */
|
||||||
if ((gint) format >= G_N_ELEMENTS (formats))
|
if ((gint) format >= G_N_ELEMENTS (formats))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -128,6 +128,9 @@ typedef enum {
|
||||||
GST_AUDIO_FORMAT_F32BE,
|
GST_AUDIO_FORMAT_F32BE,
|
||||||
GST_AUDIO_FORMAT_F64LE,
|
GST_AUDIO_FORMAT_F64LE,
|
||||||
GST_AUDIO_FORMAT_F64BE,
|
GST_AUDIO_FORMAT_F64BE,
|
||||||
|
|
||||||
|
/* Update GST_AUDIO_FORMAT_LAST below when adding more formats here */
|
||||||
|
|
||||||
/* native endianness equivalents */
|
/* native endianness equivalents */
|
||||||
GST_AUDIO_FORMAT_S16 = _GST_AUDIO_FORMAT_NE(S16),
|
GST_AUDIO_FORMAT_S16 = _GST_AUDIO_FORMAT_NE(S16),
|
||||||
GST_AUDIO_FORMAT_U16 = _GST_AUDIO_FORMAT_NE(U16),
|
GST_AUDIO_FORMAT_U16 = _GST_AUDIO_FORMAT_NE(U16),
|
||||||
|
@ -145,6 +148,14 @@ typedef enum {
|
||||||
GST_AUDIO_FORMAT_F64 = _GST_AUDIO_FORMAT_NE(F64)
|
GST_AUDIO_FORMAT_F64 = _GST_AUDIO_FORMAT_NE(F64)
|
||||||
} GstAudioFormat;
|
} GstAudioFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GST_AUDIO_FORMAT_LAST:
|
||||||
|
*
|
||||||
|
* Number of audio formats in #GstAudioFormat.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define GST_AUDIO_FORMAT_LAST (GST_AUDIO_FORMAT_F64BE + 1)
|
||||||
|
|
||||||
typedef struct _GstAudioFormatInfo GstAudioFormatInfo;
|
typedef struct _GstAudioFormatInfo GstAudioFormatInfo;
|
||||||
|
|
||||||
|
|
|
@ -8106,16 +8106,19 @@ gst_video_format_to_fourcc (GstVideoFormat format)
|
||||||
* gst_video_format_to_string:
|
* gst_video_format_to_string:
|
||||||
* @format: a #GstVideoFormat video format
|
* @format: a #GstVideoFormat video format
|
||||||
*
|
*
|
||||||
* Returns a string containing a descriptive name for
|
* Returns a string containing a descriptive name for the #GstVideoFormat.
|
||||||
* the #GstVideoFormat if there is one, or NULL otherwise.
|
*
|
||||||
|
* Since 1.26 this can also be used with %GST_VIDEO_FORMAT_UNKNOWN, previous
|
||||||
|
* versions were printing a critical warning and returned %NULL.
|
||||||
*
|
*
|
||||||
* Returns: the name corresponding to @format
|
* Returns: the name corresponding to @format
|
||||||
*/
|
*/
|
||||||
const gchar *
|
const gchar *
|
||||||
gst_video_format_to_string (GstVideoFormat format)
|
gst_video_format_to_string (GstVideoFormat format)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (format != GST_VIDEO_FORMAT_UNKNOWN, NULL);
|
g_return_val_if_fail ((gint) format < G_N_ELEMENTS (formats), NULL);
|
||||||
|
|
||||||
|
/* In case glib checks are disabled */
|
||||||
if ((gint) format >= G_N_ELEMENTS (formats))
|
if ((gint) format >= G_N_ELEMENTS (formats))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
|
@ -619,8 +619,19 @@ typedef enum {
|
||||||
* Since: 1.24
|
* Since: 1.24
|
||||||
*/
|
*/
|
||||||
GST_VIDEO_FORMAT_RBGA,
|
GST_VIDEO_FORMAT_RBGA,
|
||||||
|
|
||||||
|
/* Update GST_VIDEO_FORMAT_LAST below when adding more formats here */
|
||||||
} GstVideoFormat;
|
} GstVideoFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GST_VIDEO_FORMAT_LAST:
|
||||||
|
*
|
||||||
|
* Number of video formats in #GstVideoFormat.
|
||||||
|
*
|
||||||
|
* Since: 1.26
|
||||||
|
*/
|
||||||
|
#define GST_VIDEO_FORMAT_LAST (GST_VIDEO_FORMAT_RBGA + 1)
|
||||||
|
|
||||||
#define GST_VIDEO_MAX_PLANES 4
|
#define GST_VIDEO_MAX_PLANES 4
|
||||||
#define GST_VIDEO_MAX_COMPONENTS 4
|
#define GST_VIDEO_MAX_COMPONENTS 4
|
||||||
|
|
||||||
|
|
|
@ -31,17 +31,6 @@
|
||||||
#include <gst/check/gstharness.h>
|
#include <gst/check/gstharness.h>
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
|
|
||||||
static guint
|
|
||||||
get_num_formats (void)
|
|
||||||
{
|
|
||||||
guint i = 2;
|
|
||||||
|
|
||||||
while (gst_video_format_to_string ((GstVideoFormat) i) != NULL)
|
|
||||||
++i;
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_pad_template (GstPadTemplate * tmpl)
|
check_pad_template (GstPadTemplate * tmpl)
|
||||||
{
|
{
|
||||||
|
@ -49,10 +38,9 @@ check_pad_template (GstPadTemplate * tmpl)
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
gboolean *formats_supported;
|
gboolean *formats_supported;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
guint i, num_formats;
|
guint i;
|
||||||
|
|
||||||
num_formats = get_num_formats ();
|
formats_supported = g_new0 (gboolean, GST_VIDEO_FORMAT_LAST);
|
||||||
formats_supported = g_new0 (gboolean, num_formats);
|
|
||||||
|
|
||||||
caps = gst_pad_template_get_caps (tmpl);
|
caps = gst_pad_template_get_caps (tmpl);
|
||||||
|
|
||||||
|
@ -84,7 +72,7 @@ check_pad_template (GstPadTemplate * tmpl)
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
for (i = 2; i < num_formats; ++i) {
|
for (i = 2; i < GST_VIDEO_FORMAT_LAST; ++i) {
|
||||||
if (i == GST_VIDEO_FORMAT_DMA_DRM)
|
if (i == GST_VIDEO_FORMAT_DMA_DRM)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -33,17 +33,6 @@
|
||||||
|
|
||||||
#ifndef VSCALE_TEST_GROUP
|
#ifndef VSCALE_TEST_GROUP
|
||||||
|
|
||||||
static guint
|
|
||||||
get_num_formats (void)
|
|
||||||
{
|
|
||||||
guint i = 2;
|
|
||||||
|
|
||||||
while (gst_video_format_to_string ((GstVideoFormat) i) != NULL)
|
|
||||||
++i;
|
|
||||||
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_pad_template (GstPadTemplate * tmpl)
|
check_pad_template (GstPadTemplate * tmpl)
|
||||||
{
|
{
|
||||||
|
@ -51,10 +40,9 @@ check_pad_template (GstPadTemplate * tmpl)
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
gboolean *formats_supported;
|
gboolean *formats_supported;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
guint i, num_formats;
|
guint i;
|
||||||
|
|
||||||
num_formats = get_num_formats ();
|
formats_supported = g_new0 (gboolean, GST_VIDEO_FORMAT_LAST);
|
||||||
formats_supported = g_new0 (gboolean, num_formats);
|
|
||||||
|
|
||||||
caps = gst_pad_template_get_caps (tmpl);
|
caps = gst_pad_template_get_caps (tmpl);
|
||||||
|
|
||||||
|
@ -87,7 +75,7 @@ check_pad_template (GstPadTemplate * tmpl)
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
for (i = 2; i < num_formats; ++i) {
|
for (i = 2; i < GST_VIDEO_FORMAT_LAST; ++i) {
|
||||||
if (!formats_supported[i]) {
|
if (!formats_supported[i]) {
|
||||||
const gchar *fmt_str = gst_video_format_to_string ((GstVideoFormat) i);
|
const gchar *fmt_str = gst_video_format_to_string ((GstVideoFormat) i);
|
||||||
|
|
||||||
|
|
|
@ -365,25 +365,12 @@ video_format_is_packed (GstVideoFormat fmt)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
|
||||||
get_num_formats (void)
|
|
||||||
{
|
|
||||||
gint num_formats = 200;
|
|
||||||
fail_unless (gst_video_format_to_string (num_formats) == NULL);
|
|
||||||
while (gst_video_format_to_string (num_formats) == NULL)
|
|
||||||
--num_formats;
|
|
||||||
GST_INFO ("number of known video formats: %d", num_formats);
|
|
||||||
return num_formats + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_START_TEST (test_video_formats_all)
|
GST_START_TEST (test_video_formats_all)
|
||||||
{
|
{
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
const GValue *val, *list_val;
|
const GValue *val, *list_val;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
guint num, n, num_formats;
|
guint num, n;
|
||||||
|
|
||||||
num_formats = get_num_formats ();
|
|
||||||
|
|
||||||
caps = gst_caps_from_string ("video/x-raw, format=" GST_VIDEO_FORMATS_ALL);
|
caps = gst_caps_from_string ("video/x-raw, format=" GST_VIDEO_FORMATS_ALL);
|
||||||
s = gst_caps_get_structure (caps, 0);
|
s = gst_caps_get_structure (caps, 0);
|
||||||
|
@ -403,7 +390,7 @@ GST_START_TEST (test_video_formats_all)
|
||||||
GST_VIDEO_FORMAT_UNKNOWN);
|
GST_VIDEO_FORMAT_UNKNOWN);
|
||||||
}
|
}
|
||||||
/* Take into account GST_VIDEO_FORMAT_ENCODED, UNKNOWN and DMA_DRM. */
|
/* Take into account GST_VIDEO_FORMAT_ENCODED, UNKNOWN and DMA_DRM. */
|
||||||
fail_unless_equals_int (num, num_formats - 3);
|
fail_unless_equals_int (num, GST_VIDEO_FORMAT_LAST - 3);
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
@ -414,11 +401,7 @@ GST_END_TEST;
|
||||||
#define HEIGHT 20
|
#define HEIGHT 20
|
||||||
GST_START_TEST (test_video_formats_pack_unpack)
|
GST_START_TEST (test_video_formats_pack_unpack)
|
||||||
{
|
{
|
||||||
guint n, num_formats;
|
for (guint n = GST_VIDEO_FORMAT_ENCODED + 1; n < GST_VIDEO_FORMAT_LAST; ++n) {
|
||||||
|
|
||||||
num_formats = get_num_formats ();
|
|
||||||
|
|
||||||
for (n = GST_VIDEO_FORMAT_ENCODED + 1; n < num_formats; ++n) {
|
|
||||||
const GstVideoFormatInfo *vfinfo, *unpackinfo;
|
const GstVideoFormatInfo *vfinfo, *unpackinfo;
|
||||||
GstVideoFormat fmt = n;
|
GstVideoFormat fmt = n;
|
||||||
GstVideoInfo vinfo;
|
GstVideoInfo vinfo;
|
||||||
|
@ -2174,7 +2157,7 @@ GST_START_TEST (test_video_pack_unpack2)
|
||||||
{
|
{
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
GTimer *timer;
|
GTimer *timer;
|
||||||
gint num_formats, i;
|
gint i;
|
||||||
GArray *packarray, *unpackarray;
|
GArray *packarray, *unpackarray;
|
||||||
|
|
||||||
#define WIDTH 320
|
#define WIDTH 320
|
||||||
|
@ -2186,11 +2169,9 @@ GST_START_TEST (test_video_pack_unpack2)
|
||||||
packarray = g_array_new (FALSE, FALSE, sizeof (ConvertResult));
|
packarray = g_array_new (FALSE, FALSE, sizeof (ConvertResult));
|
||||||
unpackarray = g_array_new (FALSE, FALSE, sizeof (ConvertResult));
|
unpackarray = g_array_new (FALSE, FALSE, sizeof (ConvertResult));
|
||||||
|
|
||||||
num_formats = get_num_formats ();
|
|
||||||
|
|
||||||
GST_DEBUG ("pack/sec\t unpack/sec \tpack GB/sec\tunpack GB/sec\tformat");
|
GST_DEBUG ("pack/sec\t unpack/sec \tpack GB/sec\tunpack GB/sec\tformat");
|
||||||
|
|
||||||
for (format = GST_VIDEO_FORMAT_I420; format < num_formats; format++) {
|
for (format = GST_VIDEO_FORMAT_I420; format < GST_VIDEO_FORMAT_LAST; format++) {
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
const GstVideoFormatInfo *finfo, *fuinfo;
|
const GstVideoFormatInfo *finfo, *fuinfo;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
@ -2528,11 +2509,8 @@ static void
|
||||||
run_video_color_convert (ColorType in_type, ColorType out_type)
|
run_video_color_convert (ColorType in_type, ColorType out_type)
|
||||||
{
|
{
|
||||||
GstVideoFormat infmt, outfmt;
|
GstVideoFormat infmt, outfmt;
|
||||||
gint num_formats;
|
|
||||||
|
|
||||||
num_formats = get_num_formats ();
|
for (infmt = GST_VIDEO_FORMAT_I420; infmt < GST_VIDEO_FORMAT_LAST; infmt++) {
|
||||||
|
|
||||||
for (infmt = GST_VIDEO_FORMAT_I420; infmt < num_formats; infmt++) {
|
|
||||||
GstVideoInfo ininfo;
|
GstVideoInfo ininfo;
|
||||||
GstVideoFrame inframe;
|
GstVideoFrame inframe;
|
||||||
GstBuffer *inbuffer;
|
GstBuffer *inbuffer;
|
||||||
|
@ -2548,7 +2526,8 @@ run_video_color_convert (ColorType in_type, ColorType out_type)
|
||||||
gst_buffer_memset (inbuffer, 0, 0, -1);
|
gst_buffer_memset (inbuffer, 0, 0, -1);
|
||||||
gst_video_frame_map (&inframe, &ininfo, inbuffer, GST_MAP_READ);
|
gst_video_frame_map (&inframe, &ininfo, inbuffer, GST_MAP_READ);
|
||||||
|
|
||||||
for (outfmt = GST_VIDEO_FORMAT_I420; outfmt < num_formats; outfmt++) {
|
for (outfmt = GST_VIDEO_FORMAT_I420; outfmt < GST_VIDEO_FORMAT_LAST;
|
||||||
|
outfmt++) {
|
||||||
GstVideoInfo outinfo;
|
GstVideoInfo outinfo;
|
||||||
GstVideoFrame outframe;
|
GstVideoFrame outframe;
|
||||||
GstBuffer *outbuffer;
|
GstBuffer *outbuffer;
|
||||||
|
@ -2632,16 +2611,14 @@ GST_START_TEST (test_video_size_convert)
|
||||||
{
|
{
|
||||||
GstVideoFormat infmt, outfmt;
|
GstVideoFormat infmt, outfmt;
|
||||||
GTimer *timer;
|
GTimer *timer;
|
||||||
gint num_formats, i;
|
gint i;
|
||||||
GArray *array;
|
GArray *array;
|
||||||
|
|
||||||
array = g_array_new (FALSE, FALSE, sizeof (ConvertResult));
|
array = g_array_new (FALSE, FALSE, sizeof (ConvertResult));
|
||||||
|
|
||||||
timer = g_timer_new ();
|
timer = g_timer_new ();
|
||||||
|
|
||||||
num_formats = get_num_formats ();
|
for (infmt = GST_VIDEO_FORMAT_I420; infmt < GST_VIDEO_FORMAT_LAST; infmt++) {
|
||||||
|
|
||||||
for (infmt = GST_VIDEO_FORMAT_I420; infmt < num_formats; infmt++) {
|
|
||||||
GstVideoInfo ininfo, outinfo;
|
GstVideoInfo ininfo, outinfo;
|
||||||
GstVideoFrame inframe, outframe;
|
GstVideoFrame inframe, outframe;
|
||||||
GstBuffer *inbuffer, *outbuffer;
|
GstBuffer *inbuffer, *outbuffer;
|
||||||
|
@ -3267,8 +3244,7 @@ GST_START_TEST (test_video_formats_pstrides)
|
||||||
{
|
{
|
||||||
GstVideoFormat fmt = GST_VIDEO_FORMAT_I420;
|
GstVideoFormat fmt = GST_VIDEO_FORMAT_I420;
|
||||||
|
|
||||||
|
while (fmt < GST_VIDEO_FORMAT_LAST) {
|
||||||
while ((gst_video_format_to_string (fmt) != NULL)) {
|
|
||||||
const GstVideoFormatInfo *vf_info = gst_video_format_get_info (fmt);
|
const GstVideoFormatInfo *vf_info = gst_video_format_get_info (fmt);
|
||||||
guint n_comps = GST_VIDEO_FORMAT_INFO_N_COMPONENTS (vf_info);
|
guint n_comps = GST_VIDEO_FORMAT_INFO_N_COMPONENTS (vf_info);
|
||||||
|
|
||||||
|
@ -4101,10 +4077,9 @@ GST_END_TEST;
|
||||||
|
|
||||||
GST_START_TEST (test_video_extrapolate_stride)
|
GST_START_TEST (test_video_extrapolate_stride)
|
||||||
{
|
{
|
||||||
guint num_formats = get_num_formats ();
|
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
|
|
||||||
for (format = 2; format < num_formats; format++) {
|
for (format = 2; format < GST_VIDEO_FORMAT_LAST; format++) {
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
guint p;
|
guint p;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue