//----------------------------------------------------------------------------- // 説明: 代入演算子 // 引数: // src [in] 代入元 // 返り値: // 自身への参照 // その他: //----------------------------------------------------------------------------- CMotionData& CMotionData::operator =(const CMotionData &src) { if (!Initialize(src.NumFrames(), src.NumJoints())) return *this; ::memcpy(m_pPosition, src.m_pPosition, sizeof(Vector3f) * NumFrames()); ::memcpy(m_pRotation, src.m_pRotation, sizeof(Quaternionf) * NumFrames() * NumJoints()); return *this; }
//----------------------------------------------------------------------------- // 説明: コピーコンストラクタ // 引数: // src [in] コピー元 // 返り値: // その他: //----------------------------------------------------------------------------- CMotionData::CMotionData(const CMotionData &src) { m_nJoints = NULL; m_nFrames = NULL; m_nFrameTime = NULL; m_pPosition = NULL; m_pRotation = NULL; Initialize(src.NumFrames(), src.NumJoints()); ::memcpy(m_pPosition, src.m_pPosition, sizeof(Vector3f) * NumFrames()); ::memcpy(m_pRotation, src.m_pRotation, sizeof(Quaternionf) * NumFrames() * NumJoints()); }
double MediaStreamReaderImpl::Duration() const { MediaStreamInfo streamInfo = StreamInfo(); if ( streamInfo.IsVideo() ) return NumFrames() / streamInfo.VideoFPS(); if ( streamInfo.IsAudio() ) { if ( streamInfo.audio.FormatTag() == 1 /*WAVE_FORMAT_PCM*/ ) return TotalBytes() / streamInfo.audio.BlockAlign() / (double)streamInfo.audio.SamplesPerSec(); return TotalBytes() / (double)streamInfo.audio.AvgBytesPerSec(); } return 0; }
Backtrace::~Backtrace() { for (size_t i = 0; i < NumFrames(); i++) { if (backtrace_.frames[i].func_name) { free(backtrace_.frames[i].func_name); backtrace_.frames[i].func_name = NULL; } } if (map_info_ && map_info_requires_delete_) { backtrace_destroy_map_info_list(map_info_); map_info_ = NULL; } if (impl_) { delete impl_; impl_ = NULL; } }