New upstream version 21.1.2+dfsg1

This commit is contained in:
Sebastian Ramacher 2018-05-29 21:13:02 +02:00
parent baafb6325b
commit 665f64a933
152 changed files with 3957 additions and 356 deletions

View file

@ -3,10 +3,16 @@
#include <audioclient.h>
#ifndef KSAUDIO_SPEAKER_2POINT1
#define KSAUDIO_SPEAKER_2POINT1 (KSAUDIO_SPEAKER_STEREO|SPEAKER_LOW_FREQUENCY)
#endif
#define KSAUDIO_SPEAKER_SURROUND_AVUTIL \
(KSAUDIO_SPEAKER_STEREO|SPEAKER_FRONT_CENTER)
#ifndef KSAUDIO_SPEAKER_4POINT1
#define KSAUDIO_SPEAKER_4POINT1 (KSAUDIO_SPEAKER_SURROUND|SPEAKER_LOW_FREQUENCY)
#endif
#define safe_release(ptr) \
do { \

View file

@ -124,6 +124,28 @@ static inline const char *get_video_format_name(enum video_format format)
return "None";
}
static inline const char *get_video_colorspace_name(enum video_colorspace cs)
{
switch (cs) {
case VIDEO_CS_709: return "709";
case VIDEO_CS_601:
case VIDEO_CS_DEFAULT:;
}
return "601";
}
static inline const char *get_video_range_name(enum video_range_type range)
{
switch (range) {
case VIDEO_RANGE_FULL: return "Full";
case VIDEO_RANGE_PARTIAL:
case VIDEO_RANGE_DEFAULT:;
}
return "Partial";
}
enum video_scale_type {
VIDEO_SCALE_DEFAULT,
VIDEO_SCALE_POINT,

View file

@ -34,7 +34,7 @@
*
* Reset to zero each major version
*/
#define LIBOBS_API_MINOR_VER 0
#define LIBOBS_API_MINOR_VER 1
/*
* Increment if backward-compatible bug fix

View file

@ -2061,7 +2061,8 @@ static struct caption_text *caption_text_new(const char *text, size_t bytes,
struct caption_text *tail, struct caption_text **head)
{
struct caption_text *next = bzalloc(sizeof(struct caption_text));
snprintf(&next->text[0], CAPTION_LINE_BYTES + 1, "%.*s", bytes, text);
snprintf(&next->text[0], CAPTION_LINE_BYTES + 1, "%.*s",
(int)bytes, text);
if (!*head) {
*head = next;

View file

@ -738,7 +738,7 @@ enum obs_number_type obs_property_float_type(obs_property_t *p)
return data ? data->type : OBS_NUMBER_SCROLLER;
}
enum obs_text_type obs_proprety_text_type(obs_property_t *p)
enum obs_text_type obs_property_text_type(obs_property_t *p)
{
struct text_data *data = get_type_data(p, OBS_PROPERTY_TEXT);
return data ? data->type : OBS_TEXT_DEFAULT;
@ -1107,3 +1107,8 @@ struct media_frames_per_second obs_property_frame_rate_fps_range_max(
data->ranges.array[idx].max_time :
(struct media_frames_per_second){0};
}
enum obs_text_type obs_proprety_text_type(obs_property_t *p)
{
return obs_property_text_type(p);
}

View file

@ -263,7 +263,7 @@ EXPORT double obs_property_float_min(obs_property_t *p);
EXPORT double obs_property_float_max(obs_property_t *p);
EXPORT double obs_property_float_step(obs_property_t *p);
EXPORT enum obs_number_type obs_property_float_type(obs_property_t *p);
EXPORT enum obs_text_type obs_proprety_text_type(obs_property_t *p);
EXPORT enum obs_text_type obs_property_text_type(obs_property_t *p);
EXPORT enum obs_path_type obs_property_path_type(obs_property_t *p);
EXPORT const char * obs_property_path_filter(obs_property_t *p);
EXPORT const char * obs_property_path_default_path(obs_property_t *p);
@ -336,6 +336,11 @@ EXPORT struct media_frames_per_second obs_property_frame_rate_fps_range_min(
EXPORT struct media_frames_per_second obs_property_frame_rate_fps_range_max(
obs_property_t *p, size_t idx);
#ifndef SWIG
DEPRECATED
EXPORT enum obs_text_type obs_proprety_text_type(obs_property_t *p);
#endif
#ifdef __cplusplus
}
#endif

View file

@ -974,18 +974,26 @@ int obs_reset_video(struct obs_video_info *ovi)
break;
}
bool yuv = format_is_yuv(ovi->output_format);
const char *yuv_format = get_video_colorspace_name(ovi->colorspace);
const char *yuv_range = get_video_range_name(ovi->range);
blog(LOG_INFO, "---------------------------------");
blog(LOG_INFO, "video settings reset:\n"
"\tbase resolution: %dx%d\n"
"\toutput resolution: %dx%d\n"
"\tdownscale filter: %s\n"
"\tfps: %d/%d\n"
"\tformat: %s",
"\tformat: %s\n"
"\tYUV mode: %s%s%s",
ovi->base_width, ovi->base_height,
ovi->output_width, ovi->output_height,
scale_type_name,
ovi->fps_num, ovi->fps_den,
get_video_format_name(ovi->output_format));
get_video_format_name(ovi->output_format),
yuv ? yuv_format : "None",
yuv ? "/" : "",
yuv ? yuv_range : "");
return obs_init_video(ovi);
}

View file

@ -145,15 +145,16 @@ struct obs_transform_info {
struct vec2 bounds;
};
#ifndef SWIG
/**
* Video initialization structure
*/
struct obs_video_info {
#ifndef SWIG
/**
* Graphics module to use (usually "libobs-opengl" or "libobs-d3d11")
*/
const char *graphics_module;
#endif
uint32_t fps_num; /**< Output FPS numerator */
uint32_t fps_den; /**< Output FPS denominator */
@ -176,7 +177,6 @@ struct obs_video_info {
enum obs_scale_type scale_type; /**< How to scale if scaling */
};
#endif
/**
* Audio initialization structure
@ -283,7 +283,6 @@ EXPORT const char *obs_get_locale(void);
*/
EXPORT profiler_name_store_t *obs_get_profiler_name_store(void);
#ifndef SWIG
/**
* Sets base video output base resolution/fps/format.
*
@ -301,7 +300,6 @@ EXPORT profiler_name_store_t *obs_get_profiler_name_store(void);
* OBS_VIDEO_FAIL for generic failure
*/
EXPORT int obs_reset_video(struct obs_video_info *ovi);
#endif
/**
* Sets base audio output format/channels/samples/etc
@ -310,10 +308,8 @@ EXPORT int obs_reset_video(struct obs_video_info *ovi);
*/
EXPORT bool obs_reset_audio(const struct obs_audio_info *oai);
#ifndef SWIG
/** Gets the current video settings, returns false if no video */
EXPORT bool obs_get_video_info(struct obs_video_info *ovi);
#endif
/** Gets the current audio settings, returns false if no audio */
EXPORT bool obs_get_audio_info(struct obs_audio_info *oai);

View file

@ -212,8 +212,15 @@ static void config_parse_section(struct config_section *section,
strref_clear(&value);
config_parse_string(lex, &value, 0);
if (!strref_is_empty(&value))
if (strref_is_empty(&value)) {
struct config_item item;
item.name = bstrdup_n(name.array, name.len);
item.value = bzalloc(1);
darray_push_back(sizeof(struct config_item),
&section->items, &item);
} else {
config_add_item(&section->items, &name, &value);
}
}
}

View file

@ -37,8 +37,11 @@ static uint32_t winver = 0;
static inline uint64_t get_clockfreq(void)
{
if (!have_clockfreq)
if (!have_clockfreq) {
QueryPerformanceFrequency(&clock_freq);
have_clockfreq = true;
}
return clock_freq.QuadPart;
}