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
......@@ -2,8 +2,8 @@
TorchAudio's C++ API is a prototype feature.
API/ABI backward compatibility is not guaranteed.
torchaudio::io::StreamReader
============================
torio::io::StreamReader
=======================
``StreamReader`` is the implementation used by Python equivalent and provides similar interface.
When working with custom I/O, such as in-memory data, ``StreamReaderCustomIO`` class can be used.
......@@ -16,55 +16,55 @@ Constructors
StreamReader
^^^^^^^^^^^^
.. doxygenclass:: torchaudio::io::StreamReader
.. doxygenclass:: torio::io::StreamReader
.. doxygenfunction:: torchaudio::io::StreamReader::StreamReader(const std::string &src, const c10::optional<std::string> &format = {}, const c10::optional<OptionDict> &option = {})
.. doxygenfunction:: torio::io::StreamReader::StreamReader(const std::string &src, const c10::optional<std::string> &format = {}, const c10::optional<OptionDict> &option = {})
StreamReaderCustomIO
^^^^^^^^^^^^^^^^^^^^
.. doxygenclass:: torchaudio::io::StreamReaderCustomIO
.. doxygenclass:: torio::io::StreamReaderCustomIO
.. doxygenfunction:: torchaudio::io::StreamReaderCustomIO::StreamReaderCustomIO
.. doxygenfunction:: torio::io::StreamReaderCustomIO::StreamReaderCustomIO
Query Methods
-------------
find_best_audio_stream
^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::find_best_audio_stream
.. doxygenfunction:: torio::io::StreamReader::find_best_audio_stream
find_best_video_stream
^^^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::find_best_video_stream
.. doxygenfunction:: torio::io::StreamReader::find_best_video_stream
get_metadata
^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::get_metadata
.. doxygenfunction:: torio::io::StreamReader::get_metadata
num_src_streams
^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::num_src_streams
.. doxygenfunction:: torio::io::StreamReader::num_src_streams
get_src_stream_info
^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::get_src_stream_info
.. doxygenfunction:: torio::io::StreamReader::get_src_stream_info
num_out_streams
^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::num_out_streams
.. doxygenfunction:: torio::io::StreamReader::num_out_streams
get_out_stream_info
^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::get_out_stream_info
.. doxygenfunction:: torio::io::StreamReader::get_out_stream_info
is_buffer_ready
^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::is_buffer_ready
.. doxygenfunction:: torio::io::StreamReader::is_buffer_ready
Configure Methods
-----------------
......@@ -72,38 +72,38 @@ Configure Methods
add_audio_stream
^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::add_audio_stream
.. doxygenfunction:: torio::io::StreamReader::add_audio_stream
add_video_stream
^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::add_video_stream
.. doxygenfunction:: torio::io::StreamReader::add_video_stream
remove_stream
^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::remove_stream
.. doxygenfunction:: torio::io::StreamReader::remove_stream
Stream Methods
^^^^^^^^^^^^^^
seek
^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::seek
.. doxygenfunction:: torio::io::StreamReader::seek
process_packet
^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::process_packet()
.. doxygenfunction:: torio::io::StreamReader::process_packet()
process_packet_block
^^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::process_packet_block
.. doxygenfunction:: torio::io::StreamReader::process_packet_block
process_all_packets
^^^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::process_all_packets
.. doxygenfunction:: torio::io::StreamReader::process_all_packets
fill_buffer
^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::fill_buffer
.. doxygenfunction:: torio::io::StreamReader::fill_buffer
Retrieval Methods
-----------------
......@@ -111,7 +111,7 @@ Retrieval Methods
pop_chunks
^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamReader::pop_chunks
.. doxygenfunction:: torio::io::StreamReader::pop_chunks
Support Structures
......@@ -122,7 +122,7 @@ Chunk
.. container:: py attribute
.. doxygenstruct:: torchaudio::io::Chunk
.. doxygenstruct:: torio::io::Chunk
:members:
SrcStreaminfo
......@@ -130,7 +130,7 @@ SrcStreaminfo
.. container:: py attribute
.. doxygenstruct:: torchaudio::io::SrcStreamInfo
.. doxygenstruct:: torio::io::SrcStreamInfo
:members:
OutputStreaminfo
......@@ -138,5 +138,5 @@ OutputStreaminfo
.. container:: py attribute
.. doxygenstruct:: torchaudio::io::OutputStreamInfo
.. doxygenstruct:: torio::io::OutputStreamInfo
:members:
......@@ -2,8 +2,8 @@
TorchAudio's C++ API is prototype feature.
API/ABI backward compatibility is not guaranteed.
torchaudio::io::StreamWriter
============================
torio::io::StreamWriter
=======================
``StreamWriter`` is the implementation used by Python equivalent and provides similar interface.
When working with custom I/O, such as in-memory data, ``StreamWriterCustomIO`` class can be used.
......@@ -16,16 +16,16 @@ Constructors
StreamWriter
^^^^^^^^^^^^
.. doxygenclass:: torchaudio::io::StreamWriter
.. doxygenclass:: torio::io::StreamWriter
.. doxygenfunction:: torchaudio::io::StreamWriter::StreamWriter(const std::string &dst, const c10::optional<std::string> &format = {})
.. doxygenfunction:: torio::io::StreamWriter::StreamWriter(const std::string &dst, const c10::optional<std::string> &format = {})
StreamWriterCustomIO
^^^^^^^^^^^^^^^^^^^^
.. doxygenclass:: torchaudio::io::StreamWriterCustomIO
.. doxygenclass:: torio::io::StreamWriterCustomIO
.. doxygenfunction:: torchaudio::io::StreamWriterCustomIO::StreamWriterCustomIO
.. doxygenfunction:: torio::io::StreamWriterCustomIO::StreamWriterCustomIO
Config methods
--------------
......@@ -33,17 +33,17 @@ Config methods
add_audio_stream
^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::add_audio_stream
.. doxygenfunction:: torio::io::StreamWriter::add_audio_stream
add_video_stream
^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::add_video_stream
.. doxygenfunction:: torio::io::StreamWriter::add_video_stream
set_metadata
^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::set_metadata
.. doxygenfunction:: torio::io::StreamWriter::set_metadata
Write methods
-------------
......@@ -51,24 +51,24 @@ Write methods
open
^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::open
.. doxygenfunction:: torio::io::StreamWriter::open
close
^^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::close
.. doxygenfunction:: torio::io::StreamWriter::close
write_audio_chunk
^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::write_audio_chunk
.. doxygenfunction:: torio::io::StreamWriter::write_audio_chunk
write_video_chunk
^^^^^^^^^^^^^^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::write_video_chunk
.. doxygenfunction:: torio::io::StreamWriter::write_video_chunk
flush
^^^^^
.. doxygenfunction:: torchaudio::io::StreamWriter::flush
.. doxygenfunction:: torio::io::StreamWriter::flush
......@@ -5,7 +5,7 @@
#include <string>
#include <vector>
namespace torchaudio::io {
namespace torio::io {
////////////////////////////////////////////////////////////////////////////////
// AVDictionary
......@@ -146,4 +146,4 @@ void AVCodecParametersDeleter::operator()(AVCodecParameters* codecpar) {
AVCodecParametersPtr::AVCodecParametersPtr(AVCodecParameters* p)
: Wrapper<AVCodecParameters, AVCodecParametersDeleter>(p) {}
} // namespace torchaudio::io
} // namespace torio::io
......@@ -24,7 +24,7 @@ extern "C" {
/// @cond
namespace torchaudio {
namespace torio {
namespace io {
using OptionDict = std::map<std::string, std::string>;
......@@ -209,6 +209,6 @@ struct StreamParams {
int stream_index{};
};
} // namespace io
} // namespace torchaudio
} // namespace torio
/// @endcond
#include <libtorio/ffmpeg/filter_graph.h>
#include <stdexcept>
namespace torchaudio::io {
namespace torio::io {
namespace {
AVFilterGraph* get_filter_graph() {
......@@ -239,4 +239,4 @@ int FilterGraph::get_frame(AVFrame* pOutputFrame) {
return av_buffersink_get_frame(buffersink_ctx, pOutputFrame);
}
} // namespace torchaudio::io
} // namespace torio::io
#pragma once
#include <libtorio/ffmpeg/ffmpeg.h>
namespace torchaudio {
namespace torio {
namespace io {
/// Used to report the output formats of filter graph.
......@@ -85,4 +85,4 @@ class FilterGraph {
};
} // namespace io
} // namespace torchaudio
} // namespace torio
#include <libtorio/ffmpeg/hw_context.h>
namespace torchaudio::io {
namespace torio::io {
namespace {
static std::mutex MUTEX;
......@@ -37,4 +37,4 @@ void clear_cuda_context_cache() {
CUDA_CONTEXT_CACHE.clear();
}
} // namespace torchaudio::io
} // namespace torio::io
......@@ -2,10 +2,10 @@
#include <libtorio/ffmpeg/ffmpeg.h>
namespace torchaudio::io {
namespace torio::io {
AVBufferRef* get_cuda_context(int index);
void clear_cuda_context_cache();
} // namespace torchaudio::io
} // namespace torio::io
......@@ -3,7 +3,7 @@
#include <libtorio/ffmpeg/stream_writer/stream_writer.h>
#include <torch/extension.h>
namespace torchaudio::io {
namespace torio::io {
namespace {
std::map<std::string, std::tuple<int64_t, int64_t, int64_t>> get_versions() {
......@@ -436,4 +436,4 @@ PYBIND11_MODULE(TORCHAUDIO_FFMPEG_EXT_NAME, m) {
}
} // namespace
} // namespace torchaudio::io
} // namespace torio::io
#include <libtorio/ffmpeg/stream_reader/buffer/chunked_buffer.h>
namespace torchaudio::io::detail {
namespace torio::io::detail {
ChunkedBuffer::ChunkedBuffer(
AVRational time_base,
......@@ -126,4 +126,4 @@ void ChunkedBuffer::flush() {
chunks.clear();
}
} // namespace torchaudio::io::detail
} // namespace torio::io::detail
......@@ -2,7 +2,7 @@
#include <libtorio/ffmpeg/ffmpeg.h>
#include <libtorio/ffmpeg/stream_reader/typedefs.h>
namespace torchaudio::io::detail {
namespace torio::io::detail {
class ChunkedBuffer {
// Each AVFrame is converted to a Tensor and stored here.
......@@ -30,4 +30,4 @@ class ChunkedBuffer {
void push_frame(torch::Tensor frame, int64_t pts_);
};
} // namespace torchaudio::io::detail
} // namespace torio::io::detail
#include <libtorio/ffmpeg/stream_reader/buffer/unchunked_buffer.h>
namespace torchaudio::io::detail {
namespace torio::io::detail {
UnchunkedBuffer::UnchunkedBuffer(AVRational time_base) : time_base(time_base){};
......@@ -30,4 +30,4 @@ void UnchunkedBuffer::flush() {
chunks.clear();
}
} // namespace torchaudio::io::detail
} // namespace torio::io::detail
......@@ -4,7 +4,7 @@
#include <torch/types.h>
#include <deque>
namespace torchaudio::io::detail {
namespace torio::io::detail {
class UnchunkedBuffer {
// Each AVFrame is converted to a Tensor and stored here.
......@@ -20,4 +20,4 @@ class UnchunkedBuffer {
void flush();
};
} // namespace torchaudio::io::detail
} // namespace torio::io::detail
......@@ -5,7 +5,7 @@
#include <c10/cuda/CUDAStream.h>
#endif
namespace torchaudio::io {
namespace torio::io {
////////////////////////////////////////////////////////////////////////////////
// Audio
......@@ -627,4 +627,4 @@ torch::Tensor YUV444PCudaConverter::convert(const AVFrame* src) {
#endif
} // namespace torchaudio::io
} // namespace torio::io
......@@ -2,7 +2,7 @@
#include <libtorio/ffmpeg/ffmpeg.h>
#include <torch/types.h>
namespace torchaudio::io {
namespace torio::io {
////////////////////////////////////////////////////////////////////////////////
// Audio
......@@ -126,4 +126,4 @@ class YUV444PCudaConverter : CudaImageConverterBase {
};
#endif
} // namespace torchaudio::io
} // namespace torio::io
#include <libtorio/ffmpeg/stream_reader/packet_buffer.h>
namespace torchaudio::io {
namespace torio::io {
void PacketBuffer::push_packet(AVPacket* packet) {
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(packet, "Packet is null.");
AVPacket* p = av_packet_clone(packet);
......@@ -17,4 +17,4 @@ std::vector<AVPacketPtr> PacketBuffer::pop_packets() {
bool PacketBuffer::has_packets() {
return packets.size() > 0;
}
} // namespace torchaudio::io
} // namespace torio::io
#pragma once
#include <libtorio/ffmpeg/ffmpeg.h>
namespace torchaudio {
namespace torio {
namespace io {
class PacketBuffer {
public:
......@@ -13,4 +13,4 @@ class PacketBuffer {
std::deque<AVPacketPtr> packets;
};
} // namespace io
} // namespace torchaudio
} // namespace torio
......@@ -3,7 +3,7 @@
#include <libtorio/ffmpeg/stream_reader/conversion.h>
#include <libtorio/ffmpeg/stream_reader/post_process.h>
namespace torchaudio::io {
namespace torio::io {
namespace detail {
namespace {
......@@ -617,4 +617,4 @@ std::unique_ptr<IPostDecodeProcess> get_video_process(
return detail::get_chunked_video_process(
std::move(filter), frames_per_chunk, num_chunks);
}
} // namespace torchaudio::io
} // namespace torio::io
......@@ -2,7 +2,7 @@
#include <libtorio/ffmpeg/filter_graph.h>
#include <libtorio/ffmpeg/stream_reader/typedefs.h>
namespace torchaudio::io {
namespace torio::io {
struct IPostDecodeProcess {
virtual ~IPostDecodeProcess() = default;
......@@ -31,4 +31,4 @@ std::unique_ptr<IPostDecodeProcess> get_video_process(
int num_chunks,
const torch::Device& device);
} // namespace torchaudio::io
} // namespace torio::io
......@@ -3,7 +3,7 @@
#include <stdexcept>
#include <string_view>
namespace torchaudio::io {
namespace torio::io {
namespace {
AVCodecContextPtr alloc_codec_context(
......@@ -394,4 +394,4 @@ c10::optional<Chunk> StreamProcessor::pop_chunk(KeyType key) {
return post_processes.at(key)->pop_chunk();
}
} // 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