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 PV_PLAYER_TRACK_SELECTION_INTERFACE_H_INCLUDED 19 #define PV_PLAYER_TRACK_SELECTION_INTERFACE_H_INCLUDED 20 21 #ifndef OSCL_BASE_H_INCLUDED 22 #include "oscl_base.h" 23 #endif 24 #ifndef OSCL_TYPES_H_INCLUDED 25 #include "oscl_types.h" 26 #endif 27 #ifndef OSCL_VECTOR_H_INCLUDED 28 #include "oscl_vector.h" 29 #endif 30 #ifndef OSCL_STRING_H_INCLUDED 31 #include "oscl_string.h" 32 #endif 33 #ifndef PV_UUID_H_INCLUDED 34 #include "pv_uuid.h" 35 #endif 36 #ifndef PV_INTERFACE_H_INCLUDED 37 #include "pv_interface.h" 38 #endif 39 #ifndef PV_ENGINE_TYPES_H_INCLUDED 40 #include "pv_engine_types.h" 41 #endif 42 43 #define PV_PLAYER_TRACK_SELECTION_INTERFACE_MIMETYPE "pvxxx/pvplayer/track_selection_interface" 44 #define PVPlayerTrackSelectionInterfaceUuid PVUuid(0x960b3556,0xad6d,0x42bf,0xbc,0x3c,0xed,0x11,0x8d,0x50,0xd6,0x24) 45 46 class PVMFMediaPresentationInfo; 47 48 class PVMFTrackSelectionHelper 49 { 50 public: 51 /** 52 * A synchronous method to obtain track selection inputs from the 53 * user of pvPlayerSDK. If the user of pvPlayerSDK wishes to participate 54 * in the track selection process then, the user of the SDK needs to provide 55 * an implementation of this object. If provided, pvPlayerSDK will invoked the 56 * SelectTracks(...) API as part of prepare. 57 * 58 * 59 * @param aPlayableList [in] This is a data structure of type PVMFMediaPresentationInfo 60 * that holds the complete list of playable tracks. 61 * 62 * @param aPreferenceList [out] This is a data structure of type PVMFMediaPresentationInfo 63 * that holds the complete list of tracks that the user of SDK 64 * wants to play. The implementor of this object would have to allocate 65 * memory to populate the preference list. 66 * 67 * @returns PVMFSuccess if the wish list was successfully populated, 68 * PVMFErrNotSupported if user of SDK does not wish to provide inputs, 69 * PVMFFailure otherwise 70 */ 71 virtual PVMFStatus SelectTracks(const PVMFMediaPresentationInfo& aPlayableList, 72 PVMFMediaPresentationInfo& aPreferenceList) = 0; 73 74 /** 75 * A synchronous method to release the playable list of available tracks. 76 * This API will be called by pvPlayerSDK to release the memory allocated 77 * during SelectTracks. 78 * 79 * @param aList [in] This is a data structure of type PVMFMediaPresentationInfo 80 * that holds the preference list. 81 * 82 * @returns PVMFSuccess if the memory was successfully released, 83 * PVMFFailure otherwise 84 */ 85 virtual PVMFStatus ReleasePreferenceList(PVMFMediaPresentationInfo& aPreferenceList) = 0; 86 87 }; 88 89 /** 90 * Track Selection interface for pvPlayer 91 */ 92 class PVPlayerTrackSelectionInterface : public PVInterface 93 { 94 public: 95 96 /** 97 * A synchronous method to get the complete list of available tracks. 98 * This API can be called anytime after a successful player init, 99 * up until a reset. 100 * 101 * @param aList [out] This is a data structure of type PVMFMediaPresentationInfo 102 * that holds the complete list of available tracks. pvPlayerSDK 103 * allocates memory while populating aList. 104 * 105 * @returns PVMFSuccess if the list was successfully populated, 106 * PVMFErrInvalidState if invoked before init complete or after reset, 107 * PVMFFailure otherwise 108 */ 109 virtual PVMFStatus GetCompleteList(PVMFMediaPresentationInfo& aList) = 0; 110 111 /** 112 * A synchronous method to release the complete list of available tracks. 113 * This API must be called to release the memory allocated during GetCompleteList. 114 * 115 * @param aList [in] This is a data structure of type PVMFMediaPresentationInfo 116 * that holds the complete list of available tracks. 117 * 118 * @returns PVMFSuccess if the memory was successfully released, 119 * PVMFFailure otherwise 120 */ 121 virtual PVMFStatus ReleaseCompleteList(PVMFMediaPresentationInfo& aList) = 0; 122 123 /** 124 * A synchronous method to get the complete list of playable tracks. 125 * The list of playable tracks is a subset (at times a proper subset) of 126 * the complete list of available tracks. 127 * This API can be called anytime after a successful player prepare, 128 * up until a reset. 129 * 130 * @param aList [out] This is a data structure of type PVMFMediaPresentationInfo 131 * that holds the list of playable tracks. pvPlayerSDK 132 * allocates memory while populating aList. 133 * 134 * @returns PVMFSuccess if the list was successfully populated, 135 * PVMFErrInvalidState if invoked before prepare complete or after reset, 136 * PVMFFailure otherwise 137 */ 138 virtual PVMFStatus GetPlayableList(PVMFMediaPresentationInfo& aList) = 0; 139 140 /** 141 * A synchronous method to release the playable list of available tracks. 142 * This API must be called to release the memory allocated during GetPlayableList. 143 * 144 * @param aList [in] This is a data structure of type PVMFMediaPresentationInfo 145 * that holds the complete list of playable tracks. 146 * 147 * @returns PVMFSuccess if the memory was successfully released, 148 * PVMFFailure otherwise 149 */ 150 virtual PVMFStatus ReleasePlayableList(PVMFMediaPresentationInfo& aList) = 0; 151 152 /** 153 * A synchronous method to get the complete list of selected tracks. 154 * The list of selected tracks is a subset (at times a proper subset) of 155 * the list of playable tracks. 156 * This API can be called anytime after a successful player prepare, 157 * up until a reset. 158 * 159 * @param aList [out] This is a data structure of type PVMFMediaPresentationInfo 160 * that holds the list of selected tracks.pvPlayerSDK 161 * allocates memory while populating aList. 162 * 163 * @returns PVMFSuccess if the list was successfully populated, 164 * PVMFErrInvalidState if invoked before prepare complete or after reset, 165 * PVMFFailure otherwise 166 */ 167 virtual PVMFStatus GetSelectedList(PVMFMediaPresentationInfo& aList) = 0; 168 169 /** 170 * A synchronous method to release the playable list of available tracks. 171 * This API must be called to release the memory allocated during GetSelectedList. 172 * 173 * @param aList [in] This is a data structure of type PVMFMediaPresentationInfo 174 * that holds the complete list of selected tracks. 175 * 176 * @returns PVMFSuccess if the memory was successfully released, 177 * PVMFFailure otherwise 178 */ 179 virtual PVMFStatus ReleaseSelectedList(PVMFMediaPresentationInfo& aList) = 0; 180 181 /** 182 * A synchronous method to register the track selection helper object. 183 * This API can be called anytime after a successful player create, 184 * up until delete. This API can be invoked with NULL to effectively 185 * unregister a previously registered object. 186 * 187 * @param aObject [in] A pointer to track selection helper object, 188 * can be NULL. 189 * 190 * @returns PVMFSuccess if the object was accepted by pvPlayerSDK, 191 * PVMFErrAlreadyExists if there is a previously registered object, 192 * PVMFFailure otherwise 193 */ 194 virtual PVMFStatus RegisterHelperObject(PVMFTrackSelectionHelper* aObject) = 0; 195 196 }; 197 198 199 #endif // PV_PLAYER_LICENSE_ACQUISITION_INTERFACE_H_INCLUDED 200 201 202 203