3 * Copyright (C) 2015 Vivia Nikolaidou <vivia@toolsonair.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
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 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
21 #ifndef __GST_VIDEOFRAME_AUDIOLEVEL_H__
22 #define __GST_VIDEOFRAME_AUDIOLEVEL_H__
25 #include <gst/audio/audio.h>
28 #define GST_TYPE_VIDEOFRAME_AUDIOLEVEL (gst_videoframe_audiolevel_get_type())
29 #define GST_VIDEOFRAME_AUDIOLEVEL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VIDEOFRAME_AUDIOLEVEL,GstVideoFrameAudioLevel))
30 #define GST_IS_VIDEOFRAME_AUDIOLEVEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_VIDEOFRAME_AUDIOLEVEL))
31 #define GST_VIDEOFRAME_AUDIOLEVEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_VIDEOFRAME_AUDIOLEVEL,GstVideoFrameAudioLevelClass))
32 #define GST_IS_VIDEOFRAME_AUDIOLEVEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_VIDEOFRAME_AUDIOLEVEL))
33 #define GST_VIDEOFRAME_AUDIOLEVEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_VIDEOFRAME_AUDIOLEVEL,GstVideoFrameAudioLevelClass))
34 typedef struct _GstVideoFrameAudioLevel GstVideoFrameAudioLevel;
35 typedef struct _GstVideoFrameAudioLevelClass GstVideoFrameAudioLevelClass;
37 struct _GstVideoFrameAudioLevel
41 GstPad *asrcpad, *asinkpad, *vsrcpad, *vsinkpad;
45 gdouble *CS; /* normalized Cumulative Square */
47 GstSegment asegment, vsegment;
49 void (*process) (gpointer, guint, guint, gdouble *);
53 GstClockTime first_time;
55 guint64 next_offset, alignment_threshold, discont_time, discont_wait;
57 gboolean video_eos_flag;
58 gboolean audio_flush_flag;
59 gboolean shutdown_flag;
65 struct _GstVideoFrameAudioLevelClass
67 GstElementClass parent_class;
70 GType gst_videoframe_audiolevel_get_type (void);
71 GST_ELEMENT_REGISTER_DECLARE (videoframe_audiolevel);
74 #endif /* __GST_VIDEOFRAME_AUDIOLEVEL_H__ */