obs-ffmpeg: Implement priority for HEVC over HLS

master
jpark37 2022-07-31 17:10:06 -07:00
parent 5361d936ce
commit 2a1b047d33
2 changed files with 18 additions and 4 deletions

View File

@ -1,4 +1,8 @@
#include "obs-ffmpeg-mux.h"
#include <obs-avc.h>
#ifdef ENABLE_HEVC
#include <obs-hevc.h>
#endif
#define do_log(level, format, ...) \
blog(level, "[ffmpeg hls muxer: '%s'] " format, \
@ -292,9 +296,20 @@ void ffmpeg_hls_mux_data(void *data, struct encoder_packet *packet)
}
if (packet->type == OBS_ENCODER_VIDEO) {
obs_parse_avc_packet(&tmp_packet, packet);
packet->drop_priority = tmp_packet.priority;
obs_encoder_packet_release(&tmp_packet);
const char *const codec =
obs_encoder_get_codec(packet->encoder);
if (strcmp(codec, "h264") == 0) {
obs_parse_avc_packet(&tmp_packet, packet);
packet->drop_priority = tmp_packet.priority;
obs_encoder_packet_release(&tmp_packet);
}
#ifdef ENABLE_HEVC
else if (strcmp(codec, "hevc") == 0) {
obs_parse_hevc_packet(&tmp_packet, packet);
packet->drop_priority = tmp_packet.priority;
obs_encoder_packet_release(&tmp_packet);
}
#endif
}
obs_encoder_packet_ref(&new_packet, packet);

View File

@ -1,6 +1,5 @@
#pragma once
#include <obs-avc.h>
#include <obs-module.h>
#include <obs-hotkey.h>
#include <util/circlebuf.h>