mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
fix caps
This commit is contained in:
parent
6e469b2ac5
commit
acb3aeebd4
16 changed files with 38 additions and 61 deletions
|
@ -84,9 +84,9 @@ fine-tune the process.
|
||||||
|
|
||||||
By default the target caps are:
|
By default the target caps are:
|
||||||
|
|
||||||
_ Raw audio : audio/x-raw-int, audio/x-raw-float
|
_ Raw audio : audio/x-raw
|
||||||
|
|
||||||
_ and raw video : video/x-raw-rgb, video/x-raw-yuv
|
_ and raw video : video/x-raw
|
||||||
|
|
||||||
_ and Text : text/plain, text/x-pango-markup
|
_ and Text : text/plain, text/x-pango-markup
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ B. Goals
|
||||||
* Uncompressed (but maybe subsampled)
|
* Uncompressed (but maybe subsampled)
|
||||||
* Compressed
|
* Compressed
|
||||||
* Audio
|
* Audio
|
||||||
* Uncompressed (audio/x-raw-{int|float})
|
* Uncompressed (audio/x-raw)
|
||||||
* Compressed
|
* Compressed
|
||||||
* Timed text
|
* Timed text
|
||||||
* Private streams
|
* Private streams
|
||||||
|
@ -308,7 +308,7 @@ made as to which formatting to use for storing targets and profiles.
|
||||||
<type>audio</type>
|
<type>audio</type>
|
||||||
<format>audio/mpeg,mpegversion=4</format>
|
<format>audio/mpeg,mpegversion=4</format>
|
||||||
<preset>Quality High/Main</preset>
|
<preset>Quality High/Main</preset>
|
||||||
<restriction>audio/x-raw-int,channels=[1,2]</restriction>
|
<restriction>audio/x-raw,channels=[1,2]</restriction>
|
||||||
<presence>1</presence>
|
<presence>1</presence>
|
||||||
</stream-profile>
|
</stream-profile>
|
||||||
<stream-profile>
|
<stream-profile>
|
||||||
|
@ -316,7 +316,7 @@ made as to which formatting to use for storing targets and profiles.
|
||||||
<format>video/x-h264</format>
|
<format>video/x-h264</format>
|
||||||
<preset>Profile Baseline/Quality High</preset>
|
<preset>Profile Baseline/Quality High</preset>
|
||||||
<restriction>
|
<restriction>
|
||||||
video/x-raw-yuv,width=[16, 800],\
|
video/x-raw,width=[16, 800],\
|
||||||
height=[16, 480],framerate=[1/1, 30000/1001]
|
height=[16, 480],framerate=[1/1, 30000/1001]
|
||||||
</restriction>
|
</restriction>
|
||||||
<presence>1</presence>
|
<presence>1</presence>
|
||||||
|
|
|
@ -540,9 +540,9 @@ Other considerations:
|
||||||
TEST: should these look (roughly) alike (note text distortion) - needs fixing in textoverlay
|
TEST: should these look (roughly) alike (note text distortion) - needs fixing in textoverlay
|
||||||
|
|
||||||
gst-launch-0.10 \
|
gst-launch-0.10 \
|
||||||
videotestsrc ! video/x-raw-yuv,width=640,height=480,pixel-aspect-ratio=1/1 ! textoverlay text=Hello font-desc=72 ! xvimagesink \
|
videotestsrc ! video/x-raw,width=640,height=480,pixel-aspect-ratio=1/1 ! textoverlay text=Hello font-desc=72 ! xvimagesink \
|
||||||
videotestsrc ! video/x-raw-yuv,width=320,height=480,pixel-aspect-ratio=2/1 ! textoverlay text=Hello font-desc=72 ! xvimagesink \
|
videotestsrc ! video/x-raw,width=320,height=480,pixel-aspect-ratio=2/1 ! textoverlay text=Hello font-desc=72 ! xvimagesink \
|
||||||
videotestsrc ! video/x-raw-yuv,width=640,height=240,pixel-aspect-ratio=1/2 ! textoverlay text=Hello font-desc=72 ! xvimagesink
|
videotestsrc ! video/x-raw,width=640,height=240,pixel-aspect-ratio=1/2 ! textoverlay text=Hello font-desc=72 ! xvimagesink
|
||||||
|
|
||||||
~~~ THE END ~~~
|
~~~ THE END ~~~
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- test different strides using
|
- test different strides using
|
||||||
gst-launch -v videotestsrc ! video/x-raw-yuv,width=320,height=240,format=\(fourcc\)UYVY ! videoscale ! video/x-raw-yuv,width=328,height=240 ! xvimagesink
|
gst-launch -v videotestsrc ! video/x-raw,width=320,height=240,format=UYVY ! videoscale ! video/x-raw,width=328,height=240 ! xvimagesink
|
||||||
gst-launch -v videotestsrc ! video/x-raw-yuv,width=320,height=240,format=\(fourcc\)UYVY ! videoscale ! video/x-raw-yuv,width=324,height=240 ! xvimagesink
|
gst-launch -v videotestsrc ! video/x-raw,width=320,height=240,format=UYVY ! videoscale ! video/x-raw,width=324,height=240 ! xvimagesink
|
||||||
gst-launch -v videotestsrc ! video/x-raw-yuv,width=320,height=240,format=\(fourcc\)UYVY ! videoscale ! video/x-raw-yuv,width=322,height=240 ! xvimagesink
|
gst-launch -v videotestsrc ! video/x-raw,width=320,height=240,format=UYVY ! videoscale ! video/x-raw,width=322,height=240 ! xvimagesink
|
||||||
gst-launch -v videotestsrc ! video/x-raw-yuv,width=320,height=240,format=\(fourcc\)UYVY ! videoscale ! video/x-raw-yuv,width=321,height=240 ! xvimagesink
|
gst-launch -v videotestsrc ! video/x-raw,width=320,height=240,format=UYVY ! videoscale ! video/x-raw,width=321,height=240 ! xvimagesink
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
#include <gst/app/gstappsink.h>
|
#include <gst/app/gstappsink.h>
|
||||||
|
|
||||||
/* these are the caps we are going to pass through the appsink and appsrc */
|
/* these are the caps we are going to pass through the appsink and appsrc */
|
||||||
const gchar *audio_caps =
|
const gchar *audio_caps = "audio/x-raw,format=S16LE,channels=1,rate=8000";
|
||||||
"audio/x-raw-int,channels=1,rate=8000,signed=(boolean)true,width=16,depth=16,endianness=1234";
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,7 @@ make_mixer_channel (GstElement * pipeline, GstElement * mix, gchar * file_name)
|
||||||
|
|
||||||
/* prepare mixer channel */
|
/* prepare mixer channel */
|
||||||
filesrc = gst_element_factory_make ("filesrc", NULL);
|
filesrc = gst_element_factory_make ("filesrc", NULL);
|
||||||
decodebin = gst_element_factory_make ("decodebin2", NULL);
|
decodebin = gst_element_factory_make ("decodebin", NULL);
|
||||||
volume = gst_element_factory_make ("volume", NULL);
|
volume = gst_element_factory_make ("volume", NULL);
|
||||||
convert = gst_element_factory_make ("audioconvert", NULL);
|
convert = gst_element_factory_make ("audioconvert", NULL);
|
||||||
format = gst_element_factory_make ("capsfilter", NULL);
|
format = gst_element_factory_make ("capsfilter", NULL);
|
||||||
|
@ -148,10 +148,8 @@ make_mixer_channel (GstElement * pipeline, GstElement * mix, gchar * file_name)
|
||||||
g_object_set (filesrc, "location", file_name, NULL);
|
g_object_set (filesrc, "location", file_name, NULL);
|
||||||
g_object_set (volume, "volume", (num_vol == 0) ? 1.0 : 0.0, NULL);
|
g_object_set (volume, "volume", (num_vol == 0) ? 1.0 : 0.0, NULL);
|
||||||
|
|
||||||
caps = gst_caps_from_string ("audio/x-raw-int, "
|
caps = gst_caps_from_string ("audio/x-raw, "
|
||||||
"channels = (int) 2, "
|
"format = (string) S16LE, " "channels = (int) 2");
|
||||||
"endianness = (int) BYTE_ORDER, "
|
|
||||||
"width = (int) 16, " "depth = (int) 16, " "signed = (boolean) true");
|
|
||||||
g_object_set (format, "caps", caps, NULL);
|
g_object_set (format, "caps", caps, NULL);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
|
|
|
@ -130,8 +130,7 @@ make_pipeline (void)
|
||||||
g_assert (audiocaps);
|
g_assert (audiocaps);
|
||||||
|
|
||||||
caps =
|
caps =
|
||||||
gst_caps_from_string
|
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=48000,channels=1");
|
||||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=48000,channels=1");
|
|
||||||
g_object_set (audiocaps, "caps", caps, NULL);
|
g_object_set (audiocaps, "caps", caps, NULL);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
|
@ -161,14 +160,11 @@ make_pipeline (void)
|
||||||
|
|
||||||
/* make caps */
|
/* make caps */
|
||||||
capslist[0] =
|
capslist[0] =
|
||||||
gst_caps_from_string
|
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=48000,channels=1");
|
||||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=48000,channels=1");
|
|
||||||
capslist[1] =
|
capslist[1] =
|
||||||
gst_caps_from_string
|
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=16000,channels=1");
|
||||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=16000,channels=1");
|
|
||||||
capslist[2] =
|
capslist[2] =
|
||||||
gst_caps_from_string
|
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=8000,channels=1");
|
||||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=8000,channels=1");
|
|
||||||
|
|
||||||
/* create encoder elements */
|
/* create encoder elements */
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
|
|
|
@ -219,12 +219,9 @@ main (int argc, char *argv[])
|
||||||
convert = gst_element_factory_make ("audioconvert", "convert");
|
convert = gst_element_factory_make ("audioconvert", "convert");
|
||||||
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
||||||
|
|
||||||
caps = gst_caps_new_simple ("audio/x-raw-int",
|
caps = gst_caps_new_simple ("audio/x-raw",
|
||||||
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
|
"format", G_TYPE_STRING, "S16LE",
|
||||||
"channels", G_TYPE_INT, 1,
|
"channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 44100, NULL);
|
||||||
"width", G_TYPE_INT, 16,
|
|
||||||
"depth", G_TYPE_INT, 16,
|
|
||||||
"rate", G_TYPE_INT, 44100, "signed", G_TYPE_BOOLEAN, TRUE, NULL);
|
|
||||||
g_object_set (filter, "caps", caps, NULL);
|
g_object_set (filter, "caps", caps, NULL);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
|
|
|
@ -243,12 +243,9 @@ main (int argc, char *argv[])
|
||||||
convert = gst_element_factory_make ("audioconvert", "convert");
|
convert = gst_element_factory_make ("audioconvert", "convert");
|
||||||
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
||||||
|
|
||||||
caps = gst_caps_new_simple ("audio/x-raw-int",
|
caps = gst_caps_new_simple ("audio/x-raw",
|
||||||
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
|
"format", G_TYPE_STRING, "S16LE",
|
||||||
"channels", G_TYPE_INT, 2,
|
"channels", G_TYPE_INT, 2, "rate", G_TYPE_INT, 44100, NULL);
|
||||||
"width", G_TYPE_INT, 16,
|
|
||||||
"depth", G_TYPE_INT, 16,
|
|
||||||
"rate", G_TYPE_INT, 44100, "signed", G_TYPE_BOOLEAN, TRUE, NULL);
|
|
||||||
g_object_set (filter, "caps", caps, NULL);
|
g_object_set (filter, "caps", caps, NULL);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
|
|
|
@ -256,12 +256,9 @@ main (int argc, char *argv[])
|
||||||
convert = gst_element_factory_make ("audioconvert", "convert");
|
convert = gst_element_factory_make ("audioconvert", "convert");
|
||||||
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
||||||
|
|
||||||
caps = gst_caps_new_simple ("audio/x-raw-int",
|
caps = gst_caps_new_simple ("audio/x-raw",
|
||||||
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
|
"format", G_TYPE_STRING, "S16LE",
|
||||||
"channels", G_TYPE_INT, 2,
|
"channels", G_TYPE_INT, 2, "rate", G_TYPE_INT, 44100, NULL);
|
||||||
"width", G_TYPE_INT, 16,
|
|
||||||
"depth", G_TYPE_INT, 16,
|
|
||||||
"rate", G_TYPE_INT, 44100, "signed", G_TYPE_BOOLEAN, TRUE, NULL);
|
|
||||||
g_object_set (filter, "caps", caps, NULL);
|
g_object_set (filter, "caps", caps, NULL);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
|
|
|
@ -70,10 +70,8 @@ clear_caps (GstCaps * caps, GstCaps * rescaps)
|
||||||
/* And append to list without duplicates */
|
/* And append to list without duplicates */
|
||||||
while ((st = gst_caps_steal_structure (res, 0))) {
|
while ((st = gst_caps_steal_structure (res, 0))) {
|
||||||
/* Skip fake codecs/containers */
|
/* Skip fake codecs/containers */
|
||||||
if (gst_structure_has_name (st, "audio/x-raw-int") ||
|
if (gst_structure_has_name (st, "audio/x-raw") ||
|
||||||
gst_structure_has_name (st, "audio/x-raw-float") ||
|
gst_structure_has_name (st, "video/x-raw") ||
|
||||||
gst_structure_has_name (st, "video/x-raw-yuv") ||
|
|
||||||
gst_structure_has_name (st, "video/x-raw-rgb") ||
|
|
||||||
gst_structure_has_name (st, "unknown/unknown")) {
|
gst_structure_has_name (st, "unknown/unknown")) {
|
||||||
gst_structure_free (st);
|
gst_structure_free (st);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -2002,16 +2002,11 @@ shot_cb (GtkButton * button, gpointer data)
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
|
||||||
/* convert to our desired format (RGB24) */
|
/* convert to our desired format (RGB24) */
|
||||||
caps = gst_caps_new_simple ("video/x-raw-rgb",
|
caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, "RGB24",
|
||||||
"bpp", G_TYPE_INT, 24, "depth", G_TYPE_INT, 24,
|
|
||||||
/* Note: we don't ask for a specific width/height here, so that
|
/* Note: we don't ask for a specific width/height here, so that
|
||||||
* videoscale can adjust dimensions from a non-1/1 pixel aspect
|
* videoscale can adjust dimensions from a non-1/1 pixel aspect
|
||||||
* ratio to a 1/1 pixel-aspect-ratio */
|
* ratio to a 1/1 pixel-aspect-ratio */
|
||||||
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
|
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, NULL);
|
||||||
"endianness", G_TYPE_INT, G_BIG_ENDIAN,
|
|
||||||
"red_mask", G_TYPE_INT, 0xff0000,
|
|
||||||
"green_mask", G_TYPE_INT, 0x00ff00,
|
|
||||||
"blue_mask", G_TYPE_INT, 0x0000ff, NULL);
|
|
||||||
|
|
||||||
/* convert the latest frame to the requested format */
|
/* convert the latest frame to the requested format */
|
||||||
g_signal_emit_by_name (pipeline, "convert-frame", caps, &buffer);
|
g_signal_emit_by_name (pipeline, "convert-frame", caps, &buffer);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define CAPS "video/x-raw-rgb,width=160,pixel-aspect-ratio=1/1,bpp=(int)24,depth=(int)24,endianness=(int)4321,red_mask=(int)0xff0000, green_mask=(int)0x00ff00, blue_mask=(int)0x0000ff"
|
#define CAPS "video/x-raw,format=RGB24,width=160,pixel-aspect-ratio=1/1"
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
|
|
|
@ -120,7 +120,7 @@ main (int argc, char *argv[])
|
||||||
g_object_set (G_OBJECT (src2), "pattern", 1, NULL);
|
g_object_set (G_OBJECT (src2), "pattern", 1, NULL);
|
||||||
capsfilter = gst_element_factory_make ("capsfilter", "caps0");
|
capsfilter = gst_element_factory_make ("capsfilter", "caps0");
|
||||||
g_object_set (G_OBJECT (capsfilter), "caps",
|
g_object_set (G_OBJECT (capsfilter), "caps",
|
||||||
gst_caps_from_string ("video/x-raw-rgb,width=640,height=480"), NULL);
|
gst_caps_from_string ("video/x-raw,width=640,height=480"), NULL);
|
||||||
video_switch = gst_element_factory_make ("input-selector", "video_switch");
|
video_switch = gst_element_factory_make ("input-selector", "video_switch");
|
||||||
segment = gst_element_factory_make ("identity", "identity-segment");
|
segment = gst_element_factory_make ("identity", "identity-segment");
|
||||||
g_object_set (G_OBJECT (segment), "silent", TRUE, NULL);
|
g_object_set (G_OBJECT (segment), "silent", TRUE, NULL);
|
||||||
|
|
|
@ -119,8 +119,8 @@ main (int argc, char **argv)
|
||||||
/* we prefer our fixed width and height but allow other dimensions to pass
|
/* we prefer our fixed width and height but allow other dimensions to pass
|
||||||
* as well */
|
* as well */
|
||||||
capsstr =
|
capsstr =
|
||||||
g_strdup_printf ("video/x-raw-rgb, width=(int)%d, height=(int)%d;"
|
g_strdup_printf ("video/x-raw, width=(int)%d, height=(int)%d;"
|
||||||
"video/x-raw-rgb", width, height);
|
"video/x-raw", width, height);
|
||||||
caps = gst_caps_from_string (capsstr);
|
caps = gst_caps_from_string (capsstr);
|
||||||
g_free (capsstr);
|
g_free (capsstr);
|
||||||
g_object_set (filter, "caps", caps, NULL);
|
g_object_set (filter, "caps", caps, NULL);
|
||||||
|
|
|
@ -80,7 +80,7 @@ test_textoverlay (int width, int height)
|
||||||
gint a, b, c;
|
gint a, b, c;
|
||||||
|
|
||||||
pstr = g_strdup_printf ("videotestsrc pattern=blue ! "
|
pstr = g_strdup_printf ("videotestsrc pattern=blue ! "
|
||||||
"video/x-raw-yuv,width=%d,height=%d ! t.video_sink "
|
"video/x-raw,width=%d,height=%d ! t.video_sink "
|
||||||
"textoverlay name=t font-desc=\"Sans Serif, 20\" ! "
|
"textoverlay name=t font-desc=\"Sans Serif, 20\" ! "
|
||||||
" videoconvert ! videoscale ! autovideosink", width, height);
|
" videoconvert ! videoscale ! autovideosink", width, height);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue