diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-03-06 23:34:56 +0200 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-03-06 23:38:45 +0200 |
commit | 772f8f6a8a9febe581159f8d811a2aaace2fa096 (patch) | |
tree | 1e4e759c5a0653517eea67515835405583f94c74 /ext/metadata/metadatamuxjpeg.c | |
parent | 152830945646ca4230c60c92ce250d1a64c4f9d7 (diff) | |
download | gst-plugins-bad-772f8f6a8a9febe581159f8d811a2aaace2fa096.tar.gz gst-plugins-bad-772f8f6a8a9febe581159f8d811a2aaace2fa096.tar.bz2 gst-plugins-bad-772f8f6a8a9febe581159f8d811a2aaace2fa096.zip |
metadata: cleanup, fix the test, add comments
First do not build the plugin, if we have none of the backend, as it won't work
then. Fix the miniobject_unref error in the test. Sprinkle a first handful of
debug logs into the element code.
Diffstat (limited to 'ext/metadata/metadatamuxjpeg.c')
-rw-r--r-- | ext/metadata/metadatamuxjpeg.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/metadata/metadatamuxjpeg.c b/ext/metadata/metadatamuxjpeg.c index 57c8779f..3a418a44 100644 --- a/ext/metadata/metadatamuxjpeg.c +++ b/ext/metadata/metadatamuxjpeg.c @@ -211,6 +211,7 @@ metadatamux_jpeg_parse (JpegMuxData * jpeg_data, guint8 * buf, if (jpeg_data->state == JPEG_MUX_NULL) { if (*bufsize < 2) { + GST_INFO ("need more data"); *next_size = (buf - *next_start) + 2; ret = META_PARSING_NEED_MORE_DATA; goto done; @@ -220,6 +221,7 @@ metadatamux_jpeg_parse (JpegMuxData * jpeg_data, guint8 * buf, mark[1] = READ (buf, *bufsize); if (mark[0] != 0xFF || mark[1] != 0xD8) { + GST_INFO ("missing marker"); ret = META_PARSING_ERROR; goto done; } @@ -231,6 +233,7 @@ metadatamux_jpeg_parse (JpegMuxData * jpeg_data, guint8 * buf, while (ret == META_PARSING_DONE) { switch (jpeg_data->state) { case JPEG_MUX_READING: + GST_DEBUG ("start reading"); ret = metadatamux_jpeg_reading (jpeg_data, &buf, bufsize, offset, step_buf, next_start, next_size); @@ -239,6 +242,7 @@ metadatamux_jpeg_parse (JpegMuxData * jpeg_data, guint8 * buf, goto done; break; default: + GST_INFO ("invalid parser state"); ret = META_PARSING_ERROR; break; } @@ -379,6 +383,7 @@ metadatamux_jpeg_reading (JpegMuxData * jpeg_data, guint8 ** buf, *next_start = *buf; if (*bufsize < 2) { + GST_INFO ("need more data"); *next_size = (*buf - *next_start) + 2; ret = META_PARSING_NEED_MORE_DATA; goto done; @@ -396,6 +401,7 @@ metadatamux_jpeg_reading (JpegMuxData * jpeg_data, guint8 ** buf, if (chunk_size >= 16) { if (*bufsize < 5) { + GST_INFO ("need more data"); *next_size = (*buf - *next_start) + 5; ret = META_PARSING_NEED_MORE_DATA; goto done; @@ -406,11 +412,13 @@ metadatamux_jpeg_reading (JpegMuxData * jpeg_data, guint8 ** buf, } } else { /* FIXME: should we check if the first chunk is EXIF? */ + GST_INFO ("chunk size too small %u", chunk_size); } } if (!jfif_found) { + GST_INFO ("no jfif found"); ret = META_PARSING_ERROR; goto done; } @@ -456,7 +464,7 @@ metadatamux_jpeg_reading (JpegMuxData * jpeg_data, guint8 ** buf, ret = META_PARSING_DONE; } else { - /* invalid JPEG chunk */ + GST_INFO ("invalid JPEG chunk"); ret = META_PARSING_ERROR; } |