27 #ifndef NATIVE_PLAYER_SRC_COMMON_H_ 28 #define NATIVE_PLAYER_SRC_COMMON_H_ 34 #include "nacl_player/common.h" 40 #define LOG_STATS __LINE__, __func__, __FILE__ 41 #define LOG(msg, ...) Logger::Log(LOG_STATS, msg, ##__VA_ARGS__) 42 #define LOG_ERROR(msg, ...) Logger::Error(LOG_STATS, msg, ##__VA_ARGS__) 43 #define LOG_DEBUG(msg, ...) Logger::Debug(LOG_STATS, msg, ##__VA_ARGS__) 45 template <
typename T,
class... Args>
47 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
52 return std::unique_ptr<T>(ptr);
62 std::numeric_limits<Samsung::NaClPlayer::TimeTicks>::infinity();
64 inline std::string
ToHexString(uint32_t size,
const uint8_t* data) {
65 std::ostringstream oss;
66 oss.setf(std::ios::hex, std::ios::basefield);
67 for (
size_t i = 0; i < size; ++i) {
70 oss << static_cast<unsigned>(data[i]);
77 #endif // NATIVE_PLAYER_SRC_COMMON_H_
const Samsung::NaClPlayer::TimeTicks kEndOfStream
std::string ToHexString(uint32_t size, const uint8_t *data)
std::unique_ptr< T > AdoptUnique(T *ptr)
std::unique_ptr< T > MakeUnique(Args &&...args)