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 /* 19 * ============================================================================== 20 * Name : pv_player_datasource.h 21 * Part of : 22 * Interface : 23 * Description : Abstract base class for player engine data source 24 * Version : (see RELEASE field in copyright header above) 25 * 26 * ============================================================================== 27 */ 28 29 #ifndef PV_PLAYER_DATASOURCE_H_INCLUDED 30 #define PV_PLAYER_DATASOURCE_H_INCLUDED 31 32 #ifndef OSCL_BASE_H_INCLUDED 33 #include "oscl_base.h" 34 #endif 35 36 #ifndef OSCL_STRING_H_INCLUDED 37 #include "oscl_string.h" 38 #endif 39 40 #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED 41 #include "oscl_string_containers.h" 42 #endif 43 44 #ifndef PVMF_FORMAT_TYPE_H_INCLUDED 45 #include "pvmf_format_type.h" 46 #endif 47 48 class PVMFNodeInterface; 49 50 typedef enum 51 { 52 PVP_DATASRCTYPE_UNKNOWN, 53 PVP_DATASRCTYPE_URL, 54 PVP_DATASRCTYPE_SOURCENODE 55 } PVPDataSourceType; 56 57 58 // CLASS DECLARATION 59 /** 60 * PVPlayerDataSource is an abstract base class for player engine data source. 61 * Player engine expects the data source to be derived from PVPlayerDataSource. 62 **/ 63 class PVPlayerDataSource 64 { 65 public: 66 /** 67 * Object destructor function 68 **/ 69 virtual ~PVPlayerDataSource() {}; 70 71 /** 72 * Returns this instance's data source type 73 * 74 * @returns The PVPlayer data source type 75 **/ 76 virtual PVPDataSourceType GetDataSourceType() = 0; 77 78 /** 79 * Returns this data source instance's format type 80 * 81 * @returns The format type 82 **/ 83 virtual PVMFFormatType GetDataSourceFormatType() = 0; 84 85 /** 86 * Returns the URL for the data source 87 * 88 * @returns The URL as an OSCL_wString 89 **/ 90 virtual OSCL_wString& GetDataSourceURL() = 0; 91 92 /** 93 * Returns the opaque data specific for the data source 94 * 95 * @returns The opaque data as OsclAny pointer 96 **/ 97 virtual OsclAny* GetDataSourceContextData() = 0; 98 99 /** 100 * Returns the node interface for the data source 101 * 102 * @returns The node interface pointer to the data source 103 **/ 104 virtual PVMFNodeInterface* GetDataSourceNodeInterface() = 0; 105 106 /** 107 * Sets alternate source format type. The format types 108 * would internally go into a queue(FIFO). So in case the caller 109 * has a certain order of priority for alternates, then the 110 * caller would have to make sure the calls are made in that 111 * order. 112 * These alternates are used in case the app wants to the 113 * engine to try alternate source nodes for the same url 114 * 115 * @returns true if the alternate source format type was 116 * successfully added to the queue, false otherwise. 117 **/ 118 virtual bool SetAlternateSourceFormatType(PVMFFormatType aFormatType) = 0; 119 120 /** 121 * Returns the number of alternate source format types, if any. 122 * These alternates are used in case the app wants to the 123 * engine to try alternate source nodes for the same url 124 * 125 * @returns Number of alternate source format types 126 **/ 127 virtual uint32 GetNumAlternateSourceFormatTypes() = 0; 128 129 /** 130 * Returns the alternate source format type, based on index. 131 * (Index is zero based) 132 * These alternates are used in case the app wants to the 133 * engine to try alternate source nodes for the same url 134 * 135 * @returns true if a valid source format type is found 136 * corresponding to the mentioned index, false otherwise. 137 **/ 138 virtual bool GetAlternateSourceFormatType(PVMFFormatType& aFormatType, 139 uint32 aIndex) = 0; 140 141 }; 142 143 #endif // PV_PLAYER_DATASOURCE_H_INCLUDED 144 145