summaryrefslogtreecommitdiffstats
path: root/gst/y4m/gsty4mencode.c
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2004-04-01 11:48:27 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2004-04-01 11:48:27 +0000
commitbc4cb91fab1a4efca7e0addf7a327f397b9ba2dd (patch)
tree5c53e0af75d5df62749bc0ea9ff89eb4fc2f531f /gst/y4m/gsty4mencode.c
parent23fb6b5caeeba3badc8ef414fbfff2633b8aa542 (diff)
downloadgst-plugins-bad-bc4cb91fab1a4efca7e0addf7a327f397b9ba2dd.tar.gz
gst-plugins-bad-bc4cb91fab1a4efca7e0addf7a327f397b9ba2dd.tar.bz2
gst-plugins-bad-bc4cb91fab1a4efca7e0addf7a327f397b9ba2dd.zip
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.c22
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";