New upstream version 26.0.2+dfsg1
This commit is contained in:
parent
bc27b6c1ca
commit
040dcc3fc2
23 changed files with 226 additions and 184 deletions
|
|
@ -361,49 +361,60 @@ static HMODULE audio_toolbox = NULL;
|
|||
|
||||
static void release_lib(void)
|
||||
{
|
||||
#define RELEASE_LIB(x) \
|
||||
if (x) { \
|
||||
FreeLibrary(x); \
|
||||
x = NULL; \
|
||||
if (audio_toolbox) {
|
||||
FreeLibrary(audio_toolbox);
|
||||
audio_toolbox = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static bool load_from_shell_path(REFKNOWNFOLDERID rfid, const wchar_t *subpath)
|
||||
{
|
||||
wchar_t *sh_path;
|
||||
if (SHGetKnownFolderPath(rfid, 0, NULL, &sh_path) != S_OK) {
|
||||
CA_LOG(LOG_WARNING, "Could not retrieve shell path");
|
||||
return false;
|
||||
}
|
||||
|
||||
RELEASE_LIB(audio_toolbox);
|
||||
#undef RELEASE_LIB
|
||||
wchar_t path[MAX_PATH];
|
||||
_snwprintf(path, MAX_PATH, L"%s\\%s", sh_path, subpath);
|
||||
CoTaskMemFree(sh_path);
|
||||
|
||||
SetDllDirectory(path);
|
||||
audio_toolbox = LoadLibraryW(L"CoreAudioToolbox.dll");
|
||||
SetDllDirectory(nullptr);
|
||||
|
||||
return !!audio_toolbox;
|
||||
}
|
||||
|
||||
static bool load_lib(void)
|
||||
{
|
||||
PWSTR common_path;
|
||||
if (SHGetKnownFolderPath(FOLDERID_ProgramFilesCommon, 0, NULL,
|
||||
&common_path) != S_OK) {
|
||||
CA_LOG(LOG_WARNING, "Could not retrieve common files path");
|
||||
return false;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
/* attempt to load from path */
|
||||
|
||||
struct dstr path = {0};
|
||||
dstr_printf(&path, "%S\\Apple\\Apple Application Support", common_path);
|
||||
CoTaskMemFree(common_path);
|
||||
|
||||
wchar_t *w_path = dstr_to_wcs(&path);
|
||||
dstr_free(&path);
|
||||
|
||||
SetDllDirectory(w_path);
|
||||
bfree(w_path);
|
||||
|
||||
#define LOAD_LIB(x, n) \
|
||||
x = LoadLibrary(TEXT(n)); \
|
||||
if (!x) \
|
||||
CA_LOG(LOG_DEBUG, "Failed loading library '" n "'");
|
||||
|
||||
LOAD_LIB(audio_toolbox, "CoreAudioToolbox.dll");
|
||||
#undef LOAD_LIB
|
||||
|
||||
SetDllDirectory(NULL);
|
||||
|
||||
if (audio_toolbox)
|
||||
audio_toolbox = LoadLibraryW(L"CoreAudioToolbox.dll");
|
||||
if (!!audio_toolbox)
|
||||
return true;
|
||||
|
||||
release_lib();
|
||||
/* -------------------------------------------- */
|
||||
/* attempt to load from known install locations */
|
||||
|
||||
struct path_list_t {
|
||||
REFKNOWNFOLDERID rfid;
|
||||
const wchar_t *subpath;
|
||||
};
|
||||
|
||||
path_list_t path_list[] = {
|
||||
{FOLDERID_ProgramFilesCommon,
|
||||
L"Apple\\Apple Application Support"},
|
||||
{FOLDERID_ProgramFiles, L"iTunes"},
|
||||
};
|
||||
|
||||
for (auto &val : path_list) {
|
||||
if (load_from_shell_path(val.rfid, val.subpath)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ typedef struct cocoa_window *cocoa_window_t;
|
|||
|
||||
NSArray *enumerate_cocoa_windows(void);
|
||||
|
||||
NSArray *filter_nonzero_kcgwindowlayer_sources(NSArray *windows_arr);
|
||||
|
||||
bool find_window(cocoa_window_t cw, obs_data_t *settings, bool force);
|
||||
|
||||
void init_window(cocoa_window_t cw, obs_data_t *settings);
|
||||
|
|
|
|||
|
|
@ -23,25 +23,14 @@ static NSComparator win_info_cmp = ^(NSDictionary *o1, NSDictionary *o2) {
|
|||
return [o1[WINDOW_NUMBER] compare:o2[WINDOW_NUMBER]];
|
||||
};
|
||||
|
||||
NSArray *filter_nonzero_kcgwindowlayer_sources(NSArray *windows_arr)
|
||||
{
|
||||
NSPredicate *pred =
|
||||
[NSPredicate predicateWithFormat:@"(kCGWindowLayer == 0)"];
|
||||
NSArray *new_windows_arr =
|
||||
[windows_arr filteredArrayUsingPredicate:pred];
|
||||
|
||||
return new_windows_arr;
|
||||
}
|
||||
|
||||
NSArray *enumerate_windows(void)
|
||||
{
|
||||
NSArray *arr = (NSArray *)CGWindowListCopyWindowInfo(
|
||||
kCGWindowListOptionOnScreenOnly, kCGNullWindowID);
|
||||
NSArray *filtered_arr = filter_nonzero_kcgwindowlayer_sources(arr);
|
||||
|
||||
[arr autorelease];
|
||||
|
||||
return [filtered_arr sortedArrayUsingComparator:win_info_cmp];
|
||||
return [arr sortedArrayUsingComparator:win_info_cmp];
|
||||
}
|
||||
|
||||
#define WAIT_TIME_MS 500
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ static bool new_stream(struct ffmpeg_mux *ffm, AVStream **stream,
|
|||
|
||||
*codec = avcodec_find_encoder(desc->id);
|
||||
if (!*codec) {
|
||||
fprintf(stderr, "Couldn't create encoder");
|
||||
fprintf(stderr, "Couldn't create encoder\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -520,7 +520,7 @@ static inline int open_output_file(struct ffmpeg_mux *ffm)
|
|||
ret = avio_open(&ffm->output->pb, ffm->params.file,
|
||||
AVIO_FLAG_WRITE);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Couldn't open '%s', %s",
|
||||
fprintf(stderr, "Couldn't open '%s', %s\n",
|
||||
ffm->params.file, av_err2str(ret));
|
||||
return FFM_ERROR;
|
||||
}
|
||||
|
|
@ -529,7 +529,7 @@ static inline int open_output_file(struct ffmpeg_mux *ffm)
|
|||
AVDictionary *dict = NULL;
|
||||
if ((ret = av_dict_parse_string(&dict, ffm->params.muxer_settings, "=",
|
||||
" ", 0))) {
|
||||
fprintf(stderr, "Failed to parse muxer settings: %s\n%s",
|
||||
fprintf(stderr, "Failed to parse muxer settings: %s\n%s\n",
|
||||
av_err2str(ret), ffm->params.muxer_settings);
|
||||
|
||||
av_dict_free(&dict);
|
||||
|
|
@ -548,7 +548,7 @@ static inline int open_output_file(struct ffmpeg_mux *ffm)
|
|||
|
||||
ret = avformat_write_header(ffm->output, &dict);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Error opening '%s': %s", ffm->params.file,
|
||||
fprintf(stderr, "Error opening '%s': %s\n", ffm->params.file,
|
||||
av_err2str(ret));
|
||||
|
||||
av_dict_free(&dict);
|
||||
|
|
@ -723,7 +723,14 @@ static inline bool ffmpeg_mux_packet(struct ffmpeg_mux *ffm, uint8_t *buf,
|
|||
if (info->keyframe)
|
||||
packet.flags = AV_PKT_FLAG_KEY;
|
||||
|
||||
return av_interleaved_write_frame(ffm->output, &packet) >= 0;
|
||||
int ret = av_interleaved_write_frame(ffm->output, &packet);
|
||||
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "av_interleaved_write_frame failed: %s\n",
|
||||
av_err2str(ret));
|
||||
}
|
||||
|
||||
return ret >= 0;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
|
@ -772,7 +779,7 @@ int main(int argc, char *argv[])
|
|||
resize_buf_resize(&rb, info.size);
|
||||
|
||||
if (safe_read(rb.buf, info.size) == info.size) {
|
||||
ffmpeg_mux_packet(&ffm, rb.buf, &info);
|
||||
fail = !ffmpeg_mux_packet(&ffm, rb.buf, &info);
|
||||
} else {
|
||||
fail = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -440,7 +440,11 @@ static void signal_failure(struct ffmpeg_muxer *stream)
|
|||
code = OBS_OUTPUT_UNSUPPORTED;
|
||||
break;
|
||||
default:
|
||||
code = OBS_OUTPUT_ERROR;
|
||||
if (stream->is_network) {
|
||||
code = OBS_OUTPUT_DISCONNECTED;
|
||||
} else {
|
||||
code = OBS_OUTPUT_ENCODE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
obs_output_signal_stop(stream->output, code);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"url": "https://obsproject.com/obs2_update/rtmp-services",
|
||||
"version": 147,
|
||||
"version": 148,
|
||||
"files": [
|
||||
{
|
||||
"name": "services.json",
|
||||
"version": 147
|
||||
"version": 148
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -759,6 +759,10 @@
|
|||
"name": "North America : US West",
|
||||
"url": "rtmp://rtmp-wsu.afreecatv.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Europe : UK",
|
||||
"url": "rtmp://rtmp-uk.afreecatv.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Asia : Singapore",
|
||||
"url": "rtmp://rtmp-sgp.afreecatv.com/app"
|
||||
|
|
@ -1726,32 +1730,6 @@
|
|||
"max audio bitrate": 160
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "weabook.live",
|
||||
"servers": [
|
||||
{
|
||||
"name": "N.Virgina, US",
|
||||
"url": "rtmp://us-api.weabook.live/live"
|
||||
},
|
||||
{
|
||||
"name": "Singapore, SG",
|
||||
"url": "rtmp://sg-api.weabook.live/live"
|
||||
},
|
||||
{
|
||||
"name": "Tokyo, JP",
|
||||
"url": "rtmp://jp-api.weabook.live/live"
|
||||
},
|
||||
{
|
||||
"name": "Premium Streaming",
|
||||
"url": "rtmp://premium.rtmp.weabook.live/live"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
"keyint": 2,
|
||||
"max audio bitrate": 256,
|
||||
"max video bitrate": 20480
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Taryana - Apachat | تاریانا - آپاچت",
|
||||
"servers": [
|
||||
|
|
|
|||
|
|
@ -515,8 +515,10 @@ static void apply_video_encoder_settings(obs_data_t *settings,
|
|||
}
|
||||
|
||||
item = json_object_get(recommended, "bframes");
|
||||
if (json_is_integer(item))
|
||||
obs_data_set_int(settings, "bf", 0);
|
||||
if (json_is_integer(item)) {
|
||||
int bframes = json_integer_value(item);
|
||||
obs_data_set_int(settings, "bf", bframes);
|
||||
}
|
||||
|
||||
item = json_object_get(recommended, "x264opts");
|
||||
if (json_is_string(item)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue