54aebcfea7607e42cd486674dc9af1a9686fe18c
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 "gstducativp6dec.h"
30 #include "gstducativp7dec.h"
31 #include "gstducatirvdec.h"
32 #if HAVE_ENCODERS
33 #include "gstducatih264enc.h"
34 #include "gstducatimpeg4enc.h"
35 #endif
37 GST_DEBUG_CATEGORY (gst_ducati_debug);
39 #ifndef GST_DISABLE_GST_DEBUG
40 void
41 gst_ducati_log_extended_error_info (int error)
42 {
43 GST_ERROR ("Error %s%s%s%s%s%s%s%x",
44 XDM_ISFATALERROR (error) ? "[fatal] " : "",
45 XDM_ISUNSUPPORTEDPARAM (error) ? "[unsupported param] " : "",
46 XDM_ISUNSUPPORTEDINPUT (error) ? "[unsupported input] " : "",
47 XDM_ISCORRUPTEDHEADER (error) ? "[corrupted header] " : "",
48 XDM_ISCORRUPTEDDATA (error) ? "[corrupted data] " : "",
49 XDM_ISINSUFFICIENTDATA (error) ? "[insufficient data] " : "",
50 XDM_ISAPPLIEDCONCEALMENT (error) ? "[applied concealment] " : "", error);
51 }
52 #endif
54 static gboolean
55 plugin_init (GstPlugin * plugin)
56 {
57 GST_DEBUG_CATEGORY_INIT (gst_ducati_debug, "ducati", 0, "ducati");
59 /* TODO .. find some way to reasonably detect if the corresponding
60 * codecs are actually available..
61 */
62 return gst_element_register (plugin, "ducatih264dec", GST_RANK_PRIMARY,
63 GST_TYPE_DUCATIH264DEC) &&
64 gst_element_register (plugin, "ducatimpeg4dec", GST_RANK_PRIMARY,
65 GST_TYPE_DUCATIMPEG4DEC) &&
66 gst_element_register (plugin, "ducatimpeg2dec", GST_RANK_PRIMARY,
67 GST_TYPE_DUCATIMPEG2DEC) &&
68 gst_element_register (plugin, "ducativc1dec", GST_RANK_PRIMARY,
69 GST_TYPE_DUCATIVC1DEC) &&
70 gst_element_register (plugin, "ducativp6dec", GST_RANK_PRIMARY,
71 GST_TYPE_DUCATIVP6DEC) &&
72 gst_element_register (plugin, "ducativp7dec", GST_RANK_PRIMARY,
73 GST_TYPE_DUCATIVP7DEC) &&
74 gst_element_register (plugin, "ducatirvdec", GST_RANK_PRIMARY,
75 GST_TYPE_DUCATIRVDEC) &&
76 #ifdef HAVE_ENCODERS
77 gst_element_register (plugin, "ducatih264enc", GST_RANK_PRIMARY + 1,
78 GST_TYPE_DUCATIH264ENC) &&
79 gst_element_register (plugin, "ducatimpeg4enc", GST_RANK_PRIMARY + 1,
80 GST_TYPE_DUCATIMPEG4ENC) &&
81 #endif
82 TRUE;
83 }
85 /* PACKAGE: this is usually set by autotools depending on some _INIT macro
86 * in configure.ac and then written into and defined in config.h, but we can
87 * just set it ourselves here in case someone doesn't use autotools to
88 * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
89 */
90 #ifndef PACKAGE
91 # define PACKAGE "ducati"
92 #endif
94 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, "ducati",
95 "Hardware accellerated codecs for OMAP4",
96 plugin_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/")