1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 #ifndef PVMF_SOURCE_CONTEXT_DATA_H_INCLUDED 19 #define PVMF_SOURCE_CONTEXT_DATA_H_INCLUDED 20 21 #ifndef OSCL_BASE_H_INCLUDED 22 #include "oscl_base.h" 23 #endif 24 #ifndef OSCL_STRING_H_INCLUDED 25 #include "oscl_string.h" 26 #endif 27 #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED 28 #include "oscl_string_containers.h" 29 #endif 30 #ifndef PV_UUID_H_INCLUDED 31 #include "pv_uuid.h" 32 #endif 33 #ifndef PV_INTERFACE_H_INCLUDED 34 #include "pv_interface.h" 35 #endif 36 37 #define PVMF_SOURCE_CONTEXT_DATA_UUID PVUuid(0xf218cdfc,0x797d,0x453e,0x9c,0x94,0x8f,0x0e,0x83,0x8a,0xa1,0x99) 38 39 #define PVMF_SOURCE_CONTEXT_DATA_COMMON_UUID PVUuid(0xa6b5f829,0x8ead,0x4c21,0xad,0x40,0x8c,0xc5,0x10,0x05,0xb5,0xfa) 40 #define PVMF_SOURCE_CONTEXT_DATA_STREAMING_UUID PVUuid(0x0b8a0087,0xd539,0x4ee0,0x88,0x8d,0x0c,0x1c,0x70,0xf0,0x33,0x59) 41 #define PVMF_SOURCE_CONTEXT_DATA_DOWNLOAD_HTTP_UUID PVUuid(0x731e4269,0x849b,0x4123,0x92,0x6f,0xaf,0x27,0xc9,0x8a,0x2e,0xab) 42 #define PVMF_SOURCE_CONTEXT_DATA_DOWNLOAD_PVX_UUID PVUuid(0x3dbb1b51,0x49ea,0x4933,0xa6,0xec,0x26,0x97,0x43,0x12,0xb6,0xd6) 43 #define PVMF_SOURCE_CONTEXT_DATA_PVR_UUID PVUuid(0x442059a2,0x76b6,0x11dc,0x83,0x14,0x08,0x00,0x20,0x0c,0x9a,0x66) 44 #define PVMF_SOURCE_CONTEXT_DATA_PACKETSOURCE_UUID PVUuid(0x7f064f8c,0xa90d,0x11dc,0x83,0x14,0x08,0x00,0x20,0x0c,0x9a,0x66) 45 //3f9c615e-31e2-474c-9add-29c61dd07ead 46 47 class OsclFileHandle; 48 class PVMFCPMPluginAccessInterfaceFactory; 49 50 #define BITMASK_PVMF_SOURCE_INTENT_PLAY 0x00000001 51 #define BITMASK_PVMF_SOURCE_INTENT_GETMETADATA 0x00000002 52 #define BITMASK_PVMF_SOURCE_INTENT_PREVIEW 0x00000004 53 #define BITMASK_PVMF_SOURCE_INTENT_THUMBNAILS 0x00000008 54 55 class PVMFSourceContextDataCommon : public PVInterface 56 { 57 public: PVMFSourceContextDataCommon()58 PVMFSourceContextDataCommon() 59 { 60 iRefCounter = 0; 61 iFileHandle = NULL; 62 iPreviewMode = false; 63 iIntent = BITMASK_PVMF_SOURCE_INTENT_PLAY; 64 iContentAccessFactory = NULL; 65 iRecognizerDataStreamFactory = NULL; 66 }; 67 PVMFSourceContextDataCommon(const PVMFSourceContextDataCommon & aSrc)68 PVMFSourceContextDataCommon(const PVMFSourceContextDataCommon& aSrc) : PVInterface(aSrc) 69 { 70 iRefCounter = 0; 71 MyCopy(aSrc); 72 }; 73 74 PVMFSourceContextDataCommon& operator=(const PVMFSourceContextDataCommon& aSrc) 75 { 76 if (&aSrc != this) 77 { 78 MyCopy(aSrc); 79 } 80 return *this; 81 }; 82 83 /* From PVInterface */ addRef()84 void addRef() 85 { 86 iRefCounter++; 87 } removeRef()88 void removeRef() 89 { 90 iRefCounter--; 91 } queryInterface(const PVUuid & uuid,PVInterface * & iface)92 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 93 { 94 if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_COMMON_UUID)) 95 { 96 iface = this; 97 return true; 98 } 99 else 100 { 101 iface = NULL; 102 return false; 103 } 104 } 105 int32 iRefCounter; 106 107 //Optional file handle. 108 OsclFileHandle* iFileHandle; 109 110 //Optional field to indicate if the source that is being 111 //passed in will be played back in a preview mode. 112 bool iPreviewMode; 113 114 //Optional field to indicate if the source that is being 115 //passed in will be used for play back or just for metadata retrieval 116 uint32 iIntent; 117 118 //HTTP proxy name, either ip or dns, for DRM License Acquisition purposes 119 OSCL_wHeapString<OsclMemAllocator> iDRMLicenseProxyName; 120 121 //HTTP proxy port, for DRM for DRM License Acquisition purposes 122 int32 iDRMLicenseProxyPort; 123 124 //external datastream for usecases where the input file is controlled by the app 125 PVMFCPMPluginAccessInterfaceFactory* iContentAccessFactory; 126 127 //external datastream for usecases where input file to be recognized is controlled by the app 128 PVMFCPMPluginAccessInterfaceFactory* iRecognizerDataStreamFactory; 129 130 private: MyCopy(const PVMFSourceContextDataCommon & aSrc)131 void MyCopy(const PVMFSourceContextDataCommon& aSrc) 132 { 133 iFileHandle = aSrc.iFileHandle; 134 iPreviewMode = aSrc.iPreviewMode; 135 iIntent = aSrc.iIntent; 136 iDRMLicenseProxyName = aSrc.iDRMLicenseProxyName; 137 iDRMLicenseProxyPort = aSrc.iDRMLicenseProxyPort; 138 iContentAccessFactory = aSrc.iContentAccessFactory; 139 iRecognizerDataStreamFactory = aSrc.iRecognizerDataStreamFactory; 140 }; 141 }; 142 143 class PVMFSourceContextDataStreaming : public PVInterface 144 { 145 public: 146 //default constructor PVMFSourceContextDataStreaming()147 PVMFSourceContextDataStreaming() 148 { 149 iRefCounter = 0; 150 iProxyPort = 0; 151 }; 152 PVMFSourceContextDataStreaming(const PVMFSourceContextDataStreaming & aSrc)153 PVMFSourceContextDataStreaming(const PVMFSourceContextDataStreaming& aSrc) : PVInterface(aSrc) 154 { 155 iRefCounter = 0; 156 MyCopy(aSrc); 157 }; 158 159 PVMFSourceContextDataStreaming& operator=(const PVMFSourceContextDataStreaming& aSrc) 160 { 161 if (&aSrc != this) 162 { 163 MyCopy(aSrc); 164 } 165 return *this; 166 }; 167 168 /* From PVInterface */ addRef()169 void addRef() 170 { 171 iRefCounter++; 172 } removeRef()173 void removeRef() 174 { 175 iRefCounter--; 176 } queryInterface(const PVUuid & uuid,PVInterface * & iface)177 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 178 { 179 if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_STREAMING_UUID)) 180 { 181 iface = this; 182 return true; 183 } 184 else 185 { 186 iface = NULL; 187 return false; 188 } 189 } 190 int32 iRefCounter; 191 192 //Optional logging url. 193 //When present, streaming stats will be sent to this URL. 194 //Typically applies to MS HTTP Streaming sessions 195 OSCL_wHeapString<OsclMemAllocator> iStreamStatsLoggingURL; 196 197 //HTTP proxy name, either ip or dns 198 OSCL_wHeapString<OsclMemAllocator> iProxyName; 199 200 //HTTP proxy port 201 int32 iProxyPort; 202 203 // Optional UserID and UserAuthentication (e.g. password) string 204 // used for HTTP basic/digest authentication 205 OSCL_HeapString<OsclMemAllocator> iUserID; 206 OSCL_HeapString<OsclMemAllocator> iUserPasswd; 207 208 private: MyCopy(const PVMFSourceContextDataStreaming & aSrc)209 void MyCopy(const PVMFSourceContextDataStreaming& aSrc) 210 { 211 iStreamStatsLoggingURL = aSrc.iStreamStatsLoggingURL; 212 iProxyName = aSrc.iProxyName; 213 iProxyPort = aSrc.iProxyPort; 214 iUserID = aSrc.iUserID; 215 iUserPasswd = aSrc.iUserPasswd; 216 }; 217 }; 218 219 //Source data for HTTP Progressive download (format type PVMF_DATA_SOURCE_HTTP_URL) 220 class PVMFSourceContextDataDownloadHTTP : public PVInterface 221 { 222 public: PVMFSourceContextDataDownloadHTTP()223 PVMFSourceContextDataDownloadHTTP() 224 { 225 iRefCounter = 0; 226 bIsNewSession = true; 227 iMaxFileSize = 0; 228 }; 229 PVMFSourceContextDataDownloadHTTP(const PVMFSourceContextDataDownloadHTTP & aSrc)230 PVMFSourceContextDataDownloadHTTP(const PVMFSourceContextDataDownloadHTTP& aSrc) : PVInterface(aSrc) 231 { 232 iRefCounter = 0; 233 MyCopy(aSrc); 234 }; 235 236 PVMFSourceContextDataDownloadHTTP& operator=(const PVMFSourceContextDataDownloadHTTP& aSrc) 237 { 238 if (&aSrc != this) 239 { 240 MyCopy(aSrc); 241 } 242 return *this; 243 }; 244 245 /* From PVInterface */ addRef()246 void addRef() 247 { 248 iRefCounter++; 249 } removeRef()250 void removeRef() 251 { 252 iRefCounter--; 253 } queryInterface(const PVUuid & uuid,PVInterface * & iface)254 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 255 { 256 if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_DOWNLOAD_HTTP_UUID)) 257 { 258 iface = this; 259 return true; 260 } 261 else 262 { 263 iface = NULL; 264 return false; 265 } 266 } 267 int32 iRefCounter; 268 269 bool bIsNewSession; //true if the downloading a new file 270 //false if keep downloading a partial downloading file 271 OSCL_wHeapString<OsclMemAllocator> iConfigFileName; //download config file 272 OSCL_wHeapString<OsclMemAllocator> iDownloadFileName; //local file name of the downloaded clip 273 uint32 iMaxFileSize; //the max size of the file. 274 OSCL_HeapString<OsclMemAllocator> iProxyName; //HTTP proxy name, either ip or dns 275 int32 iProxyPort; //HTTP proxy port 276 277 typedef enum // For Download only 278 { 279 ENoPlayback = 0, 280 EAfterDownload, 281 EAsap, 282 ENoSaveToFile, 283 EReserve 284 } TPVPlaybackControl; 285 TPVPlaybackControl iPlaybackControl; 286 287 // Optional UserID and UserAuthentication (e.g. password) string 288 // used for HTTP basic/digest authentication 289 OSCL_HeapString<OsclMemAllocator> iUserID; 290 OSCL_HeapString<OsclMemAllocator> iUserPasswd; 291 292 private: MyCopy(const PVMFSourceContextDataDownloadHTTP & aSrc)293 void MyCopy(const PVMFSourceContextDataDownloadHTTP& aSrc) 294 { 295 bIsNewSession = aSrc.bIsNewSession; 296 iConfigFileName = aSrc.iConfigFileName; 297 iDownloadFileName = aSrc.iDownloadFileName; 298 iMaxFileSize = aSrc.iMaxFileSize; 299 iProxyName = aSrc.iProxyName; 300 iProxyPort = aSrc.iProxyPort; 301 iUserID = aSrc.iUserID; 302 iUserPasswd = aSrc.iUserPasswd; 303 }; 304 }; 305 306 class CPVXInfo; 307 308 //Source data for Fasttrack download (format type PVMF_DATA_SOURCE_PVX_FILE) 309 class PVMFSourceContextDataDownloadPVX : public PVInterface 310 { 311 public: PVMFSourceContextDataDownloadPVX()312 PVMFSourceContextDataDownloadPVX() 313 { 314 iRefCounter = 0; 315 bIsNewSession = true; 316 iMaxFileSize = 0; 317 } 318 PVMFSourceContextDataDownloadPVX(const PVMFSourceContextDataDownloadPVX & aSrc)319 PVMFSourceContextDataDownloadPVX(const PVMFSourceContextDataDownloadPVX& aSrc) : PVInterface(aSrc) 320 { 321 iRefCounter = 0; 322 MyCopy(aSrc); 323 }; 324 325 PVMFSourceContextDataDownloadPVX& operator=(const PVMFSourceContextDataDownloadPVX& aSrc) 326 { 327 if (&aSrc != this) 328 { 329 MyCopy(aSrc); 330 } 331 return *this; 332 }; 333 334 /* From PVInterface */ addRef()335 void addRef() 336 { 337 iRefCounter++; 338 } removeRef()339 void removeRef() 340 { 341 iRefCounter--; 342 } queryInterface(const PVUuid & uuid,PVInterface * & iface)343 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 344 { 345 if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_DOWNLOAD_PVX_UUID)) 346 { 347 iface = this; 348 return true; 349 } 350 else 351 { 352 iface = NULL; 353 return false; 354 } 355 } 356 int32 iRefCounter; 357 358 bool bIsNewSession; //true if the downloading a new file 359 //false if keep downloading a partial downloading file 360 OSCL_wHeapString<OsclMemAllocator> iConfigFileName; //download config file 361 OSCL_wHeapString<OsclMemAllocator> iDownloadFileName; //local file name of the downloaded clip 362 uint32 iMaxFileSize; //the max size of the file. 363 OSCL_HeapString<OsclMemAllocator> iProxyName; //HTTP proxy name, either ip or dns 364 int32 iProxyPort; //HTTP proxy port 365 366 CPVXInfo *iPvxInfo; //class which contains all the info in the .pvx file except the URL 367 368 private: MyCopy(const PVMFSourceContextDataDownloadPVX & aSrc)369 void MyCopy(const PVMFSourceContextDataDownloadPVX& aSrc) 370 { 371 bIsNewSession = aSrc.bIsNewSession; 372 iConfigFileName = aSrc.iConfigFileName; 373 iDownloadFileName = aSrc.iDownloadFileName; 374 iMaxFileSize = aSrc.iMaxFileSize; 375 iProxyName = aSrc.iProxyName; 376 iProxyPort = aSrc.iProxyPort; 377 iPvxInfo = aSrc.iPvxInfo; 378 }; 379 }; 380 381 382 //Source Context Data for PVR 383 class PVMFPVRControl; 384 385 class PVMFSourceContextDataPVR : public PVInterface 386 { 387 public: 388 //default constructor PVMFSourceContextDataPVR()389 PVMFSourceContextDataPVR() 390 { 391 iRefCounter = 0; 392 iPVMFPVRControl = NULL; 393 iLiveBufferSizeInSeconds = 0; 394 }; 395 PVMFSourceContextDataPVR(const PVMFSourceContextDataPVR & aSrc)396 PVMFSourceContextDataPVR(const PVMFSourceContextDataPVR& aSrc) : PVInterface(aSrc) 397 { 398 iRefCounter = 0; 399 iPVMFPVRControl = NULL; 400 iLiveBufferSizeInSeconds = 0; 401 MyCopy(aSrc); 402 }; 403 404 PVMFSourceContextDataPVR& operator=(const PVMFSourceContextDataPVR& aSrc) 405 { 406 if (&aSrc != this) 407 { 408 MyCopy(aSrc); 409 } 410 return *this; 411 }; 412 SetPVRControl(PVMFPVRControl * aPVMFPVRControl)413 void SetPVRControl(PVMFPVRControl* aPVMFPVRControl) 414 { 415 iPVMFPVRControl = aPVMFPVRControl; 416 } 417 GetPVRControl()418 PVMFPVRControl* GetPVRControl() 419 { 420 return iPVMFPVRControl; 421 } 422 423 424 // void SetLiveBufferSizeInSeconds(uint32 aLiveBufferSizeInSeconds) 425 // { 426 // iLiveBufferSizeInSeconds = aLiveBufferSizeInSeconds; 427 // } 428 429 // uint32 LiveBufferSizeInSeconds() 430 // { 431 // return iLiveBufferSizeInSeconds; 432 // } 433 434 /* From PVInterface */ addRef()435 void addRef() 436 { 437 iRefCounter++; 438 } removeRef()439 void removeRef() 440 { 441 iRefCounter--; 442 } 443 queryInterface(const PVUuid & uuid,PVInterface * & iface)444 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 445 { 446 if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_PVR_UUID)) 447 { 448 iface = this; 449 return true; 450 } 451 else 452 { 453 iface = NULL; 454 return false; 455 } 456 } 457 458 private: MyCopy(const PVMFSourceContextDataPVR & aSrc)459 void MyCopy(const PVMFSourceContextDataPVR& aSrc) 460 { 461 // \todo: check this copy constructor 462 iPVMFPVRControl = aSrc.iPVMFPVRControl; 463 iLiveBufferSizeInSeconds = aSrc.iLiveBufferSizeInSeconds; 464 }; 465 466 // reference counter 467 int32 iRefCounter; 468 469 470 // This class doesn't own PVMFPVRControl 471 PVMFPVRControl* iPVMFPVRControl; 472 473 // temp buffer size in seconds 474 uint32 iLiveBufferSizeInSeconds; 475 }; 476 477 478 class PVMFPacketSource; 479 480 class PVMFSourceContextDataPacketSource : public PVInterface 481 { 482 public: 483 //default constructor PVMFSourceContextDataPacketSource()484 PVMFSourceContextDataPacketSource() 485 { 486 iRefCounter = 0; 487 iPacketSourcePlugin = NULL; 488 }; 489 PVMFSourceContextDataPacketSource(const PVMFSourceContextDataPacketSource & aSrc)490 PVMFSourceContextDataPacketSource(const PVMFSourceContextDataPacketSource& aSrc) : PVInterface(aSrc) 491 { 492 iRefCounter = 0; 493 MyCopy(aSrc); 494 }; 495 496 PVMFSourceContextDataPacketSource& operator=(const PVMFSourceContextDataPacketSource& aSrc) 497 { 498 if (&aSrc != this) 499 { 500 MyCopy(aSrc); 501 } 502 return *this; 503 }; 504 SetPacketSourcePlugin(PVMFPacketSource * aPacketSourcePlugin)505 void SetPacketSourcePlugin(PVMFPacketSource* aPacketSourcePlugin) 506 { 507 iPacketSourcePlugin = aPacketSourcePlugin; 508 } 509 GetPacketSourcePlugin()510 PVMFPacketSource* GetPacketSourcePlugin() 511 { 512 return iPacketSourcePlugin; 513 } 514 515 /* From PVInterface */ addRef()516 void addRef() 517 { 518 iRefCounter++; 519 } removeRef()520 void removeRef() 521 { 522 iRefCounter--; 523 } 524 queryInterface(const PVUuid & uuid,PVInterface * & iface)525 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 526 { 527 if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_PACKETSOURCE_UUID)) 528 { 529 iface = this; 530 return true; 531 } 532 else 533 { 534 iface = NULL; 535 return false; 536 } 537 } 538 539 private: MyCopy(const PVMFSourceContextDataPacketSource & aSrc)540 void MyCopy(const PVMFSourceContextDataPacketSource& aSrc) 541 { 542 // \todo: check this copy constructor 543 iPacketSourcePlugin = aSrc.iPacketSourcePlugin; 544 }; 545 546 // reference counter 547 int32 iRefCounter; 548 549 // This class doesn't own PVMFPVRControl 550 PVMFPacketSource* iPacketSourcePlugin; 551 }; 552 553 class PVMFSourceContextData : public PVInterface 554 { 555 public: PVMFSourceContextData()556 PVMFSourceContextData() 557 { 558 iRefCounter = 0; 559 iCommonDataContextValid = false; 560 iStreamingDataContextValid = false; 561 iDownloadHTTPDataContextValid = false; 562 iDownloadPVXDataContextValid = false; 563 iPVRDataContextValid = false; 564 iPacketSourceDataContextValid = false; 565 }; 566 PVMFSourceContextData(const PVMFSourceContextData & aSrc)567 PVMFSourceContextData(const PVMFSourceContextData& aSrc) : PVInterface(aSrc) 568 { 569 iRefCounter = 0; 570 MyCopy(aSrc); 571 }; 572 573 PVMFSourceContextData& operator=(const PVMFSourceContextData& aSrc) 574 { 575 if (&aSrc != this) 576 { 577 MyCopy(aSrc); 578 } 579 return *this; 580 }; 581 582 /* From PVInterface */ addRef()583 void addRef() 584 { 585 iRefCounter++; 586 } removeRef()587 void removeRef() 588 { 589 iRefCounter--; 590 } queryInterface(const PVUuid & uuid,PVInterface * & iface)591 bool queryInterface(const PVUuid& uuid, PVInterface*& iface) 592 { 593 if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_UUID)) 594 { 595 iface = this; 596 return true; 597 } 598 else if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_COMMON_UUID)) 599 { 600 if (iCommonDataContextValid == true) 601 { 602 iface = &iPVMFSourceContextDataCommon; 603 return true; 604 } 605 } 606 else if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_STREAMING_UUID)) 607 { 608 if (iStreamingDataContextValid == true) 609 { 610 iface = &iPVMFSourceContextDataStreaming; 611 return true; 612 } 613 } 614 else if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_DOWNLOAD_HTTP_UUID)) 615 { 616 if (iDownloadHTTPDataContextValid == true) 617 { 618 iface = &iPVMFSourceContextDataDownloadHTTP; 619 return true; 620 } 621 } 622 else if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_DOWNLOAD_PVX_UUID)) 623 { 624 if (iDownloadPVXDataContextValid == true) 625 { 626 iface = &iPVMFSourceContextDataDownloadPVX; 627 return true; 628 } 629 } 630 else if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_PVR_UUID)) 631 { 632 if (iPVRDataContextValid == true) 633 { 634 iface = &iPVMFSourceContextDataPVR; 635 return true; 636 } 637 } 638 else if (uuid == PVUuid(PVMF_SOURCE_CONTEXT_DATA_PACKETSOURCE_UUID)) 639 { 640 if (iPacketSourceDataContextValid == true) 641 { 642 iface = &iPVMFSourceContextDataPacketSource; 643 return true; 644 } 645 } 646 647 iface = NULL; 648 return false; 649 } 650 EnableCommonSourceContext()651 void EnableCommonSourceContext() 652 { 653 iCommonDataContextValid = true; 654 } EnableStreamingSourceContext()655 void EnableStreamingSourceContext() 656 { 657 iStreamingDataContextValid = true; 658 } EnableDownloadHTTPSourceContext()659 void EnableDownloadHTTPSourceContext() 660 { 661 iDownloadHTTPDataContextValid = true; 662 } EnableDownloadPVXSourceContext()663 void EnableDownloadPVXSourceContext() 664 { 665 iDownloadPVXDataContextValid = true; 666 } EnablePVRSourceContext()667 void EnablePVRSourceContext() 668 { 669 iPVRDataContextValid = true; 670 } EnablePacketSourceSourceContext()671 void EnablePacketSourceSourceContext() 672 { 673 iPacketSourceDataContextValid = true; 674 } DisableCommonSourceContext()675 void DisableCommonSourceContext() 676 { 677 iCommonDataContextValid = false; 678 } DisableStreamingSourceContext()679 void DisableStreamingSourceContext() 680 { 681 iStreamingDataContextValid = false; 682 } DisableeDownloadHTTPSourceContext()683 void DisableeDownloadHTTPSourceContext() 684 { 685 iDownloadHTTPDataContextValid = false; 686 } DisableDownloadPVXSourceContext()687 void DisableDownloadPVXSourceContext() 688 { 689 iDownloadPVXDataContextValid = false; 690 } DisablePVRSourceContext()691 void DisablePVRSourceContext() 692 { 693 iPVRDataContextValid = false; 694 } DisablePacketSourceSourceContext()695 void DisablePacketSourceSourceContext() 696 { 697 iPacketSourceDataContextValid = false; 698 } CommonData()699 PVMFSourceContextDataCommon* CommonData() 700 { 701 return iCommonDataContextValid ? &iPVMFSourceContextDataCommon : NULL; 702 } StreamingData()703 PVMFSourceContextDataStreaming* StreamingData() 704 { 705 return iStreamingDataContextValid ? &iPVMFSourceContextDataStreaming : NULL; 706 } DownloadHTTPData()707 PVMFSourceContextDataDownloadHTTP* DownloadHTTPData() 708 { 709 return iDownloadHTTPDataContextValid ? &iPVMFSourceContextDataDownloadHTTP : NULL; 710 } DownloadPVXData()711 PVMFSourceContextDataDownloadPVX* DownloadPVXData() 712 { 713 return iDownloadPVXDataContextValid ? &iPVMFSourceContextDataDownloadPVX : NULL; 714 } PVRData()715 PVMFSourceContextDataPVR* PVRData() 716 { 717 return iPVRDataContextValid ? &iPVMFSourceContextDataPVR : NULL; 718 } PacketSourceData()719 PVMFSourceContextDataPacketSource* PacketSourceData() 720 { 721 return iPacketSourceDataContextValid ? &iPVMFSourceContextDataPacketSource : NULL; 722 } 723 724 private: 725 int32 iRefCounter; 726 bool iCommonDataContextValid; 727 bool iStreamingDataContextValid; 728 bool iDownloadHTTPDataContextValid; 729 bool iDownloadPVXDataContextValid; 730 bool iPVRDataContextValid; 731 bool iPacketSourceDataContextValid; 732 733 PVMFSourceContextDataCommon iPVMFSourceContextDataCommon; 734 PVMFSourceContextDataStreaming iPVMFSourceContextDataStreaming; 735 PVMFSourceContextDataDownloadHTTP iPVMFSourceContextDataDownloadHTTP; 736 PVMFSourceContextDataDownloadPVX iPVMFSourceContextDataDownloadPVX; 737 PVMFSourceContextDataPVR iPVMFSourceContextDataPVR; 738 PVMFSourceContextDataPacketSource iPVMFSourceContextDataPacketSource; 739 MyCopy(const PVMFSourceContextData & aSrc)740 void MyCopy(const PVMFSourceContextData& aSrc) 741 { 742 iCommonDataContextValid = aSrc.iCommonDataContextValid; 743 iStreamingDataContextValid = aSrc.iStreamingDataContextValid; 744 iDownloadHTTPDataContextValid = aSrc.iDownloadHTTPDataContextValid; 745 iDownloadPVXDataContextValid = aSrc.iDownloadPVXDataContextValid; 746 iPVRDataContextValid = aSrc.iPVRDataContextValid; 747 iPacketSourceDataContextValid = aSrc.iPacketSourceDataContextValid; 748 749 iPVMFSourceContextDataCommon = aSrc.iPVMFSourceContextDataCommon; 750 iPVMFSourceContextDataStreaming = aSrc.iPVMFSourceContextDataStreaming; 751 iPVMFSourceContextDataDownloadHTTP = aSrc.iPVMFSourceContextDataDownloadHTTP; 752 iPVMFSourceContextDataDownloadPVX = aSrc.iPVMFSourceContextDataDownloadPVX; 753 iPVMFSourceContextDataPVR = aSrc.iPVMFSourceContextDataPVR; 754 iPVMFSourceContextDataPacketSource = aSrc.iPVMFSourceContextDataPacketSource; 755 }; 756 }; 757 758 #endif //PVMF_SOURCE_CONTEXT_DATA_H_INCLUDED 759 760