mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +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:
|
||||
|
||||
_ 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
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ B. Goals
|
|||
* Uncompressed (but maybe subsampled)
|
||||
* Compressed
|
||||
* Audio
|
||||
* Uncompressed (audio/x-raw-{int|float})
|
||||
* Uncompressed (audio/x-raw)
|
||||
* Compressed
|
||||
* Timed text
|
||||
* Private streams
|
||||
|
@ -308,7 +308,7 @@ made as to which formatting to use for storing targets and profiles.
|
|||
<type>audio</type>
|
||||
<format>audio/mpeg,mpegversion=4</format>
|
||||
<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>
|
||||
</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>
|
||||
<preset>Profile Baseline/Quality High</preset>
|
||||
<restriction>
|
||||
video/x-raw-yuv,width=[16, 800],\
|
||||
video/x-raw,width=[16, 800],\
|
||||
height=[16, 480],framerate=[1/1, 30000/1001]
|
||||
</restriction>
|
||||
<presence>1</presence>
|
||||
|
|
|
@ -540,9 +540,9 @@ Other considerations:
|
|||
TEST: should these look (roughly) alike (note text distortion) - needs fixing in textoverlay
|
||||
|
||||
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-yuv,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=480,pixel-aspect-ratio=1/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,width=640,height=240,pixel-aspect-ratio=1/2 ! textoverlay text=Hello font-desc=72 ! xvimagesink
|
||||
|
||||
~~~ THE END ~~~
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- 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-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-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-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=328,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,width=320,height=240,format=UYVY ! videoscale ! video/x-raw,width=322,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>
|
||||
|
||||
/* these are the caps we are going to pass through the appsink and appsrc */
|
||||
const gchar *audio_caps =
|
||||
"audio/x-raw-int,channels=1,rate=8000,signed=(boolean)true,width=16,depth=16,endianness=1234";
|
||||
const gchar *audio_caps = "audio/x-raw,format=S16LE,channels=1,rate=8000";
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -135,7 +135,7 @@ make_mixer_channel (GstElement * pipeline, GstElement * mix, gchar * file_name)
|
|||
|
||||
/* prepare mixer channel */
|
||||
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);
|
||||
convert = gst_element_factory_make ("audioconvert", 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 (volume, "volume", (num_vol == 0) ? 1.0 : 0.0, NULL);
|
||||
|
||||
caps = gst_caps_from_string ("audio/x-raw-int, "
|
||||
"channels = (int) 2, "
|
||||
"endianness = (int) BYTE_ORDER, "
|
||||
"width = (int) 16, " "depth = (int) 16, " "signed = (boolean) true");
|
||||
caps = gst_caps_from_string ("audio/x-raw, "
|
||||
"format = (string) S16LE, " "channels = (int) 2");
|
||||
g_object_set (format, "caps", caps, NULL);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
|
|
|
@ -130,8 +130,7 @@ make_pipeline (void)
|
|||
g_assert (audiocaps);
|
||||
|
||||
caps =
|
||||
gst_caps_from_string
|
||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=48000,channels=1");
|
||||
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=48000,channels=1");
|
||||
g_object_set (audiocaps, "caps", caps, NULL);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
|
@ -161,14 +160,11 @@ make_pipeline (void)
|
|||
|
||||
/* make caps */
|
||||
capslist[0] =
|
||||
gst_caps_from_string
|
||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=48000,channels=1");
|
||||
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=48000,channels=1");
|
||||
capslist[1] =
|
||||
gst_caps_from_string
|
||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=16000,channels=1");
|
||||
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=16000,channels=1");
|
||||
capslist[2] =
|
||||
gst_caps_from_string
|
||||
("audio/x-raw-int,signed=true,width=16,depth=16,rate=8000,channels=1");
|
||||
gst_caps_from_string ("audio/x-raw,format=S16LE,rate=8000,channels=1");
|
||||
|
||||
/* create encoder elements */
|
||||
for (i = 0; i < 3; i++) {
|
||||
|
|
|
@ -219,12 +219,9 @@ main (int argc, char *argv[])
|
|||
convert = gst_element_factory_make ("audioconvert", "convert");
|
||||
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
||||
|
||||
caps = gst_caps_new_simple ("audio/x-raw-int",
|
||||
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
|
||||
"channels", G_TYPE_INT, 1,
|
||||
"width", G_TYPE_INT, 16,
|
||||
"depth", G_TYPE_INT, 16,
|
||||
"rate", G_TYPE_INT, 44100, "signed", G_TYPE_BOOLEAN, TRUE, NULL);
|
||||
caps = gst_caps_new_simple ("audio/x-raw",
|
||||
"format", G_TYPE_STRING, "S16LE",
|
||||
"channels", G_TYPE_INT, 1, "rate", G_TYPE_INT, 44100, NULL);
|
||||
g_object_set (filter, "caps", caps, NULL);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
|
|
|
@ -243,12 +243,9 @@ main (int argc, char *argv[])
|
|||
convert = gst_element_factory_make ("audioconvert", "convert");
|
||||
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
||||
|
||||
caps = gst_caps_new_simple ("audio/x-raw-int",
|
||||
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
|
||||
"channels", G_TYPE_INT, 2,
|
||||
"width", G_TYPE_INT, 16,
|
||||
"depth", G_TYPE_INT, 16,
|
||||
"rate", G_TYPE_INT, 44100, "signed", G_TYPE_BOOLEAN, TRUE, NULL);
|
||||
caps = gst_caps_new_simple ("audio/x-raw",
|
||||
"format", G_TYPE_STRING, "S16LE",
|
||||
"channels", G_TYPE_INT, 2, "rate", G_TYPE_INT, 44100, NULL);
|
||||
g_object_set (filter, "caps", caps, NULL);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
|
|
|
@ -256,12 +256,9 @@ main (int argc, char *argv[])
|
|||
convert = gst_element_factory_make ("audioconvert", "convert");
|
||||
sink = gst_element_factory_make ("autoaudiosink", "sink");
|
||||
|
||||
caps = gst_caps_new_simple ("audio/x-raw-int",
|
||||
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
|
||||
"channels", G_TYPE_INT, 2,
|
||||
"width", G_TYPE_INT, 16,
|
||||
"depth", G_TYPE_INT, 16,
|
||||
"rate", G_TYPE_INT, 44100, "signed", G_TYPE_BOOLEAN, TRUE, NULL);
|
||||
caps = gst_caps_new_simple ("audio/x-raw",
|
||||
"format", G_TYPE_STRING, "S16LE",
|
||||
"channels", G_TYPE_INT, 2, "rate", G_TYPE_INT, 44100, NULL);
|
||||
g_object_set (filter, "caps", caps, NULL);
|
||||
gst_caps_unref (caps);
|
||||
|
||||
|
|
|
@ -70,10 +70,8 @@ clear_caps (GstCaps * caps, GstCaps * rescaps)
|
|||
/* And append to list without duplicates */
|
||||
while ((st = gst_caps_steal_structure (res, 0))) {
|
||||
/* Skip fake codecs/containers */
|
||||
if (gst_structure_has_name (st, "audio/x-raw-int") ||
|
||||
gst_structure_has_name (st, "audio/x-raw-float") ||
|
||||
gst_structure_has_name (st, "video/x-raw-yuv") ||
|
||||
gst_structure_has_name (st, "video/x-raw-rgb") ||
|
||||
if (gst_structure_has_name (st, "audio/x-raw") ||
|
||||
gst_structure_has_name (st, "video/x-raw") ||
|
||||
gst_structure_has_name (st, "unknown/unknown")) {
|
||||
gst_structure_free (st);
|
||||
continue;
|
||||
|
|
|
@ -2002,16 +2002,11 @@ shot_cb (GtkButton * button, gpointer data)
|
|||
GstCaps *caps;
|
||||
|
||||
/* convert to our desired format (RGB24) */
|
||||
caps = gst_caps_new_simple ("video/x-raw-rgb",
|
||||
"bpp", G_TYPE_INT, 24, "depth", G_TYPE_INT, 24,
|
||||
caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, "RGB24",
|
||||
/* Note: we don't ask for a specific width/height here, so that
|
||||
* videoscale can adjust dimensions from a non-1/1 pixel aspect
|
||||
* ratio to a 1/1 pixel-aspect-ratio */
|
||||
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1,
|
||||
"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);
|
||||
"pixel-aspect-ratio", GST_TYPE_FRACTION, 1, 1, NULL);
|
||||
|
||||
/* convert the latest frame to the requested format */
|
||||
g_signal_emit_by_name (pipeline, "convert-frame", caps, &buffer);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
#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
|
||||
main (int argc, char *argv[])
|
||||
|
|
|
@ -120,7 +120,7 @@ main (int argc, char *argv[])
|
|||
g_object_set (G_OBJECT (src2), "pattern", 1, NULL);
|
||||
capsfilter = gst_element_factory_make ("capsfilter", "caps0");
|
||||
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");
|
||||
segment = gst_element_factory_make ("identity", "identity-segment");
|
||||
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
|
||||
* as well */
|
||||
capsstr =
|
||||
g_strdup_printf ("video/x-raw-rgb, width=(int)%d, height=(int)%d;"
|
||||
"video/x-raw-rgb", width, height);
|
||||
g_strdup_printf ("video/x-raw, width=(int)%d, height=(int)%d;"
|
||||
"video/x-raw", width, height);
|
||||
caps = gst_caps_from_string (capsstr);
|
||||
g_free (capsstr);
|
||||
g_object_set (filter, "caps", caps, NULL);
|
||||
|
|
|
@ -80,7 +80,7 @@ test_textoverlay (int width, int height)
|
|||
gint a, b, c;
|
||||
|
||||
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\" ! "
|
||||
" videoconvert ! videoscale ! autovideosink", width, height);
|
||||
|
||||
|
|
Loading…
Reference in a new issue