Commit 2e20e4cc authored by David Schleef's avatar David Schleef
Browse files

ext/ffmpeg/gstffmpegenc.c: Fix pad_link function to handle formats that ffmpeg...

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().
parent e83494a2
...@@ -286,6 +286,8 @@ gst_ffmpegenc_connect (GstPad *pad, ...@@ -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, ...@@ -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)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment