ext/ffmpeg/gstffmpegcolorspace.c: Backport changes from ffmpegcolorspace (gst-plugins...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Mon, 25 Oct 2004 21:26:34 +0000 (21:26 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Mon, 25 Oct 2004 21:26:34 +0000 (21:26 +0000)
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
Backport changes from ffmpegcolorspace (gst-plugins) so we can
then move the whole of this plugin back and deprecate this (no,
I'm not insane).

ChangeLog
ext/ffmpeg/gstffmpegcolorspace.c

index a9fddf2..8402aed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-10-25  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
+       * ext/ffmpeg/gstffmpegcolorspace.c: (gst_ffmpegcsp_pad_link):
+         Backport changes from ffmpegcolorspace (gst-plugins) so we can
+         then move the whole of this plugin back and deprecate this (no,
+         I'm not insane).
+
+2004-10-25  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
        * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
        (gst_ffmpeg_codectype_to_caps), (gst_ffmpeg_caps_with_codecid):
        * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_base_init),
index 118ccdc..3c2f21d 100644 (file)
@@ -176,15 +176,20 @@ gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps)
   GstPadLinkReturn ret;
   int height, width;
   double framerate;
+  const GValue *par = NULL;
 
   space = GST_FFMPEGCSP (gst_pad_get_parent (pad));
 
+  GST_DEBUG_OBJECT (space, "pad_link on %s:%s with caps %" GST_PTR_FORMAT,
+      GST_DEBUG_PAD_NAME (pad), caps);
+
   otherpad = (pad == space->srcpad) ? space->sinkpad : space->srcpad;
 
   structure = gst_caps_get_structure (caps, 0);
   gst_structure_get_int (structure, "width", &width);
   gst_structure_get_int (structure, "height", &height);
   gst_structure_get_double (structure, "framerate", &framerate);
+  par = gst_structure_get_value (structure, "pixel-aspect-ratio");
 
   /* FIXME attempt and/or check for passthru */
 
@@ -218,6 +223,12 @@ gst_ffmpegcsp_pad_link (GstPad * pad, const GstCaps * caps)
         "width", G_TYPE_INT, width,
         "height", G_TYPE_INT, height,
         "framerate", G_TYPE_DOUBLE, framerate, NULL);
+    if (par) {
+      gst_caps_set_simple (caps,
+          "pixel-aspect-ratio", GST_TYPE_FRACTION,
+          gst_value_get_fraction_numerator (par),
+          gst_value_get_fraction_denominator (par), NULL);
+    }
     ret = gst_pad_try_set_caps (otherpad, caps);
     if (GST_PAD_LINK_FAILED (ret)) {
       return ret;