gst_plugins_good/ext/jpeg/gstjpeg.c
changeset 27 d43ce56a1534
parent 23 29ecd5cb86b3
child 31 aec498aab1d3
equal deleted inserted replaced
23:29ecd5cb86b3 27:d43ce56a1534
     1 /* GStreamer
       
     2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
       
     3  *
       
     4  * This library is free software; you can redistribute it and/or
       
     5  * modify it under the terms of the GNU Library General Public
       
     6  * License as published by the Free Software Foundation; either
       
     7  * version 2 of the License, or (at your option) any later version.
       
     8  *
       
     9  * This library is distributed in the hope that it will be useful,
       
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
       
    12  * Library General Public License for more details.
       
    13  *
       
    14  * You should have received a copy of the GNU Library General Public
       
    15  * License along with this library; if not, write to the
       
    16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
       
    17  * Boston, MA 02111-1307, USA.
       
    18  */
       
    19 #ifdef HAVE_CONFIG_H
       
    20 #include <config.h>
       
    21 #endif
       
    22 
       
    23 #include <string.h>
       
    24 
       
    25 #include <gst/gst.h>
       
    26 
       
    27 #include "gstjpegdec.h"
       
    28 #include "gstjpegenc.h"
       
    29 #include "gstsmokeenc.h"
       
    30 #include "gstsmokedec.h"
       
    31 
       
    32 #if 0
       
    33 static GstStaticCaps smoke_caps = GST_STATIC_CAPS ("video/x-smoke");
       
    34 
       
    35 #define SMOKE_CAPS (gst_static_caps_get(&smoke_caps))
       
    36 static void
       
    37 smoke_type_find (GstTypeFind * tf, gpointer private)
       
    38 {
       
    39   guint8 *data = gst_type_find_peek (tf, 0, 6);
       
    40 
       
    41   if (data) {
       
    42     if (data[0] != 0x80)
       
    43       return;
       
    44     if (memcmp (&data[1], "smoke", 5) != 0)
       
    45       return;
       
    46     gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SMOKE_CAPS);
       
    47   }
       
    48 }
       
    49 #endif
       
    50 
       
    51 static gboolean
       
    52 plugin_init (GstPlugin * plugin)
       
    53 {
       
    54 
       
    55   if (!gst_element_register (plugin, "jpegenc", GST_RANK_NONE,
       
    56           GST_TYPE_JPEGENC))
       
    57     return FALSE;
       
    58 
       
    59   if (!gst_element_register (plugin, "jpegdec", GST_RANK_PRIMARY,
       
    60           GST_TYPE_JPEG_DEC))
       
    61     return FALSE;
       
    62 
       
    63   if (!gst_element_register (plugin, "smokeenc", GST_RANK_PRIMARY,
       
    64           GST_TYPE_SMOKEENC))
       
    65     return FALSE;
       
    66 
       
    67   if (!gst_element_register (plugin, "smokedec", GST_RANK_PRIMARY,
       
    68           GST_TYPE_SMOKEDEC))
       
    69     return FALSE;
       
    70 
       
    71 #if 0
       
    72   if (!gst_type_find_register (plugin, "video/x-smoke", GST_RANK_PRIMARY,
       
    73           smoke_type_find, NULL, SMOKE_CAPS, NULL))
       
    74     return FALSE;
       
    75 #endif
       
    76 
       
    77   return TRUE;
       
    78 }
       
    79 
       
    80 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
       
    81     GST_VERSION_MINOR,
       
    82     "jpeg",
       
    83     "JPeg plugin library",
       
    84     plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
       
    85 
       
    86 #ifdef SYMBIAN
       
    87 EXPORT_C GstPluginDesc* _GST_PLUGIN_DESC()
       
    88 {
       
    89 	return &gst_plugin_desc;
       
    90 }
       
    91 
       
    92 #endif