~ubuntu-branches/ubuntu/quantal/gst-plugins-bad0.10/quantal-proposed

« back to all changes in this revision

Viewing changes to gst/dtmf/gstdtmfsrc.c

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2011-07-19 14:32:43 UTC
  • mfrom: (18.4.21 sid)
  • Revision ID: james.westby@ubuntu.com-20110719143243-p7pnkh45akfp0ihk
Tags: 0.10.22-2ubuntu1
* Rebased on debian unstable, remaining changes:
  - debian/gstreamer-plugins-bad.install
    * don't include dtmf, liveadder, rtpmux, autoconvert and shm, we include 
      them in -good

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
 */
114
114
 
115
115
#ifdef HAVE_CONFIG_H
116
 
#  include "config.h"
 
116
#include "config.h"
117
117
#endif
118
118
 
119
119
#include <stdlib.h>
122
122
 
123
123
#include <glib.h>
124
124
 
125
 
#ifndef M_PI
126
 
# define M_PI           3.14159265358979323846  /* pi */
127
 
#endif
128
 
 
 
125
#include "gstdtmfcommon.h"
129
126
 
130
127
#include "gstdtmfsrc.h"
131
128
 
136
133
#define DEFAULT_SAMPLE_RATE      8000
137
134
#define SAMPLE_SIZE              16
138
135
#define CHANNELS                 1
139
 
#define MIN_EVENT                0
140
 
#define MAX_EVENT                16
141
 
#define MIN_VOLUME               0
142
 
#define MAX_VOLUME               36
143
 
#define MIN_INTER_DIGIT_INTERVAL 100
144
 
#define MIN_PULSE_DURATION       250
145
136
#define MIN_DUTY_CYCLE           (MIN_INTER_DIGIT_INTERVAL + MIN_PULSE_DURATION)
146
137
 
147
138
 
457
448
gst_dtmf_prepare_timestamps (GstDTMFSrc * dtmfsrc)
458
449
{
459
450
  GstClock *clock;
460
 
  GstClockTime base_time;
461
 
 
462
 
  base_time = gst_element_get_base_time (GST_ELEMENT (dtmfsrc));
463
451
 
464
452
  clock = gst_element_get_clock (GST_ELEMENT (dtmfsrc));
465
453
  if (clock != NULL) {
466
 
#ifdef MAEMO_BROKEN
467
 
    dtmfsrc->timestamp = gst_clock_get_time (clock);
468
 
#else
469
 
    dtmfsrc->timestamp = gst_clock_get_time (clock) - base_time;
470
 
#endif
 
454
    dtmfsrc->timestamp = gst_clock_get_time (clock)
 
455
        - gst_element_get_base_time (GST_ELEMENT (dtmfsrc));
471
456
    gst_object_unref (clock);
472
457
  } else {
473
458
    gchar *dtmf_name = gst_element_get_name (dtmfsrc);
696
681
 
697
682
  clock = gst_element_get_clock (GST_ELEMENT (basesrc));
698
683
 
699
 
#ifdef MAEMO_BROKEN
700
 
  clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp);
701
 
#else
702
684
  clockid = gst_clock_new_single_shot_id (clock, dtmfsrc->timestamp +
703
685
      gst_element_get_base_time (GST_ELEMENT (dtmfsrc)));
704
 
#endif
705
686
  gst_object_unref (clock);
706
687
 
707
688
  GST_OBJECT_LOCK (dtmfsrc);