summaryrefslogtreecommitdiff
path: root/ext/kate/gstkateutil.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-02-10 16:46:50 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2012-02-10 16:46:50 +0100
commit1119f6ee4103990ccc55d521be08bdce10737c8e (patch)
treed2b9a31d43d6a1f832951a9c984127e27622211a /ext/kate/gstkateutil.c
parent9fcfa6046d0e8e8ec89c32d7091b747088265d70 (diff)
parent1cbd755a2cd45531076c7b19ef194b77d5575cb0 (diff)
downloadgstreamer-plugins-bad-1119f6ee4103990ccc55d521be08bdce10737c8e.tar.gz
Merge branch 'master' into 0.11
Conflicts: ext/chromaprint/gstchromaprint.c ext/mpeg2enc/Makefile.am ext/voaacenc/gstvoaacenc.c gst/dvbsuboverlay/gstdvbsuboverlay.c gst/mpegtsdemux/mpegtsbase.c gst/sdp/gstsdpdemux.c gst/videoparsers/gsth264parse.c sys/d3dvideosink/d3dvideosink.c tests/examples/camerabin/gst-camera-perf.c tests/examples/camerabin/gst-camerabin-test.c tests/examples/camerabin2/gst-camerabin2-test.c tests/examples/mxf/mxfdemux-structure.c tests/examples/scaletempo/demo-main.c
Diffstat (limited to 'ext/kate/gstkateutil.c')
-rw-r--r--ext/kate/gstkateutil.c57
1 files changed, 54 insertions, 3 deletions
diff --git a/ext/kate/gstkateutil.c b/ext/kate/gstkateutil.c
index 787bc3e10..d28158758 100644
--- a/ext/kate/gstkateutil.c
+++ b/ext/kate/gstkateutil.c
@@ -24,6 +24,9 @@
#endif
#include <string.h>
+#ifdef HAVE_TIGER
+#include <tiger/tiger.h>
+#endif
#include <gst/tag/tag.h>
#include "gstkate.h"
#include "gstkateutil.h"
@@ -273,7 +276,8 @@ gst_kate_util_decoder_base_chain_kate_packet (GstKateDecoderBase * decoder,
if (G_UNLIKELY (ret < 0)) {
GST_ELEMENT_ERROR (element, STREAM, DECODE, (NULL),
- ("Failed to decode Kate packet: %d", ret));
+ ("Failed to decode Kate packet: %s",
+ gst_kate_util_get_error_message (ret)));
return GST_FLOW_ERROR;
}
@@ -443,8 +447,8 @@ gst_kate_decoder_base_change_state (GstKateDecoderBase * decoder,
GST_DEBUG_OBJECT (element, "READY -> PAUSED, initializing kate state");
ret = kate_high_decode_init (&decoder->k);
if (ret < 0) {
- GST_WARNING_OBJECT (element, "failed to initialize kate state: %d",
- ret);
+ GST_WARNING_OBJECT (element, "failed to initialize kate state: %s",
+ gst_kate_util_get_error_message (ret));
}
gst_segment_init (&decoder->kate_segment, GST_FORMAT_UNDEFINED);
decoder->kate_flushing = FALSE;
@@ -627,3 +631,50 @@ gst_kate_decoder_base_sink_query (GstKateDecoderBase * decoder,
return gst_pad_query_default (pad, query);
}
}
+
+const char *
+gst_kate_util_get_error_message (int ret)
+{
+ switch (ret) {
+ case KATE_E_NOT_FOUND:
+ return "value not found";
+ case KATE_E_INVALID_PARAMETER:
+ return "invalid parameter";
+ case KATE_E_OUT_OF_MEMORY:
+ return "out of memory";
+ case KATE_E_BAD_GRANULE:
+ return "bad granule";
+ case KATE_E_INIT:
+ return "initialization error";
+ case KATE_E_BAD_PACKET:
+ return "bad packet";
+ case KATE_E_TEXT:
+ return "invalid/truncated text";
+ case KATE_E_LIMIT:
+ return "a limit was exceeded";
+ case KATE_E_VERSION:
+ return "unsupported bitstream version";
+ case KATE_E_NOT_KATE:
+ return "not a kate bitstream";
+ case KATE_E_BAD_TAG:
+ return "bad tag";
+ case KATE_E_IMPL:
+ return "not implemented";
+
+#ifdef HAVE_TIGER
+ case TIGER_E_NOT_FOUND:
+ return "value not found";
+ case TIGER_E_INVALID_PARAMETER:
+ return "invalid parameter";
+ case TIGER_E_OUT_OF_MEMORY:
+ return "out of memory";
+ case TIGER_E_CAIRO_ERROR:
+ return "Cairo error";
+ case TIGER_E_BAD_SURFACE_TYPE:
+ return "bad surface type";
+#endif
+
+ default:
+ return "unknown error";
+ }
+}