1 /*
2 * GStreamer
3 * Copyright (c) 2010, Texas Instruments Incorporated
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation
8 * version 2.1 of the License.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
20 #ifdef HAVE_CONFIG_H
21 # include <config.h>
22 #endif
24 #include "gstducati.h"
25 #include "gstducatih264dec.h"
26 #include "gstducatimpeg4dec.h"
27 #include "gstducatimpeg2dec.h"
28 #include "gstducativc1dec.h"
29 #include "gstducatijpegdec.h"
31 #include "gstducatih264enc.h"
32 #include "gstducatimpeg4enc.h"
33 #include "gstducatijpegenc.h"
36 GST_DEBUG_CATEGORY (gst_ducati_debug);
38 void
39 gst_ducati_set_generic_error_strings (const char *strings[])
40 {
41 #ifndef GST_DISABLE_GST_DEBUG
42 strings[XDM_PARAMSCHANGE] = "sequence parameters change";
43 strings[XDM_APPLIEDCONCEALMENT] = "applied concealment";
44 strings[XDM_INSUFFICIENTDATA] = "insufficient data";
45 strings[XDM_CORRUPTEDDATA] = "corrupted data";
46 strings[XDM_CORRUPTEDHEADER] = "corrupted header";
47 strings[XDM_UNSUPPORTEDINPUT] = "unsupported input";
48 strings[XDM_UNSUPPORTEDPARAM] = "unsupported param";
49 strings[XDM_FATALERROR] = "fatal";
50 #endif
51 }
53 #ifndef GST_DISABLE_GST_DEBUG
54 void
55 gst_ducati_log_extended_error_info (uint32_t error, const char *strings[])
56 {
57 int bit = 0;
58 while (error) {
59 if (error & 1) {
60 GST_ERROR ("Bit %d (%08x): %s", bit, 1 << bit,
61 strings[bit] ? strings[bit] : "unknown");
62 }
63 error >>= 1;
64 ++bit;
65 }
66 }
67 #endif
69 static gboolean
70 plugin_init (GstPlugin * plugin)
71 {
72 GST_DEBUG_CATEGORY_INIT (gst_ducati_debug, "ducati", 0, "ducati");
74 return gst_element_register (plugin, "ducatih264dec", GST_RANK_PRIMARY + 1,
75 GST_TYPE_DUCATIH264DEC) &&
76 gst_element_register (plugin, "ducatimpeg4dec", GST_RANK_PRIMARY + 1,
77 GST_TYPE_DUCATIMPEG4DEC) &&
78 gst_element_register (plugin, "ducatimpeg2dec", GST_RANK_PRIMARY + 1,
79 GST_TYPE_DUCATIMPEG2DEC) &&
80 gst_element_register (plugin, "ducativc1dec", GST_RANK_PRIMARY + 1,
81 GST_TYPE_DUCATIVC1DEC) &&
82 gst_element_register (plugin, "ducatijpegdec", GST_RANK_PRIMARY + 1,
83 GST_TYPE_DUCATIJPEGDEC) &&
84 gst_element_register (plugin, "ducatih264enc", GST_RANK_PRIMARY + 1,
85 GST_TYPE_DUCATIH264ENC) &&
86 gst_element_register (plugin, "ducatimpeg4enc", GST_RANK_PRIMARY + 1,
87 GST_TYPE_DUCATIMPEG4ENC) &&
88 gst_element_register (plugin, "ducatijpegenc", GST_RANK_PRIMARY + 1,
89 GST_TYPE_DUCATIJPEGENC);
90 }
92 /* PACKAGE: this is usually set by autotools depending on some _INIT macro
93 * in configure.ac and then written into and defined in config.h, but we can
94 * just set it ourselves here in case someone doesn't use autotools to
95 * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
96 */
97 #ifndef PACKAGE
98 # define PACKAGE "ducati"
99 #endif
101 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, ducati,
102 "Hardware accelerated codecs for OMAP4",
103 plugin_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/")