Commit 155d1bae authored by Moto Hira's avatar Moto Hira Committed by Facebook GitHub Bot
Browse files

Revert D47402174: [audio][PR] Resolve some compilation warnings

Differential Revision:
D47402174

Original commit changeset: 00c0719ab184

Original Phabricator Diff: D47402174

fbshipit-source-id: b1f6ea4cc3ecef3f72a87bf2f67bf9644c847546
parent a6d1fec0
......@@ -186,8 +186,7 @@ FilterGraphOutputInfo FilterGraph::get_output_info() const {
switch (l->type) {
case AVMEDIA_TYPE_AUDIO: {
ret.sample_rate = l->sample_rate;
#if LIBAVFILTER_VERSION_MAJOR >= 9 || \
(LIBAVFILTER_VERSION_MAJOR == 8 && LIBAVFILTER_VERSION_MINOR >= 44)
#if LIBAVFILTER_VERSION_MAJOR >= 8 && LIBAVFILTER_VERSION_MINOR >= 44
ret.num_channels = l->ch_layout.nb_channels;
#else
// Before FFmpeg 5.1
......
......@@ -98,7 +98,6 @@ torch::Tensor get_image_buffer(
shape, torch::TensorOptions().dtype(dtype).layout(torch::kStrided));
}
#ifdef USE_CUDA
torch::Tensor get_image_buffer(
at::IntArrayRef shape,
torch::Device device,
......@@ -110,7 +109,6 @@ torch::Tensor get_image_buffer(
.layout(torch::kStrided)
.device(device));
}
#endif
} // namespace
......
......@@ -27,7 +27,6 @@ AVCodecContextPtr alloc_codec_context(
return AVCodecContextPtr(codec_ctx);
}
#ifdef USE_CUDA
const AVCodecHWConfig* get_cuda_config(const AVCodec* codec) {
for (int i = 0;; ++i) {
const AVCodecHWConfig* config = avcodec_get_hw_config(codec, i);
......@@ -81,7 +80,6 @@ enum AVPixelFormat get_hw_format(
TORCH_WARN("Failed to get HW surface format.");
return AV_PIX_FMT_NONE;
}
#endif
AVBufferRef* get_hw_frames_ctx(AVCodecContext* codec_ctx) {
AVBufferRef* p = av_hwframe_ctx_alloc(codec_ctx->hw_device_ctx);
......@@ -140,12 +138,10 @@ void open_codec(
av_dict_set(&opts, "threads", "1", 0);
}
#if LIBAVUTIL_VERSION_MAJOR < 58
if (!codec_ctx->channel_layout) {
codec_ctx->channel_layout =
av_get_default_channel_layout(codec_ctx->channels);
}
#endif
int ret = avcodec_open2(codec_ctx, codec_ctx->codec, &opts);
clean_up_dict(opts);
......@@ -336,12 +332,7 @@ int StreamProcessor::process_packet(AVPacket* packet) {
// This is because they might be intra-frames not in chronological
// order. In this case, we use received frames as-is in the order they
// are received.
#if LIBAVCODEC_VERSION_MAJOR >= 60
frame->pts = codec_ctx->frame_num + 1;
#else
frame->pts = codec_ctx->frame_number + 1;
#endif
} else {
frame->pts = frame->best_effort_timestamp;
}
......
......@@ -527,7 +527,6 @@ void configure_video_codec_ctx(
}
}
#ifdef USE_CUDA
void configure_hw_accel(AVCodecContext* ctx, const std::string& hw_accel) {
torch::Device device{hw_accel};
TORCH_CHECK(
......@@ -571,7 +570,6 @@ void configure_hw_accel(AVCodecContext* ctx, const std::string& hw_accel) {
"Failed to initialize CUDA frame context: ",
av_err2string(ret));
}
#endif
////////////////////////////////////////////////////////////////////////////////
// AVStream
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment