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