diff options
author | Jan Schmidt <thaytan@mad.scientist.com> | 2004-04-01 11:48:27 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-05-15 23:35:06 +0100 |
commit | caac59573c8abd04595881b1397463ae1f0020d9 (patch) | |
tree | 19a5d9a198803501e599ea093330cfcfcc6b5012 /gst/y4m/gsty4mencode.c | |
parent | 1beae4829c6b302ac14206b877a0f32db6a12fd6 (diff) |
[MOVED FROM BAD] a52dec: Use a debug category, Output timestamps correctly
Original commit message from CVS:
a52dec: Use a debug category, Output timestamps correctly
Emit tag info, Handle events, tell liba52dec about cpu
capabilities so it can use MMX etc.
dvdec: Fix a crasher accessing invalid memory
dvdnavsrc:Some support for byte-format seeking.
Small fixes for still frames and menu button overlays
mpeg2dec: Use a debug category. Adjust the report level of several items to
LOG. Call mpeg2_custom_fbuf to mark our buffers as 'custom buffers'
so it doesn't lose the GstBuffer pointer
navseek: Add the navseek debug element for seeking back and forth in a
video stream using arrow keys.
mpeg2subt:Pretty much a complete rewrite. Now a loopbased element. May still
require work to properly synchronise subtitle buffers.
mpegdemux:
dvddemux: Don't attempt to create subbuffers of size 0
Reduce a couple of error outputs to warnings.
y4mencode:Output the y4m frame header correctly
Diffstat (limited to 'gst/y4m/gsty4mencode.c')
-rw-r--r-- | gst/y4m/gsty4mencode.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/gst/y4m/gsty4mencode.c b/gst/y4m/gsty4mencode.c index 773f96b8..25e1f94e 100644 --- a/gst/y4m/gsty4mencode.c +++ b/gst/y4m/gsty4mencode.c @@ -148,21 +148,19 @@ gst_y4mencode_sinkconnect (GstPad * pad, const GstCaps * caps) structure = gst_caps_get_structure (caps, 0); - gst_structure_get_int (structure, "width", &filter->width); - gst_structure_get_int (structure, "height", &filter->height); - gst_structure_get_double (structure, "framerate", &fps); + if (!gst_structure_get_int (structure, "width", &filter->width) || + !gst_structure_get_int (structure, "height", &filter->height) || + !gst_structure_get_double (structure, "framerate", &fps)) + return GST_PAD_LINK_REFUSED; /* find fps idx */ + idx = 0; for (i = 1; i < 9; i++) { - if (idx == -1) { - idx = i; - } else { - gdouble old_diff = fabs (framerates[idx] - fps), - new_diff = fabs (framerates[i] - fps); + gdouble old_diff = fabs (framerates[idx] - fps), + new_diff = fabs (framerates[i] - fps); - if (new_diff < old_diff) { - idx = i; - } + if (new_diff < old_diff) { + idx = i; } } filter->fps_idx = idx; @@ -209,7 +207,7 @@ gst_y4mencode_chain (GstPad * pad, GstData * _data) GST_BUFFER_DATA (outbuf) = g_malloc (GST_BUFFER_SIZE (buf) + 256); if (filter->init) { - header = "YUV4MPEG %d %d %d\nFRAME\n"; + header = "YUV4MPEG W%d H%d I? %d\nFRAME\n"; filter->init = FALSE; } else { header = "FRAME\n"; |