1 /* GStreamer AccurateRip (TM) audio checksumming element 2 * 3 * Copyright (C) 2012 Christophe Fergeau <teuf@gnome.org> 4 * 5 * Based on the GStreamer chromaprint audio fingerprinting element 6 * Copyright (C) 2006 M. Derezynski 7 * Copyright (C) 2008 Eric Buehl 8 * Copyright (C) 2008 Sebastian Dröge <slomo@circular-chaos.org> 9 * Copyright (C) 2011 Lukáš Lalinský <<user@hostname.org>> 10 * 11 * This library is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU Library General Public 13 * License as published by the Free Software Foundation; either 14 * version 2 of the License, or (at your option) any later version. 15 * 16 * This library is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * Library General Public License for more details. 20 * 21 * You should have received a copy of the GNU Library General Public 22 * License along with this library; if not, write to the 23 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 24 * Boston, MA 02110-1301, USA. 25 */ 26 27 #ifndef __GST_ACCURIP_H__ 28 #define __GST_ACCURIP_H__ 29 30 #include <gst/gst.h> 31 #include <gst/base/gstadapter.h> 32 #include <gst/audio/gstaudiofilter.h> 33 #include <gst/audio/audio.h> 34 35 G_BEGIN_DECLS 36 37 #define GST_TYPE_ACCURIP \ 38 (gst_accurip_get_type()) 39 #define GST_ACCURIP(obj) \ 40 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ACCURIP,GstAccurip)) 41 #define GST_ACCURIP_CLASS(klass) \ 42 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ACCURIP,GstAccuripClass)) 43 #define GST_IS_ACCURIP(obj) \ 44 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ACCURIP)) 45 #define GST_IS_ACCURIP_CLASS(klass) \ 46 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ACCURIP)) 47 48 #define GST_TAG_ACCURIP_CRC "accurip-crc" 49 #define GST_TAG_ACCURIP_CRC_V2 "accurip-crcv2" 50 51 typedef struct _GstAccurip GstAccurip; 52 typedef struct _GstAccuripClass GstAccuripClass; 53 54 /** 55 * GstAccurip: 56 * 57 * Opaque #GstAccurip element structure 58 */ 59 struct _GstAccurip 60 { 61 GstAudioFilter element; 62 63 /*< private >*/ 64 guint32 crc; 65 guint32 crc_v2; 66 guint64 num_samples; 67 gboolean is_first; 68 gboolean is_last; 69 70 /* Needed when 'is_last' is true */ 71 guint32 *crcs_ring; 72 guint32 *crcs_v2_ring; 73 guint64 ring_samples; 74 }; 75 76 struct _GstAccuripClass 77 { 78 GstAudioFilterClass parent_class; 79 }; 80 81 GType gst_accurip_get_type (void); 82 83 GST_ELEMENT_REGISTER_DECLARE (accurip); 84 85 G_END_DECLS 86 87 #endif /* __GST_ACCURIP_H__ */ 88