Fix FFmpeg decode frame copy and publish encoder config
This commit is contained in:
parent
bb5ebcfab4
commit
982ab2ff97
@ -642,6 +642,8 @@ public:
|
||||
fps_ = config.ValueOr<int>("fps", 25);
|
||||
gop_ = config.ValueOr<int>("gop", 50);
|
||||
bitrate_kbps_ = config.ValueOr<int>("bitrate_kbps", 4000);
|
||||
mpp_output_timeout_ms_ = config.ValueOr<int>("mpp_output_timeout_ms", mpp_output_timeout_ms_);
|
||||
mpp_packet_wait_ms_ = config.ValueOr<int>("mpp_packet_wait_ms", mpp_packet_wait_ms_);
|
||||
platform_ = config.ValueOr<std::string>("platform", "");
|
||||
hw_platform_ = config.ValueOr<std::string>("hw_platform", "");
|
||||
use_mpp_ = config.ValueOr<bool>("use_mpp", true);
|
||||
@ -746,6 +748,8 @@ public:
|
||||
int new_fps = new_config.ValueOr<int>("fps", fps_);
|
||||
int new_gop = new_config.ValueOr<int>("gop", gop_);
|
||||
int new_bitrate = new_config.ValueOr<int>("bitrate_kbps", bitrate_kbps_);
|
||||
int new_output_timeout = new_config.ValueOr<int>("mpp_output_timeout_ms", mpp_output_timeout_ms_);
|
||||
int new_packet_wait = new_config.ValueOr<int>("mpp_packet_wait_ms", mpp_packet_wait_ms_);
|
||||
|
||||
if (new_codec != codec_) return false;
|
||||
|
||||
@ -754,6 +758,8 @@ public:
|
||||
fps_ = new_fps;
|
||||
gop_ = new_gop;
|
||||
bitrate_kbps_ = new_bitrate;
|
||||
mpp_output_timeout_ms_ = new_output_timeout;
|
||||
mpp_packet_wait_ms_ = new_packet_wait;
|
||||
use_mpp_ = new_use_mpp;
|
||||
use_ffmpeg_mux_ = new_use_ffmpeg_mux;
|
||||
|
||||
@ -1252,6 +1258,8 @@ private:
|
||||
enc_obj["fps"] = SimpleJson(static_cast<double>(fps_));
|
||||
enc_obj["gop"] = SimpleJson(static_cast<double>(gop_));
|
||||
enc_obj["bitrate_kbps"] = SimpleJson(static_cast<double>(bitrate_kbps_));
|
||||
enc_obj["mpp_output_timeout_ms"] = SimpleJson(static_cast<double>(mpp_output_timeout_ms_));
|
||||
enc_obj["mpp_packet_wait_ms"] = SimpleJson(static_cast<double>(mpp_packet_wait_ms_));
|
||||
enc_obj["width"] = SimpleJson(static_cast<double>(frame->width));
|
||||
enc_obj["height"] = SimpleJson(static_cast<double>(frame->height));
|
||||
enc_obj["pixel_format"] = SimpleJson(PixelFormatToString(frame->format));
|
||||
@ -1363,6 +1371,8 @@ private:
|
||||
int fps_ = 25;
|
||||
int gop_ = 50;
|
||||
int bitrate_kbps_ = 4000;
|
||||
int mpp_output_timeout_ms_ = 50;
|
||||
int mpp_packet_wait_ms_ = 10;
|
||||
std::string platform_;
|
||||
std::string hw_platform_;
|
||||
bool use_mpp_ = false;
|
||||
|
||||
@ -595,7 +595,7 @@ private:
|
||||
}
|
||||
|
||||
uint8_t* dst_uv = dst + hor_stride_ * ver_stride_;
|
||||
int uv_rows = ver_stride_ / 2;
|
||||
const int uv_rows = std::max(0, height_ / 2);
|
||||
if (mpp_fmt_ == MPP_FMT_YUV420SP) {
|
||||
for (int row = 0; row < uv_rows; ++row) {
|
||||
std::memcpy(dst_uv + row * hor_stride_, uv.data + row * uv.stride,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user