Unverified Commit 2836a23d authored by moto-meta's avatar moto-meta Committed by GitHub
Browse files

Move libtorchaudio_ffmpeg to dedicated directory

Differential Revision: D50082877

Pull Request resolved: https://github.com/pytorch/audio/pull/3646
parent a8bb3973
#include <torchaudio/csrc/ffmpeg/stream_reader/buffer/chunked_buffer.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/buffer/unchunked_buffer.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/conversion.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/post_process.h>
#include <libtorio/ffmpeg/stream_reader/buffer/chunked_buffer.h>
#include <libtorio/ffmpeg/stream_reader/buffer/unchunked_buffer.h>
#include <libtorio/ffmpeg/stream_reader/conversion.h>
#include <libtorio/ffmpeg/stream_reader/post_process.h>
namespace torchaudio::io {
namespace detail {
......@@ -116,11 +116,11 @@ struct ProcessImpl : public IPostDecodeProcess {
const std::string& get_filter_desc() const override {
return filter_wrapper.desc;
};
}
FilterGraphOutputInfo get_filter_output_info() const override {
return filter_wrapper.filter.get_output_info();
};
}
void flush() override {
filter_wrapper.reset();
......
#pragma once
#include <torchaudio/csrc/ffmpeg/filter_graph.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/typedefs.h>
#include <libtorio/ffmpeg/filter_graph.h>
#include <libtorio/ffmpeg/stream_reader/typedefs.h>
namespace torchaudio::io {
......
#include <torchaudio/csrc/ffmpeg/hw_context.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/stream_processor.h>
#include <libtorio/ffmpeg/hw_context.h>
#include <libtorio/ffmpeg/stream_reader/stream_processor.h>
#include <stdexcept>
#include <string_view>
......@@ -310,12 +310,15 @@ int StreamProcessor::process_packet(AVPacket* packet) {
ret = avcodec_receive_frame(codec_ctx, frame);
// AVERROR(EAGAIN) means that new input data is required to return new
// output.
if (ret == AVERROR(EAGAIN))
if (ret == AVERROR(EAGAIN)) {
return 0;
if (ret == AVERROR_EOF)
}
if (ret == AVERROR_EOF) {
return send_frame(nullptr);
if (ret < 0)
}
if (ret < 0) {
return ret;
}
// If pts is undefined then overwrite with best effort estimate.
// In this case, best_effort_timestamp is basically the number of frames
......@@ -375,8 +378,9 @@ int StreamProcessor::send_frame(AVFrame* frame_) {
int ret = 0;
for (auto& ite : post_processes) {
int ret2 = ite.second->process_frame(frame_);
if (ret2 < 0)
if (ret2 < 0) {
ret = ret2;
}
}
return ret;
}
......
#pragma once
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/stream_reader/post_process.h>
#include <libtorio/ffmpeg/stream_reader/typedefs.h>
#include <torch/types.h>
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/post_process.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/typedefs.h>
#include <map>
namespace torchaudio {
......
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/stream_reader.h>
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/stream_reader/stream_reader.h>
#include <chrono>
#include <sstream>
#include <stdexcept>
......
#pragma once
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/packet_buffer.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/stream_processor.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/typedefs.h>
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/stream_reader/packet_buffer.h>
#include <libtorio/ffmpeg/stream_reader/stream_processor.h>
#include <libtorio/ffmpeg/stream_reader/typedefs.h>
#include <vector>
namespace torchaudio {
......
#pragma once
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/ffmpeg.h>
#include <iostream>
namespace torchaudio {
......
#include <torchaudio/csrc/ffmpeg/hw_context.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/encode_process.h>
#include <libtorio/ffmpeg/hw_context.h>
#include <libtorio/ffmpeg/stream_writer/encode_process.h>
#include <cmath>
namespace torchaudio::io {
......
#pragma once
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/filter_graph.h>
#include <libtorio/ffmpeg/stream_writer/encoder.h>
#include <libtorio/ffmpeg/stream_writer/tensor_converter.h>
#include <libtorio/ffmpeg/stream_writer/types.h>
#include <torch/types.h>
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <torchaudio/csrc/ffmpeg/filter_graph.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/encoder.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/tensor_converter.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/types.h>
namespace torchaudio::io {
......
#include <torchaudio/csrc/ffmpeg/stream_writer/encoder.h>
#include <libtorio/ffmpeg/stream_writer/encoder.h>
namespace torchaudio::io {
......
#pragma once
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/filter_graph.h>
#include <torch/types.h>
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <torchaudio/csrc/ffmpeg/filter_graph.h>
namespace torchaudio::io {
......
#include <torchaudio/csrc/ffmpeg/stream_writer/packet_writer.h>
#include <libtorio/ffmpeg/stream_writer/packet_writer.h>
namespace torchaudio::io {
namespace {
......
#pragma once
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/ffmpeg.h>
namespace torchaudio::io {
class PacketWriter {
......
#include <torchaudio/csrc/ffmpeg/stream_writer/stream_writer.h>
#include <libtorio/ffmpeg/stream_writer/stream_writer.h>
#ifdef USE_CUDA
#include <c10/cuda/CUDAStream.h>
......
#pragma once
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/filter_graph.h>
#include <libtorio/ffmpeg/stream_writer/encode_process.h>
#include <libtorio/ffmpeg/stream_writer/packet_writer.h>
#include <libtorio/ffmpeg/stream_writer/types.h>
#include <torch/types.h>
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
#include <torchaudio/csrc/ffmpeg/filter_graph.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/encode_process.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/packet_writer.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/types.h>
namespace torchaudio {
namespace io {
......
#include <torchaudio/csrc/ffmpeg/stream_writer/tensor_converter.h>
#include <libtorio/ffmpeg/stream_writer/tensor_converter.h>
#ifdef USE_CUDA
#include <c10/cuda/CUDAStream.h>
......
#pragma once
#include <libtorio/ffmpeg/ffmpeg.h>
#include <torch/types.h>
#include <torchaudio/csrc/ffmpeg/ffmpeg.h>
namespace torchaudio::io {
......
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