GNOME Bugzilla – Bug 361260
New element: nuvdemux
Last modified: 2006-10-17 16:53:53 UTC
This is a patch to new nuvdemux element without external dependecies.
Created attachment 74440 [details] [review] patch for apply on gst-plugins-bad
Created attachment 74441 [details] this files you need descompress inside gst-plugins-bad/gst directory.
Tips about the utility functions: gst_nuv_demux_getdwle is unneeded, just use GST_READ_UINT32_LE (like you already do mostly, why are some places handled by gst_nuv_demux_getdwle?). GetDoubleLE is a bit awkward, better make use of the existing byte order swapping macro for guint64 instead, like this: #if G_BYTE_ORDER == G_BIG_ENDIAN static inline gdouble _gdouble_swap_le_be (gdouble d) { union { guint64 i; gdouble d; } u; u.d = d; u.i = GUINT64_SWAP_LE_BE (u.i); return u.d; } #define READ_DOUBLE_FROM_LE(d) (_gdouble_swap_le_be(d)) #else /* G_BYTE_ORDER != G_BIG_ENDIAN #define READ_DOUBLE_FROM_LE(d) (d) #endif /* G_BYTE_ORDER != G_BIG_ENDIAN (adapt it as needed)
Instead of GST_WARNING, GST_ERROR, etc. use GST_OBJECT_WARNING, GST_OBJECT_ERROR. In gst_nuv_demux_chain: if (NULL == nuv->adapter) { GST_ERROR (_("pull expected! Chain func should not be called")); GST_(OBJECT_)ERROR generates a debug message, no need for translation here. Better write nuv->adapter == NULL for readability. In gst_nuv_demux_reset, all these if (nuv->h != NULL) { g_free (nuv->h); nuv->h = NULL; } can be just written as g_free (nuv->h); nuv->h = NULL; because g_free is just a no-op if the argument is NULL.
Created attachment 74502 [details] uncompressed source file new source file fixed René Stadler points.
Created attachment 74504 [details] c source file uncompressed files
Created attachment 74505 [details] h source file uncompressed file
just commited. Renato, update all your gstreamer and please check it and then close this bug.
2006-10-17 Edgard Lima <edgard.lima@indt.org.br> * gst/nuvdemux/gstnuvdemux.c: Just a cast to make it compile oos big_endian systems. 2006-10-17 Edgard Lima <edgard.lima@indt.org.br> Patch by: Renato Filho <renato.filho@indt.org.br> and Rosfran Borges <rosfran.borges@indt.org.br> * configure.ac: * gst/nuvdemux/: * gst/nuvdemux/Makefile.am: * gst/nuvdemux/gstnuvdemux.c: * gst/nuvdemux/gstnuvdemux.h: Created new element nuvdemux.