diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2004-10-18 17:49:09 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2004-10-18 17:49:09 +0000 |
commit | cda34e6a8df5fe1a55358ce73f13c764e7613f45 (patch) | |
tree | 22e04602e29d8a882ae1bf6228579fe7e8d8b846 /ext/dv/gstdvdec.c | |
parent | cf398c5fad02834aa7946d90049e1418519f6f46 (diff) |
ext/dv/gstdvdec.*: Make sure we renegotiate aspect ratio when the camera switches.
Original commit message from CVS:
* ext/dv/gstdvdec.c: (gst_dvdec_init), (gst_dvdec_video_getcaps),
(gst_dvdec_video_link), (gst_dvdec_push), (gst_dvdec_loop):
* ext/dv/gstdvdec.h:
Make sure we renegotiate aspect ratio when the camera switches.
Diffstat (limited to 'ext/dv/gstdvdec.c')
-rw-r--r-- | ext/dv/gstdvdec.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index 2b538448..ea891585 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -400,6 +400,7 @@ gst_dvdec_init (GstDVDec * dvdec) dvdec->height = 0; dvdec->frequency = 0; dvdec->channels = 0; + dvdec->wide = FALSE; dvdec->drop_factor = 1; dvdec->clamp_luma = FALSE; @@ -771,7 +772,7 @@ gst_dvdec_video_getcaps (GstPad * pad) gint par_x, par_y; if (dvdec->PAL) { - if (dv_format_wide (dvdec->decoder)) { + if (dvdec->wide) { par_x = PAL_WIDE_PAR_X; par_y = PAL_WIDE_PAR_Y; } else { @@ -779,7 +780,7 @@ gst_dvdec_video_getcaps (GstPad * pad) par_y = PAL_NORMAL_PAR_Y; } } else { - if (dv_format_wide (dvdec->decoder)) { + if (dvdec->wide) { par_x = NTSC_WIDE_PAR_X; par_y = NTSC_WIDE_PAR_Y; } else { @@ -882,6 +883,7 @@ gst_dvdec_loop (GstElement * element) guint32 length, got_bytes; GstClockTime ts, duration; gdouble fps; + gboolean wide; dvdec = GST_DVDEC (element); @@ -912,6 +914,7 @@ gst_dvdec_loop (GstElement * element) fps = (dvdec->PAL ? PAL_FRAMERATE : NTSC_FRAMERATE); height = (dvdec->PAL ? PAL_HEIGHT : NTSC_HEIGHT); length = (dvdec->PAL ? PAL_BUFFER : NTSC_BUFFER); + wide = dv_format_wide (dvdec->decoder); if (length != dvdec->length) { dvdec->length = length; @@ -1002,9 +1005,11 @@ gst_dvdec_loop (GstElement * element) } dvdec->framecount = 0; - if ((dvdec->framerate != fps) || (dvdec->height != height)) { + if ((dvdec->framerate != fps) || (dvdec->height != height) + || dvdec->wide != wide) { dvdec->height = height; dvdec->framerate = fps; + dvdec->wide = wide; if (GST_PAD_LINK_FAILED (gst_pad_renegotiate (dvdec->videosrcpad))) { GST_ELEMENT_ERROR (dvdec, CORE, NEGOTIATION, (NULL), (NULL)); @@ -1038,6 +1043,7 @@ gst_dvdec_loop (GstElement * element) } else { dvdec->height = height; dvdec->framerate = fps; + dvdec->wide = wide; } end: |