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
...@@ -177,7 +177,7 @@ if (USE_FFMPEG) ...@@ -177,7 +177,7 @@ if (USE_FFMPEG)
message(STATUS "Building FFmpeg integration with multi version support") message(STATUS "Building FFmpeg integration with multi version support")
add_subdirectory(third_party/ffmpeg/multi) add_subdirectory(third_party/ffmpeg/multi)
endif() endif()
add_subdirectory(src/torchaudio/csrc/ffmpeg) add_subdirectory(src/libtorio/ffmpeg)
endif() endif()
if (BUILD_CUDA_CTC_DECODER) if (BUILD_CUDA_CTC_DECODER)
if (NOT USE_CUDA) if (NOT USE_CUDA)
......
...@@ -908,9 +908,9 @@ WARN_LOGFILE = ...@@ -908,9 +908,9 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched. # Note: If this tag is empty the current directory is searched.
INPUT = ../torchaudio/csrc/ffmpeg/stream_reader/typedefs.h \ INPUT = ../src/libtorio/ffmpeg/stream_reader/typedefs.h \
../torchaudio/csrc/ffmpeg/stream_reader/stream_reader.h \ ../src/libtorio/ffmpeg/stream_reader/stream_reader.h \
../torchaudio/csrc/ffmpeg/stream_writer/stream_writer.h ../src/libtorio/ffmpeg/stream_writer/stream_writer.h
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
......
#include <libtorio/ffmpeg/stream_reader/stream_reader.h>
#include <torch/script.h> #include <torch/script.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/stream_reader.h>
#include <stdexcept> #include <stdexcept>
namespace torchaudio { namespace torchaudio {
......
#include <c10/util/Exception.h> #include <c10/util/Exception.h>
#include <torchaudio/csrc/ffmpeg/ffmpeg.h> #include <libtorio/ffmpeg/ffmpeg.h>
#include <sstream> #include <sstream>
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
......
...@@ -58,13 +58,13 @@ class Wrapper { ...@@ -58,13 +58,13 @@ class Wrapper {
public: public:
Wrapper() = delete; Wrapper() = delete;
Wrapper<T, Deleter>(T* t) : ptr(t){}; explicit Wrapper<T, Deleter>(T* t) : ptr(t) {}
T* operator->() const { T* operator->() const {
return ptr.get(); return ptr.get();
}; }
explicit operator bool() const { explicit operator bool() const {
return (bool)ptr; return (bool)ptr;
}; }
operator T*() const { operator T*() const {
return ptr.get(); return ptr.get();
} }
...@@ -140,7 +140,7 @@ AVPacketPtr alloc_avpacket(); ...@@ -140,7 +140,7 @@ AVPacketPtr alloc_avpacket();
// `AutoPacketUnref` handles the second-stage memory management. // `AutoPacketUnref` handles the second-stage memory management.
struct AutoPacketUnref { struct AutoPacketUnref {
AVPacketPtr& p_; AVPacketPtr& p_;
AutoPacketUnref(AVPacketPtr& p); explicit AutoPacketUnref(AVPacketPtr& p);
~AutoPacketUnref(); ~AutoPacketUnref();
operator AVPacket*() const; operator AVPacket*() const;
}; };
......
#include <torchaudio/csrc/ffmpeg/filter_graph.h> #include <libtorio/ffmpeg/filter_graph.h>
#include <stdexcept> #include <stdexcept>
namespace torchaudio::io { namespace torchaudio::io {
......
#pragma once #pragma once
#include <torchaudio/csrc/ffmpeg/ffmpeg.h> #include <libtorio/ffmpeg/ffmpeg.h>
namespace torchaudio { namespace torchaudio {
namespace io { namespace io {
......
#include <torchaudio/csrc/ffmpeg/hw_context.h> #include <libtorio/ffmpeg/hw_context.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 {
......
#include <libtorio/ffmpeg/hw_context.h>
#include <libtorio/ffmpeg/stream_reader/stream_reader.h>
#include <libtorio/ffmpeg/stream_writer/stream_writer.h>
#include <torch/extension.h> #include <torch/extension.h>
#include <torchaudio/csrc/ffmpeg/hw_context.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/stream_reader.h>
#include <torchaudio/csrc/ffmpeg/stream_writer/stream_writer.h>
namespace torchaudio::io { namespace torchaudio::io {
namespace { namespace {
......
#include <torchaudio/csrc/ffmpeg/stream_reader/buffer/chunked_buffer.h> #include <libtorio/ffmpeg/stream_reader/buffer/chunked_buffer.h>
namespace torchaudio::io::detail { namespace torchaudio::io::detail {
......
#pragma once #pragma once
#include <torchaudio/csrc/ffmpeg/ffmpeg.h> #include <libtorio/ffmpeg/ffmpeg.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/typedefs.h> #include <libtorio/ffmpeg/stream_reader/typedefs.h>
namespace torchaudio::io::detail { namespace torchaudio::io::detail {
......
#include <torchaudio/csrc/ffmpeg/stream_reader/buffer/unchunked_buffer.h> #include <libtorio/ffmpeg/stream_reader/buffer/unchunked_buffer.h>
namespace torchaudio::io::detail { namespace torchaudio::io::detail {
......
#pragma once #pragma once
#include <libtorio/ffmpeg/ffmpeg.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/typedefs.h>
#include <deque> #include <deque>
namespace torchaudio::io::detail { namespace torchaudio::io::detail {
...@@ -13,7 +13,7 @@ class UnchunkedBuffer { ...@@ -13,7 +13,7 @@ class UnchunkedBuffer {
AVRational time_base; AVRational time_base;
public: public:
UnchunkedBuffer(AVRational time_base); explicit UnchunkedBuffer(AVRational time_base);
bool is_ready() const; bool is_ready() const;
void push_frame(torch::Tensor frame, int64_t pts_); void push_frame(torch::Tensor frame, int64_t pts_);
c10::optional<Chunk> pop_chunk(); c10::optional<Chunk> pop_chunk();
......
#include <libtorio/ffmpeg/stream_reader/conversion.h>
#include <torch/torch.h> #include <torch/torch.h>
#include <torchaudio/csrc/ffmpeg/stream_reader/conversion.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 {
...@@ -12,7 +12,7 @@ class AudioConverter { ...@@ -12,7 +12,7 @@ class AudioConverter {
const int num_channels; const int num_channels;
public: public:
AudioConverter(int num_channels); explicit AudioConverter(int num_channels);
// Converts AVFrame* into Tensor of [T, C] // Converts AVFrame* into Tensor of [T, C]
torch::Tensor convert(const AVFrame* src); torch::Tensor convert(const AVFrame* src);
......
#include <torchaudio/csrc/ffmpeg/stream_reader/packet_buffer.h> #include <libtorio/ffmpeg/stream_reader/packet_buffer.h>
namespace torchaudio::io { namespace torchaudio::io {
void PacketBuffer::push_packet(AVPacket* packet) { void PacketBuffer::push_packet(AVPacket* packet) {
......
#pragma once #pragma once
#include <torchaudio/csrc/ffmpeg/ffmpeg.h> #include <libtorio/ffmpeg/ffmpeg.h>
namespace torchaudio { namespace torchaudio {
namespace io { namespace 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