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_COMPOSER_SIZE_AND_DURATION_H_INCLUDED 19 #define PVMF_COMPOSER_SIZE_AND_DURATION_H_INCLUDED 20 21 #ifndef OSCL_BASE_H_INCLUDED 22 #include "oscl_base.h" 23 #endif 24 #ifndef PV_UUID_H_INCLUDED 25 #include "pv_uuid.h" 26 #endif 27 #ifndef PV_INTERFACE_H_INCLUDED 28 #include "pv_interface.h" 29 #endif 30 31 /** Uuid of PVMFComposerSizeAndDurationEvent group of events */ 32 #define PvmfComposerSizeAndDurationEventsUuid PVUuid(0x68cd880f,0xf0fa,0x4ed9,0xaa,0x39,0x6f,0x33,0xc8,0xda,0xb1,0x82) 33 34 /** 35 * Enumerated list of informational events for maximum file size and duration, and 36 * recording progress report. 37 */ 38 typedef enum 39 { 40 PVMF_COMPOSER_MAXFILESIZE_REACHED = 2048, /**< Maximum file size reached */ 41 PVMF_COMPOSER_MAXDURATION_REACHED, /**< Maximum duration reached */ 42 PVMF_COMPOSER_FILESIZE_PROGRESS, /**< Recording progress report in terms of file size written */ 43 PVMF_COMPOSER_DURATION_PROGRESS, /**< Recording progress report in terms of duration recorded */ 44 PVMF_COMPOSER_EOS_REACHED 45 } PVMFComposerSizeAndDurationEvent; 46 47 /** Uuid of PvmfComposerSizeAndDurationInterface */ 48 #define PvmfComposerSizeAndDurationUuid PVUuid(0x09b87b61,0x34bc,0x4ccb,0x85,0x04,0x53,0x93,0xdb,0x5f,0x35,0x2d) 49 50 /** 51 * Configuration interface for maximum file size and duration, and recording progress 52 * reporting features. To use the features provided by this interface, the client 53 * must implement PVInformationalEventObserver interface to receive events generated. 54 */ 55 class PvmfComposerSizeAndDurationInterface : public PVInterface 56 { 57 public: 58 59 /** 60 * Set maximum file size. 61 * 62 * If maximum file size is enabled, the composer will stop the recording session 63 * when it detects that writing further media data to the output file will cause the 64 * size of output file to go beyond the maximum size. The client will receive 65 * an informational event PVMF_COMPOSER_MAXFILESIZE_REACHED after the maximum file 66 * size is reached and the recording session has stopped successfully. This method 67 * is valid only after a composer has been selected through 68 * PVAuthorEngineInterface::SelectComposer() method. 69 * 70 * @param aEnable Set to true to enable maximum file size, else set to false. 71 * @param aMaxFileSizeBytes If aEnable is set to true, this parameter specifies 72 * the maximum file size in bytes, else this parameter is ignored. 73 * @return Completion status. 74 */ 75 virtual PVMFStatus SetMaxFileSize(bool aEnable, uint32 aMaxFileSizeBytes) = 0; 76 77 /** 78 * Query maximum file size configuration. 79 * 80 * This method is valid only after a composer has been selected through 81 * PVAuthorEngineInterface::SelectComposer() method. 82 * 83 * @param aEnable Output parameter which will be set to true if maximum file size 84 * is enabled, else false. 85 * @param aMaxFileSizeBytes Output parameter which will be set to the maximum file 86 * size in bytes if aEnable is set to true, else this parameter is ignored. 87 */ 88 virtual void GetMaxFileSizeConfig(bool& aEnable, uint32& aMaxFileSizeBytes) = 0; 89 90 /** 91 * Set maximum recording duration. 92 * 93 * If maximum recording duration is enabled, the composer will stop the recording session 94 * when it detects that writing further media data to the output file will cause the 95 * duration of output file to go beyond the maximum duration. The client will receive 96 * an informational event PVMF_COMPOSER_MAXDURATION_REACHED after the maximum recording 97 * duration is reached and the recording session has stopped successfully. 98 * 99 * This method is valid only after a composer has been selected through 100 * PVAuthorEngineInterface::SelectComposer() method. 101 * 102 * @param aEnable Set to true to enable maximum duration, else set to false. 103 * @param aMaxDurationMilliseconds If aEnable is set to true, this parameter specifies 104 * the maximum recording duration in milliseconds, else this parameter is ignored. 105 * @return Completion status. 106 */ 107 virtual PVMFStatus SetMaxDuration(bool aEnable, uint32 aMaxDurationMilliseconds) = 0; 108 109 /** 110 * Query maximum recording duration configuration. 111 * 112 * This method is valid only after a composer has been selected through 113 * PVAuthorEngineInterface::SelectComposer() method. 114 * 115 * @param aEnable Output parameter which will be set to true if maximum recording duration 116 * is enabled, else false. 117 * @param aMaxFileSizeBytes Output parameter which will be set to the maximum recording duration 118 * in milliseconds if aEnable is set to true, else this parameter is ignored. 119 */ 120 virtual void GetMaxDurationConfig(bool& aEnable, uint32& aMaxDurationMilliseconds) = 0; 121 122 /** 123 * Configure recording progress report in terms of file size written. 124 * 125 * If recording progress report in terms of file size written is enabled, the composer will 126 * send informational event PVMF_COMPOSER_FILESIZE_PROGRESS periodically to the client 127 * to report progress. The frequency of progress report is set through the aReportFrequency 128 * parameter, which specifies the number of bytes written to output file per progress report. 129 * The progress can be retrieved by calling GetEventData method on the PVAsyncInformationalEvent 130 * object sent to the client in the PVInformationalEventObserver::HandleInformationalEvent 131 * observer function, and then cast the retrieved data to int32 type. 132 * 133 * This method is valid only after a composer has been selected through 134 * PVAuthorEngineInterface::SelectComposer() method. 135 * 136 * @param aEnable Output parameter which will be set to true if recording progress report 137 * in terms of file size written is enabled, else false. 138 * @param aReportFrequency Output parameter which will be set to the frequency of recording 139 * progress report in terms of bytes written per report. 140 */ 141 virtual PVMFStatus SetFileSizeProgressReport(bool aEnable, uint32 aReportFrequency) = 0; 142 143 /** 144 * Query configuration for recording progress report in terms of file size written. 145 * 146 * This method is valid only after a composer has been selected through 147 * PVAuthorEngineInterface::SelectComposer() method. 148 * 149 * @param aEnable Output parameter which will be set to true if recording progress report 150 * in terms of file size written is enabled, else false. 151 * @param aReportFrequency Output parameter which will be set to the frequency of recording 152 * progress report in terms of bytes written per report. 153 */ 154 virtual void GetFileSizeProgressReportConfig(bool& aEnable, uint32& aReportFrequency) = 0; 155 156 /** 157 * Configure recording progress report in terms of duration of output file. 158 * 159 * If recording progress report in terms of duration of output file is enabled, the composer will 160 * send informational event PVMF_COMPOSER_DURATION_PROGRESS periodically to the client 161 * to report progress. The frequency of progress report is set through the aReportFrequency 162 * parameter, which specifies the duration output file in milliseconds per progress report. 163 * The progress can be retrieved by calling GetEventData method on the PVAsyncInformationalEvent 164 * object sent to the client in the PVInformationalEventObserver::HandleInformationalEvent 165 * observer function, and then cast the retrieved data to int32 type. 166 * 167 * This method is valid only after a composer has been selected through 168 * PVAuthorEngineInterface::SelectComposer() method. 169 * 170 * @param aEnable Output parameter which will be set to true if recording progress report 171 * in terms of duration of output file is enabled, else false. 172 * @param aReportFrequency Output parameter which will be set to the frequency of recording 173 * progress report in terms of milliseconds recorded per report. 174 */ 175 virtual PVMFStatus SetDurationProgressReport(bool aEnable, uint32 aReportFrequency) = 0; 176 177 /** 178 * Query configuration for recording progress report in terms of duration of output file. 179 * 180 * This method is valid only after a composer has been selected through 181 * PVAuthorEngineInterface::SelectComposer() method. 182 * 183 * @param aEnable Output parameter which will be set to true if recording progress report 184 * in terms of duration of output file is enabled, else false. 185 * @param aReportFrequency Output parameter which will be set to the frequency of recording 186 * progress report in terms of milliseconds recorded per report. 187 */ 188 virtual void GetDurationProgressReportConfig(bool& aEnable, uint32& aReportFrequency) = 0; 189 }; 190 191 #endif // PVMF_COMPOSER_SIZE_AND_DURATION_H_INCLUDED 192 193 194 195 196