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

Change namespace to torio

Differential Revision: D50506299

Pull Request resolved: https://github.com/pytorch/audio/pull/3669
parent b7b61c2b
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <torch/types.h> #include <torch/types.h>
#include <map> #include <map>
namespace torchaudio { namespace torio {
namespace io { namespace io {
class StreamProcessor { class StreamProcessor {
...@@ -104,4 +104,4 @@ class StreamProcessor { ...@@ -104,4 +104,4 @@ class StreamProcessor {
}; };
} // namespace io } // namespace io
} // namespace torchaudio } // namespace torio
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <stdexcept> #include <stdexcept>
#include <thread> #include <thread>
namespace torchaudio::io { namespace torio::io {
using KeyType = StreamProcessor::KeyType; using KeyType = StreamProcessor::KeyType;
...@@ -606,4 +606,4 @@ StreamReaderCustomIO::StreamReaderCustomIO( ...@@ -606,4 +606,4 @@ StreamReaderCustomIO::StreamReaderCustomIO(
: CustomInput(opaque, buffer_size, read_packet, seek), : CustomInput(opaque, buffer_size, read_packet, seek),
StreamReader(io_ctx, format, option) {} StreamReader(io_ctx, format, option) {}
} // namespace torchaudio::io } // namespace torio::io
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <libtorio/ffmpeg/stream_reader/typedefs.h> #include <libtorio/ffmpeg/stream_reader/typedefs.h>
#include <vector> #include <vector>
namespace torchaudio { namespace torio {
namespace io { namespace io {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
...@@ -386,4 +386,9 @@ class StreamReaderCustomIO : private detail::CustomInput, public StreamReader { ...@@ -386,4 +386,9 @@ class StreamReaderCustomIO : private detail::CustomInput, public StreamReader {
}; };
} // namespace io } // namespace io
} // namespace torchaudio } // namespace torio
// For BC
namespace torchaudio::io {
using namespace torio::io;
} // namespace torchaudio::io
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <libtorio/ffmpeg/ffmpeg.h> #include <libtorio/ffmpeg/ffmpeg.h>
#include <iostream> #include <iostream>
namespace torchaudio { namespace torio {
namespace io { namespace io {
/// Information about source stream found in the input media. /// Information about source stream found in the input media.
...@@ -162,4 +162,4 @@ struct Chunk { ...@@ -162,4 +162,4 @@ struct Chunk {
}; };
} // namespace io } // namespace io
} // namespace torchaudio } // namespace torio
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include <libtorio/ffmpeg/stream_writer/encode_process.h> #include <libtorio/ffmpeg/stream_writer/encode_process.h>
#include <cmath> #include <cmath>
namespace torchaudio::io { namespace torio::io {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// EncodeProcess Logic Implementation // EncodeProcess Logic Implementation
...@@ -973,4 +973,4 @@ EncodeProcess get_video_encode_process( ...@@ -973,4 +973,4 @@ EncodeProcess get_video_encode_process(
std::move(codec_ctx)}; std::move(codec_ctx)};
} }
} // namespace torchaudio::io } // namespace torio::io
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include <libtorio/ffmpeg/stream_writer/types.h> #include <libtorio/ffmpeg/stream_writer/types.h>
#include <torch/types.h> #include <torch/types.h>
namespace torchaudio::io { namespace torio::io {
class EncodeProcess { class EncodeProcess {
TensorConverter converter; TensorConverter converter;
...@@ -64,4 +64,4 @@ EncodeProcess get_video_encode_process( ...@@ -64,4 +64,4 @@ EncodeProcess get_video_encode_process(
const c10::optional<std::string>& filter_desc, const c10::optional<std::string>& filter_desc,
bool disable_converter = false); bool disable_converter = false);
}; // namespace torchaudio::io }; // namespace torio::io
#include <libtorio/ffmpeg/stream_writer/encoder.h> #include <libtorio/ffmpeg/stream_writer/encoder.h>
namespace torchaudio::io { namespace torio::io {
Encoder::Encoder( Encoder::Encoder(
AVFormatContext* format_ctx, AVFormatContext* format_ctx,
...@@ -59,4 +59,4 @@ void Encoder::encode(AVFrame* frame) { ...@@ -59,4 +59,4 @@ void Encoder::encode(AVFrame* frame) {
} }
} }
} // namespace torchaudio::io } // namespace torio::io
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <libtorio/ffmpeg/filter_graph.h> #include <libtorio/ffmpeg/filter_graph.h>
#include <torch/types.h> #include <torch/types.h>
namespace torchaudio::io { namespace torio::io {
// Encoder + Muxer // Encoder + Muxer
class Encoder { class Encoder {
...@@ -27,4 +27,4 @@ class Encoder { ...@@ -27,4 +27,4 @@ class Encoder {
void encode(AVFrame* frame); void encode(AVFrame* frame);
}; };
} // namespace torchaudio::io } // namespace torio::io
#include <libtorio/ffmpeg/stream_writer/packet_writer.h> #include <libtorio/ffmpeg/stream_writer/packet_writer.h>
namespace torchaudio::io { namespace torio::io {
namespace { namespace {
AVStream* add_stream( AVStream* add_stream(
AVFormatContext* format_ctx, AVFormatContext* format_ctx,
...@@ -33,4 +33,4 @@ void PacketWriter::write_packet(const AVPacketPtr& packet) { ...@@ -33,4 +33,4 @@ void PacketWriter::write_packet(const AVPacketPtr& packet) {
ret = av_interleaved_write_frame(format_ctx, &dst_packet); ret = av_interleaved_write_frame(format_ctx, &dst_packet);
TORCH_CHECK(ret >= 0, "Failed to write packet to destination."); TORCH_CHECK(ret >= 0, "Failed to write packet to destination.");
} }
} // namespace torchaudio::io } // namespace torio::io
#pragma once #pragma once
#include <libtorio/ffmpeg/ffmpeg.h> #include <libtorio/ffmpeg/ffmpeg.h>
namespace torchaudio::io { namespace torio::io {
class PacketWriter { class PacketWriter {
AVFormatContext* format_ctx; AVFormatContext* format_ctx;
AVStream* stream; AVStream* stream;
...@@ -13,4 +13,4 @@ class PacketWriter { ...@@ -13,4 +13,4 @@ class PacketWriter {
const StreamParams& stream_params_); const StreamParams& stream_params_);
void write_packet(const AVPacketPtr& packet); void write_packet(const AVPacketPtr& packet);
}; };
} // namespace torchaudio::io } // namespace torio::io
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <c10/cuda/CUDAStream.h> #include <c10/cuda/CUDAStream.h>
#endif #endif
namespace torchaudio { namespace torio {
namespace io { namespace io {
namespace { namespace {
...@@ -385,4 +385,4 @@ StreamWriterCustomIO::StreamWriterCustomIO( ...@@ -385,4 +385,4 @@ StreamWriterCustomIO::StreamWriterCustomIO(
StreamWriter(io_ctx, format) {} StreamWriter(io_ctx, format) {}
} // namespace io } // namespace io
} // namespace torchaudio } // namespace torio
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <libtorio/ffmpeg/stream_writer/types.h> #include <libtorio/ffmpeg/stream_writer/types.h>
#include <torch/types.h> #include <torch/types.h>
namespace torchaudio { namespace torio {
namespace io { namespace io {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
...@@ -330,4 +330,9 @@ class StreamWriterCustomIO : private detail::CustomOutput, public StreamWriter { ...@@ -330,4 +330,9 @@ class StreamWriterCustomIO : private detail::CustomOutput, public StreamWriter {
}; };
} // namespace io } // namespace io
} // namespace torchaudio } // namespace torio
// For BC
namespace torchaudio::io {
using namespace torio::io;
} // namespace torchaudio::io
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <c10/cuda/CUDAStream.h> #include <c10/cuda/CUDAStream.h>
#endif #endif
namespace torchaudio::io { namespace torio::io {
namespace { namespace {
...@@ -494,4 +494,4 @@ bool Iterator::operator!=(const int64_t end) const { ...@@ -494,4 +494,4 @@ bool Iterator::operator!=(const int64_t end) const {
return i < end; return i < end;
} }
} // namespace torchaudio::io } // namespace torio::io
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include <libtorio/ffmpeg/ffmpeg.h> #include <libtorio/ffmpeg/ffmpeg.h>
#include <torch/types.h> #include <torch/types.h>
namespace torchaudio::io { namespace torio::io {
class TensorConverter { class TensorConverter {
public: public:
...@@ -92,4 +92,4 @@ class TensorConverter { ...@@ -92,4 +92,4 @@ class TensorConverter {
Generator convert(const torch::Tensor& t); Generator convert(const torch::Tensor& t);
}; };
} // namespace torchaudio::io } // namespace torio::io
#pragma once #pragma once
namespace torchaudio::io { namespace torio::io {
struct CodecConfig { struct CodecConfig {
int bit_rate = -1; int bit_rate = -1;
...@@ -16,4 +16,4 @@ struct CodecConfig { ...@@ -16,4 +16,4 @@ struct CodecConfig {
int gop_size = -1; int gop_size = -1;
int max_b_frames = -1; int max_b_frames = -1;
}; };
} // namespace torchaudio::io } // namespace torio::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