00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifdef WINDOWS
00025
00026 #include "stdafx.h"
00027 #else
00028 #include <sys/time.h>
00029 #endif
00030
00031
00032 #include <stdio.h>
00033 #include <string.h>
00034 #include "RioInterface.h"
00035 #include "RioError.h"
00036 #include "StreamManager.h"
00037 #include "ObjectManager.h"
00038
00039
00040
00041 CRioObject::CRioObject()
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;
00058 m_ipmulticast = NULL;
00059 m_PID = 0;
00060
00061 #ifdef RIO_DEBUG1
00062 RioErr << "### [CRioObject - Constructor] Finish" << endl;
00063 #endif
00064 }
00065
00066 CRioObject::~CRioObject()
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 }
00079
00080
00081 RioResult CRioObject::Open( const char* ObjectName,
00082 const RioAccess Access,
00083 CRioStream* RioStream )
00084 {
00085 #ifdef RIO_DEBUG1
00086 RioErr << "### [CRioObject - Open1] Start" << endl;
00087 #endif
00088
00089 RioStreamId StreamId;
00090
00091
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
00115 m_TCPconnection = m_RioStream->m_TCPconnection;
00116
00117
00118 m_ObjectManager = new CObjectManager(m_TCPconnection);
00119
00120
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
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 }
00192
00193
00194
00195 #ifdef WINDOWS
00196
00197 RioResult CRioObject::Open(const char* ObjectName,
00198 const RioAccess Access,
00199 struct _SYSTEMTIME RTT_average,
00200 int BufferSize,
00201 CRioStream* RioStream,
00202 ofstream &m_log)
00203 #else
00204
00205 RioResult CRioObject::Open(const char* ObjectName,
00206 const RioAccess Access,
00207 struct timeval RTT_average,
00208 int BufferSize,
00209 CRioStream* RioStream,
00210 ofstream &m_log)
00211 #endif
00212
00213 {
00214 #ifdef RIO_DEBUG1
00215 RioErr << "### [CRioObject - Open2] Start" << endl;
00216 #endif
00217
00218 RioStreamId StreamId;
00219
00220
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
00244 m_TCPconnection = m_RioStream->m_TCPconnection;
00245
00246
00247 m_ObjectManager = new CObjectManager(m_TCPconnection);
00248
00249
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
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 }
00315
00316
00317 CRioStream* CRioObject::GetObjectStream()
00318 {
00319 #ifdef RIO_DEBUG1
00320 RioErr << "### [CRioObject - GetObjectStream] Single" << endl;
00321 #endif
00322
00323 return( m_RioStream );
00324 }
00325
00326
00327 RioResult CRioObject::Close()
00328 {
00329 #ifdef RIO_DEBUG1
00330 RioErr << "### [CRioObject - Close] Start" << endl;
00331 #endif
00332
00333 HRESULT hResult;
00334
00335
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
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 }
00365
00366
00367 void CRioObject::Getmyaddr( int *my_address, int *my_port )
00368 {
00369 #ifdef RIO_DEBUG1
00370 RioErr << "### [CRioObject - Getmyaddr] Single" << endl;
00371 #endif
00372
00373 m_RioStream->Getmyaddr( my_address, my_port );
00374 }
00375
00376 int CRioObject::CancelExpect(int reqid)
00377 {
00378 #ifdef RIO_DEBUG1
00379 RioErr << "### [CRioObject - CancelExpect] Start" << endl;
00380 #endif
00381
00382
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 }
00398
00399
00400 RioResult CRioObject::GetMulticastInfo( int *Flag_Requests,
00401 int *PID )
00402 {
00403 #ifdef RIO_DEBUG1
00404 RioErr << "### [CRioObject - GetMulticastInfo] Start" << endl;
00405 #endif
00406
00407
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 }
00425
00426
00427 bool CRioObject::SetMulticastSocket( unsigned short multicast_port,
00428 char* multicast_addr,
00429 void *callback,
00430 BufferStream *buffer_stream,
00431 int enable_join )
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 }
00450
00451
00452 void CRioObject::LeaveGroup( unsigned short multicastport )
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 }
00464
00465
00466 void CRioObject::LeaveAllGroups( void )
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 }
00478
00479
00480
00481 RioResult CRioObject::MulticastStreamRead( RioBlock block, int sendack,
00482 RioStreamType traffic )
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
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
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 }
00524
00525
00526
00527
00528 RioResult CRioObject::StreamRead( RioRequest* Request, RioStreamType traffic )
00529 {
00530 #ifdef RIO_DEBUG1
00531 RioErr << "### [CRioObject - StreamRead] Start" << endl;
00532 #endif
00533
00534 HRESULT hResult;
00535
00536
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
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 }
00572
00573
00574
00575 RioResult CRioObject::StreamRead( RioRequest *Request, int sendack,
00576 RioStreamType traffic, int ip, int port )
00577 {
00578 #ifdef RIO_DEBUG1
00579 RioErr << "### [CRioObject - StreamRead] Start" << endl;
00580 #endif
00581
00582 HRESULT hResult;
00583
00584
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
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 }
00623
00624
00625 RioResult CRioObject::StreamWrite( RioRequest* Request )
00626 {
00627 #ifdef RIO_DEBUG1
00628 RioErr << "### [CRioObject - StreamWrite] Start" << endl;
00629 #endif
00630
00631 HRESULT hResult;
00632
00633
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
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 }
00661
00662
00663 RioResult CRioObject::SetSize(const RioObjectSize Size, char *md5sum)
00664 {
00665 #ifdef RIO_DEBUG1
00666 RioErr << "### [CRioObject - SetSize] Start" << endl;
00667 #endif
00668
00669
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
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 }
00701
00702
00703 RioResult CRioObject::GetSize(RioObjectSize* Size)
00704 {
00705 #ifdef RIO_DEBUG1
00706 RioErr << "### [CRioObject - GetSize] Single" << endl;
00707 #endif
00708
00709
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 }
00727
00728 void CRioObject::FreeMembers()
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 }
00759
00760
00761 int CRioObject::FreeBlock( unsigned int block_id, RioStreamType traffic )
00762 {
00763 #ifdef RIO_DEBUG1
00764 RioErr << "### [CRioObject - FreeBlock] Single" << endl;
00765 #endif
00766
00767 return( m_RioStream->FreeBlock( block_id, traffic ) );
00768 }
00769
00770 int CRioObject::FreePendentBlocks( bool useCache, int nBuffers )
00771 {
00772 #ifdef RIO_DEBUG1
00773 RioErr << "### [CRioObject - FreePendentBlocks] Single" << endl;
00774 #endif
00775
00776 return( m_RioStream->FreePendentBlocks( useCache, nBuffers ) );
00777 }
00778
00779 bool CRioObject::thereAreFragments( RioBlock block )
00780 {
00781 #ifdef RIO_DEBUG1
00782 RioErr << "### [CRioObject - thereAreFragments] Single" << endl;
00783 #endif
00784
00785 return( m_RioStream->thereAreFragments( block ) );
00786 }
00787
00788 #ifdef RIO_DEBUG2
00789 void CRioObject::printDebug( short debugCode, string message )
00790 {
00791 #ifdef RIO_DEBUG1
00792 RioErr << "### [CRioObject - printDebug] Start" << endl;
00793 #endif
00794
00795 m_RioStream->printDebug( debugCode, message );
00796
00797 #ifdef RIO_DEBUG1
00798 RioErr << "### [CRioObject - printDebug] Finish" << endl;
00799 #endif
00800 }
00801 #endif
00802
00803
00804
00805
00806
00807
00808
00809
00810 RioResult CRioObject::GetVideoRate( unsigned int *VideoRate )
00811 {
00812 #ifdef RIO_DEBUG1
00813 RioErr << "### [CRioObject - GetVideoRate] Single" << endl;
00814 #endif
00815
00816
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 }
00834
00835
00836
00837
00838 RioResult CRioObject::SetVideoRate( const unsigned int VideoRate )
00839 {
00840 #ifdef RIO_DEBUG1
00841 RioErr << "### [CRioObject - SetVideoRate] Start" << endl;
00842 #endif
00843
00844
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
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 }
00876
00877
00878
00879
00880
00881
00882
00883 RioResult CRioObject::ReallocBlocks( const RioBlock Block )
00884 {
00885 #ifdef RIO_DEBUG1
00886 RioErr << "### [CRioObject - ReallocBlocks] Start" << endl;
00887 #endif
00888
00889
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
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 }
00920