ext/dv/gstdvdec.c: Fix caps nego and pad templates. RGB mode caps should work now.
authorJan Schmidt <thaytan@mad.scientist.com>
Fri, 7 May 2004 16:17:25 +0000 (16:17 +0000)
committerJan Schmidt <thaytan@mad.scientist.com>
Fri, 7 May 2004 16:17:25 +0000 (16:17 +0000)
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_video_link):
Fix caps nego and pad templates. RGB mode caps should
work now.
* ext/dvdnav/gst-dvd:
Move mpeg2dec inside the thread because otherwise the
queue rejects cap changes mid-stream
* ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_get_type),
(gst_mpeg2dec_flush_decoder):
For mpeg2dec > 0.4.0, call the flush function instead of
manually extracting all in-flight frames.
* ext/raw1394/gstdv1394src.c: (gst_dv1394src_factory),
(gst_dv1394src_init), (gst_dv1394src_iso_receive):
Change mime type video/dv go video/x-dv to match the
rest of gst-plugins

ChangeLog
ext/dv/gstdvdec.c
ext/raw1394/gstdv1394src.c

index ab7a05c..8b7fd9e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2004-05-08  Jan Schmidt  <thaytan@mad.scientist.com>
+       * ext/dv/gstdvdec.c: (gst_dvdec_video_link):
+         Fix caps nego and pad templates. RGB mode caps should
+         work now.
+       * ext/dvdnav/gst-dvd:
+         Move mpeg2dec inside the thread because otherwise the
+         queue rejects cap changes mid-stream
+       * ext/mpeg2dec/gstmpeg2dec.c: (gst_mpeg2dec_get_type),
+       (gst_mpeg2dec_flush_decoder):
+         For mpeg2dec > 0.4.0, call the flush function instead of
+         manually extracting all in-flight frames.
+       * ext/raw1394/gstdv1394src.c: (gst_dv1394src_factory),
+       (gst_dv1394src_init), (gst_dv1394src_iso_receive):
+         Change mime type video/dv go video/x-dv to match the
+         rest of gst-plugins
+
 2004-05-07  Ronald Bultje  <rbultje@ronald.bitfreak.net>
 
        * ext/alsa/gstalsamixer.c: (gst_alsa_mixer_build_list):
index fc5f162..2ce3a47 100644 (file)
@@ -93,9 +93,9 @@ static GstStaticPadTemplate video_src_temp = GST_STATIC_PAD_TEMPLATE ("video",
         "bpp = (int) 32, "
         "depth = (int) 32, "
         "endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", "
-        "red_mask =   (int) 0x000000ff, "
+        "red_mask =   (int) 0x00ff0000, "
         "green_mask = (int) 0x0000ff00, "
-        "blue_mask =  (int) 0x00ff0000, "
+        "blue_mask =  (int) 0x000000ff, "
         "width = (int) 720, "
         "height = (int) { "
         G_STRINGIFY (NTSC_HEIGHT) ", " G_STRINGIFY (PAL_HEIGHT)
@@ -107,9 +107,9 @@ static GstStaticPadTemplate video_src_temp = GST_STATIC_PAD_TEMPLATE ("video",
         "bpp = (int) 24, "
         "depth = (int) 24, "
         "endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", "
-        "red_mask =   (int) 0x000000ff, "
+        "red_mask =   (int) 0x00ff0000, "
         "green_mask = (int) 0x0000ff00, "
-        "blue_mask =  (int) 0x00ff0000, "
+        "blue_mask =  (int) 0x000000ff, "
         "width = (int) 720, "
         "height = (int) { "
         G_STRINGIFY (NTSC_HEIGHT) ", " G_STRINGIFY (PAL_HEIGHT)
@@ -712,16 +712,14 @@ gst_dvdec_video_link (GstPad * pad, const GstCaps * caps)
 
   structure = gst_caps_get_structure (caps, 0);
 
-  /* it worked, try to find what it was again */
-  if (!gst_structure_get_fourcc (structure, "format", &fourcc) ||
-      !gst_structure_get_int (structure, "height", &height) ||
+  if (!gst_structure_get_int (structure, "height", &height) ||
       !gst_structure_get_double (structure, "framerate", &framerate))
     return GST_PAD_LINK_REFUSED;
 
   if ((height != dvdec->height) || (framerate != dvdec->framerate))
     return GST_PAD_LINK_REFUSED;
 
-  if (fourcc == GST_STR_FOURCC ("RGB ")) {
+  if (strcmp (gst_structure_get_name (structure), "video/x-raw-rgb") == 0) {
     gint bpp;
 
     gst_structure_get_int (structure, "bpp", &bpp);
@@ -733,6 +731,9 @@ gst_dvdec_video_link (GstPad * pad, const GstCaps * caps)
       dvdec->bpp = 4;
     }
   } else {
+    if (!gst_structure_get_fourcc (structure, "format", &fourcc))
+      return GST_PAD_LINK_REFUSED;
+
     dvdec->space = e_dv_color_yuv;
     dvdec->bpp = 2;
   }
index fcc9372..be9de56 100644 (file)
@@ -63,7 +63,7 @@ gst_dv1394src_factory (void)
         GST_PAD_SRC,
         GST_PAD_ALWAYS,
         GST_STATIC_CAPS ("dv1394src",
-            "video/dv",
+            "video/x-dv",
             gst_props_new ("format", GST_PROPS_LIST (G_TYPE_STRING ("NTSC"),
                     G_TYPE_STRING ("PAL")
                 ), NULL)
@@ -156,6 +156,7 @@ gst_dv1394src_init (GstDV1394Src * dv1394src)
 {
   dv1394src->srcpad = gst_pad_new ("src", GST_PAD_SRC);
   gst_pad_set_get_function (dv1394src->srcpad, gst_dv1394src_get);
+  gst_pad_use_explicit_caps (dv1394src->srcpad);
   gst_element_add_pad (GST_ELEMENT (dv1394src), dv1394src->srcpad);
 
   dv1394src->card = 0;
@@ -252,9 +253,9 @@ gst_dv1394src_iso_receive (raw1394handle_t handle, int channel, size_t len,
           // PAL
           dv1394src->frameSize = PAL_FRAMESIZE;
           GST_DEBUG ("PAL data");
-          if (gst_pad_try_set_caps (dv1394src->srcpad,
-                  gst_caps_new_simple ("video/dv",
-                      "format", G_TYPE_STRING, "PAL", NULL)) <= 0) {
+          if (!gst_pad_set_explicit_caps (dv1394src->srcpad,
+                  gst_caps_new_simple ("video/x-dv",
+                      "format", G_TYPE_STRING, "PAL", NULL))) {
             GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, (NULL),
                 ("Could not set source caps for PAL"));
             return 0;
@@ -264,9 +265,9 @@ gst_dv1394src_iso_receive (raw1394handle_t handle, int channel, size_t len,
           dv1394src->frameSize = NTSC_FRAMESIZE;
           GST_DEBUG
               ("NTSC data [untested] - please report success/failure to <dan@f3c.com>");
-          if (gst_pad_try_set_caps (dv1394src->srcpad,
-                  gst_caps_new_simple ("video/dv", "format", G_TYPE_STRING,
-                      "NTSC", NULL)) <= 0) {
+          if (!gst_pad_set_explicit_caps (dv1394src->srcpad,
+                  gst_caps_new_simple ("video/x-dv", "format", G_TYPE_STRING,
+                      "NTSC", NULL))) {
             GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, (NULL),
                 ("Could not set source caps for NTSC"));
             return 0;