ext/dv/gstdvdec.c: Fix caps nego and pad templates. RGB mode caps should work now.

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
This commit is contained in:
Jan Schmidt 2004-05-07 16:17:25 +00:00
parent 69127d320c
commit e9d760851b
3 changed files with 33 additions and 15 deletions

View file

@ -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> 2004-05-07 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/alsa/gstalsamixer.c: (gst_alsa_mixer_build_list): * ext/alsa/gstalsamixer.c: (gst_alsa_mixer_build_list):

View file

@ -93,9 +93,9 @@ static GstStaticPadTemplate video_src_temp = GST_STATIC_PAD_TEMPLATE ("video",
"bpp = (int) 32, " "bpp = (int) 32, "
"depth = (int) 32, " "depth = (int) 32, "
"endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", " "endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", "
"red_mask = (int) 0x000000ff, " "red_mask = (int) 0x00ff0000, "
"green_mask = (int) 0x0000ff00, " "green_mask = (int) 0x0000ff00, "
"blue_mask = (int) 0x00ff0000, " "blue_mask = (int) 0x000000ff, "
"width = (int) 720, " "width = (int) 720, "
"height = (int) { " "height = (int) { "
G_STRINGIFY (NTSC_HEIGHT) ", " G_STRINGIFY (PAL_HEIGHT) 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, " "bpp = (int) 24, "
"depth = (int) 24, " "depth = (int) 24, "
"endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", " "endianness = (int) " G_STRINGIFY (G_BIG_ENDIAN) ", "
"red_mask = (int) 0x000000ff, " "red_mask = (int) 0x00ff0000, "
"green_mask = (int) 0x0000ff00, " "green_mask = (int) 0x0000ff00, "
"blue_mask = (int) 0x00ff0000, " "blue_mask = (int) 0x000000ff, "
"width = (int) 720, " "width = (int) 720, "
"height = (int) { " "height = (int) { "
G_STRINGIFY (NTSC_HEIGHT) ", " G_STRINGIFY (PAL_HEIGHT) 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); structure = gst_caps_get_structure (caps, 0);
/* it worked, try to find what it was again */ if (!gst_structure_get_int (structure, "height", &height) ||
if (!gst_structure_get_fourcc (structure, "format", &fourcc) ||
!gst_structure_get_int (structure, "height", &height) ||
!gst_structure_get_double (structure, "framerate", &framerate)) !gst_structure_get_double (structure, "framerate", &framerate))
return GST_PAD_LINK_REFUSED; return GST_PAD_LINK_REFUSED;
if ((height != dvdec->height) || (framerate != dvdec->framerate)) if ((height != dvdec->height) || (framerate != dvdec->framerate))
return GST_PAD_LINK_REFUSED; 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; gint bpp;
gst_structure_get_int (structure, "bpp", &bpp); gst_structure_get_int (structure, "bpp", &bpp);
@ -733,6 +731,9 @@ gst_dvdec_video_link (GstPad * pad, const GstCaps * caps)
dvdec->bpp = 4; dvdec->bpp = 4;
} }
} else { } else {
if (!gst_structure_get_fourcc (structure, "format", &fourcc))
return GST_PAD_LINK_REFUSED;
dvdec->space = e_dv_color_yuv; dvdec->space = e_dv_color_yuv;
dvdec->bpp = 2; dvdec->bpp = 2;
} }

View file

@ -63,7 +63,7 @@ gst_dv1394src_factory (void)
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS ("dv1394src", GST_STATIC_CAPS ("dv1394src",
"video/dv", "video/x-dv",
gst_props_new ("format", GST_PROPS_LIST (G_TYPE_STRING ("NTSC"), gst_props_new ("format", GST_PROPS_LIST (G_TYPE_STRING ("NTSC"),
G_TYPE_STRING ("PAL") G_TYPE_STRING ("PAL")
), NULL) ), NULL)
@ -156,6 +156,7 @@ gst_dv1394src_init (GstDV1394Src * dv1394src)
{ {
dv1394src->srcpad = gst_pad_new ("src", GST_PAD_SRC); dv1394src->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_pad_set_get_function (dv1394src->srcpad, gst_dv1394src_get); 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); gst_element_add_pad (GST_ELEMENT (dv1394src), dv1394src->srcpad);
dv1394src->card = 0; dv1394src->card = 0;
@ -252,9 +253,9 @@ gst_dv1394src_iso_receive (raw1394handle_t handle, int channel, size_t len,
// PAL // PAL
dv1394src->frameSize = PAL_FRAMESIZE; dv1394src->frameSize = PAL_FRAMESIZE;
GST_DEBUG ("PAL data"); GST_DEBUG ("PAL data");
if (gst_pad_try_set_caps (dv1394src->srcpad, if (!gst_pad_set_explicit_caps (dv1394src->srcpad,
gst_caps_new_simple ("video/dv", gst_caps_new_simple ("video/x-dv",
"format", G_TYPE_STRING, "PAL", NULL)) <= 0) { "format", G_TYPE_STRING, "PAL", NULL))) {
GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, (NULL), GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, (NULL),
("Could not set source caps for PAL")); ("Could not set source caps for PAL"));
return 0; return 0;
@ -264,9 +265,9 @@ gst_dv1394src_iso_receive (raw1394handle_t handle, int channel, size_t len,
dv1394src->frameSize = NTSC_FRAMESIZE; dv1394src->frameSize = NTSC_FRAMESIZE;
GST_DEBUG GST_DEBUG
("NTSC data [untested] - please report success/failure to <dan@f3c.com>"); ("NTSC data [untested] - please report success/failure to <dan@f3c.com>");
if (gst_pad_try_set_caps (dv1394src->srcpad, if (!gst_pad_set_explicit_caps (dv1394src->srcpad,
gst_caps_new_simple ("video/dv", "format", G_TYPE_STRING, gst_caps_new_simple ("video/x-dv", "format", G_TYPE_STRING,
"NTSC", NULL)) <= 0) { "NTSC", NULL))) {
GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, (NULL), GST_ELEMENT_ERROR (dv1394src, CORE, NEGOTIATION, (NULL),
("Could not set source caps for NTSC")); ("Could not set source caps for NTSC"));
return 0; return 0;