2002-03-20 21:45:03 +00:00
|
|
|
/* GStreamer
|
2001-12-22 23:43:34 +00:00
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* Library <2001> Thomas Vander Stichele <thomas@apestaart.org>
|
2011-08-18 17:15:03 +00:00
|
|
|
* <2011> Wim Taymans <wim.taymans@gmail.com>
|
2001-12-22 23:43:34 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2004-02-27 21:47:49 +00:00
|
|
|
#ifndef __GST_AUDIO_AUDIO_H__
|
|
|
|
#define __GST_AUDIO_AUDIO_H__
|
|
|
|
|
2012-06-08 08:10:08 +00:00
|
|
|
#include <gst/gst.h>
|
2012-03-19 15:18:56 +00:00
|
|
|
#include <gst/audio/audio-enumtypes.h>
|
2012-06-08 08:10:08 +00:00
|
|
|
#include <gst/audio/audio-format.h>
|
|
|
|
#include <gst/audio/audio-channels.h>
|
|
|
|
#include <gst/audio/audio-info.h>
|
2012-03-19 15:18:56 +00:00
|
|
|
|
2012-06-08 08:10:08 +00:00
|
|
|
G_BEGIN_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2011-08-18 17:15:03 +00:00
|
|
|
/* conversion macros */
|
2008-08-11 08:34:56 +00:00
|
|
|
/**
|
2011-08-18 17:15:03 +00:00
|
|
|
* GST_FRAMES_TO_CLOCK_TIME:
|
|
|
|
* @frames: sample frames
|
|
|
|
* @rate: sampling rate
|
|
|
|
*
|
|
|
|
* Calculate clocktime from sample @frames and @rate.
|
2008-08-11 08:34:56 +00:00
|
|
|
*/
|
2011-08-18 17:15:03 +00:00
|
|
|
#define GST_FRAMES_TO_CLOCK_TIME(frames, rate) \
|
|
|
|
((GstClockTime) gst_util_uint64_scale_round (frames, GST_SECOND, rate))
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2008-08-11 08:34:56 +00:00
|
|
|
/**
|
2011-08-18 17:15:03 +00:00
|
|
|
* GST_CLOCK_TIME_TO_FRAMES:
|
|
|
|
* @clocktime: clock time
|
|
|
|
* @rate: sampling rate
|
|
|
|
*
|
|
|
|
* Calculate frames from @clocktime and sample @rate.
|
2008-08-11 08:34:56 +00:00
|
|
|
*/
|
2011-08-18 17:15:03 +00:00
|
|
|
#define GST_CLOCK_TIME_TO_FRAMES(clocktime, rate) \
|
|
|
|
gst_util_uint64_scale_round (clocktime, rate, GST_SECOND)
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2001-12-22 23:43:34 +00:00
|
|
|
/*
|
|
|
|
* this library defines and implements some helper functions for audio
|
|
|
|
* handling
|
|
|
|
*/
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2011-08-20 08:49:17 +00:00
|
|
|
GstBuffer * gst_audio_buffer_clip (GstBuffer *buffer, GstSegment *segment,
|
|
|
|
gint rate, gint bpf);
|
2004-01-12 19:35:54 +00:00
|
|
|
|
2011-12-16 09:55:13 +00:00
|
|
|
|
2003-07-19 23:47:42 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 16:32:55 +00:00
|
|
|
|
2004-02-27 21:47:49 +00:00
|
|
|
#endif /* __GST_AUDIO_AUDIO_H__ */
|