43 * @GST_AUDIO_TEST_SRC_WAVE_SINE: a sine wave |
43 * @GST_AUDIO_TEST_SRC_WAVE_SINE: a sine wave |
44 * @GST_AUDIO_TEST_SRC_WAVE_SQUARE: a square wave |
44 * @GST_AUDIO_TEST_SRC_WAVE_SQUARE: a square wave |
45 * @GST_AUDIO_TEST_SRC_WAVE_SAW: a saw wave |
45 * @GST_AUDIO_TEST_SRC_WAVE_SAW: a saw wave |
46 * @GST_AUDIO_TEST_SRC_WAVE_TRIANGLE: a tringle wave |
46 * @GST_AUDIO_TEST_SRC_WAVE_TRIANGLE: a tringle wave |
47 * @GST_AUDIO_TEST_SRC_WAVE_SILENCE: silence |
47 * @GST_AUDIO_TEST_SRC_WAVE_SILENCE: silence |
48 * @GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE: white uniform noise |
48 * @GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE: white noise |
49 * @GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE: pink noise |
49 * @GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE: pink noise |
50 * @GST_AUDIO_TEST_SRC_WAVE_SINE_TAB: sine wave using a table |
50 * @GST_AUDIO_TEST_SRC_WAVE_SINE_TAB: sine wave using a table |
51 * @GST_AUDIO_TEST_SRC_WAVE_TICKS: periodic ticks |
|
52 * @GST_AUDIO_TEST_SRC_WAVE_GAUSSIAN_WHITE_NOISE: white (zero mean) Gaussian noise; volume sets the standard deviation of the noise in units of the range of values of the sample type, e.g. volume=0.1 produces noise with a standard deviation of 0.1*32767=3277 with 16-bit integer samples, or 0.1*1.0=0.1 with floating-point samples. |
|
53 * |
51 * |
54 * Different types of supported sound waves. |
52 * Different types of supported sound waves. |
55 */ |
53 */ |
56 typedef enum { |
54 typedef enum { |
57 GST_AUDIO_TEST_SRC_WAVE_SINE, |
55 GST_AUDIO_TEST_SRC_WAVE_SINE, |
59 GST_AUDIO_TEST_SRC_WAVE_SAW, |
57 GST_AUDIO_TEST_SRC_WAVE_SAW, |
60 GST_AUDIO_TEST_SRC_WAVE_TRIANGLE, |
58 GST_AUDIO_TEST_SRC_WAVE_TRIANGLE, |
61 GST_AUDIO_TEST_SRC_WAVE_SILENCE, |
59 GST_AUDIO_TEST_SRC_WAVE_SILENCE, |
62 GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE, |
60 GST_AUDIO_TEST_SRC_WAVE_WHITE_NOISE, |
63 GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE, |
61 GST_AUDIO_TEST_SRC_WAVE_PINK_NOISE, |
64 GST_AUDIO_TEST_SRC_WAVE_SINE_TAB, |
62 GST_AUDIO_TEST_SRC_WAVE_SINE_TAB |
65 GST_AUDIO_TEST_SRC_WAVE_TICKS, |
|
66 GST_AUDIO_TEST_SRC_WAVE_GAUSSIAN_WHITE_NOISE |
|
67 } GstAudioTestSrcWave; |
63 } GstAudioTestSrcWave; |
68 |
64 |
69 #define PINK_MAX_RANDOM_ROWS (30) |
65 #define PINK_MAX_RANDOM_ROWS (30) |
70 #define PINK_RANDOM_BITS (16) |
66 #define PINK_RANDOM_BITS (16) |
71 #define PINK_RANDOM_SHIFT ((sizeof(long)*8)-PINK_RANDOM_BITS) |
67 #define PINK_RANDOM_SHIFT ((sizeof(long)*8)-PINK_RANDOM_BITS) |
105 GstAudioTestSrcWave wave; |
101 GstAudioTestSrcWave wave; |
106 gdouble volume; |
102 gdouble volume; |
107 gdouble freq; |
103 gdouble freq; |
108 |
104 |
109 /* audio parameters */ |
105 /* audio parameters */ |
110 gint channels; |
|
111 gint samplerate; |
106 gint samplerate; |
112 gint samples_per_buffer; |
107 gint samples_per_buffer; |
113 gint sample_size; |
|
114 GstAudioTestSrcFormat format; |
108 GstAudioTestSrcFormat format; |
115 |
109 |
116 /*< private >*/ |
110 /*< private >*/ |
117 gboolean tags_pushed; /* send tags just once ? */ |
111 gboolean tags_pushed; /* send tags just once ? */ |
118 GstClockTimeDiff timestamp_offset; /* base offset */ |
112 GstClockTimeDiff timestamp_offset; /* base offset */ |
119 GstClockTime next_time; /* next timestamp */ |
113 GstClockTime running_time; /* total running time */ |
120 gint64 next_sample; /* next sample to send */ |
114 gint64 n_samples; /* total samples sent */ |
121 gint64 next_byte; /* next byte to send */ |
115 gint64 n_samples_stop; |
122 gint64 sample_stop; |
|
123 gboolean check_seek_stop; |
116 gboolean check_seek_stop; |
124 gboolean eos_reached; |
117 gboolean eos_reached; |
125 gint generate_samples_per_buffer; /* used to generate a partial buffer */ |
118 gint generate_samples_per_buffer; /* used to generate a partial buffer */ |
126 gboolean can_activate_pull; |
|
127 |
119 |
128 /* waveform specific context data */ |
120 /* waveform specific context data */ |
129 gdouble accumulator; /* phase angle */ |
121 gdouble accumulator; /* phase angle */ |
130 GstPinkNoise pink; |
122 GstPinkNoise pink; |
131 gdouble wave_table[1024]; |
123 gdouble wave_table[1024]; |