Compare commits
8 Commits
5eba4807f2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e4034f6b9 | |||
| 8afda30420 | |||
| 25c3952e94 | |||
| e61d2dd0d9 | |||
| 61fe565d6d | |||
| 18a615a358 | |||
| 2c4eb8680a | |||
| 090da72dde |
1227
minijson_reader.hpp
Normal file
1227
minijson_reader.hpp
Normal file
File diff suppressed because it is too large
Load Diff
891
minijson_writer.hpp
Normal file
891
minijson_writer.hpp
Normal file
@@ -0,0 +1,891 @@
|
|||||||
|
#ifndef MINIJSON_WRITER_H
|
||||||
|
#define MINIJSON_WRITER_H
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <iterator>
|
||||||
|
#include <locale>
|
||||||
|
#include <ostream>
|
||||||
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
|
#define MJW_CPP11_SUPPORTED __cplusplus > 199711L || _MSC_VER >= 1800
|
||||||
|
|
||||||
|
#if MJW_CPP11_SUPPORTED
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <type_traits>
|
||||||
|
#define MJW_LIB_NS std
|
||||||
|
#define MJW_ISFINITE(X) std::isfinite(X)
|
||||||
|
#define MJW_STATIC_ASSERT(COND, MESSAGE) static_assert(COND, MESSAGE)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <boost/type_traits/remove_cv.hpp>
|
||||||
|
#include <boost/type_traits/is_integral.hpp>
|
||||||
|
#include <boost/type_traits/is_same.hpp>
|
||||||
|
#include <boost/type_traits/is_floating_point.hpp>
|
||||||
|
#include <boost/math/special_functions/fpclassify.hpp>
|
||||||
|
#define MJW_LIB_NS boost
|
||||||
|
#define MJW_ISFINITE(X) boost::math::isfinite(X)
|
||||||
|
#define MJW_STATIC_ASSERT(COND, MESSAGE) BOOST_STATIC_ASSERT(COND)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace minijson
|
||||||
|
{
|
||||||
|
|
||||||
|
enum null_t
|
||||||
|
{
|
||||||
|
null = 0
|
||||||
|
};
|
||||||
|
|
||||||
|
class writer_configuration
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
size_t m_nesting_level;
|
||||||
|
bool m_pretty_printing;
|
||||||
|
size_t m_indent_spaces;
|
||||||
|
bool m_use_tabs;
|
||||||
|
bool m_horizontal_array;
|
||||||
|
bool m_close_on_destroy;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit writer_configuration() :
|
||||||
|
m_nesting_level(0),
|
||||||
|
m_pretty_printing(false),
|
||||||
|
m_indent_spaces(4),
|
||||||
|
m_use_tabs(false),
|
||||||
|
m_horizontal_array(false),
|
||||||
|
m_close_on_destroy(true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t nesting_level() const
|
||||||
|
{
|
||||||
|
return m_nesting_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration increase_nesting_level() const
|
||||||
|
{
|
||||||
|
writer_configuration result = *this;
|
||||||
|
result.m_nesting_level++;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pretty_printing() const
|
||||||
|
{
|
||||||
|
return m_pretty_printing;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration pretty_printing(bool value) const
|
||||||
|
{
|
||||||
|
writer_configuration result = *this;
|
||||||
|
result.m_pretty_printing = value;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t indent_spaces() const
|
||||||
|
{
|
||||||
|
return m_indent_spaces;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration indent_spaces(size_t value) const
|
||||||
|
{
|
||||||
|
writer_configuration result = *this;
|
||||||
|
result.m_indent_spaces = value;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool use_tabs() const
|
||||||
|
{
|
||||||
|
return m_use_tabs;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration use_tabs(bool value) const
|
||||||
|
{
|
||||||
|
writer_configuration result = *this;
|
||||||
|
result.m_use_tabs = value;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool horizontal_array() const
|
||||||
|
{
|
||||||
|
return m_horizontal_array;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration horizontal_array(bool value) const
|
||||||
|
{
|
||||||
|
writer_configuration result = *this;
|
||||||
|
result.m_horizontal_array = value;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration& horizontal_array_inplace(bool value)
|
||||||
|
{
|
||||||
|
m_horizontal_array = value;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool close_on_destroy() const
|
||||||
|
{
|
||||||
|
return m_close_on_destroy;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration& close_on_destroy_inplace(bool value)
|
||||||
|
{
|
||||||
|
m_close_on_destroy = value;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename V, typename Enable = void>
|
||||||
|
struct default_value_writer;
|
||||||
|
|
||||||
|
template<typename InputIt>
|
||||||
|
void write_array(
|
||||||
|
std::ostream& stream,
|
||||||
|
InputIt begin, InputIt end,
|
||||||
|
const writer_configuration& configuration = writer_configuration());
|
||||||
|
|
||||||
|
template<typename InputIt, typename ValueWriter>
|
||||||
|
void write_array(
|
||||||
|
std::ostream& stream,
|
||||||
|
InputIt begin, InputIt end,
|
||||||
|
const ValueWriter& value_writer,
|
||||||
|
const writer_configuration& configuration = writer_configuration());
|
||||||
|
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
|
||||||
|
template<bool>
|
||||||
|
struct enable_if;
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct enable_if<true>
|
||||||
|
{
|
||||||
|
typedef void type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename InputIt>
|
||||||
|
struct get_value_type
|
||||||
|
{
|
||||||
|
typedef typename MJW_LIB_NS::remove_cv<typename std::iterator_traits<InputIt>::value_type>::type type;
|
||||||
|
};
|
||||||
|
|
||||||
|
#if MJW_CPP11_SUPPORTED
|
||||||
|
|
||||||
|
template<size_t Rank>
|
||||||
|
struct overload_rank : overload_rank<Rank - 1>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct overload_rank<0>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef overload_rank<63> call_ranked;
|
||||||
|
|
||||||
|
template<typename Functor>
|
||||||
|
struct two_or_three_args_functor
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
Functor functor;
|
||||||
|
|
||||||
|
template<typename Arg1, typename Arg2, typename Arg3>
|
||||||
|
auto operator_impl(Arg1&& arg1, Arg2&& arg2, Arg3&& arg3, overload_rank<1>)
|
||||||
|
-> decltype(functor(std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3)))
|
||||||
|
{
|
||||||
|
functor(std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Arg1, typename Arg2, typename Arg3>
|
||||||
|
auto operator_impl(Arg1&& arg1, Arg2&& arg2, Arg3&&, overload_rank<0>)
|
||||||
|
-> decltype(functor(std::forward<Arg1>(arg1), std::forward<Arg2>(arg2)))
|
||||||
|
{
|
||||||
|
functor(std::forward<Arg1>(arg1), std::forward<Arg2>(arg2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit two_or_three_args_functor(Functor functor) :
|
||||||
|
functor(std::move(functor))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Arg1, typename Arg2, typename Arg3>
|
||||||
|
void operator()(Arg1&& arg1, Arg2&& arg2, Arg3&& arg3)
|
||||||
|
{
|
||||||
|
operator_impl(std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3), call_ranked());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
template<typename Functor>
|
||||||
|
struct two_or_three_args_functor : Functor
|
||||||
|
{
|
||||||
|
mutable Functor functor;
|
||||||
|
|
||||||
|
explicit two_or_three_args_functor(const Functor& functor) :
|
||||||
|
Functor(functor),
|
||||||
|
functor(functor)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
using Functor::operator();
|
||||||
|
|
||||||
|
template<typename Arg1, typename Arg2, typename Arg3>
|
||||||
|
void operator()(Arg1& arg1, Arg2& arg2, Arg3&) const
|
||||||
|
{
|
||||||
|
functor(arg1, arg2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename R, typename X1, typename X2>
|
||||||
|
struct two_or_three_args_functor<R (*)(X1, X2)>
|
||||||
|
{
|
||||||
|
typedef R (*Function)(X1, X2);
|
||||||
|
|
||||||
|
Function function;
|
||||||
|
|
||||||
|
explicit two_or_three_args_functor(Function function) :
|
||||||
|
function(function)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Arg1, typename Arg2, typename Arg3>
|
||||||
|
void operator()(Arg1& arg1, Arg2& arg2, Arg3&) const
|
||||||
|
{
|
||||||
|
function(arg1, arg2);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename R, typename X1, typename X2, typename X3>
|
||||||
|
struct two_or_three_args_functor<R (*)(X1, X2, X3)>
|
||||||
|
{
|
||||||
|
typedef R (*Function)(X1, X2, X3);
|
||||||
|
|
||||||
|
Function function;
|
||||||
|
|
||||||
|
explicit two_or_three_args_functor(Function function) :
|
||||||
|
function(function)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Arg1, typename Arg2, typename Arg3>
|
||||||
|
void operator()(Arg1& arg1, Arg2& arg2, Arg3& arg3) const
|
||||||
|
{
|
||||||
|
function(arg1, arg2, arg3);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename Functor>
|
||||||
|
two_or_three_args_functor<Functor> wrap_two_or_three_args_functor(Functor functor)
|
||||||
|
{
|
||||||
|
return two_or_three_args_functor<Functor>(functor);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<size_t Size = 128>
|
||||||
|
class buffered_writer
|
||||||
|
{
|
||||||
|
MJW_STATIC_ASSERT(Size != 0, "Illegal instantiation of buffered_writer");
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
std::ostream& m_stream;
|
||||||
|
char m_buffer[Size];
|
||||||
|
size_t m_offset;
|
||||||
|
|
||||||
|
buffered_writer(const buffered_writer &);
|
||||||
|
buffered_writer &operator=(const buffered_writer &);
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit buffered_writer(std::ostream& stream) :
|
||||||
|
m_stream(stream),
|
||||||
|
m_offset(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
buffered_writer& operator<<(char c)
|
||||||
|
{
|
||||||
|
if (m_offset == Size)
|
||||||
|
{
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_buffer[m_offset++] = c;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<size_t N>
|
||||||
|
buffered_writer& operator<<(const char (&str)[N])
|
||||||
|
{
|
||||||
|
MJW_STATIC_ASSERT(N != 0, "Illegal instantiation of buffered_writer::operator<<(const char (&str)[N])");
|
||||||
|
|
||||||
|
for (size_t i = 0; i < N - 1; i++)
|
||||||
|
{
|
||||||
|
operator<<(str[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
void flush()
|
||||||
|
{
|
||||||
|
m_stream.write(m_buffer, m_offset);
|
||||||
|
|
||||||
|
m_offset = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
|
void adjust_stream_settings(std::ostream& stream)
|
||||||
|
{
|
||||||
|
stream.imbue(std::locale::classic());
|
||||||
|
stream << std::resetiosflags(std::ios::showpoint | std::ios::showpos);
|
||||||
|
stream << std::dec << std::setw(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_quoted_string(std::ostream& stream, const char* str)
|
||||||
|
{
|
||||||
|
stream << std::hex << std::right << std::setfill('0');
|
||||||
|
|
||||||
|
buffered_writer<> writer(stream);
|
||||||
|
|
||||||
|
writer << '"';
|
||||||
|
|
||||||
|
while (*str != '\0')
|
||||||
|
{
|
||||||
|
switch (*str)
|
||||||
|
{
|
||||||
|
case '"':
|
||||||
|
writer << "\\\"";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\\':
|
||||||
|
writer << "\\\\";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\n':
|
||||||
|
writer << "\\n";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\r':
|
||||||
|
writer << "\\r";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case '\t':
|
||||||
|
writer << "\\t";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if ((*str > 0 && *str < 32) || *str == 127) // ASCII control characters (NUL is not supported)
|
||||||
|
{
|
||||||
|
writer << "\\u";
|
||||||
|
|
||||||
|
writer.flush();
|
||||||
|
stream << std::setw(4) << static_cast<unsigned>(*str);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
writer << *str;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
str++;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer << '"';
|
||||||
|
|
||||||
|
writer.flush();
|
||||||
|
|
||||||
|
stream << std::dec;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // unnamed namespace
|
||||||
|
|
||||||
|
template<typename InputIt>
|
||||||
|
struct range
|
||||||
|
{
|
||||||
|
InputIt begin;
|
||||||
|
InputIt end;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename InputIt>
|
||||||
|
range<InputIt> make_range(InputIt begin, InputIt end)
|
||||||
|
{
|
||||||
|
const range<InputIt> range = { begin, end };
|
||||||
|
|
||||||
|
return range;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename InputIt, typename ValueWriter>
|
||||||
|
class range_writer
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
ValueWriter m_value_writer;
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit range_writer(const ValueWriter& value_writer) :
|
||||||
|
m_value_writer(value_writer)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void operator()(std::ostream& stream, const range<InputIt>& range, const writer_configuration& configuration) const
|
||||||
|
{
|
||||||
|
write_array(stream, range.begin, range.end, m_value_writer, configuration);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
class writer
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
|
enum status
|
||||||
|
{
|
||||||
|
EMPTY,
|
||||||
|
OPEN,
|
||||||
|
CLOSED
|
||||||
|
};
|
||||||
|
|
||||||
|
bool m_array;
|
||||||
|
status m_status;
|
||||||
|
std::ostream* m_stream;
|
||||||
|
writer_configuration m_configuration;
|
||||||
|
|
||||||
|
enum pretty_print_token
|
||||||
|
{
|
||||||
|
BEFORE_ELEMENT,
|
||||||
|
AFTER_COLON,
|
||||||
|
BEFORE_CLOSING_BRACKET
|
||||||
|
};
|
||||||
|
|
||||||
|
void write_pretty_print_token(pretty_print_token token)
|
||||||
|
{
|
||||||
|
if (!m_configuration.pretty_printing())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
detail::buffered_writer<16> writer(*m_stream);
|
||||||
|
|
||||||
|
if ((token == BEFORE_ELEMENT) || ((token == BEFORE_CLOSING_BRACKET) && (m_status != EMPTY)))
|
||||||
|
{
|
||||||
|
if (!m_configuration.horizontal_array())
|
||||||
|
{
|
||||||
|
const size_t base_depth = (token == BEFORE_ELEMENT) ? 1 : 0;
|
||||||
|
const size_t no_indent_characters = m_configuration.use_tabs() ?
|
||||||
|
(base_depth + m_configuration.nesting_level()) :
|
||||||
|
(base_depth + m_configuration.nesting_level()) * m_configuration.indent_spaces();
|
||||||
|
|
||||||
|
writer << '\n';
|
||||||
|
|
||||||
|
for (size_t i = 0; i < no_indent_characters; i++)
|
||||||
|
{
|
||||||
|
writer << ((m_configuration.use_tabs()) ? '\t' : ' ');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (token == AFTER_COLON)
|
||||||
|
{
|
||||||
|
writer << ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
writer.flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_opening_bracket()
|
||||||
|
{
|
||||||
|
if (m_array)
|
||||||
|
{
|
||||||
|
*m_stream << '[';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*m_stream << '{';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_closing_bracket()
|
||||||
|
{
|
||||||
|
write_pretty_print_token(BEFORE_CLOSING_BRACKET);
|
||||||
|
|
||||||
|
if (m_array)
|
||||||
|
{
|
||||||
|
*m_stream << ']';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*m_stream << '}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
void next_field()
|
||||||
|
{
|
||||||
|
if (m_status == EMPTY)
|
||||||
|
{
|
||||||
|
write_opening_bracket();
|
||||||
|
}
|
||||||
|
else if (m_status == OPEN)
|
||||||
|
{
|
||||||
|
*m_stream << ',';
|
||||||
|
}
|
||||||
|
|
||||||
|
write_pretty_print_token(BEFORE_ELEMENT);
|
||||||
|
|
||||||
|
m_status = OPEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
void write_field_name(const char* name)
|
||||||
|
{
|
||||||
|
detail::write_quoted_string(*m_stream, name);
|
||||||
|
|
||||||
|
*m_stream << ':';
|
||||||
|
|
||||||
|
write_pretty_print_token(AFTER_COLON);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename V, typename ValueWriter>
|
||||||
|
void write_helper(const char* field_name, const V& value, const ValueWriter& value_writer)
|
||||||
|
{
|
||||||
|
if (m_status == CLOSED)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
detail::adjust_stream_settings(*m_stream);
|
||||||
|
|
||||||
|
next_field();
|
||||||
|
|
||||||
|
if (field_name != NULL)
|
||||||
|
{
|
||||||
|
write_field_name(field_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
const writer_configuration nested_object_configuration = m_configuration.increase_nesting_level();
|
||||||
|
detail::wrap_two_or_three_args_functor(value_writer)(*m_stream, value, nested_object_configuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
explicit writer(std::ostream& stream, bool array, const writer_configuration& configuration) :
|
||||||
|
m_array(array),
|
||||||
|
m_status(EMPTY),
|
||||||
|
m_stream(&stream),
|
||||||
|
m_configuration(configuration)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
~writer()
|
||||||
|
{
|
||||||
|
if (m_configuration.close_on_destroy())
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::ostream& stream() const
|
||||||
|
{
|
||||||
|
return *m_stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
const writer_configuration& configuration() const
|
||||||
|
{
|
||||||
|
return m_configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
writer_configuration& configuration()
|
||||||
|
{
|
||||||
|
return m_configuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
void close()
|
||||||
|
{
|
||||||
|
if (m_status == CLOSED)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
detail::adjust_stream_settings(*m_stream);
|
||||||
|
|
||||||
|
if (m_status == EMPTY)
|
||||||
|
{
|
||||||
|
write_opening_bracket();
|
||||||
|
}
|
||||||
|
|
||||||
|
write_closing_bracket();
|
||||||
|
|
||||||
|
m_status = CLOSED;
|
||||||
|
m_stream->flush();
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class object_writer;
|
||||||
|
class array_writer;
|
||||||
|
|
||||||
|
class object_writer : public writer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit object_writer(std::ostream& stream, const writer_configuration& configuration = writer_configuration()) :
|
||||||
|
writer(stream, false, configuration)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename V>
|
||||||
|
void write(const char* field_name, const V& value)
|
||||||
|
{
|
||||||
|
write_helper(field_name, value, default_value_writer<V>());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename V, typename ValueWriter>
|
||||||
|
void write(const char* field_name, const V& value, const ValueWriter& value_writer)
|
||||||
|
{
|
||||||
|
write_helper(field_name, value, value_writer);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename InputIt>
|
||||||
|
void write_array(const char* field_name, InputIt begin, InputIt end)
|
||||||
|
{
|
||||||
|
write_array(field_name, begin, end, default_value_writer<typename detail::get_value_type<InputIt>::type>());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename InputIt, typename ValueWriter>
|
||||||
|
void write_array(const char* field_name, InputIt begin, InputIt end, ValueWriter value_writer)
|
||||||
|
{
|
||||||
|
write(field_name, detail::make_range(begin, end), detail::range_writer<InputIt, ValueWriter>(value_writer));
|
||||||
|
}
|
||||||
|
|
||||||
|
object_writer nested_object(const char* field_name);
|
||||||
|
|
||||||
|
array_writer nested_array(const char* field_name);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class array_writer : public writer
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
explicit array_writer(std::ostream& stream, const writer_configuration& configuration = writer_configuration()) :
|
||||||
|
writer(stream, true, configuration)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename V>
|
||||||
|
void write(const V& value)
|
||||||
|
{
|
||||||
|
write_helper(NULL, value, default_value_writer<V>());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename V, typename ValueWriter>
|
||||||
|
void write(const V& value, const ValueWriter& value_writer)
|
||||||
|
{
|
||||||
|
write_helper(NULL, value, value_writer);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename InputIt>
|
||||||
|
void write_array(InputIt begin, InputIt end)
|
||||||
|
{
|
||||||
|
write_array(begin, end, default_value_writer<typename detail::get_value_type<InputIt>::type>());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename InputIt, typename ValueWriter>
|
||||||
|
void write_array(InputIt begin, InputIt end, ValueWriter value_writer)
|
||||||
|
{
|
||||||
|
write(detail::make_range(begin, end), detail::range_writer<InputIt, ValueWriter>(value_writer));
|
||||||
|
}
|
||||||
|
|
||||||
|
object_writer nested_object();
|
||||||
|
|
||||||
|
array_writer nested_array();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
inline object_writer object_writer::nested_object(const char* field_name)
|
||||||
|
{
|
||||||
|
detail::adjust_stream_settings(stream());
|
||||||
|
|
||||||
|
next_field();
|
||||||
|
write_field_name(field_name);
|
||||||
|
|
||||||
|
return object_writer(stream(), configuration().increase_nesting_level());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline array_writer object_writer::nested_array(const char* field_name)
|
||||||
|
{
|
||||||
|
detail::adjust_stream_settings(stream());
|
||||||
|
|
||||||
|
next_field();
|
||||||
|
write_field_name(field_name);
|
||||||
|
|
||||||
|
return array_writer(stream(), configuration().increase_nesting_level());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline object_writer array_writer::nested_object()
|
||||||
|
{
|
||||||
|
detail::adjust_stream_settings(stream());
|
||||||
|
|
||||||
|
next_field();
|
||||||
|
|
||||||
|
return object_writer(stream(), configuration().increase_nesting_level());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline array_writer array_writer::nested_array()
|
||||||
|
{
|
||||||
|
detail::adjust_stream_settings(stream());
|
||||||
|
|
||||||
|
next_field();
|
||||||
|
|
||||||
|
return array_writer(stream(), configuration().increase_nesting_level());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct default_value_writer<null_t>
|
||||||
|
{
|
||||||
|
void operator()(std::ostream& stream, null_t) const
|
||||||
|
{
|
||||||
|
stream << "null";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#if MJW_CPP11_SUPPORTED
|
||||||
|
template<>
|
||||||
|
struct default_value_writer<std::nullptr_t>
|
||||||
|
{
|
||||||
|
void operator()(std::ostream& stream, std::nullptr_t) const
|
||||||
|
{
|
||||||
|
default_value_writer<null_t>()(stream, null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template<typename IntegralType>
|
||||||
|
struct default_value_writer<
|
||||||
|
IntegralType,
|
||||||
|
typename detail::enable_if<MJW_LIB_NS::is_integral<IntegralType>::value && !MJW_LIB_NS::is_same<IntegralType, bool>::value>::type>
|
||||||
|
{
|
||||||
|
void operator()(std::ostream& stream, IntegralType value) const
|
||||||
|
{
|
||||||
|
// the unary plus is used here to force chars to be printed as integers
|
||||||
|
stream << +value;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct default_value_writer<bool>
|
||||||
|
{
|
||||||
|
void operator()(std::ostream& stream, bool value) const
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
stream << "true";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stream << "false";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename FloatingPoint>
|
||||||
|
struct default_value_writer<
|
||||||
|
FloatingPoint,
|
||||||
|
typename detail::enable_if<MJW_LIB_NS::is_floating_point<FloatingPoint>::value>::type>
|
||||||
|
{
|
||||||
|
void operator()(std::ostream& stream, FloatingPoint value) const
|
||||||
|
{
|
||||||
|
// Numeric values that cannot be represented as sequences of digits
|
||||||
|
// (such as Infinity and NaN) are not permitted in JSON
|
||||||
|
if (!MJW_ISFINITE(value))
|
||||||
|
{
|
||||||
|
default_value_writer<null_t>()(stream, null); // falling back to null
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
stream << value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct default_value_writer<char*>
|
||||||
|
{
|
||||||
|
void operator()(std::ostream& stream, const char* str) const
|
||||||
|
{
|
||||||
|
detail::write_quoted_string(stream, str);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct default_value_writer<const char*> : public default_value_writer<char*>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<size_t N>
|
||||||
|
struct default_value_writer<char[N]> : public default_value_writer<char*>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<size_t N>
|
||||||
|
struct default_value_writer<const char[N]> : public default_value_writer<char*>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct default_value_writer<std::string>
|
||||||
|
{
|
||||||
|
void operator()(std::ostream& stream, const std::string& str) const
|
||||||
|
{
|
||||||
|
default_value_writer<char*>()(stream, str.c_str());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename InputIt>
|
||||||
|
void write_array(
|
||||||
|
std::ostream& stream,
|
||||||
|
InputIt begin, InputIt end,
|
||||||
|
const writer_configuration& configuration)
|
||||||
|
{
|
||||||
|
write_array(stream, begin, end, default_value_writer<typename detail::get_value_type<InputIt>::type>(), configuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename InputIt, typename ValueWriter>
|
||||||
|
void write_array(
|
||||||
|
std::ostream& stream,
|
||||||
|
InputIt begin, InputIt end,
|
||||||
|
const ValueWriter& value_writer,
|
||||||
|
const writer_configuration& configuration)
|
||||||
|
{
|
||||||
|
array_writer writer(stream, configuration);
|
||||||
|
|
||||||
|
for (InputIt it = begin; it != end; ++it)
|
||||||
|
{
|
||||||
|
writer.write(*it, value_writer);
|
||||||
|
}
|
||||||
|
|
||||||
|
writer.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace minijson
|
||||||
|
|
||||||
|
#endif // MINIJSON_WRITER_H
|
||||||
Binary file not shown.
Binary file not shown.
BIN
openssl/1.1/macos/libcrypto.a
Normal file
BIN
openssl/1.1/macos/libcrypto.a
Normal file
Binary file not shown.
BIN
openssl/1.1/macos/libssl.a
Normal file
BIN
openssl/1.1/macos/libssl.a
Normal file
Binary file not shown.
BIN
opus/android/arm64-v8a/libopus.a
Normal file
BIN
opus/android/arm64-v8a/libopus.a
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
opus/android/x86_64/libopus.a
Normal file
BIN
opus/android/x86_64/libopus.a
Normal file
Binary file not shown.
@@ -103,7 +103,7 @@ extern "C" {
|
|||||||
* @endcode
|
* @endcode
|
||||||
*
|
*
|
||||||
* where opus_encoder_get_size() returns the required size for the encoder state. Note that
|
* where opus_encoder_get_size() returns the required size for the encoder state. Note that
|
||||||
* future versions of this code may change the size, so no assuptions should be made about it.
|
* future versions of this code may change the size, so no assumptions should be made about it.
|
||||||
*
|
*
|
||||||
* The encoder state is always continuous in memory and only a shallow copy is sufficient
|
* The encoder state is always continuous in memory and only a shallow copy is sufficient
|
||||||
* to copy it (e.g. memcpy())
|
* to copy it (e.g. memcpy())
|
||||||
@@ -198,7 +198,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_encoder_get_size(int channels);
|
|||||||
* This must be one of 8000, 12000, 16000,
|
* This must be one of 8000, 12000, 16000,
|
||||||
* 24000, or 48000.
|
* 24000, or 48000.
|
||||||
* @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal
|
* @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal
|
||||||
* @param [in] application <tt>int</tt>: Coding mode (@ref OPUS_APPLICATION_VOIP/@ref OPUS_APPLICATION_AUDIO/@ref OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
* @param [in] application <tt>int</tt>: Coding mode (one of @ref OPUS_APPLICATION_VOIP, @ref OPUS_APPLICATION_AUDIO, or @ref OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
||||||
* @param [out] error <tt>int*</tt>: @ref opus_errorcodes
|
* @param [out] error <tt>int*</tt>: @ref opus_errorcodes
|
||||||
* @note Regardless of the sampling rate and number channels selected, the Opus encoder
|
* @note Regardless of the sampling rate and number channels selected, the Opus encoder
|
||||||
* can switch to a lower audio bandwidth or number of channels if the bitrate
|
* can switch to a lower audio bandwidth or number of channels if the bitrate
|
||||||
@@ -222,7 +222,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusEncoder *opus_encoder_create(
|
|||||||
* This must be one of 8000, 12000, 16000,
|
* This must be one of 8000, 12000, 16000,
|
||||||
* 24000, or 48000.
|
* 24000, or 48000.
|
||||||
* @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal
|
* @param [in] channels <tt>int</tt>: Number of channels (1 or 2) in input signal
|
||||||
* @param [in] application <tt>int</tt>: Coding mode (OPUS_APPLICATION_VOIP/OPUS_APPLICATION_AUDIO/OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
* @param [in] application <tt>int</tt>: Coding mode (one of OPUS_APPLICATION_VOIP, OPUS_APPLICATION_AUDIO, or OPUS_APPLICATION_RESTRICTED_LOWDELAY)
|
||||||
* @retval #OPUS_OK Success or @ref opus_errorcodes
|
* @retval #OPUS_OK Success or @ref opus_errorcodes
|
||||||
*/
|
*/
|
||||||
OPUS_EXPORT int opus_encoder_init(
|
OPUS_EXPORT int opus_encoder_init(
|
||||||
@@ -357,7 +357,7 @@ OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NON
|
|||||||
* error = opus_decoder_init(dec, Fs, channels);
|
* error = opus_decoder_init(dec, Fs, channels);
|
||||||
* @endcode
|
* @endcode
|
||||||
* where opus_decoder_get_size() returns the required size for the decoder state. Note that
|
* where opus_decoder_get_size() returns the required size for the decoder state. Note that
|
||||||
* future versions of this code may change the size, so no assuptions should be made about it.
|
* future versions of this code may change the size, so no assumptions should be made about it.
|
||||||
*
|
*
|
||||||
* The decoder state is always continuous in memory and only a shallow copy is sufficient
|
* The decoder state is always continuous in memory and only a shallow copy is sufficient
|
||||||
* to copy it (e.g. memcpy())
|
* to copy it (e.g. memcpy())
|
||||||
@@ -398,6 +398,21 @@ OPUS_EXPORT int opus_encoder_ctl(OpusEncoder *st, int request, ...) OPUS_ARG_NON
|
|||||||
*/
|
*/
|
||||||
typedef struct OpusDecoder OpusDecoder;
|
typedef struct OpusDecoder OpusDecoder;
|
||||||
|
|
||||||
|
/** Opus DRED decoder.
|
||||||
|
* This contains the complete state of an Opus DRED decoder.
|
||||||
|
* It is position independent and can be freely copied.
|
||||||
|
* @see opus_dred_decoder_create,opus_dred_decoder_init
|
||||||
|
*/
|
||||||
|
typedef struct OpusDREDDecoder OpusDREDDecoder;
|
||||||
|
|
||||||
|
|
||||||
|
/** Opus DRED state.
|
||||||
|
* This contains the complete state of an Opus DRED packet.
|
||||||
|
* It is position independent and can be freely copied.
|
||||||
|
* @see opus_dred_create,opus_dred_init
|
||||||
|
*/
|
||||||
|
typedef struct OpusDRED OpusDRED;
|
||||||
|
|
||||||
/** Gets the size of an <code>OpusDecoder</code> structure.
|
/** Gets the size of an <code>OpusDecoder</code> structure.
|
||||||
* @param [in] channels <tt>int</tt>: Number of channels.
|
* @param [in] channels <tt>int</tt>: Number of channels.
|
||||||
* This must be 1 or 2.
|
* This must be 1 or 2.
|
||||||
@@ -511,6 +526,101 @@ OPUS_EXPORT int opus_decoder_ctl(OpusDecoder *st, int request, ...) OPUS_ARG_NON
|
|||||||
*/
|
*/
|
||||||
OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st);
|
OPUS_EXPORT void opus_decoder_destroy(OpusDecoder *st);
|
||||||
|
|
||||||
|
/** Gets the size of an <code>OpusDREDDecoder</code> structure.
|
||||||
|
* @returns The size in bytes.
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_dred_decoder_get_size(void);
|
||||||
|
|
||||||
|
/** Allocates and initializes an OpusDREDDecoder state.
|
||||||
|
* @param [out] error <tt>int*</tt>: #OPUS_OK Success or @ref opus_errorcodes
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT OpusDREDDecoder *opus_dred_decoder_create(int *error);
|
||||||
|
|
||||||
|
/** Initializes an <code>OpusDREDDecoder</code> state.
|
||||||
|
* @param[in] dec <tt>OpusDREDDecoder*</tt>: State to be initialized.
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_dred_decoder_init(OpusDREDDecoder *dec);
|
||||||
|
|
||||||
|
/** Frees an <code>OpusDREDDecoder</code> allocated by opus_dred_decoder_create().
|
||||||
|
* @param[in] dec <tt>OpusDREDDecoder*</tt>: State to be freed.
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT void opus_dred_decoder_destroy(OpusDREDDecoder *dec);
|
||||||
|
|
||||||
|
/** Perform a CTL function on an Opus DRED decoder.
|
||||||
|
*
|
||||||
|
* Generally the request and subsequent arguments are generated
|
||||||
|
* by a convenience macro.
|
||||||
|
* @param dred_dec <tt>OpusDREDDecoder*</tt>: DRED Decoder state.
|
||||||
|
* @param request This and all remaining parameters should be replaced by one
|
||||||
|
* of the convenience macros in @ref opus_genericctls or
|
||||||
|
* @ref opus_decoderctls.
|
||||||
|
* @see opus_genericctls
|
||||||
|
* @see opus_decoderctls
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_dred_decoder_ctl(OpusDREDDecoder *dred_dec, int request, ...);
|
||||||
|
|
||||||
|
/** Gets the size of an <code>OpusDRED</code> structure.
|
||||||
|
* @returns The size in bytes.
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_dred_get_size(void);
|
||||||
|
|
||||||
|
/** Allocates and initializes a DRED state.
|
||||||
|
* @param [out] error <tt>int*</tt>: #OPUS_OK Success or @ref opus_errorcodes
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT OpusDRED *opus_dred_alloc(int *error);
|
||||||
|
|
||||||
|
/** Frees an <code>OpusDRED</code> allocated by opus_dred_create().
|
||||||
|
* @param[in] dec <tt>OpusDRED*</tt>: State to be freed.
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT void opus_dred_free(OpusDRED *dec);
|
||||||
|
|
||||||
|
/** Decode an Opus DRED packet.
|
||||||
|
* @param [in] dred_dec <tt>OpusDRED*</tt>: DRED Decoder state
|
||||||
|
* @param [in] dred <tt>OpusDRED*</tt>: DRED state
|
||||||
|
* @param [in] data <tt>char*</tt>: Input payload
|
||||||
|
* @param [in] len <tt>opus_int32</tt>: Number of bytes in payload
|
||||||
|
* @param [in] max_dred_samples <tt>opus_int32</tt>: Maximum number of DRED samples that may be needed (if available in the packet).
|
||||||
|
* @param [in] sampling_rate <tt>opus_int32</tt>: Sampling rate used for max_dred_samples argument. Needs not match the actual sampling rate of the decoder.
|
||||||
|
* @param [out] dred_end <tt>opus_int32*</tt>: Number of non-encoded (silence) samples between the DRED timestamp and the last DRED sample.
|
||||||
|
* @param [in] defer_processing <tt>int</tt>: Flag (0 or 1). If set to one, the CPU-intensive part of the DRED decoding is deferred until opus_dred_process() is called.
|
||||||
|
* @returns Offset (positive) of the first decoded DRED samples, zero if no DRED is present, or @ref opus_errorcodes
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_dred_parse(OpusDREDDecoder *dred_dec, OpusDRED *dred, const unsigned char *data, opus_int32 len, opus_int32 max_dred_samples, opus_int32 sampling_rate, int *dred_end, int defer_processing) OPUS_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/** Finish decoding an Opus DRED packet. The function only needs to be called if opus_dred_parse() was called with defer_processing=1.
|
||||||
|
* The source and destination will often be the same DRED state.
|
||||||
|
* @param [in] dred_dec <tt>OpusDRED*</tt>: DRED Decoder state
|
||||||
|
* @param [in] src <tt>OpusDRED*</tt>: Source DRED state to start the processing from.
|
||||||
|
* @param [out] dst <tt>OpusDRED*</tt>: Destination DRED state to store the updated state after processing.
|
||||||
|
* @returns @ref opus_errorcodes
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_dred_process(OpusDREDDecoder *dred_dec, const OpusDRED *src, OpusDRED *dst);
|
||||||
|
|
||||||
|
/** Decode audio from an Opus DRED packet with floating point output.
|
||||||
|
* @param [in] st <tt>OpusDecoder*</tt>: Decoder state
|
||||||
|
* @param [in] dred <tt>OpusDRED*</tt>: DRED state
|
||||||
|
* @param [in] dred_offset <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).
|
||||||
|
* @param [out] pcm <tt>opus_int16*</tt>: Output signal (interleaved if 2 channels). length
|
||||||
|
* is frame_size*channels*sizeof(opus_int16)
|
||||||
|
* @param [in] frame_size Number of samples per channel to decode in \a pcm.
|
||||||
|
* frame_size <b>must</b> be a multiple of 2.5 ms.
|
||||||
|
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_decoder_dred_decode(OpusDecoder *st, const OpusDRED *dred, opus_int32 dred_offset, opus_int16 *pcm, opus_int32 frame_size);
|
||||||
|
|
||||||
|
/** Decode audio from an Opus DRED packet with floating point output.
|
||||||
|
* @param [in] st <tt>OpusDecoder*</tt>: Decoder state
|
||||||
|
* @param [in] dred <tt>OpusDRED*</tt>: DRED state
|
||||||
|
* @param [in] dred_offset <tt>opus_int32</tt>: position of the redundancy to decode (in samples before the beginning of the real audio data in the packet).
|
||||||
|
* @param [out] pcm <tt>float*</tt>: Output signal (interleaved if 2 channels). length
|
||||||
|
* is frame_size*channels*sizeof(float)
|
||||||
|
* @param [in] frame_size Number of samples per channel to decode in \a pcm.
|
||||||
|
* frame_size <b>must</b> be a multiple of 2.5 ms.
|
||||||
|
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT int opus_decoder_dred_decode_float(OpusDecoder *st, const OpusDRED *dred, opus_int32 dred_offset, float *pcm, opus_int32 frame_size);
|
||||||
|
|
||||||
|
|
||||||
/** Parse an opus packet into one or more frames.
|
/** Parse an opus packet into one or more frames.
|
||||||
* Opus_decode will perform this operation internally so most applications do
|
* Opus_decode will perform this operation internally so most applications do
|
||||||
* not need to use this function.
|
* not need to use this function.
|
||||||
@@ -583,6 +693,14 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_frames(const unsigned
|
|||||||
*/
|
*/
|
||||||
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1);
|
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_get_nb_samples(const unsigned char packet[], opus_int32 len, opus_int32 Fs) OPUS_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/** Checks whether an Opus packet has LBRR.
|
||||||
|
* @param [in] packet <tt>char*</tt>: Opus packet
|
||||||
|
* @param [in] len <tt>opus_int32</tt>: Length of packet
|
||||||
|
* @returns 1 is LBRR is present, 0 otherwise
|
||||||
|
* @retval OPUS_INVALID_PACKET The compressed data passed is corrupted or of an unsupported type
|
||||||
|
*/
|
||||||
|
OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_packet_has_lbrr(const unsigned char packet[], opus_int32 len);
|
||||||
|
|
||||||
/** Gets the number of samples of an Opus packet.
|
/** Gets the number of samples of an Opus packet.
|
||||||
* @param [in] dec <tt>OpusDecoder*</tt>: Decoder state
|
* @param [in] dec <tt>OpusDecoder*</tt>: Decoder state
|
||||||
* @param [in] packet <tt>char*</tt>: Opus packet
|
* @param [in] packet <tt>char*</tt>: Opus packet
|
||||||
|
|||||||
@@ -104,7 +104,8 @@ typedef struct OpusCustomDecoder OpusCustomDecoder;
|
|||||||
/** The mode contains all the information necessary to create an
|
/** The mode contains all the information necessary to create an
|
||||||
encoder. Both the encoder and decoder need to be initialized
|
encoder. Both the encoder and decoder need to be initialized
|
||||||
with exactly the same mode, otherwise the output will be
|
with exactly the same mode, otherwise the output will be
|
||||||
corrupted.
|
corrupted. The mode MUST NOT BE DESTROYED until the encoders and
|
||||||
|
decoders that use it are destroyed as well.
|
||||||
@brief Mode configuration
|
@brief Mode configuration
|
||||||
*/
|
*/
|
||||||
typedef struct OpusCustomMode OpusCustomMode;
|
typedef struct OpusCustomMode OpusCustomMode;
|
||||||
@@ -178,7 +179,7 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encode
|
|||||||
) OPUS_ARG_NONNULL(1);
|
) OPUS_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
|
||||||
/** Destroys a an encoder state.
|
/** Destroys an encoder state.
|
||||||
* @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed.
|
* @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed.
|
||||||
*/
|
*/
|
||||||
OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(OpusCustomEncoder *st);
|
OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(OpusCustomEncoder *st);
|
||||||
@@ -286,7 +287,7 @@ OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *opus_custom_decode
|
|||||||
int *error
|
int *error
|
||||||
) OPUS_ARG_NONNULL(1);
|
) OPUS_ARG_NONNULL(1);
|
||||||
|
|
||||||
/** Destroys a an decoder state.
|
/** Destroys a decoder state.
|
||||||
* @param[in] st <tt>OpusCustomDecoder*</tt>: State to be freed.
|
* @param[in] st <tt>OpusCustomDecoder*</tt>: State to be freed.
|
||||||
*/
|
*/
|
||||||
OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(OpusCustomDecoder *st);
|
OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(OpusCustomDecoder *st);
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ extern "C" {
|
|||||||
/**Export control for opus functions */
|
/**Export control for opus functions */
|
||||||
|
|
||||||
#ifndef OPUS_EXPORT
|
#ifndef OPUS_EXPORT
|
||||||
# if defined(WIN32)
|
# if defined(_WIN32)
|
||||||
# if defined(OPUS_BUILD) && defined(DLL_EXPORT)
|
# if defined(OPUS_BUILD) && defined(DLL_EXPORT)
|
||||||
# define OPUS_EXPORT __declspec(dllexport)
|
# define OPUS_EXPORT __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
@@ -168,15 +168,33 @@ extern "C" {
|
|||||||
/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */
|
/* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */
|
||||||
#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046
|
#define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046
|
||||||
#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047
|
#define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047
|
||||||
|
#define OPUS_GET_IN_DTX_REQUEST 4049
|
||||||
|
#define OPUS_SET_DRED_DURATION_REQUEST 4050
|
||||||
|
#define OPUS_GET_DRED_DURATION_REQUEST 4051
|
||||||
|
#define OPUS_SET_DNN_BLOB_REQUEST 4052
|
||||||
|
/*#define OPUS_GET_DNN_BLOB_REQUEST 4053 */
|
||||||
|
|
||||||
/** Defines for the presence of extended APIs. */
|
/** Defines for the presence of extended APIs. */
|
||||||
#define OPUS_HAVE_OPUS_PROJECTION_H
|
#define OPUS_HAVE_OPUS_PROJECTION_H
|
||||||
|
|
||||||
/* Macros to trigger compilation errors when the wrong types are provided to a CTL */
|
/* Macros to trigger compilation errors when the wrong types are provided to a CTL */
|
||||||
#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x))
|
#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x))
|
||||||
|
|
||||||
|
#ifdef DISABLE_PTR_CHECK
|
||||||
|
/* Disable checks to prevent ubsan from complaining about NULL checks
|
||||||
|
in test_opus_api. */
|
||||||
|
#define __opus_check_int_ptr(ptr) (ptr)
|
||||||
|
#define __opus_check_uint_ptr(ptr) (ptr)
|
||||||
|
#define __opus_check_uint8_ptr(ptr) (ptr)
|
||||||
|
#define __opus_check_val16_ptr(ptr) (ptr)
|
||||||
|
#define __opus_check_void_ptr(ptr) (ptr)
|
||||||
|
#else
|
||||||
#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr)))
|
#define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr)))
|
||||||
#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr)))
|
#define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr)))
|
||||||
|
#define __opus_check_uint8_ptr(ptr) ((ptr) + ((ptr) - (opus_uint8*)(ptr)))
|
||||||
#define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr)))
|
#define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr)))
|
||||||
|
#define __opus_check_void_ptr(x) ((void)((void *)0 == (x)), (x))
|
||||||
|
#endif
|
||||||
/** @endcond */
|
/** @endcond */
|
||||||
|
|
||||||
/** @defgroup opus_ctlvalues Pre-defined values for CTL interface
|
/** @defgroup opus_ctlvalues Pre-defined values for CTL interface
|
||||||
@@ -481,7 +499,8 @@ extern "C" {
|
|||||||
* @param[in] x <tt>opus_int32</tt>: Allowed values:
|
* @param[in] x <tt>opus_int32</tt>: Allowed values:
|
||||||
* <dl>
|
* <dl>
|
||||||
* <dt>0</dt><dd>Disable inband FEC (default).</dd>
|
* <dt>0</dt><dd>Disable inband FEC (default).</dd>
|
||||||
* <dt>1</dt><dd>Enable inband FEC.</dd>
|
* <dt>1</dt><dd>Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.</dd>
|
||||||
|
* <dt>2</dt><dd>Inband FEC enabled, but does not necessarily switch to SILK if we have music.</dd>
|
||||||
* </dl>
|
* </dl>
|
||||||
* @hideinitializer */
|
* @hideinitializer */
|
||||||
#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x)
|
#define OPUS_SET_INBAND_FEC(x) OPUS_SET_INBAND_FEC_REQUEST, __opus_check_int(x)
|
||||||
@@ -490,7 +509,8 @@ extern "C" {
|
|||||||
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
|
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
|
||||||
* <dl>
|
* <dl>
|
||||||
* <dt>0</dt><dd>Inband FEC disabled (default).</dd>
|
* <dt>0</dt><dd>Inband FEC disabled (default).</dd>
|
||||||
* <dt>1</dt><dd>Inband FEC enabled.</dd>
|
* <dt>1</dt><dd>Inband FEC enabled. If the packet loss rate is sufficiently high, Opus will automatically switch to SILK even at high rates to enable use of that FEC.</dd>
|
||||||
|
* <dt>2</dt><dd>Inband FEC enabled, but does not necessarily switch to SILK if we have music.</dd>
|
||||||
* </dl>
|
* </dl>
|
||||||
* @hideinitializer */
|
* @hideinitializer */
|
||||||
#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x)
|
#define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x)
|
||||||
@@ -617,6 +637,18 @@ extern "C" {
|
|||||||
* @hideinitializer */
|
* @hideinitializer */
|
||||||
#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x)
|
#define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x)
|
||||||
|
|
||||||
|
/** If non-zero, enables Deep Redundancy (DRED) and use the specified maximum number of 10-ms redundant frames
|
||||||
|
* @hideinitializer */
|
||||||
|
#define OPUS_SET_DRED_DURATION(x) OPUS_SET_DRED_DURATION_REQUEST, __opus_check_int(x)
|
||||||
|
/** Gets the encoder's configured Deep Redundancy (DRED) maximum number of frames.
|
||||||
|
* @hideinitializer */
|
||||||
|
#define OPUS_GET_DRED_DURATION(x) OPUS_GET_DRED_DURATION_REQUEST, __opus_check_int_ptr(x)
|
||||||
|
|
||||||
|
/** Provide external DNN weights from binary object (only when explicitly built without the weights)
|
||||||
|
* @hideinitializer */
|
||||||
|
#define OPUS_SET_DNN_BLOB(data, len) OPUS_SET_DNN_BLOB_REQUEST, __opus_check_void_ptr(data), __opus_check_int(len)
|
||||||
|
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
/** @defgroup opus_genericctls Generic CTLs
|
/** @defgroup opus_genericctls Generic CTLs
|
||||||
@@ -715,6 +747,16 @@ extern "C" {
|
|||||||
* </dl>
|
* </dl>
|
||||||
* @hideinitializer */
|
* @hideinitializer */
|
||||||
#define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x)
|
#define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x)
|
||||||
|
/** Gets the DTX state of the encoder.
|
||||||
|
* Returns whether the last encoded frame was either a comfort noise update
|
||||||
|
* during DTX or not encoded because of DTX.
|
||||||
|
* @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values:
|
||||||
|
* <dl>
|
||||||
|
* <dt>0</dt><dd>The encoder is not in DTX.</dd>
|
||||||
|
* <dt>1</dt><dd>The encoder is in DTX.</dd>
|
||||||
|
* </dl>
|
||||||
|
* @hideinitializer */
|
||||||
|
#define OPUS_GET_IN_DTX(x) OPUS_GET_IN_DTX_REQUEST, __opus_check_int_ptr(x)
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ extern "C" {
|
|||||||
* <a href="https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810004.3.9">Vorbis
|
* <a href="https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810004.3.9">Vorbis
|
||||||
* channel ordering</a>. A decoder may wish to apply an additional permutation
|
* channel ordering</a>. A decoder may wish to apply an additional permutation
|
||||||
* to the mapping the encoder used to achieve a different output channel
|
* to the mapping the encoder used to achieve a different output channel
|
||||||
* order (e.g. for outputing in WAV order).
|
* order (e.g. for outputting in WAV order).
|
||||||
*
|
*
|
||||||
* Each multistream packet contains an Opus packet for each stream, and all of
|
* Each multistream packet contains an Opus packet for each stream, and all of
|
||||||
* the Opus packets in a single multistream packet must have the same
|
* the Opus packets in a single multistream packet must have the same
|
||||||
|
|||||||
@@ -33,14 +33,29 @@
|
|||||||
#ifndef OPUS_TYPES_H
|
#ifndef OPUS_TYPES_H
|
||||||
#define OPUS_TYPES_H
|
#define OPUS_TYPES_H
|
||||||
|
|
||||||
/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
|
#define opus_int int /* used for counters etc; at least 16 bits */
|
||||||
#if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
|
#define opus_int64 long long
|
||||||
#include <stdint.h>
|
#define opus_int8 signed char
|
||||||
|
|
||||||
|
#define opus_uint unsigned int /* used for counters etc; at least 16 bits */
|
||||||
|
#define opus_uint64 unsigned long long
|
||||||
|
#define opus_uint8 unsigned char
|
||||||
|
|
||||||
|
/* Use the real stdint.h if it's there (taken from Paul Hsieh's pstdint.h) */
|
||||||
|
#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || (defined(__GNUC__) && (defined(_STDINT_H) || defined(_STDINT_H_)) || defined (HAVE_STDINT_H))
|
||||||
|
#include <stdint.h>
|
||||||
|
# undef opus_int64
|
||||||
|
# undef opus_int8
|
||||||
|
# undef opus_uint64
|
||||||
|
# undef opus_uint8
|
||||||
|
typedef int8_t opus_int8;
|
||||||
|
typedef uint8_t opus_uint8;
|
||||||
typedef int16_t opus_int16;
|
typedef int16_t opus_int16;
|
||||||
typedef uint16_t opus_uint16;
|
typedef uint16_t opus_uint16;
|
||||||
typedef int32_t opus_int32;
|
typedef int32_t opus_int32;
|
||||||
typedef uint32_t opus_uint32;
|
typedef uint32_t opus_uint32;
|
||||||
|
typedef int64_t opus_int64;
|
||||||
|
typedef uint64_t opus_uint64;
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
|
|
||||||
# if defined(__CYGWIN__)
|
# if defined(__CYGWIN__)
|
||||||
@@ -148,12 +163,4 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define opus_int int /* used for counters etc; at least 16 bits */
|
|
||||||
#define opus_int64 long long
|
|
||||||
#define opus_int8 signed char
|
|
||||||
|
|
||||||
#define opus_uint unsigned int /* used for counters etc; at least 16 bits */
|
|
||||||
#define opus_uint64 unsigned long long
|
|
||||||
#define opus_uint8 unsigned char
|
|
||||||
|
|
||||||
#endif /* OPUS_TYPES_H */
|
#endif /* OPUS_TYPES_H */
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,8 +1,10 @@
|
|||||||
if (CMAKE_SYSTEM MATCHES "Linux*")
|
if (CMAKE_SYSTEM MATCHES "Linux*")
|
||||||
# Linux Specific flags
|
# Linux Specific flags
|
||||||
set (OPENSSL_SSL ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/lin64/libssl.a)
|
#set (OPENSSL_SSL ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/lin64/libssl.a)
|
||||||
set (OPENSSL_CRYPTO ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/lin64/libcrypto.a)
|
#set (OPENSSL_CRYPTO ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/lin64/libcrypto.a)
|
||||||
set (OPENSSL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/include)
|
#set (OPENSSL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/include)
|
||||||
|
set (OPENSSL_SSL ssl)
|
||||||
|
set (OPENSSL_CRYPTO crypto)
|
||||||
|
|
||||||
# opencore-amr libraries
|
# opencore-amr libraries
|
||||||
set (OPENCORE_AMRNB ${CMAKE_CURRENT_LIST_DIR}/opencore-amr/linux/libopencore-amrnb.a)
|
set (OPENCORE_AMRNB ${CMAKE_CURRENT_LIST_DIR}/opencore-amr/linux/libopencore-amrnb.a)
|
||||||
@@ -37,10 +39,12 @@ if (CMAKE_SYSTEM MATCHES "Linux*")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ANDROID_ABI)
|
if (ANDROID_ABI)
|
||||||
# Linux Specific flags
|
# Android Specific flags
|
||||||
set (OPENSSL_SSL ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/android/${ANDROID_ABI}/libssl.a)
|
set (OPENSSL_SSL ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/android/${ANDROID_ABI}/libssl.a)
|
||||||
set (OPENSSL_CRYPTO ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/android/${ANDROID_ABI}/libcrypto.a)
|
set (OPENSSL_CRYPTO ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/android/${ANDROID_ABI}/libcrypto.a)
|
||||||
set (OPENSSL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/include)
|
set (OPENSSL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/include)
|
||||||
|
set (OPUS_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/opus/include)
|
||||||
|
set (OPUS_LIB ${CMAKE_CURRENT_LIST_DIR}/opus/android/${ANDROID_ABI}/libopus.a)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_SYSTEM MATCHES "Windows*")
|
if (CMAKE_SYSTEM MATCHES "Windows*")
|
||||||
@@ -70,7 +74,9 @@ if (CMAKE_SYSTEM MATCHES "Windows*")
|
|||||||
|
|
||||||
# set (PCAPPP_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/pcappp/include)
|
# set (PCAPPP_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/pcappp/include)
|
||||||
|
|
||||||
#if (CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
|
set (PCAPPP_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/pcappp/include)
|
||||||
|
|
||||||
|
# if (CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
|
||||||
# set (PCAPPP_LIBS ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Release/Pcap++.lib
|
# set (PCAPPP_LIBS ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Release/Pcap++.lib
|
||||||
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Release/Packet++.lib
|
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Release/Packet++.lib
|
||||||
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Release/Packet.lib
|
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Release/Packet.lib
|
||||||
@@ -85,13 +91,17 @@ if (CMAKE_SYSTEM MATCHES "Windows*")
|
|||||||
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Debug/wpcap.lib
|
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Debug/wpcap.lib
|
||||||
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Debug/pthreadVC3d.lib)
|
# ${CMAKE_CURRENT_LIST_DIR}/pcappp/lib/win/x64/Debug/pthreadVC3d.lib)
|
||||||
#endif()
|
#endif()
|
||||||
|
|
||||||
|
# set (OPENSSL_SSL ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/win64/libssl.lib)
|
||||||
|
# set (OPENSSL_CRYPTO ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/win64/libcrypto.lib)
|
||||||
|
set (OPENSSL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (CMAKE_SYSTEM MATCHES "Darwin*")
|
if (CMAKE_SYSTEM MATCHES "Darwin*")
|
||||||
set (OPENSSL_SSL ${CMAKE_CURRENT_LIST_DIR}/openssl/1.0/osx/libssl.a)
|
set (OPENSSL_SSL ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/macos/libssl.a)
|
||||||
set (OPENSSL_CRYPTO ${CMAKE_CURRENT_LIST_DIR}/openssl/1.0/osx/libcrypto.a)
|
set (OPENSSL_CRYPTO ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/macos/libcrypto.a)
|
||||||
set (OPENSSL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/openssl/1.0/include)
|
set (OPENSSL_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/openssl/1.1/include)
|
||||||
|
|
||||||
set (SNDFILE_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/sndfile/include)
|
set (SNDFILE_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/sndfile/include)
|
||||||
set (SNDFILE_LIBS ${CMAKE_CURRENT_LIST_DIR}/sndfile/macos/libsndfile.a)
|
set (SNDFILE_LIBS ${CMAKE_CURRENT_LIST_DIR}/sndfile/macos/libsndfile.a)
|
||||||
|
|||||||
44298
ryml_all.hpp
Normal file
44298
ryml_all.hpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user