• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DOWNLOAD_PROGRESS_EXTENSION_H
19 #define PVMF_DOWNLOAD_PROGRESS_EXTENSION_H
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 
40 #define PVMF_DOWNLOAD_PROGRESS_INTERFACE_MIMETYPE "x-pvmf/pvmf/download/progress"
41 #define PVMF_DOWNLOAD_PROGRESS_INTERFACE_UUID PVUuid(0x01da7746, 0x7d6b, 0x4673, 0xb9, 0x0c, 0x63, 0x2c, 0x82, 0xdd, 0x33, 0xad)
42 
43 class PVMFMP4ProgDownloadSupportInterface;
44 class PVMFFormatProgDownloadSupportInterface;
45 
46 class PVMFDownloadProgressInterface : public PVInterface
47 {
48     public:
49 
50         /**
51          * Sets the download support interface which provides access to some MP4 fileformat
52          * utilities that are used to determine download progress.
53          *
54          * @param  download_support_interface - the input parameter that is a pointer to the
55          * mp4 download support interface.
56          *
57          * @return - none
58          */
59         virtual void setMP4DownloadSupportInterface(PVMFMP4ProgDownloadSupportInterface* download_support_interface) = 0;
60 
61         /**
62          * Sets the download support interface which provides access to some fileformat (e.g. MP4, ASF or Real)
63          * utilities that are used to determine download progress.
64          *
65          * @param  download_support_interface - the input parameter that is a pointer to the
66          * mp4 download support interface.
67          *
68          * @return - none
69          */
70         virtual void setFormatDownloadSupportInterface(PVMFFormatProgDownloadSupportInterface* download_support_interface) = 0;
71 
72         /**
73          * Sets the clip duration for the objects with download support interface
74          *
75          * @param  aClipDurationMsec - the unit of the duration is milli-seconds
76          *
77          * @return - none
78          */
79         virtual void setClipDuration(const uint32 aClipDurationMsec) = 0;
80 
81 
82         /**
83          * Returns the download progress clock
84          *
85          * @return OsclSharedPtr<PVMFMediaClock> - the shared pointer to the download progress clock.
86          */
87         virtual OsclSharedPtr<PVMFMediaClock> getDownloadProgressClock() = 0;
88 
89         /**
90          * Requests notification when playback can continue uninterrupted based on the
91          * play position and the current download rate.
92          *
93          * @param currentNPTReadPosition The current playback position of the data source as millisecond NPT time
94          * @param aDownloadComplete Output parameter which will be set to true if the download has completed
95          *
96          * @return none
97          */
98         virtual void requestResumeNotification(const uint32 currentNPTReadPosition, bool& aDownloadComplete) = 0;
99 
100         /**
101         * Cancels any pending resume notification.
102         *
103         * @param none
104         *
105         * @return none
106         */
107         virtual void cancelResumeNotification() = 0;
108 
109 };
110 
111 #endif //PVMF_MP4_PROGDOWNLOAD_SUPPORT_EXTENSION_H
112 
113