mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-24 16:18:16 +00:00
ext/ffmpeg/gstffmpegenc.c: Fix pad_link function to handle formats that ffmpeg returns as multiple caps structures.
Original commit message from CVS: * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect): Fix pad_link function to handle formats that ffmpeg returns as multiple caps structures. * gst/videofilter/gstvideofilter.c: (gst_videofilter_chain): Only complain if source buffer is _smaller_ than expected. * gst/videoscale/gstvideoscale.c: (gst_videoscale_init), (gst_videoscale_handle_src_event): Resize navigation events when passing them upstream. * gst/videotestsrc/gstvideotestsrc.c: * gst/videotestsrc/gstvideotestsrc.h: * gst/videotestsrc/videotestsrc.c: * gst/videotestsrc/videotestsrc.h: Rewrite many of the buffer painting functions to handle odd sizes (for many formats, size%4!=0 or size%8!=0). Most have been verified to work with my video card. * testsuite/gst-lint: Add check for elements calling gst_pad_get_caps() instead of gst_pad_get_allowed_caps().
This commit is contained in:
parent
e83494a26f
commit
2e20e4ccdf
1 changed files with 20 additions and 0 deletions
|
@ -286,6 +286,8 @@ gst_ffmpegenc_connect (GstPad *pad,
|
||||||
const GstCaps *caps)
|
const GstCaps *caps)
|
||||||
{
|
{
|
||||||
GstCaps *other_caps;
|
GstCaps *other_caps;
|
||||||
|
GstCaps *allowed_caps;
|
||||||
|
GstCaps *icaps;
|
||||||
enum PixelFormat pix_fmt;
|
enum PixelFormat pix_fmt;
|
||||||
GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) gst_pad_get_parent (pad);
|
GstFFMpegEnc *ffmpegenc = (GstFFMpegEnc *) gst_pad_get_parent (pad);
|
||||||
GstFFMpegEncClass *oclass = (GstFFMpegEncClass *) G_OBJECT_GET_CLASS(ffmpegenc);
|
GstFFMpegEncClass *oclass = (GstFFMpegEncClass *) G_OBJECT_GET_CLASS(ffmpegenc);
|
||||||
|
@ -344,6 +346,24 @@ gst_ffmpegenc_connect (GstPad *pad,
|
||||||
return GST_PAD_LINK_REFUSED;
|
return GST_PAD_LINK_REFUSED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allowed_caps = gst_pad_get_allowed_caps (ffmpegenc->srcpad);
|
||||||
|
icaps = gst_caps_intersect (allowed_caps, other_caps);
|
||||||
|
gst_caps_free (allowed_caps);
|
||||||
|
gst_caps_free (other_caps);
|
||||||
|
|
||||||
|
if (gst_caps_is_empty (icaps)) {
|
||||||
|
gst_caps_free (icaps);
|
||||||
|
return GST_PAD_LINK_REFUSED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gst_caps_get_size (icaps) > 1) {
|
||||||
|
GstCaps *newcaps;
|
||||||
|
|
||||||
|
newcaps = gst_caps_new_full (gst_caps_get_structure (icaps, 0), NULL);
|
||||||
|
gst_caps_free (icaps);
|
||||||
|
icaps = newcaps;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME set_explicit_caps is not supposed to be used in a pad link
|
/* FIXME set_explicit_caps is not supposed to be used in a pad link
|
||||||
* function. */
|
* function. */
|
||||||
if (!gst_pad_set_explicit_caps (ffmpegenc->srcpad, other_caps)) {
|
if (!gst_pad_set_explicit_caps (ffmpegenc->srcpad, other_caps)) {
|
||||||
|
|
Loading…
Reference in a new issue