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_FORMAT_PROGDOWNLOAD_SUPPORT_EXTENSION_H_INCLUDED 19 #define PVMF_FORMAT_PROGDOWNLOAD_SUPPORT_EXTENSION_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_SHARED_PTR_H_INCLUDED 28 #include "oscl_shared_ptr.h" 29 #endif 30 #ifndef PVMF_MEDIA_CLOCK_H_INCLUDED 31 #include "pvmf_media_clock.h" 32 #endif 33 #ifndef PV_UUID_H_INCLUDED 34 #include "pv_uuid.h" 35 #endif 36 #ifndef PV_INTERFACE_H 37 #include "pv_interface.h" 38 #endif 39 #ifndef PVMI_KVP_H_INCLUDED 40 #include "pvmi_kvp.h" 41 #endif 42 43 #define PVMF_FF_PROGDOWNLOAD_SUPPORT_INTERFACE_MIMETYPE "x-pvmf/pvmf/ff/progdownload-support" 44 #define PVMF_FF_PROGDOWNLOAD_SUPPORT_INTERFACE_UUID PVUuid(0x00f80b00, 0x4bd4, 0x4656, 0x8e, 0x0f, 0x63, 0xe0, 0x3d, 0x7a, 0x5f, 0x39) 45 46 class PVMFDownloadProgressInterface; 47 48 class PVMFFormatProgDownloadSupportInterface: public PVInterface 49 { 50 public: 51 52 /** 53 * This API return the timestamp of a sample that is closest to the given fileSize. 54 * 55 * @param aFileSize 56 * 57 * @param uint32& timeStamp - gives the NPT in milliseconds of the closest sample to the fileSize byte offset. 58 * 59 * @return EVERYTHING_FINE - In case a valid sample and corresponding time stamp was located. 60 * INSUFFICIENT_DATA in case the very first sample location is past the fileSize 61 * Any other return value indicates ERROR. 62 * 63 */ 64 virtual int32 convertSizeToTime(uint32 aFileSize, uint32& aNPTInMS) = 0; 65 66 /** 67 * This API sets the file size to parser node. If the file size is not available, then this API shouldn't be called 68 * @param aFileSize 69 */ 70 virtual void setFileSize(const uint32 aFileSize) = 0; 71 72 /** 73 * Sets the download progress interface which will be used to determine if there is sufficient 74 * data downloaded to proceed with playback and request notification play resume if autopause is 75 * necessary. 76 * 77 * @param download_progress - this parameter is an interface pointer to the set of APIs for download progress. 78 * 79 * @return - none 80 * 81 */ 82 virtual void setDownloadProgressInterface(PVMFDownloadProgressInterface* download_progress) = 0; 83 84 /** 85 * Callback in response to the requestResumeNotification call in PVMFDownloadProgressInterface when 86 * playback can continue 87 * 88 * @param aDownloadComplete Set to true if download operation has fully completed between requestResumeNotification and this callback 89 * 90 * @return - none 91 */ 92 virtual void playResumeNotification(bool aDownloadComplete) = 0; 93 94 /** 95 * Notifies that the download is complete. 96 * 97 * @param - none 98 * 99 * @return - none 100 */ 101 virtual void notifyDownloadComplete() = 0; 102 103 /** 104 * Set the protocol information that is defined as kvp 105 * 106 * @param aInfoKvpVec, a kvp vector of all protocol information 107 * 108 * @return true means success, and false means any exceptional case, such as aInfoKvpVec has nothing 109 */ setProtocolInfo(Oscl_Vector<PvmiKvp *,OsclMemAllocator> & aInfoKvpVec)110 virtual bool setProtocolInfo(Oscl_Vector<PvmiKvp*, OsclMemAllocator>& aInfoKvpVec) 111 { 112 OSCL_UNUSED_ARG(aInfoKvpVec); 113 return true; 114 } 115 116 }; 117 118 #endif //PVMF_FF_PROGDOWNLOAD_SUPPORT_EXTENSION_H_INCLUDED 119 120 121