From 820c8f9ed19786258609d157d1df8c240e22b4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 22 May 2010 09:02:26 +0200 Subject: [PATCH] ivfparse: Integrate into the build system --- configure.ac | 2 ++ gst/ivfparse/Makefile.am | 14 ++++++++++++++ gst/ivfparse/gstivfparse.c | 26 ++++---------------------- 3 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 gst/ivfparse/Makefile.am diff --git a/configure.ac b/configure.ac index e826eb4bd0..7f6b97c1f4 100644 --- a/configure.ac +++ b/configure.ac @@ -285,6 +285,7 @@ AG_GST_CHECK_PLUGIN(h264parse) AG_GST_CHECK_PLUGIN(hdvparse) AG_GST_CHECK_PLUGIN(id3tag) AG_GST_CHECK_PLUGIN(invtelecine) +AG_GST_CHECK_PLUGIN(ivfparse) AG_GST_CHECK_PLUGIN(jpegformat) AG_GST_CHECK_PLUGIN(librfb) AG_GST_CHECK_PLUGIN(liveadder) @@ -1658,6 +1659,7 @@ gst/h264parse/Makefile gst/hdvparse/Makefile gst/id3tag/Makefile gst/invtelecine/Makefile +gst/ivfparse/Makefile gst/jpegformat/Makefile gst/legacyresample/Makefile gst/librfb/Makefile diff --git a/gst/ivfparse/Makefile.am b/gst/ivfparse/Makefile.am new file mode 100644 index 0000000000..b41c87f92a --- /dev/null +++ b/gst/ivfparse/Makefile.am @@ -0,0 +1,14 @@ +plugin_LTLIBRARIES = libgstivfparse.la + +libgstivfparse_la_SOURCES = gstivfparse.c +libgstivfparse_la_CFLAGS = \ + $(GST_BASE_CFLAGS) \ + $(GST_CFLAGS) +libgstivfparse_la_LIBADD = \ + $(GST_BASE_LIBS) \ + $(GST_LIBS) +libgstivfparse_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstivfparse_la_LIBTOOLFLAGS = --tag=disable-static + +noinst_HEADERS = gstivfparse.h + diff --git a/gst/ivfparse/gstivfparse.c b/gst/ivfparse/gstivfparse.c index be2224e64d..ac36b329ce 100644 --- a/gst/ivfparse/gstivfparse.c +++ b/gst/ivfparse/gstivfparse.c @@ -234,9 +234,11 @@ gst_ivfparse_chain (GstPad * pad, GstBuffer * buf) frame_size, frame_pts); if (gst_adapter_available (ivf->adapter) >= 12 + frame_size) { + GstBuffer *frame; + gst_adapter_flush (ivf->adapter, 12); - GstBuffer *frame = gst_adapter_take_buffer (ivf->adapter, frame_size); + frame = gst_adapter_take_buffer (ivf->adapter, frame_size); gst_buffer_set_caps (frame, GST_PAD_CAPS (ivf->srcpad)); GST_BUFFER_TIMESTAMP (frame) = gst_util_uint64_scale_int (GST_SECOND * frame_pts, ivf->rate_den, @@ -270,20 +272,6 @@ gst_ivfparse_chain (GstPad * pad, GstBuffer * buf) return res; } -/* typefinder for IVF + VP8 */ -static void -ivf_typefind (GstTypeFind * tf, gpointer user_data) -{ - guint8 *data = gst_type_find_peek (tf, 0, 12); - - if (data && - GST_READ_UINT32_LE (data) == GST_MAKE_FOURCC ('D', 'K', 'I', 'F') && - GST_READ_UINT32_LE (data + 8) == GST_MAKE_FOURCC ('V', 'P', '8', '0')) { - gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, - gst_caps_new_simple ("video/x-ivf", NULL)); - } -} - /* entry point to initialize the plug-in */ static gboolean ivfparse_init (GstPlugin * ivfparse) @@ -292,16 +280,10 @@ ivfparse_init (GstPlugin * ivfparse) GST_DEBUG_CATEGORY_INIT (gst_ivfparse_debug, "ivfparse", 0, "IVF parser"); /* register parser element */ - if (!gst_element_register (ivfparse, "ivfparse", GST_RANK_NONE, + if (!gst_element_register (ivfparse, "ivfparse", GST_RANK_PRIMARY, GST_TYPE_IVFPARSE)) return FALSE; - /* register typefinder function */ - if (!gst_type_find_register (ivfparse, "", GST_RANK_PRIMARY, - ivf_typefind, NULL, - gst_caps_new_simple ("video/x-ivf", NULL), NULL, NULL)) - return FALSE; - return TRUE; }