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