1 /* GStreamer Wavpack encoder plugin 2 * Copyright (c) 2006 Sebastian Dröge <slomo@circular-chaos.org> 3 * 4 * gstwavpackenc.h: Wavpack audio encoder 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __GST_WAVPACK_ENC_H__ 23 #define __GST_WAVPACK_ENC_H__ 24 25 #include <gst/gst.h> 26 #include <gst/audio/gstaudioencoder.h> 27 28 #include <wavpack/wavpack.h> 29 30 G_BEGIN_DECLS 31 32 #define GST_TYPE_WAVPACK_ENC (gst_wavpack_enc_get_type()) 33 G_DECLARE_FINAL_TYPE (GstWavpackEnc, gst_wavpack_enc, GST, WAVPACK_ENC, 34 GstAudioEncoder) 35 36 typedef struct 37 { 38 gboolean correction; 39 GstWavpackEnc *wavpack_enc; 40 gboolean passthrough; 41 } GstWavpackEncWriteID; 42 43 struct _GstWavpackEnc 44 { 45 GstAudioEncoder element; 46 47 /*< private > */ 48 GstPad *wvcsrcpad; 49 50 GstFlowReturn srcpad_last_return; 51 GstFlowReturn wvcsrcpad_last_return; 52 53 WavpackConfig *wp_config; 54 WavpackContext *wp_context; 55 56 gint samplerate; 57 gint channels; 58 gint channel_mask; 59 gint8 channel_mapping[8]; 60 gboolean need_channel_remap; 61 gint depth; 62 63 GstWavpackEncWriteID wv_id; 64 GstWavpackEncWriteID wvc_id; 65 66 guint mode; 67 guint bitrate; 68 gdouble bps; 69 guint correction_mode; 70 gboolean md5; 71 GChecksum *md5_context; 72 guint extra_processing; 73 guint joint_stereo_mode; 74 75 void *first_block; 76 int32_t first_block_size; 77 78 GstBuffer *pending_buffer; 79 gint32 pending_offset; 80 GstEvent *pending_segment; 81 82 GstClockTime timestamp_offset; 83 GstClockTime next_ts; 84 }; 85 86 gboolean gst_wavpack_enc_plugin_init (GstPlugin * plugin); 87 88 G_END_DECLS 89 #endif /* __GST_WAVPACK_ENC_H__ */ 90