2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 #include "FMedia_VideoStreamInfoImpl.h"
21 namespace Tizen { namespace Media
24 using namespace Tizen::Base;
26 _VideoStreamInfoImpl::_VideoStreamInfoImpl(CodecType codecType, int width, int height, int bitrate, float frameRate)
28 __codecType = codecType;
32 __frameRate = frameRate;
35 _VideoStreamInfoImpl::~_VideoStreamInfoImpl()
40 _VideoStreamInfoImpl::_VideoStreamInfoImpl(const _VideoStreamInfoImpl& rhs)
42 __codecType = rhs.__codecType;
43 __bitrate = rhs.__bitrate;
44 __width = rhs.__width;
45 __height = rhs.__height;
46 __frameRate = rhs.__frameRate;
50 _VideoStreamInfoImpl::operator =(const _VideoStreamInfoImpl& rhs)
52 // check for self-assignment
58 __codecType = rhs.__codecType;
59 __bitrate = rhs.__bitrate;
60 __width = rhs.__width;
61 __height = rhs.__height;
62 __frameRate = rhs.__frameRate;
68 _VideoStreamInfoImpl::Equals(const Object& info) const
70 const _VideoStreamInfoImpl* pVideoStreamInfoImpl = dynamic_cast <const _VideoStreamInfoImpl *> (&info);
71 if (!pVideoStreamInfoImpl)
75 return (((__codecType == pVideoStreamInfoImpl->__codecType) && (__width == pVideoStreamInfoImpl->__width)
76 && (__height == pVideoStreamInfoImpl->__height) && (__bitrate == pVideoStreamInfoImpl->__bitrate ) &&
77 (!Float::Compare(this->__frameRate, pVideoStreamInfoImpl->__frameRate))) ? true : false);
81 _VideoStreamInfoImpl::GetHashCode(void) const
83 int framerate = (int)__frameRate;
84 int codecType = (int)__codecType;
85 return ((framerate ^ codecType) + (__width * __height) + (__bitrate));
89 _VideoStreamInfoImpl::GetWidth() const
95 _VideoStreamInfoImpl::GetHeight() const
101 _VideoStreamInfoImpl::GetBitRate() const
107 _VideoStreamInfoImpl::GetCodecType() const
115 _VideoStreamInfoImpl::GetFrameRate() const