ext/: Fix mimetype on smoke encoder.
authorWim Taymans <wim.taymans@gmail.com>
Mon, 18 Oct 2004 14:02:51 +0000 (14:02 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 18 Oct 2004 14:02:51 +0000 (14:02 +0000)
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_video_getcaps),
(gst_dvdec_video_link), (gst_dvdec_push):
* ext/jpeg/gstsmokeenc.c: (gst_smokeenc_class_init),
(gst_smokeenc_resync), (gst_smokeenc_chain):
Fix mimetype on smoke encoder.
Add aspect ratio to dvdec. Not sure if these
values are correct though....

ChangeLog
ext/dv/gstdvdec.c
ext/jpeg/gstsmokeenc.c

index 91dcad3..6dabaa9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2004-10-18  Wim Taymans  <wim@fluendo.com>
 
+       * ext/dv/gstdvdec.c: (gst_dvdec_video_getcaps),
+       (gst_dvdec_video_link), (gst_dvdec_push):
+       * ext/jpeg/gstsmokeenc.c: (gst_smokeenc_class_init),
+       (gst_smokeenc_resync), (gst_smokeenc_chain):
+       Fix mimetype on smoke encoder.
+       Add aspect ratio to dvdec. Not sure if these
+       values are correct though....
+
+2004-10-18  Wim Taymans  <wim@fluendo.com>
+
        * ext/vorbis/vorbisenc.c: (gst_vorbisenc_class_init):
        Fix vorbis property descriptions and ranges.
 
index e71c02b..2b53844 100644 (file)
 #define PAL_BUFFER 144000
 #define PAL_FRAMERATE 25.0
 
+#define PAL_NORMAL_PAR_X       16
+#define PAL_NORMAL_PAR_Y       15
+#define PAL_WIDE_PAR_X         64
+#define PAL_WIDE_PAR_Y         45
+
+#define NTSC_NORMAL_PAR_X      80
+#define NTSC_NORMAL_PAR_Y      89
+#define NTSC_WIDE_PAR_X                320
+#define NTSC_WIDE_PAR_Y                267
+
 /* The ElementDetails structure gives a human-readable description
  * of the plugin, as well as author and version data.
  */
@@ -98,7 +108,13 @@ static GstStaticPadTemplate video_src_temp = GST_STATIC_PAD_TEMPLATE ("video",
         "width = (int) 720, "
         "height = (int) { "
         G_STRINGIFY (NTSC_HEIGHT) ", " G_STRINGIFY (PAL_HEIGHT)
-        " }, " "framerate = (double) [ 1.0, 60.0 ];"
+        " }, "
+        "pixel-aspect-ratio=(fraction) { "
+        G_STRINGIFY (PAL_NORMAL_PAR_X) "/" G_STRINGIFY (PAL_NORMAL_PAR_Y) ","
+        G_STRINGIFY (PAL_WIDE_PAR_X) "/" G_STRINGIFY (PAL_WIDE_PAR_Y) ","
+        G_STRINGIFY (NTSC_NORMAL_PAR_X) "/" G_STRINGIFY (NTSC_NORMAL_PAR_Y) ","
+        G_STRINGIFY (NTSC_WIDE_PAR_X) "/" G_STRINGIFY (NTSC_WIDE_PAR_Y) "},"
+        "framerate = (double) [ 1.0, 60.0 ];"
         //"framerate = (double) { "
         //G_STRINGIFY (PAL_FRAMERATE) ", " G_STRINGIFY (NTSC_FRAMERATE)
         //" }; "
@@ -112,7 +128,13 @@ static GstStaticPadTemplate video_src_temp = GST_STATIC_PAD_TEMPLATE ("video",
         "width = (int) 720, "
         "height = (int) { "
         G_STRINGIFY (NTSC_HEIGHT) ", " G_STRINGIFY (PAL_HEIGHT)
-        " }, " "framerate = (double) [ 1.0, 60.0 ];"
+        " }, "
+        "pixel-aspect-ratio=(fraction) { "
+        G_STRINGIFY (PAL_NORMAL_PAR_X) "/" G_STRINGIFY (PAL_NORMAL_PAR_Y) ","
+        G_STRINGIFY (PAL_WIDE_PAR_X) "/" G_STRINGIFY (PAL_WIDE_PAR_Y) ","
+        G_STRINGIFY (NTSC_NORMAL_PAR_X) "/" G_STRINGIFY (NTSC_NORMAL_PAR_Y) ","
+        G_STRINGIFY (NTSC_WIDE_PAR_X) "/" G_STRINGIFY (NTSC_WIDE_PAR_Y) "},"
+        "framerate = (double) [ 1.0, 60.0 ];"
         //"framerate = (double) { "
         //G_STRINGIFY (PAL_FRAMERATE) ", " G_STRINGIFY (NTSC_FRAMERATE)
         //" }; "
@@ -126,7 +148,13 @@ static GstStaticPadTemplate video_src_temp = GST_STATIC_PAD_TEMPLATE ("video",
         "width = (int) 720, "
         "height = (int) { "
         G_STRINGIFY (NTSC_HEIGHT) ", " G_STRINGIFY (PAL_HEIGHT)
-        " }, " "framerate = (double) [ 1.0, 60.0 ]"
+        " }, "
+        "pixel-aspect-ratio=(fraction) { "
+        G_STRINGIFY (PAL_NORMAL_PAR_X) "/" G_STRINGIFY (PAL_NORMAL_PAR_Y) ","
+        G_STRINGIFY (PAL_WIDE_PAR_X) "/" G_STRINGIFY (PAL_WIDE_PAR_Y) ","
+        G_STRINGIFY (NTSC_NORMAL_PAR_X) "/" G_STRINGIFY (NTSC_NORMAL_PAR_Y) ","
+        G_STRINGIFY (NTSC_WIDE_PAR_X) "/" G_STRINGIFY (NTSC_WIDE_PAR_Y) "},"
+        "framerate = (double) [ 1.0, 60.0 ]"
         //"framerate = (double) { "
         //G_STRINGIFY (PAL_FRAMERATE) ", " G_STRINGIFY (NTSC_FRAMERATE)
         //" }"
@@ -740,7 +768,25 @@ gst_dvdec_video_getcaps (GstPad * pad)
 
   if (dvdec->found_header) {
     int i;
-
+    gint par_x, par_y;
+
+    if (dvdec->PAL) {
+      if (dv_format_wide (dvdec->decoder)) {
+        par_x = PAL_WIDE_PAR_X;
+        par_y = PAL_WIDE_PAR_Y;
+      } else {
+        par_x = PAL_NORMAL_PAR_X;
+        par_y = PAL_NORMAL_PAR_Y;
+      }
+    } else {
+      if (dv_format_wide (dvdec->decoder)) {
+        par_x = NTSC_WIDE_PAR_X;
+        par_y = NTSC_WIDE_PAR_Y;
+      } else {
+        par_x = NTSC_NORMAL_PAR_X;
+        par_y = NTSC_NORMAL_PAR_Y;
+      }
+    }
     /* set the height */
     for (i = 0; i < gst_caps_get_size (caps); i++) {
       GstStructure *structure = gst_caps_get_structure (caps, i);
@@ -748,7 +794,7 @@ gst_dvdec_video_getcaps (GstPad * pad)
       gst_structure_set (structure,
           "height", G_TYPE_INT, dvdec->height,
           "framerate", G_TYPE_DOUBLE, dvdec->framerate / dvdec->drop_factor,
-          NULL);
+          "pixel-aspect-ratio", GST_TYPE_FRACTION, par_x, par_y, NULL);
     }
   }
 
index 212a8bc..d56037b 100644 (file)
@@ -114,7 +114,7 @@ static GstStaticPadTemplate gst_smokeenc_src_pad_template =
 GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_SRC,
     GST_PAD_ALWAYS,
-    GST_STATIC_CAPS ("image/x-smoke, "
+    GST_STATIC_CAPS ("video/x-smoke, "
         "width = (int) [ 16, 4096 ], "
         "height = (int) [ 16, 4096 ], " "framerate = (double) [ 1, MAX ]")
     );