试图解决编译错误
This commit is contained in:
@@ -66,7 +66,7 @@ QVector<QString> ConformManager::GetConformedFilename(const QString &cache_path,
|
||||
QString::number(stream.stream()),
|
||||
QString::number(params.sample_rate()),
|
||||
QString::number(params.format()),
|
||||
QString::number(params.channel_layout()),
|
||||
QString::number(params.channel_layout().u.mask),
|
||||
QString::number(i));
|
||||
|
||||
filenames[i] = QDir(cache_path).filePath(index_fn);
|
||||
|
||||
@@ -256,7 +256,9 @@ void EncodingParams::Save(QXmlStreamWriter *writer) const
|
||||
if (audio_enabled_) {
|
||||
writer->writeTextElement(QStringLiteral("codec"), QString::number(audio_codec_));
|
||||
writer->writeTextElement(QStringLiteral("samplerate"), QString::number(audio_params_.sample_rate()));
|
||||
writer->writeTextElement(QStringLiteral("channellayout"), QString::number());
|
||||
|
||||
writer->writeTextElement(QStringLiteral("channellayout"),
|
||||
QString::number(audio_params().channel_layout().u.mask));
|
||||
writer->writeTextElement(QStringLiteral("format"), QString::fromStdString(audio_params_.format().to_string()));
|
||||
writer->writeTextElement(QStringLiteral("bitrate"), QString::number(audio_bit_rate_));
|
||||
}
|
||||
@@ -469,7 +471,10 @@ bool EncodingParams::LoadV1(QXmlStreamReader *reader)
|
||||
} else if (reader->name() == QStringLiteral("samplerate")) {
|
||||
audio_params_.set_sample_rate(reader->readElementText().toInt());
|
||||
} else if (reader->name() == QStringLiteral("channellayout")) {
|
||||
audio_params_.set_channel_layout(reader->readElementText().toULongLong());
|
||||
AVChannelLayout av_channel_layout;
|
||||
av_channel_layout_from_mask(&av_channel_layout, reader->readElementText().toLongLong());
|
||||
audio_params_.set_channel_layout(av_channel_layout);
|
||||
av_channel_layout_uninit(&av_channel_layout);
|
||||
} else if (reader->name() == QStringLiteral("format")) {
|
||||
audio_params_.set_format(SampleFormat::from_string(reader->readElementText().toStdString()));
|
||||
} else if (reader->name() == QStringLiteral("bitrate")) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@
|
||||
#include "render/colortransform.h"
|
||||
#include "render/subtitleparams.h"
|
||||
#include "render/videoparams.h"
|
||||
//这个代码也许是创建工程文件用的?还是导出编码视频用的?
|
||||
//这个代码也许是导出编码视频用的?
|
||||
namespace olive {
|
||||
|
||||
class Encoder;
|
||||
|
||||
@@ -439,8 +439,8 @@ FootageDescription FFmpegDecoder::Probe(const QString &filename, CancelAtom *can
|
||||
} else if (avstream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
|
||||
// Create an audio stream object
|
||||
AVChannelLayout channel_layout = avstream->codecpar->ch_layout;
|
||||
if (!channel_layout.nb_channels==0) {
|
||||
AVChannelLayout &channel_layout = avstream->codecpar->ch_layout;
|
||||
if (!av_channel_layout_check(&channel_layout)) {
|
||||
av_channel_layout_default(&channel_layout,avstream->codecpar->ch_layout.nb_channels);
|
||||
}
|
||||
|
||||
@@ -557,10 +557,10 @@ bool FFmpegDecoder::ConformAudioInternal(const QVector<QString> &filenames, cons
|
||||
return false;
|
||||
}
|
||||
// Create resampling context
|
||||
AVChannelLayout layout=params.channel_layout();
|
||||
std::shared_ptr<AVChannelLayout> layout=params.channel_layout();
|
||||
SwrContext* resampler;
|
||||
swr_alloc_set_opts2(&resampler,
|
||||
&layout,
|
||||
layout.get(),
|
||||
FFmpegUtils::GetFFmpegSampleFormat(params.format()),
|
||||
params.sample_rate(),
|
||||
&channel_layout,
|
||||
|
||||
@@ -334,7 +334,7 @@ bool FFmpegEncoder::WriteAudioData(const AudioParams &audio_params, const uint8_
|
||||
int output_sample_count = input_sample_count ? swr_get_out_samples(audio_resample_ctx_, input_sample_count) : 102400;
|
||||
uint8_t** output_data = nullptr;
|
||||
int output_linesize;
|
||||
av_samples_alloc_array_and_samples(&output_data, &output_linesize, audio_stream_->codecpar->channels,
|
||||
av_samples_alloc_array_and_samples(&output_data, &output_linesize, audio_stream_->codecpar->ch_layout.nb_channels,
|
||||
output_sample_count, static_cast<AVSampleFormat>(audio_stream_->codecpar->format), 0);
|
||||
|
||||
// Perform conversion
|
||||
|
||||
@@ -134,10 +134,10 @@ TexturePtr OIIODecoder::RetrieveVideoInternal(const RetrieveVideoParams &p)
|
||||
|
||||
if (p.divider == 1) {
|
||||
// Just upload straight to the buffer
|
||||
image_->read_image(oiio_pix_fmt_, buffer_.data(), OIIO::AutoStride, buffer_.linesize_bytes());
|
||||
image_->read_image(0, 0, 0, -1, oiio_pix_fmt_, buffer_.data());
|
||||
} else {
|
||||
OIIO::ImageBuf buf(image_->spec());
|
||||
image_->read_image(image_->spec().format, buf.localpixels(), buf.pixel_stride(), buf.scanline_stride(), buf.z_stride());
|
||||
image_->read_image(0,0,0,-1,image_->spec().format, buf.localpixels(), buf.pixel_stride(), buf.scanline_stride(), buf.z_stride());
|
||||
|
||||
// Roughly downsample image for divider (for some reason OIIO::ImageBufAlgo::resample failed here)
|
||||
int px_sz = vp.GetBytesPerPixel();
|
||||
|
||||
Reference in New Issue
Block a user