CRioObject Class Reference

#include <RioInterface.h>

Public Member Functions

 CRioObject ()
 ~CRioObject ()
RioResult Open (const char *ObjectName, const RioAccess Access, CRioStream *RioStream)
RioResult Open (const char *ObjectName, const RioAccess Access, struct timeval RTT_average, int BufferSize, CRioStream *RioStream, ofstream &m_log)
int CancelExpect (int reqid)
RioResult Close ()
RioResult StreamRead (RioRequest *Request, RioStreamType traffic=UNICASTTRAFFIC)
RioResult StreamRead (RioRequest *Request, int sendack, RioStreamType traffic, int ip=0, int port=0)
RioResult MulticastStreamRead (RioBlock block, int sendack, RioStreamType traffic)
RioResult GetMulticastInfo (int *Flag_Requests, int *PID)
bool SetMulticastSocket (unsigned short multicastport, char *multicast_addr, void *callback=0, BufferStream *buffer_stream=0, int enable_join=1)
void LeaveGroup (unsigned short multicastport)
void LeaveAllGroups (void)
RioResult StreamWrite (RioRequest *Request)
RioResult SetSize (const RioObjectSize Size, char *md5sum)
RioResult GetSize (RioObjectSize *Size)
int FreeBlock (unsigned int block_id, RioStreamType traffic)
int FreePendentBlocks (bool useCache, int nBuffers)
bool thereAreFragments (RioBlock block)
CRioStreamGetObjectStream ()
void Getmyaddr (int *my_address, int *my_port)
RioResult GetVideoRate (unsigned int *VideoRate)
 GetVideoRate retorna a taxa de transmissao (em Kbps) do video.
RioResult SetVideoRate (const unsigned int VideoRate)
 SetVideoRate altera a taxa de transmissao (em Kbps) do video.
RioResult ReallocBlocks (const RioBlock Block)
 Funcao usada para realocar os blocos fisicos do bloco logico passado como parametro.

Private Member Functions

void FreeMembers ()

Private Attributes

CRioStreamm_RioStream
CRouterm_Router
CObjectManagerm_ObjectManager
CRioTCPm_TCPconnection
int m_ObjectId
ObjectHandle m_ObjectHandle
unsigned int m_BlockSize
RioObjectSize m_ObjectSize
bool m_opened
int m_FlagRequests
char * m_ipmulticast
int m_PID
unsigned int m_VideoRate

Detailed Description

Definition at line 499 of file RioInterface.h.


Constructor & Destructor Documentation

CRioObject::CRioObject (  ) 

Definition at line 41 of file RioObject.cpp.

00042 {
00043     #ifdef RIO_DEBUG1
00044     RioErr << "### [CRioObject - Constructor] Start" << endl;
00045     #endif
00046 
00047     m_RioStream             = NULL;
00048     m_Router                = NULL;
00049     m_ObjectManager         = NULL;
00050     m_TCPconnection         = NULL;
00051     m_ObjectId              = 0;
00052     m_ObjectHandle.Version  = -1;
00053     m_ObjectHandle.Index    = -1;
00054     m_BlockSize             = 0;
00055     m_ObjectSize            = 0;
00056     m_opened                = false;
00057     m_FlagRequests          = 1;  /* Default: do requests */
00058     m_ipmulticast           = NULL;
00059     m_PID                   = 0;
00060 
00061     #ifdef RIO_DEBUG1
00062     RioErr << "### [CRioObject - Constructor] Finish" << endl;
00063     #endif
00064 }

CRioObject::~CRioObject (  ) 

Definition at line 66 of file RioObject.cpp.

00067 {
00068     #ifdef RIO_DEBUG1
00069     RioErr << "### [CRioObject - Destructor] Start" << endl;
00070     #endif
00071 
00072     if(m_opened)
00073         Close();
00074 
00075     #ifdef RIO_DEBUG1
00076     RioErr << "### [CRioObject - Destructor] Finish" << endl;
00077     #endif
00078 }


Member Function Documentation

int CRioObject::CancelExpect ( int  reqid  ) 

Definition at line 376 of file RioObject.cpp.

00377 {
00378     #ifdef RIO_DEBUG1
00379     RioErr << "### [CRioObject - CancelExpect] Start" << endl;
00380     #endif
00381 
00382     // Check if object is  opened
00383     if(!m_opened)
00384     {
00385         #ifdef RIO_DEBUG1
00386         RioErr << "### [CRioObject - CancelExpect] Finish1" << endl;
00387         #endif
00388 
00389         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00390     }
00391 
00392     #ifdef RIO_DEBUG1
00393     RioErr << "### [CRioObject - CancelExpect] Finish2" << endl;
00394     #endif
00395 
00396     return m_RioStream->CancelExpect( reqid );
00397 }

RioResult CRioObject::Close ( void   ) 

Definition at line 327 of file RioObject.cpp.

00328 {
00329     #ifdef RIO_DEBUG1
00330     RioErr << "### [CRioObject - Close] Start" << endl;
00331     #endif
00332 
00333     HRESULT hResult;
00334 
00335     // Check if object is  opened
00336     if(!m_opened)
00337     {
00338         #ifdef RIO_DEBUG1
00339         RioErr << "### [CRioObject - Close] Finish1" << endl;
00340         #endif
00341 
00342         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00343     }
00344 
00345     hResult = m_ObjectManager->Close( m_ObjectHandle );
00346 
00347     if( FAILED( hResult ) )
00348     {
00349         RioErr << "[CRioObject] Servidor nao conseguiu fechar o objeto: "
00350                << GetErrorDescription( hResult ) << endl;
00351     }
00352 
00353     // always consider the object closed at this point
00354     m_ObjectHandle.Version = -1;
00355     m_ObjectHandle.Index = -1;
00356     FreeMembers();
00357     m_opened = false;
00358 
00359     #ifdef RIO_DEBUG1
00360     RioErr << "### [CRioObject - Close] Finish2" << endl;
00361     #endif
00362 
00363     return hResult;
00364 }

int CRioObject::FreeBlock ( unsigned int  block_id,
RioStreamType  traffic 
)

Definition at line 761 of file RioObject.cpp.

00762 {
00763     #ifdef RIO_DEBUG1
00764     RioErr << "### [CRioObject - FreeBlock] Single" << endl;
00765     #endif
00766 
00767     return( m_RioStream->FreeBlock( block_id, traffic ) );
00768 }

void CRioObject::FreeMembers (  )  [private]

Definition at line 728 of file RioObject.cpp.

00729 {
00730     #ifdef RIO_DEBUG1
00731     RioErr << "### [CRioObject - FreeMembers] Start" << endl;
00732     #endif
00733 
00734     if( m_ObjectHandle.Index != -1 )
00735     {
00736         m_ObjectManager->Close(m_ObjectHandle);
00737         m_ObjectHandle.Version = -1;
00738         m_ObjectHandle.Index = -1;
00739     }
00740 
00741     if( m_TCPconnection !=0 )
00742     {
00743         m_TCPconnection = 0;
00744     }
00745 
00746     if( m_ObjectManager != 0 )
00747     {
00748         delete m_ObjectManager;
00749         m_ObjectManager = 0;
00750     }
00751 
00752     m_BlockSize  = 0;
00753     m_ObjectSize = 0;
00754 
00755     #ifdef RIO_DEBUG1
00756     RioErr << "### [CRioObject - FreeMembers] Finish" << endl;
00757     #endif
00758 }

int CRioObject::FreePendentBlocks ( bool  useCache,
int  nBuffers 
)

Definition at line 770 of file RioObject.cpp.

00771 {
00772     #ifdef RIO_DEBUG1
00773     RioErr << "### [CRioObject - FreePendentBlocks] Single" << endl;
00774     #endif
00775 
00776     return( m_RioStream->FreePendentBlocks( useCache, nBuffers ) );
00777 }

RioResult CRioObject::GetMulticastInfo ( int *  Flag_Requests,
int *  PID 
)

Definition at line 400 of file RioObject.cpp.

00402 {
00403     #ifdef RIO_DEBUG1
00404     RioErr << "### [CRioObject - GetMulticastInfo] Start" << endl;
00405     #endif
00406 
00407     // Check if object is  opened
00408     if(!m_opened)
00409     {
00410         #ifdef RIO_DEBUG1
00411         RioErr << "### [CRioObject - GetMulticastInfo] Finish1" << endl;
00412         #endif
00413 
00414         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00415     }
00416 
00417     *PID = m_PID;
00418 
00419     #ifdef RIO_DEBUG1
00420     RioErr << "### [CRioObject - GetMulticastInfo] Finish2" << endl;
00421     #endif
00422 
00423     return S_OK;
00424 }

void CRioObject::Getmyaddr ( int *  my_address,
int *  my_port 
)

Definition at line 367 of file RioObject.cpp.

00368 {
00369     #ifdef RIO_DEBUG1
00370     RioErr << "### [CRioObject - Getmyaddr] Single" << endl;
00371     #endif
00372 
00373      m_RioStream->Getmyaddr( my_address, my_port );
00374 }

CRioStream * CRioObject::GetObjectStream (  ) 

Definition at line 317 of file RioObject.cpp.

00318 {
00319     #ifdef RIO_DEBUG1
00320     RioErr << "### [CRioObject - GetObjectStream] Single" << endl;
00321     #endif
00322 
00323     return( m_RioStream );
00324 }

RioResult CRioObject::GetSize ( RioObjectSize Size  ) 

Definition at line 703 of file RioObject.cpp.

00704 {
00705     #ifdef RIO_DEBUG1
00706     RioErr << "### [CRioObject - GetSize] Single" << endl;
00707     #endif
00708 
00709     // Check if object is  opened
00710     if(!m_opened)
00711     {
00712         #ifdef RIO_DEBUG1
00713         RioErr << "### [CRioObject - GetSize] Finish1" << endl;
00714         #endif
00715 
00716         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00717     }
00718 
00719     *Size = m_ObjectSize;
00720 
00721     #ifdef RIO_DEBUG1
00722     RioErr << "### [CRioObject - GetSize] Finish2" << endl;
00723     #endif
00724 
00725     return S_OK;
00726 }

RioResult CRioObject::GetVideoRate ( unsigned int *  VideoRate  ) 

GetVideoRate retorna a taxa de transmissao (em Kbps) do video.

Parameters:
VideoRate ponteiro para o inteiro nao sinalizado que armazenara a taxa de transmissao do video.
Returns:
erro se nao foi possivel chamar o metodo ou se algum erro ocorreu ao executar o metodo.

Definition at line 810 of file RioObject.cpp.

00811 {
00812     #ifdef RIO_DEBUG1
00813     RioErr << "### [CRioObject - GetVideoRate] Single" << endl;
00814     #endif
00815 
00816     // Check if object is  opened
00817     if(!m_opened)
00818     {
00819         #ifdef RIO_DEBUG1
00820         RioErr << "### [CRioObject - GetVideoRate] Finish1" << endl;
00821         #endif
00822 
00823         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00824     }
00825 
00826     *VideoRate = m_VideoRate;
00827 
00828     #ifdef RIO_DEBUG1
00829     RioErr << "### [CRioObject - GetVideoRate] Finish2" << endl;
00830     #endif
00831 
00832     return S_OK;
00833 }       

void CRioObject::LeaveAllGroups ( void   ) 

Definition at line 466 of file RioObject.cpp.

00467 {
00468     #ifdef RIO_DEBUG1
00469     RioErr << "### [CRioObject - LeaveAllGroups] Start" << endl;
00470     #endif
00471 
00472     m_RioStream->LeaveAllGroups();
00473 
00474     #ifdef RIO_DEBUG1
00475     RioErr << "### [CRioObject - LeaveAllGroups] Finish" << endl;
00476     #endif
00477 }

void CRioObject::LeaveGroup ( unsigned short  multicastport  ) 

Definition at line 452 of file RioObject.cpp.

00453 {
00454     #ifdef RIO_DEBUG1
00455     RioErr << "### [CRioObject - LeaveGroup] Start" << endl;
00456     #endif
00457 
00458     m_RioStream->LeaveGroup( multicastport );
00459 
00460     #ifdef RIO_DEBUG1
00461     RioErr << "### [CRioObject - LeaveGroup] Finish" << endl;
00462     #endif
00463 }

RioResult CRioObject::MulticastStreamRead ( RioBlock  block,
int  sendack,
RioStreamType  traffic 
)

Definition at line 481 of file RioObject.cpp.

00483 {
00484     #ifdef RIO_DEBUG1
00485     RioErr << "### [CRioObject - MulticastStreamRead] Start" << endl;
00486     #endif
00487 
00488     #ifdef RIO_DEBUG2
00489     RioErr << "RioObject MulticastStreamRead - cliente fazendo pedido do bloco "
00490            << block << endl;
00491     #endif
00492 
00493     HRESULT hResult;
00494 
00495     // Check if object is  opened
00496     if( !m_opened)
00497     {
00498         #ifdef RIO_DEBUG1
00499         RioErr << "### [CRioObject - MulticastStreamRead] Finish1" << endl;
00500         #endif
00501 
00502         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00503     }
00504 
00505     // ### let Server check for block out of map..
00506     hResult = m_RioStream->MulticastRead( block, m_ObjectHandle.Index,
00507                                           sendack, traffic );
00508 
00509     if( FAILED(hResult))
00510     {
00511         #ifdef RIO_DEBUG1
00512         RioErr << "### [CRioObject - MulticastStreamRead] Finish2" << endl;
00513         #endif
00514 
00515         return hResult;
00516     }
00517 
00518     #ifdef RIO_DEBUG1
00519     RioErr << "### [CRioObject - MulticastStreamRead] Finish3" << endl;
00520     #endif
00521 
00522     return S_OK;
00523 }

RioResult CRioObject::Open ( const char *  ObjectName,
const RioAccess  Access,
struct timeval  RTT_average,
int  BufferSize,
CRioStream RioStream,
ofstream &  m_log 
)

Definition at line 205 of file RioObject.cpp.

00213 {
00214     #ifdef RIO_DEBUG1
00215     RioErr << "### [CRioObject - Open2] Start" << endl;
00216     #endif
00217 
00218     RioStreamId StreamId;
00219 
00220     // Check if object is not already opened
00221     if(m_opened)
00222     {
00223         #ifdef RIO_DEBUG1
00224         RioErr << "### [CRioObject - Open2] Finish1" << endl;
00225         #endif
00226 
00227         return ERROR_RIOOBJECT + ERROR_OBJECT_ALREADY_OPENED;
00228     }
00229 
00230     m_RioStream = RioStream;
00231 
00232     HRESULT hResult;
00233     hResult = m_RioStream->GetId( &StreamId );
00234     if(FAILED(hResult))
00235     {
00236         #ifdef RIO_DEBUG1
00237         RioErr << "### [CRioObject - Open2] Finish2" << endl;
00238         #endif
00239 
00240         return hResult;
00241     }
00242 
00243     // Get TCPconnection from RioStream
00244     m_TCPconnection = m_RioStream->m_TCPconnection;
00245 
00246     // Create Object Manager Proxy
00247     m_ObjectManager = new CObjectManager(m_TCPconnection);
00248 
00249     // Create Temporary Stream Manager Proxy
00250     CStreamManager StreamManager(m_TCPconnection);
00251 
00252     hResult = StreamManager.OpenObject(StreamId,
00253                                        ObjectName,
00254                                        Access,
00255                                        RTT_average,
00256                                        BufferSize,
00257                                        &m_ObjectHandle,
00258                                        &m_ObjectSize,
00259                                        &m_FlagRequests,
00260                                        &m_PID);
00261 
00262     if(FAILED(hResult))
00263     {
00264         m_ObjectHandle.Version = -1;
00265         m_ObjectHandle.Index = -1;
00266         FreeMembers();
00267 
00268         #ifdef RIO_DEBUG1
00269         RioErr << "### [CRioObject - Open2] Finish3" << endl;
00270         #endif
00271 
00272         return hResult;
00273     }
00274 
00275     hResult = m_RioStream->GetBlockSize(&m_BlockSize);
00276     if(FAILED(hResult))
00277     {
00278         FreeMembers();
00279 
00280         #ifdef RIO_DEBUG1
00281         RioErr << "### [CRioObject - Open2] Finish4" << endl;
00282         #endif
00283 
00284         return hResult;
00285     }
00286 
00287     // Obtem a taxa de transferencia do video.
00288 
00289     hResult = m_ObjectManager->GetVideoRate( m_ObjectHandle, &m_VideoRate );
00290     if(FAILED(hResult))
00291     {
00292         if( ( unsigned int ) hResult != ERROR_CONNECTIONMANAGER + 
00293                                         ERROR_INVALID_METHOD )
00294         {
00295             FreeMembers();
00296 
00297             #ifdef RIO_DEBUG1
00298             RioErr << "### [CRioObject - Open2] Finish5" << endl;
00299             #endif
00300 
00301             return hResult;
00302         }
00303         else
00304             m_VideoRate = 0;    
00305     }
00306 
00307     m_opened = true;
00308 
00309     #ifdef RIO_DEBUG1
00310     RioErr << "### [CRioObject - Open2] Finish6" << endl;
00311     #endif
00312 
00313     return S_OK;
00314 }

RioResult CRioObject::Open ( const char *  ObjectName,
const RioAccess  Access,
CRioStream RioStream 
)

Definition at line 81 of file RioObject.cpp.

00084 {
00085     #ifdef RIO_DEBUG1
00086     RioErr << "### [CRioObject - Open1] Start" << endl;
00087     #endif
00088 
00089     RioStreamId StreamId;
00090 
00091     // Check if object is not already opened
00092     if(m_opened)
00093     {
00094         #ifdef RIO_DEBUG1
00095         RioErr << "### [CRioObject - Open1] Finish1" << endl;
00096         #endif
00097 
00098         return ERROR_RIOOBJECT + ERROR_OBJECT_ALREADY_OPENED;
00099     }
00100 
00101     m_RioStream = RioStream;
00102 
00103     HRESULT hResult;
00104     hResult = m_RioStream->GetId(&StreamId);
00105     if(FAILED(hResult))
00106     {
00107         #ifdef RIO_DEBUG1
00108         RioErr << "### [CRioObject - Open1] Finish2" << endl;
00109         #endif
00110 
00111         return hResult;
00112     }
00113 
00114     // Get TCPconnection from RioStream
00115     m_TCPconnection = m_RioStream->m_TCPconnection;
00116 
00117     // Create Object Manager Proxy
00118     m_ObjectManager = new CObjectManager(m_TCPconnection);
00119 
00120     // Create Temporary Stream Manager Proxy
00121     CStreamManager StreamManager(m_TCPconnection);
00122 
00123     hResult = StreamManager.OpenObject(StreamId,
00124                                        ObjectName,
00125                                        Access,
00126                                        &m_ObjectHandle);
00127     if(FAILED(hResult))
00128     {
00129         m_ObjectHandle.Version = -1;
00130         m_ObjectHandle.Index = -1;
00131         FreeMembers();
00132 
00133         #ifdef RIO_DEBUG1
00134         RioErr << "### [CRioObject - Open1] Finish3" << endl;
00135         #endif
00136 
00137         return hResult;
00138     }
00139 
00140     hResult = m_RioStream->GetBlockSize(&m_BlockSize);
00141     if(FAILED(hResult))
00142     {
00143         FreeMembers();
00144 
00145         #ifdef RIO_DEBUG1
00146         RioErr << "### [CRioObject - Open1] Finish4" << endl;
00147         #endif
00148 
00149         return hResult;
00150     }
00151 
00152     hResult = m_ObjectManager->GetSize(m_ObjectHandle,&m_ObjectSize);
00153     if(FAILED(hResult))
00154     {
00155         FreeMembers();
00156 
00157         #ifdef RIO_DEBUG1
00158         RioErr << "### [CRioObject - Open1] Finish5" << endl;
00159         #endif
00160 
00161         return hResult;
00162     }
00163     
00164     // Obtem a taxa de transferencia do video.
00165 
00166     hResult = m_ObjectManager->GetVideoRate( m_ObjectHandle, &m_VideoRate );
00167     if(FAILED(hResult))
00168     {
00169         if( ( unsigned int ) hResult != ERROR_CONNECTIONMANAGER + 
00170                                         ERROR_INVALID_METHOD )
00171         {
00172             FreeMembers();
00173 
00174             #ifdef RIO_DEBUG1
00175             RioErr << "### [CRioObject - Open1] Finish5" << endl;
00176             #endif
00177 
00178             return hResult;
00179         }
00180         else
00181             m_VideoRate = 0;    
00182     }
00183 
00184     m_opened = true;
00185 
00186     #ifdef RIO_DEBUG1
00187     RioErr << "### [CRioObject - Open1] Finish6" << endl;
00188     #endif
00189 
00190     return S_OK;
00191 }

RioResult CRioObject::ReallocBlocks ( const RioBlock  Block  ) 

Funcao usada para realocar os blocos fisicos do bloco logico passado como parametro.

Parameters:
Block identificadao do bloco logico.
Returns:
S_OK se a realocacao foi feita com sucesso ou um valor diferente de S_OK se algum erro ocorreu.

Definition at line 883 of file RioObject.cpp.

00884 {
00885     #ifdef RIO_DEBUG1
00886     RioErr << "### [CRioObject - ReallocBlocks] Start" << endl;
00887     #endif
00888 
00889     // Check if object is  opened
00890     if(!m_opened)
00891     {
00892         #ifdef RIO_DEBUG1
00893         RioErr << "### [CRioObject - ReallocBlocks] Finish1" << endl;
00894         #endif
00895 
00896         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00897     }
00898 
00899     HRESULT hResult;
00900 
00901     // Change object transmission rate.
00902     hResult = m_ObjectManager->ReallocBlocks( m_ObjectHandle, Block );
00903 
00904     if(FAILED (hResult) )
00905     {
00906         #ifdef RIO_DEBUG1
00907         RioErr << "### [CRioObject - ReallocBlocks] Finish2" << endl;
00908         #endif
00909 
00910         return hResult;
00911     }
00912 
00913     #ifdef RIO_DEBUG1
00914     RioErr << "### [CRioObject - ReallocBlocks] Finish3" << endl;
00915     #endif
00916 
00917     return S_OK;
00918 
00919 }       

bool CRioObject::SetMulticastSocket ( unsigned short  multicastport,
char *  multicast_addr,
void *  callback = 0,
BufferStream buffer_stream = 0,
int  enable_join = 1 
)

Definition at line 427 of file RioObject.cpp.

00432 {
00433     #ifdef RIO_DEBUG1
00434     RioErr << "### [CRioObject - SetMulticastSocket] Start" << endl;
00435     #endif
00436 
00437     bool rc = true;
00438     rc = m_RioStream->SetMulticastSocket( multicast_port,
00439                                           multicast_addr,
00440                                           callback,
00441                                           buffer_stream ,
00442                                           enable_join );
00443 
00444     #ifdef RIO_DEBUG1
00445     RioErr << "### [CRioObject - SetMulticastSocket] Finish" << endl;
00446     #endif
00447 
00448     return rc;
00449 }

RioResult CRioObject::SetSize ( const RioObjectSize  Size,
char *  md5sum 
)

Definition at line 663 of file RioObject.cpp.

00664 {
00665     #ifdef RIO_DEBUG1
00666     RioErr << "### [CRioObject - SetSize] Start" << endl;
00667     #endif
00668 
00669     // Check if object is  opened
00670     if(!m_opened)
00671     {
00672         #ifdef RIO_DEBUG1
00673         RioErr << "### [CRioObject - SetSize] Finish1" << endl;
00674         #endif
00675 
00676         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00677     }
00678 
00679     HRESULT hResult;
00680 
00681     // Change object size
00682     hResult = m_ObjectManager->SetSize( m_ObjectHandle, Size, md5sum);
00683     if(FAILED (hResult) )
00684     {
00685         #ifdef RIO_DEBUG1
00686         RioErr << "### [CRioObject - SetSize] Finish2" << endl;
00687         #endif
00688 
00689         return hResult;
00690     }
00691 
00692     m_ObjectSize = Size;
00693 
00694     #ifdef RIO_DEBUG1
00695     RioErr << "### [CRioObject - SetSize] Finish3" << endl;
00696     #endif
00697 
00698     return S_OK;
00699 
00700 }

RioResult CRioObject::SetVideoRate ( const unsigned int  VideoRate  ) 

SetVideoRate altera a taxa de transmissao (em Kbps) do video.

Parameters:
VideoRate nova taxa de transmissao do video.
Returns:
erro se nao foi possivel chamar o metodo ou se algum erro ocorreu ao executar o metodo.

Definition at line 838 of file RioObject.cpp.

00839 {
00840     #ifdef RIO_DEBUG1
00841     RioErr << "### [CRioObject - SetVideoRate] Start" << endl;
00842     #endif
00843 
00844     // Check if object is  opened
00845     if(!m_opened)
00846     {
00847         #ifdef RIO_DEBUG1
00848         RioErr << "### [CRioObject - SetVideoRate] Finish1" << endl;
00849         #endif
00850 
00851         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00852     }
00853 
00854     HRESULT hResult;
00855 
00856     // Change object transmission rate.
00857     hResult = m_ObjectManager->SetVideoRate( m_ObjectHandle, VideoRate );
00858     if(FAILED (hResult) )
00859     {
00860         #ifdef RIO_DEBUG1
00861         RioErr << "### [CRioObject - SetVideoRate] Finish2" << endl;
00862         #endif
00863 
00864         return hResult;
00865     }
00866 
00867     m_VideoRate = VideoRate;
00868 
00869     #ifdef RIO_DEBUG1
00870     RioErr << "### [CRioObject - SetVideoRate] Finish3" << endl;
00871     #endif
00872 
00873     return S_OK;
00874 
00875 }       

RioResult CRioObject::StreamRead ( RioRequest Request,
int  sendack,
RioStreamType  traffic,
int  ip = 0,
int  port = 0 
)

Definition at line 575 of file RioObject.cpp.

00577 {
00578     #ifdef RIO_DEBUG1
00579     RioErr << "### [CRioObject - StreamRead] Start" << endl;
00580     #endif
00581 
00582     HRESULT hResult;
00583 
00584     // Check if object is  opened
00585     if(!m_opened)
00586     {
00587         #ifdef RIO_DEBUG1
00588         RioErr << "### [CRioObject - StreamRead] Finish1" << endl;
00589         #endif
00590 
00591         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00592     }
00593 
00594     // ### let Server check for block out of map..
00595 
00596     #ifdef RIO_DEBUG2
00597     RioErr << "RioObject StreamRead1- cliente " << Request->threadid
00598            << " fazendo pedido do bloco " << Request->Block << endl;
00599     #endif
00600 
00601     hResult = m_RioStream->Read( Request, m_ObjectHandle.Index, sendack,
00602                                  traffic, ip, port );
00603 
00604     if( FAILED( hResult ) )
00605     {
00606         #ifdef RIO_DEBUG2
00607         RioErr << "[CRioObject] Failed read " << endl;
00608         #endif
00609 
00610         #ifdef RIO_DEBUG1
00611         RioErr << "### [CRioObject - StreamRead] Finish2" << endl;
00612         #endif
00613 
00614         return hResult;
00615     }
00616 
00617     #ifdef RIO_DEBUG1
00618     RioErr << "### [CRioObject - StreamRead] Finish3" << endl;
00619     #endif
00620 
00621     return S_OK;
00622 }

RioResult CRioObject::StreamRead ( RioRequest Request,
RioStreamType  traffic = UNICASTTRAFFIC 
)

Definition at line 528 of file RioObject.cpp.

00529 {
00530     #ifdef RIO_DEBUG1
00531     RioErr << "### [CRioObject - StreamRead] Start" << endl;
00532     #endif
00533 
00534     HRESULT hResult;
00535 
00536     // Check if object is  opened
00537     if(!m_opened)
00538     {
00539         #ifdef RIO_DEBUG1
00540         RioErr << "### [CRioObject - StreamRead] Finish1" << endl;
00541         #endif
00542 
00543         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00544     }
00545 
00546     // ### let Server check for block out of map..
00547     #ifdef RIO_DEBUG2
00548     RioErr << "RioObject StreamRead2 - cliente " << Request->threadid
00549            << " fazendo pedido do bloco " << Request->Block << endl;
00550     #endif
00551 
00552     hResult = m_RioStream->Read( Request, m_ObjectHandle.Index, traffic );
00553     if(FAILED(hResult))
00554     {
00555         #ifdef RIO_DEBUG2
00556         RioErr << "[CRioObject] Failed read " << endl;
00557         #endif
00558 
00559         #ifdef RIO_DEBUG1
00560         RioErr << "### [CRioObject - StreamRead] Finish2" << endl;
00561         #endif
00562 
00563         return hResult;
00564     }
00565 
00566     #ifdef RIO_DEBUG1
00567     RioErr << "### [CRioObject - StreamRead] Finish3" << endl;
00568     #endif
00569 
00570     return S_OK;
00571 }

RioResult CRioObject::StreamWrite ( RioRequest Request  ) 

Definition at line 625 of file RioObject.cpp.

00626 {
00627     #ifdef RIO_DEBUG1
00628     RioErr << "### [CRioObject - StreamWrite] Start" << endl;
00629     #endif
00630 
00631     HRESULT hResult;
00632 
00633     // Check if object is  opened
00634     if(!m_opened)
00635     {
00636         #ifdef RIO_DEBUG1
00637         RioErr << "### [CRioObject - StreamWrite] Finish1" << endl;
00638         #endif
00639 
00640         return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED;
00641     }
00642 
00643     // ### let Server check for block out of map..
00644 
00645     hResult = m_RioStream->Write( Request, m_ObjectHandle.Index );
00646     if(FAILED(hResult))
00647     {
00648         #ifdef RIO_DEBUG1
00649         RioErr << "### [CRioObject - StreamWrite] Finish2" << endl;
00650         #endif
00651 
00652         return hResult;
00653     }
00654 
00655     #ifdef RIO_DEBUG1
00656     RioErr << "### [CRioObject - StreamWrite] Finish3" << endl;
00657     #endif
00658 
00659     return S_OK;
00660 }

bool CRioObject::thereAreFragments ( RioBlock  block  ) 

Definition at line 779 of file RioObject.cpp.

00780 {
00781     #ifdef RIO_DEBUG1
00782     RioErr << "### [CRioObject - thereAreFragments] Single" << endl;
00783     #endif
00784 
00785     return( m_RioStream->thereAreFragments( block ) );
00786 }


Field Documentation

unsigned int CRioObject::m_BlockSize [private]

Definition at line 596 of file RioInterface.h.

Definition at line 599 of file RioInterface.h.

char* CRioObject::m_ipmulticast [private]

Definition at line 600 of file RioInterface.h.

Definition at line 595 of file RioInterface.h.

int CRioObject::m_ObjectId [private]

Definition at line 594 of file RioInterface.h.

Definition at line 592 of file RioInterface.h.

Definition at line 597 of file RioInterface.h.

bool CRioObject::m_opened [private]

Definition at line 598 of file RioInterface.h.

int CRioObject::m_PID [private]

Definition at line 601 of file RioInterface.h.

Definition at line 590 of file RioInterface.h.

Definition at line 591 of file RioInterface.h.

Definition at line 593 of file RioInterface.h.

unsigned int CRioObject::m_VideoRate [private]

Definition at line 604 of file RioInterface.h.


The documentation for this class was generated from the following files:
Generated on Wed Jul 4 16:03:32 2012 for RIO by  doxygen 1.6.3