mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
y4m: fix negotiation
This commit is contained in:
parent
02034ce772
commit
9196e0a3d6
1 changed files with 5 additions and 5 deletions
|
@ -155,9 +155,7 @@ gst_y4m_encode_setcaps (GstPad * pad, GstCaps * vscaps)
|
|||
if (!gst_video_info_from_caps (&info, vscaps))
|
||||
goto invalid_format;
|
||||
|
||||
filter->info = info;
|
||||
|
||||
switch (GST_VIDEO_INFO_FORMAT (&filter->info)) {
|
||||
switch (GST_VIDEO_INFO_FORMAT (&info)) {
|
||||
case GST_VIDEO_FORMAT_I420:
|
||||
filter->colorspace = "420";
|
||||
break;
|
||||
|
@ -174,6 +172,8 @@ gst_y4m_encode_setcaps (GstPad * pad, GstCaps * vscaps)
|
|||
goto invalid_format;
|
||||
}
|
||||
|
||||
filter->info = info;
|
||||
|
||||
/* the template caps will do for the src pad, should always accept */
|
||||
ret = gst_pad_set_caps (filter->srcpad,
|
||||
gst_static_pad_template_get_caps (&y4mencode_src_factory));
|
||||
|
@ -270,7 +270,7 @@ gst_y4m_encode_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
GstClockTime timestamp;
|
||||
|
||||
/* check we got some decent info from caps */
|
||||
if (GST_VIDEO_INFO_FORMAT (&filter->info) != GST_VIDEO_FORMAT_UNKNOWN)
|
||||
if (GST_VIDEO_INFO_FORMAT (&filter->info) == GST_VIDEO_FORMAT_UNKNOWN)
|
||||
goto not_negotiated;
|
||||
|
||||
timestamp = GST_BUFFER_TIMESTAMP (buf);
|
||||
|
@ -299,7 +299,7 @@ gst_y4m_encode_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
|
|||
/* ERRORS */
|
||||
not_negotiated:
|
||||
{
|
||||
GST_ELEMENT_ERROR ("filter", CORE, NEGOTIATION, (NULL),
|
||||
GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION, (NULL),
|
||||
("format wasn't negotiated before chain function"));
|
||||
gst_buffer_unref (buf);
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
|
|
Loading…
Reference in a new issue