- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
PVideoData.cpp
资源名称:视频会议系统.rar [点击查看]
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:2k
源码类别:
IP电话/视频会议
开发平台:
Visual C++
- // PVideoData.cpp: implementation of the PVideoData class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "PVideoData.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- PVideoData::PVideoData()
- {
- this->Tag = PVideoDataTAG;
- this->user_id = 0;
- this->charement_id = 0;
- this->type = 0;
- this->size = 0;
- this->video = NULL;
- }
- PVideoData::~PVideoData()
- {
- }
- bool PVideoData::assembleData( int user_id , int charement_id , int type , char * buffer , int size )
- {
- this->buffer.Resize( 6 * INT_SIZE + size );
- char * now = this->buffer.GetBuffer( );
- *( int * )now = this->buffer.GetSize( ); now += INT_SIZE;
- *( int * )now = this->Tag; now += INT_SIZE;
- *( int * )now = user_id; now += INT_SIZE;
- *( int * )now = charement_id; now += INT_SIZE;
- *( int * )now = type; now += INT_SIZE;
- *( int * )now = size; now += INT_SIZE;
- if( size && buffer )
- memcpy( now , buffer , size );
- return true;
- }
- bool PVideoData::parseData( CBuffer & buffer )
- {
- if( ! buffer.GetSize( ) ) return false;
- char * now = buffer.GetBuffer( ) + 2 * INT_SIZE;
- this->user_id = *( int * )now; now += INT_SIZE;
- this->charement_id = *( int * )now; now += INT_SIZE;
- this->type = *( int * )now; now += INT_SIZE;
- this->size = *( int * )now; now += INT_SIZE;
- this->video = this->size ? now : NULL;
- return true;
- }