0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
obs-studio/test/test-input/test-sinewave.h
jp9000 f827ba38ef Added a sinewave audio test source
- Added a test audio sinewave test source that should just play a sine
   wave of the middle C note.  Using unsigned 8 bit mono to test
   ffmpeg's audio resampler, seems to work pretty good.

 - Fixed a boolean trap in threading.h for the event_init function, it
   now uses enum event_type, which can be EVENT_TYPE_MANUAL or
   EVENT_TYPE_AUTO, to specify whether the event is automatically reset
   or not.

 - Changed display names of test sources to something a little less
   vague.

 - Removed te whole "if timestamp is 0 just use current system time"
   when outputting source audio, if you want to use system time you
   should just use system time yourself.  Using 0 as some sort of
   "indicator" like that just makes things confusing, and prevents you
   from legitimately using 0 as a timestamp for your audio data.
2014-01-09 22:10:04 -07:00

29 lines
581 B
C

#pragma once
#include <util/bmem.h>
#include <util/threading.h>
#include <util/platform.h>
#include <obs.h>
#ifdef __cplusplus
extern "C" {
#endif
struct sinewave_data {
bool initialized_thread;
pthread_t thread;
event_t event;
obs_source_t source;
};
EXPORT const char *sinewave_getname(const char *locale);
EXPORT struct sinewave_data *sinewave_create(const char *settings,
obs_source_t source);
EXPORT void sinewave_destroy(struct sinewave_data *swd);
EXPORT uint32_t sinewave_get_output_flags(struct sinewave_data *swd);
#ifdef __cplusplus
}
#endif