New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
|
|
@ -9,10 +9,7 @@ class resampler_obj {
|
|||
audio_resampler_t *resampler = nullptr;
|
||||
|
||||
public:
|
||||
inline ~resampler_obj()
|
||||
{
|
||||
audio_resampler_destroy(resampler);
|
||||
}
|
||||
inline ~resampler_obj() { audio_resampler_destroy(resampler); }
|
||||
|
||||
inline bool reset(const resample_info &dst, const resample_info &src)
|
||||
{
|
||||
|
|
@ -21,15 +18,15 @@ public:
|
|||
return !!resampler;
|
||||
}
|
||||
|
||||
inline operator audio_resampler_t*() {return resampler;}
|
||||
inline operator audio_resampler_t *() { return resampler; }
|
||||
};
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
typedef std::function<void (const std::string &)> captions_cb;
|
||||
typedef std::function<void(const std::string &)> captions_cb;
|
||||
|
||||
#define captions_error(s) std::string(obs_module_text("Captions.Error." ## s))
|
||||
#define CAPTIONS_ERROR_GENERIC_FAIL captions_error("GenericFail")
|
||||
#define captions_error(s) std::string(obs_module_text("Captions.Error."##s))
|
||||
#define CAPTIONS_ERROR_GENERIC_FAIL captions_error("GenericFail")
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
|
|
@ -38,22 +35,17 @@ class captions_handler {
|
|||
resampler_obj resampler;
|
||||
|
||||
protected:
|
||||
inline void callback(const std::string &text)
|
||||
{
|
||||
cb(text);
|
||||
}
|
||||
inline void callback(const std::string &text) { cb(text); }
|
||||
|
||||
virtual void pcm_data(const void *data, size_t frames)=0;
|
||||
virtual void pcm_data(const void *data, size_t frames) = 0;
|
||||
|
||||
/* always resamples to 1 channel */
|
||||
bool reset_resampler(enum audio_format format, uint32_t sample_rate);
|
||||
|
||||
public:
|
||||
/* throw std::string for errors shown to users */
|
||||
captions_handler(
|
||||
captions_cb callback,
|
||||
enum audio_format format,
|
||||
uint32_t sample_rate);
|
||||
captions_handler(captions_cb callback, enum audio_format format,
|
||||
uint32_t sample_rate);
|
||||
virtual ~captions_handler() {}
|
||||
|
||||
void push_audio(const audio_data *audio);
|
||||
|
|
@ -62,6 +54,6 @@ public:
|
|||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
struct captions_handler_info {
|
||||
std::string (*name)(void);
|
||||
std::string (*name)(void);
|
||||
captions_handler *(*create)(captions_cb cb, const std::string &lang);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue