Table of Contents

Wwise SDK 2019.2.3
IAkStreamMgr.h
1 /*******************************************************************************
2 The content of this file includes portions of the AUDIOKINETIC Wwise Technology
3 released in source code form as part of the SDK installer package.
4 
5 Commercial License Usage
6 
7 Licensees holding valid commercial licenses to the AUDIOKINETIC Wwise Technology
8 may use this file in accordance with the end user license agreement provided
9 with the software or, alternatively, in accordance with the terms contained in a
10 written agreement between you and Audiokinetic Inc.
11 
12 Apache License Usage
13 
14 Alternatively, this file may be used under the Apache License, Version 2.0 (the
15 "Apache License"); you may not use this file except in compliance with the
16 Apache License. You may obtain a copy of the Apache License at
17 http://www.apache.org/licenses/LICENSE-2.0.
18 
19 Unless required by applicable law or agreed to in writing, software distributed
20 under the Apache License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
21 OR CONDITIONS OF ANY KIND, either express or implied. See the Apache License for
22 the specific language governing permissions and limitations under the License.
23 
24  Version: <VERSION> Build: <BUILDNUMBER>
25  Copyright (c) <COPYRIGHTYEAR> Audiokinetic Inc.
26 *******************************************************************************/
27 
28 /// \file
29 /// Defines the API of Audiokinetic's I/O streaming solution.
30 
31 #ifndef _IAK_STREAM_MGR_H_
32 #define _IAK_STREAM_MGR_H_
33 
34 #include <AK/SoundEngine/Common/AkMemoryMgr.h>
35 
36 //-----------------------------------------------------------------------------
37 // Defines.
38 //-----------------------------------------------------------------------------
39 
40 /// \name Profiling string lengths.
41 //@{
42 #define AK_MONITOR_STREAMNAME_MAXLENGTH (64)
43 #define AK_MONITOR_DEVICENAME_MAXLENGTH (16)
44 //@}
45 
46 //-----------------------------------------------------------------------------
47 // Enums.
48 //-----------------------------------------------------------------------------
49 
50 /// Stream status.
51 enum AkStmStatus
52 {
53  AK_StmStatusIdle = 0, ///< The stream is idle
54  AK_StmStatusCompleted = 1, ///< Operation completed / Automatic stream reached end
55  AK_StmStatusPending = 2, ///< Operation pending / The stream is waiting for I/O
56  AK_StmStatusCancelled = 3, ///< Operation cancelled
57  AK_StmStatusError = 4 ///< The low-level I/O reported an error
58 };
59 
60 /// Move method for position change.
61 /// \sa
62 /// - AK::IAkStdStream::SetPosition()
63 /// - AK::IAkAutoStream::SetPosition()
64 enum AkMoveMethod
65 {
66  AK_MoveBegin = 0, ///< Move offset from the start of the stream
67  AK_MoveCurrent = 1, ///< Move offset from the current stream position
68  AK_MoveEnd = 2 ///< Move offset from the end of the stream
69 };
70 
71 /// File open mode.
72 enum AkOpenMode
73 {
74  AK_OpenModeRead = 0, ///< Read-only access
75  AK_OpenModeWrite = 1, ///< Write-only access (opens the file if it already exists)
76  AK_OpenModeWriteOvrwr = 2, ///< Write-only access (deletes the file if it already exists)
77  AK_OpenModeReadWrite = 3 ///< Read and write access
78 };
79 
80 /// File system flags for file descriptors mapping.
82 {
84  : uCacheID( AK_INVALID_FILE_ID ) {}
85 
86  AkFileSystemFlags( AkUInt32 in_uCompanyID, AkUInt32 in_uCodecID, AkUInt32 in_uCustomParamSize, void * in_pCustomParam, bool in_bIsLanguageSpecific, AkFileID in_uCacheID )
87  : uCompanyID( in_uCompanyID )
88  , uCodecID( in_uCodecID )
89  , uCustomParamSize( in_uCustomParamSize )
90  , pCustomParam( in_pCustomParam )
91  , bIsLanguageSpecific( in_bIsLanguageSpecific )
92  , uCacheID( in_uCacheID )
93  , uNumBytesPrefetch( 0 ) {}
94 
95  AkUInt32 uCompanyID; ///< Company ID (Wwise uses AKCOMPANYID_AUDIOKINETIC, defined in AkTypes.h, for soundbanks and standard streaming files, and AKCOMPANYID_AUDIOKINETIC_EXTERNAL for streaming external sources).
96  AkUInt32 uCodecID; ///< File/codec type ID (defined in AkTypes.h)
97  AkUInt32 uCustomParamSize; ///< Size of the custom parameter
98  void * pCustomParam; ///< Custom parameter
99  bool bIsLanguageSpecific;///< True when the file location depends on language
100  bool bIsAutomaticStream; ///< True when the file is opened to be used as an automatic stream. Note that you don't need to set it.
101  ///< If you pass an AkFileSystemFlags to IAkStreamMgr CreateStd|Auto(), it will be set internally to the correct value.
102  AkFileID uCacheID; ///< Cache ID for caching system used by automatic streams. The user is responsible for guaranteeing unicity of IDs.
103  ///< When set, it supersedes the file ID passed to AK::IAkStreamMgr::CreateAuto() (ID version). Caching is optional and depends on the implementation.
104  AkUInt32 uNumBytesPrefetch; ///< Indicates the number of bytes from the beginning of the file that should be streamed into cache via a caching stream. This field is only relevant when opening caching streams via
105  ///< AK::IAkStreamMgr::PinFileInCache() and AK::SoundEngine::PinEventInStreamCache(). When using AK::SoundEngine::PinEventInStreamCache(),
106  ///< it is initialized to the prefetch size stored in the sound bank, but may be changed by the file location resolver, or set to 0 to cancel caching.
107 };
108 
109 /// Stream information.
110 /// \sa
111 /// - AK::IAkStdStream::GetInfo()
112 /// - AK::IAkAutoStream::GetInfo()
114 {
115  AkDeviceID deviceID; ///< Device ID
116  const AkOSChar * pszName; ///< User-defined stream name (specified through AK::IAkStdStream::SetStreamName() or AK::IAkAutoStream::SetStreamName())
117  AkUInt64 uSize; ///< Total stream/file size in bytes
118  bool bIsOpen; ///< True when the file is open (implementations may defer file opening)
119 };
120 
121 /// Automatic streams heuristics.
123 {
124  AkReal32 fThroughput; ///< Average throughput in bytes/ms
125  AkUInt32 uLoopStart; ///< Set to the start of loop (byte offset from the beginning of the stream) for streams that loop, 0 otherwise
126  AkUInt32 uLoopEnd; ///< Set to the end of loop (byte offset from the beginning of the stream) for streams that loop, 0 otherwise
127  AkUInt8 uMinNumBuffers; ///< Minimum number of buffers if you plan to own more than one buffer at a time, 0 or 1 otherwise
128  ///< \remarks You should always release buffers as fast as possible, therefore this heuristic should be used only when
129  ///< dealing with special contraints, like drivers or hardware that require more than one buffer at a time.\n
130  ///< Also, this is only a heuristic: it does not guarantee that data will be ready when calling AK::IAkAutoStream::GetBuffer().
131  AkPriority priority; ///< The stream priority. it should be between AK_MIN_PRIORITY and AK_MAX_PRIORITY (included).
132 };
133 
134 /// Automatic streams buffer settings/constraints.
136 {
137  AkUInt32 uBufferSize; ///< Hard user constraint: When non-zero, forces the I/O buffer to be of size uBufferSize
138  ///< (overriding the device's granularity).
139  ///< Otherwise, the size is determined by the device's granularity.
140  AkUInt32 uMinBufferSize; ///< Soft user constraint: When non-zero, specifies a minimum buffer size
141  ///< \remarks Ignored if uBufferSize is specified.
142  AkUInt32 uBlockSize; ///< Hard user constraint: When non-zero, buffer size will be a multiple of that number, and returned addresses will always be aligned on multiples of this value.
143 };
144 
145 /// \name Profiling structures.
146 //@{
147 
148 /// Device descriptor.
150 {
151  AkDeviceID deviceID; ///< Device ID
152  bool bCanWrite; ///< Specifies whether or not the device is writable
153  bool bCanRead; ///< Specifies whether or not the device is readable
154  AkUtf16 szDeviceName[AK_MONITOR_DEVICENAME_MAXLENGTH]; ///< Device name
155  AkUInt32 uStringSize; ///< Device name string's size (number of characters)
156 };
157 
158 /// Device descriptor.
160 {
161  AkDeviceID deviceID; ///< Device ID
162  AkUInt32 uMemSize; ///< IO memory pool size
163  AkUInt32 uMemUsed; ///< IO memory pool used
164  AkUInt32 uAllocs; ///< Cumulative number of allocations
165  AkUInt32 uFrees; ///< Cumulative number of deallocations
166  AkUInt32 uPeakRefdMemUsed; ///< Memory peak since monitoring started
167  AkUInt32 uUnreferencedCachedBytes; ///< IO memory that is cached but is not currently used for active streams.
168  AkUInt32 uGranularity; ///< IO memory pool block size
169  AkUInt32 uNumActiveStreams; ///< Number of streams that have been active in the previous frame
170  AkUInt32 uTotalBytesTransferred; ///< Number of bytes transferred, including cached transfers
171  AkUInt32 uLowLevelBytesTransferred; ///< Number of bytes transferred exclusively via low-level
172  AkReal32 fAvgCacheEfficiency; ///< Total bytes from cache as a percentage of total bytes.
173  AkUInt32 uNumLowLevelRequestsCompleted; ///< Number of low-level transfers that have completed in the previous monitoring frame
174  AkUInt32 uNumLowLevelRequestsCancelled; ///< Number of low-level transfers that were cancelled in the previous monitoring frame
175  AkUInt32 uNumLowLevelRequestsPending; ///< Number of low-level transfers that are currently pending
176  AkUInt32 uCustomParam; ///< Custom number queried from low-level IO.
177  AkUInt32 uCachePinnedBytes; ///< Number of bytes that can be pinned into cache.
178 };
179 
180 /// Stream general information.
182 {
183  AkUInt32 uStreamID; ///< Unique stream identifier
184  AkDeviceID deviceID; ///< Device ID
185  AkUtf16 szStreamName[AK_MONITOR_STREAMNAME_MAXLENGTH]; ///< Stream name
186  AkUInt32 uStringSize; ///< Stream name string's size (number of characters)
187  AkUInt64 uFileSize; ///< File size
188  AkUInt32 uCustomParamSize; ///< File descriptor's uCustomParamSize
189  AkUInt32 uCustomParam; ///< File descriptor's pCustomParam (on 32 bits)
190  bool bIsAutoStream; ///< True for auto streams
191  bool bIsCachingStream; ///< True for caching streams
192 };
193 
194 /// Stream statistics.
196 {
197  AkUInt32 uStreamID; ///< Unique stream identifier
198  // Status (replace)
199  AkUInt32 uPriority; ///< Stream priority
200  AkUInt64 uFilePosition; ///< Current position
201  AkUInt32 uTargetBufferingSize; ///< Total stream buffer size (specific to IAkAutoStream)
202  AkUInt32 uVirtualBufferingSize; ///< Size of available data including requested data (specific to IAkAutoStream)
203  AkUInt32 uBufferedSize; ///< Size of available data (specific to IAkAutoStream)
204  AkUInt32 uNumBytesTransfered; ///< Transfered amount since last query (Accumulate/Reset)
205  AkUInt32 uNumBytesTransferedLowLevel;///< Transfered amount (from low-level IO only) since last query (Accumulate/Reset)
206  AkUInt32 uMemoryReferenced; ///< Amount of streaming memory referenced by this stream
207  AkReal32 fEstimatedThroughput; ///< Estimated throughput heuristic
208  bool bActive; ///< True if this stream has been active (that is, was ready for I/O or had at least one pending I/O transfer, uncached or not) in the previous frame
209 };
210 //@}
211 
212 namespace AK
213 {
214  /// \name Profiling interfaces.
215  //@{
216 
217  /// Profiling interface of streams.
218  /// \akwarning
219  /// The functions in this interface are not thread-safe, unless stated otherwise.
220  /// \endakwarning
222  {
223  protected:
224  /// Virtual destructor on interface to avoid warnings.
225  virtual ~IAkStreamProfile(){}
226 
227  public:
228  /// Returns the stream's record (once).
229  /// \sa
230  /// - \ref streamingdevicemanager
231  virtual void GetStreamRecord(
232  AkStreamRecord & out_streamRecord ///< Returned stream record interface
233  ) = 0;
234 
235  /// Returns the stream's statistics (every profile frame).
236  /// \sa
237  /// - \ref streamingdevicemanager
238  virtual void GetStreamData(
239  AkStreamData & out_streamData ///< Returned periodic stream data interface
240  ) = 0;
241 
242  /// Query the stream's "new" flag.
243  /// \return True, until AK::IAkStreamProfile::ClearNew() is called.
244  /// \sa
245  /// - \ref streamingdevicemanager
246  virtual bool IsNew() = 0;
247 
248  /// Resets the stream's "new" flag.
249  /// \sa
250  /// - \ref streamingdevicemanager
251  virtual void ClearNew() = 0;
252  };
253 
254 
255  /// Profiling interface of high-level I/O devices.
256  /// \akwarning
257  /// The functions in this interface are not thread-safe, unless stated otherwise.
258  /// \endakwarning
260  {
261  protected:
262  /// Virtual destructor on interface to avoid warnings.
263  virtual ~IAkDeviceProfile(){}
264 
265  public:
266 
267  /// Notify device when monitor sampling starts.
268  virtual void OnProfileStart() = 0;
269 
270  /// Notify device when monitor sampling ends.
271  virtual void OnProfileEnd() = 0;
272 
273  /// Query the device's description (once).
274  /// \sa
275  /// - \ref streamingdevicemanager
276  virtual void GetDesc(
277  AkDeviceDesc & out_deviceDesc ///< Device descriptor.
278  ) = 0;
279 
280  /// Query the device's statistics (at every profiling frame).
281  /// \sa
282  /// - \ref streamingdevicemanager
283  virtual void GetData(
284  AkDeviceData & out_deviceData ///< Device data.
285  ) = 0;
286 
287  /// Query the device's "new" flag.
288  /// \return True, until ClearNew() is called.
289  /// \sa
290  /// - \ref streamingdevicemanager
291  virtual bool IsNew() = 0;
292 
293  /// Resets the device's "new" flag.
294  /// \sa
295  /// - \ref streamingdevicemanager
296  virtual void ClearNew() = 0;
297 
298  /// Get the number of streams currently associated with that device.
299  /// \return The number of streams
300  /// \sa
301  /// - \ref streamingdevicemanager
302  virtual AkUInt32 GetNumStreams() = 0;
303 
304  /// Get a stream profile, for a specified stream index.
305  /// \remarks GetStreamProfile() refers to streams by index, which must honor the call to AK::IAkDeviceProfile::GetNumStreams().
306  /// \sa
307  /// - \ref streamingdevicemanager
309  AkUInt32 in_uStreamIndex ///< Stream index: [0,numStreams[
310  ) = 0;
311  };
312 
313  /// Profiling interface of the Stream Manager.
314  /// \akwarning
315  /// The functions in this interface are not thread-safe, unless stated otherwise.
316  /// \endakwarning
318  {
319  protected:
320  /// Virtual destructor on interface to avoid warnings.
322 
323  public:
324  /// Start profile monitoring.
325  /// \return AK_Success if successful, AK_Fail otherwise.
326  /// \sa
327  /// - \ref streamingdevicemanager
328  virtual AKRESULT StartMonitoring() = 0;
329 
330  /// Stop profile monitoring.
331  /// \sa
332  /// - \ref streamingdevicemanager
333  virtual void StopMonitoring() = 0;
334 
335  /// Device enumeration.
336  /// \return The number of devices.
337  /// \sa
338  /// - \ref streamingdevicemanager
339  virtual AkUInt32 GetNumDevices() = 0;
340 
341  /// Get a device profile for a specified device index.
342  /// \remarks GetDeviceProfile() refers to devices by index, which must honor the call to AK::IAkStreamMgrProfile::GetNumDevices().
343  /// \remarks The device index is not the same as the device ID (AkDeviceID).
344  /// \sa
345  /// - \ref streamingdevicemanager
347  AkUInt32 in_uDeviceIndex ///< Device index: [0,numDevices[
348  ) = 0;
349  };
350  //@}
351 
352  /// \name High-level streams API.
353  //@{
354 
355  /// Interface of standard streams. Used as a handle to a standard stream. Has methods for
356  /// stream control. Obtained through the Stream Manager's AK::IAkStreamMgr::CreateStd() method.
357  /// \akwarning
358  /// The functions in this interface are not thread-safe, unless stated otherwise.
359  /// \endakwarning
361  {
362  protected:
363  /// Virtual destructor on interface to avoid warnings.
364  virtual ~IAkStdStream(){}
365 
366  public:
367  /// \name Stream management and settings.
368  //@{
369  /// Close the stream. The object is destroyed and the interface becomes invalid.
370  /// \sa
371  /// - \ref streamingdevicemanager
372  virtual void Destroy() = 0;
373 
374  /// Get information about a stream.
375  /// \sa
376  /// - \ref streamingdevicemanager
377  virtual void GetInfo(
378  AkStreamInfo & out_info ///< Returned stream info
379  ) = 0;
380 
381  /// Returns a unique cookie for a given stream.
382  /// The default implementation of the Stream Manager returns its file descriptor (see AkStreamMgrModule.h).
383  virtual void * GetFileDescriptor() = 0;
384 
385  /// Give the stream a name (appears in the Wwise Profiler).
386  /// \sa
387  /// - \ref streamingdevicemanager
388  virtual AKRESULT SetStreamName(
389  const AkOSChar * in_pszStreamName ///< Stream name
390  ) = 0;
391 
392  /// Get the I/O block size.
393  /// \remark Queries the low-level I/O, by calling AK::StreamMgr::IAkLowLevelIOHook::GetBlockSize() with the
394  /// stream's file descriptor.
395  /// \return The block size, in bytes.
396  /// \sa
397  /// - \ref streamingdevicemanager
398  virtual AkUInt32 GetBlockSize() = 0;
399  //@}
400 
401  /// \name I/O operations.
402  //@{
403 
404  /// Schedule a read request.
405  /// \warning Use only with a multiple of the block size, queried via AK::IAkStdStream::GetBlockSize().
406  /// \remarks If the call is asynchronous (in_bWait = false), wait until AK::IAkStdStream::GetStatus() stops returning AK_StmStatusPending.
407  /// \return AK_Success if the operation was successfully scheduled (but not necessarily completed)
408  /// \sa
409  /// - \ref streamingdevicemanager
410  virtual AKRESULT Read(
411  void * in_pBuffer, ///< User buffer address
412  AkUInt32 in_uReqSize, ///< Requested read size
413  bool in_bWait, ///< Block until the operation is complete
414  AkPriority in_priority, ///< Heuristic: operation priority
415  AkReal32 in_fDeadline, ///< Heuristic: operation deadline (ms)
416  AkUInt32 & out_uSize ///< The size that was actually read
417  ) = 0;
418 
419  /// Schedule a write request.
420  /// \warning Use only with a multiple of the block size, queried via AK::IAkStdStream::GetBlockSize().
421  /// \remarks If the call is asynchronous (in_bWait = false), wait until GetStatus() stops returning AK_StmStatusPending.
422  /// \return AK_Success if the operation was successfully scheduled
423  /// \sa
424  /// - \ref streamingdevicemanager
425  virtual AKRESULT Write(
426  void * in_pBuffer, ///< User buffer address
427  AkUInt32 in_uReqSize, ///< Requested write size
428  bool in_bWait, ///< Block until the operation is complete
429  AkPriority in_priority, ///< Heuristic: operation priority
430  AkReal32 in_fDeadline, ///< Heuristic: operation deadline (ms)
431  AkUInt32 & out_uSize ///< The size that was actually written
432  ) = 0;
433 
434  /// Get the current stream position.
435  /// \remarks If an operation is pending, there is no guarantee that the position was queried before (or after) the operation was completed.
436  /// \return The current stream position
437  /// \sa
438  /// - \ref streamingdevicemanager
439  virtual AkUInt64 GetPosition(
440  bool * out_pbEndOfStream ///< Returned end-of-stream flag, only for streams opened with AK_OpenModeRead (can pass NULL)
441  ) = 0;
442 
443  /// Set the stream position. Modifies the position for the next read/write operation.
444  /// \warning No operation should be pending.
445  /// \remarks The new position will snap to the lowest block boundary.
446  /// \return AK_Success if the stream position was changed
447  /// \sa
448  /// - \ref streamingdevicemanager
449  virtual AKRESULT SetPosition(
450  AkInt64 in_iMoveOffset, ///< Seek offset
451  AkMoveMethod in_eMoveMethod, ///< Seek method, from the beginning, end, or current file position
452  AkInt64 * out_piRealOffset ///< The actual seek offset may differ from the expected value when the block size is bigger than 1.
453  ///< In that case, the seek offset floors to the sector boundary. Can pass NULL.
454  ) = 0;
455 
456  /// Cancel the current operation.
457  /// \remarks When it returns, the caller is guaranteed that no operation is pending.
458  /// \remarks This method can block the caller for the whole duration of the I/O operation, if the request was already posted.
459  /// \sa
460  /// - \ref streamingdevicemanager
461  virtual void Cancel() = 0;
462 
463  //@}
464 
465  /// \name Access to data and status.
466  //@{
467  /// Get user data (and accessed size).
468  /// \return The address of data provided by user
469  /// \sa
470  /// - \ref streamingdevicemanager
471  virtual void * GetData(
472  AkUInt32 & out_uSize ///< Size actually read or written
473  ) = 0;
474 
475  /// Get the stream's status.
476  /// \return The stream status.
477  /// \sa
478  /// - \ref streamingdevicemanager
479  virtual AkStmStatus GetStatus() = 0;
480 
481  /// Block and wait for a pending read to finish, and return the current status of the stream.
482  /// This will return immediately if the status is not pending.
483  /// \return The stream status.
484  /// \sa
485  /// - \ref streamingdevicemanager
486  virtual AkStmStatus WaitForPendingOperation() = 0;
487 
488  //@}
489  };
490 
491 
492  /// Interface of automatic streams. It is used as a handle to a stream,
493  /// I/O operations are triggered from here.
494  /// Obtained through the Stream Manager's AK::IAkStreamMgr::CreateAuto() method.
495  /// \akwarning
496  /// The functions in this interface are not thread-safe, unless stated otherwise.
497  /// \endakwarning
498  /// \sa
499  /// - \ref streamingdevicemanager
501  {
502  protected:
503  /// Virtual destructor on interface to avoid warnings.
504  virtual ~IAkAutoStream(){}
505 
506  public:
507  /// \name Stream management, settings access, and run-time change.
508  //@{
509  /// Close the stream. The object is destroyed and the interface becomes invalid.
510  /// \sa
511  /// - \ref streamingdevicemanager
512  virtual void Destroy() = 0;
513 
514  /// Get information about the stream.
515  /// \sa
516  /// - \ref streamingdevicemanager
517  virtual void GetInfo(
518  AkStreamInfo & out_info ///< Returned stream info
519  ) = 0;
520 
521  /// Returns a unique cookie for a given stream.
522  /// The default implementation of the Stream Manager returns its file descriptor (see AkStreamMgrModule.h).
523  virtual void * GetFileDescriptor() = 0;
524 
525  /// Get the stream's heuristics.
526  /// \sa
527  /// - \ref streamingdevicemanager
528  virtual void GetHeuristics(
529  AkAutoStmHeuristics & out_heuristics///< Returned stream heuristics
530  ) = 0;
531 
532  /// Run-time change of the stream's heuristics.
533  /// \sa
534  /// - \ref streamingdevicemanager
535  virtual AKRESULT SetHeuristics(
536  const AkAutoStmHeuristics & in_heuristics ///< New stream heuristics
537  ) = 0;
538 
539  /// Run-time change of the stream's minimum buffer size that can be handed out to client
540  /// in GetBuffer() (except the last buffer at the end of file).
541  /// Corresponds to the uMinBufferSize field of the AkAutoStmBufSettings passed to CreateAuto().
542  /// \sa
543  /// - AkAutoStmBufSettings
544  /// - \ref streamingdevicemanager
545  virtual AKRESULT SetMinimalBufferSize(
546  AkUInt32 in_uMinBufferSize ///< Minimum buffer size that can be handed out to client.
547  ) = 0;
548 
549  /// Set the minimum size to buffer ahead in an automated stream.
550  ///
551  /// This function was made available to allow systems that cannot only rely on AkAutoStmHeuristics::fThroughput to predict what will be the best target size of an automatic stream.
552  /// The system will predict the minimum size to buffer and will consider this value as the minimal size to be the target.
553  /// \sa
554  /// - AkAutoStmBufSettings
555  /// - \ref streamingdevicemanager
556  /// - \ref AkAutoStmHeuristics
557  virtual AKRESULT SetMinTargetBufferSize(
558  AkUInt32 in_uMinTargetBufferSize ///< Minimum size to buffer ahead in an automated stream. (in bytes)
559  ) = 0;
560 
561  /// Give the stream a name (appears in the Wwise profiler).
562  /// \sa
563  /// - \ref streamingdevicemanager
564  virtual AKRESULT SetStreamName(
565  const AkOSChar * in_pszStreamName ///< Stream name
566  ) = 0;
567 
568  /// Get the I/O block size.
569  /// \remark Queries the actual low-level I/O device, by calling AK::StreamMgr::IAkLowLevelIOHook::GetBlockSize() with the
570  /// stream's file descriptor.
571  /// \return The block size (in bytes)
572  /// \sa
573  /// - \ref streamingdevicemanager
574  virtual AkUInt32 GetBlockSize() = 0;
575 
576  /// Get the amount of buffering that the stream has.
577  /// The buffering is defined as the number of bytes that the stream has buffered, excluding the number
578  /// of bytes that is currently granted to the user (with GetBuffer()).
579  /// \remark The returned value corresponds to the buffering status at that moment, and does not even
580  /// guarantee that it will not shrink.
581  /// \return
582  /// - AK_DataReady: Some data has been buffered (out_uNumBytesAvailable is greater than 0).
583  /// - AK_NoDataReady: No data is available, and the end of file has not been reached.
584  /// - AK_NoMoreData: Some or no data is available, but the end of file has been reached. The stream will not buffer any more data.
585  /// - AK_Fail: The stream is invalid due to an I/O error.
586  virtual AKRESULT QueryBufferingStatus(
587  AkUInt32 & out_uNumBytesAvailable ///< Number of bytes available in the stream's buffer(s).
588  ) = 0;
589 
590  /// Returns the target buffering size based on the throughput heuristic.
591  /// \return
592  /// Target buffering length expressed in bytes.
593  virtual AkUInt32 GetNominalBuffering() = 0;
594 
595  //@}
596 
597  /// \name Stream operations.
598  //@{
599 
600  /// Start the automatic scheduling.
601  /// \return AK_Success if the automatic scheduling was started successfully
602  /// \sa
603  /// - \ref streamingdevicemanager
604  virtual AKRESULT Start() = 0;
605 
606  /// Stop the automatic scheduling.
607  /// \return AK_Success if the automatic scheduling was stopped successfully.
608  /// \sa
609  /// - \ref streamingdevicemanager
610  virtual AKRESULT Stop() = 0;
611 
612  /// Get the stream's position.
613  /// \remarks The stream position is the position seen by the user, not the position of the file
614  /// already streamed into the Stream Manager's memory. The stream position is updated when buffers
615  /// are released, using AK::IAkAutoStream::ReleaseBuffer().
616  /// \return The file position in bytes of the beginning of the first buffer owned by the user.
617  /// If the user does not own a buffer, it returns the position of the beginning of the buffer that
618  /// would be returned from a call to AK::IAkAutoStream::GetBuffer().
619  /// \sa
620  /// - \ref streamingdevicemanager
621  virtual AkUInt64 GetPosition(
622  bool * out_pbEndOfStream ///< Returned end-of-stream flag (can pass NULL)
623  ) = 0;
624 
625  /// Set the stream's position.
626  /// The next call to AK::IAkAutoStream::GetBuffer() will grant data that corresponds to the position specified here.
627  /// \remarks Data already streamed into the Stream Manager's memory might be flushed.
628  /// \remarks The new position will round down to the low-level I/O block size.
629  /// \return AK_Success if the resulting position is valid
630  /// \sa
631  /// - \ref streamingdevicemanager
632  virtual AKRESULT SetPosition(
633  AkInt64 in_iMoveOffset, ///< Seek offset
634  AkMoveMethod in_eMoveMethod, ///< Seek method, from the beginning, end or current file position
635  AkInt64 * out_piRealOffset ///< The actual seek offset may differ from the expected value when the low-level's block size is greater than 1.
636  ///< In that case, the real absolute position rounds down to the block boundary. Can pass NULL.
637  ) = 0;
638 
639  //@}
640 
641 
642  /// \name Data/status access.
643  //@{
644 
645  /// Get data from the Stream Manager buffers.
646  /// \remarks Grants a buffer if data is available. Each successful call to this method returns a new
647  /// buffer of data, at the current stream position.
648  /// Buffers should be released as soon as they are not needed, using AK::IAkAutoStream::ReleaseBuffer().
649  /// \aknote AK::IAkAutoStream::ReleaseBuffer() does not take any argument, because it releases buffers in order. \endaknote
650  /// \return
651  /// - AK_DataReady : the buffer was granted
652  /// - AK_NoDataReady : the buffer is not granted yet (never happens when called with in_bWait flag)
653  /// - AK_NoMoreData : the buffer was granted but reached end of file (next call will return with size 0)
654  /// - AK_Fail : there was an I/O error
655  /// \sa
656  /// - \ref streamingdevicemanager
657  virtual AKRESULT GetBuffer(
658  void *& out_pBuffer, ///< Returned address of granted data space
659  AkUInt32 & out_uSize, ///< Returned size of granted data space
660  bool in_bWait ///< Block until data is ready
661  ) = 0;
662 
663  /// Release buffer granted through GetBuffer(). Buffers are released in order.
664  /// \return AK_Success if a valid buffer was released, AK_Fail if the user did not own any buffer.
665  /// \note To implementers: Clients like the sound engine may release buffers until this function returns AK_Fail.
666  /// Failing to release a buffer should not be considered as a fatal error.
667  /// \sa
668  /// - \ref streamingdevicemanager
669  virtual AKRESULT ReleaseBuffer() = 0;
670  //@}
671  };
672 
673  //@}
674 
675 
676  /// Interface of the Stream Manager.
677  /// \akwarning
678  /// The functions in this interface are not thread-safe, unless stated otherwise.
679  /// \endakwarning
681  {
682  protected:
683  /// Virtual destructor on interface to avoid warnings.
684  virtual ~IAkStreamMgr(){}
685 
686  public:
687  /// Global access to singleton.
688  /// \return The interface of the global Stream Manager
689  /// \sa
690  /// - \ref streamingdevicemanager
691  inline static IAkStreamMgr * Get()
692  {
693  return m_pStreamMgr;
694  }
695 
696  /// Destroy the Stream Manager.
697  /// \sa
698  /// - \ref streamingdevicemanager
699  virtual void Destroy() = 0;
700 
701 
702  /// \name Profiling.
703  //@{
704  /// Get the profiling interface.
705  /// \return The interface of the Stream Manager profiler
706  virtual IAkStreamMgrProfile * GetStreamMgrProfile() = 0;
707  //@}
708 
709 
710  /// \name Stream creation interface.
711  //@{
712 
713  // Standard stream creation methods.
714 
715  /// Create a standard stream (string overload).
716  /// \return AK_Success if the stream was created successfully
717  /// \remarks The string overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
718  /// \sa
719  /// - \ref streamingdevicemanager
720  virtual AKRESULT CreateStd(
721  const AkOSChar* in_pszFileName, ///< Application-defined string (title only, or full path, or code...)
722  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags. Can pass NULL
723  AkOpenMode in_eOpenMode, ///< Open mode (read, write, ...)
724  IAkStdStream *& out_pStream, ///< Returned interface to a standard stream. If the function does not return AK_Success, this pointer is left untouched.
725  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
726  ) = 0;
727 
728  /// Create a standard stream (ID overload).
729  /// \return AK_Success if the stream was created successfully
730  /// \remarks The ID overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
731  /// \sa
732  /// - \ref streamingdevicemanager
733  virtual AKRESULT CreateStd(
734  AkFileID in_fileID, ///< Application-defined ID
735  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can pass NULL)
736  AkOpenMode in_eOpenMode, ///< Open mode (read, write, ...)
737  IAkStdStream *& out_pStream, ///< Returned interface to a standard stream. If the function does not return AK_Success, this pointer is left untouched.
738  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
739  ) = 0;
740 
741 
742  // Automatic stream create methods.
743 
744  /// Create an automatic stream (string overload).
745  /// \return AK_Success if the stream was created successfully
746  /// \remarks The stream needs to be started explicitly with AK::IAkAutoStream::Start().
747  /// \remarks The string overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
748  /// \sa
749  /// - \ref streamingdevicemanager
750  virtual AKRESULT CreateAuto(
751  const AkOSChar* in_pszFileName, ///< Application-defined string (title only, or full path, or code...)
752  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can pass NULL)
753  const AkAutoStmHeuristics & in_heuristics, ///< Streaming heuristics
754  AkAutoStmBufSettings * in_pBufferSettings, ///< Stream buffer settings (it is recommended to pass NULL in order to use the default settings)
755  IAkAutoStream *& out_pStream, ///< Returned interface to an automatic stream. If the function does not return AK_Success, this pointer is left untouched.
756  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
757  ) = 0;
758 
759  /// Create an automatic stream (ID overload).
760  /// \return AK_Success if the stream was created successfully
761  /// \remarks The stream needs to be started explicitly with IAkAutoStream::Start().
762  /// \remarks The ID overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
763  /// \sa
764  /// - \ref streamingdevicemanager
765  virtual AKRESULT CreateAuto(
766  AkFileID in_fileID, ///< Application-defined ID
767  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can pass NULL)
768  const AkAutoStmHeuristics & in_heuristics, ///< Streaming heuristics
769  AkAutoStmBufSettings * in_pBufferSettings, ///< Stream buffer settings (it is recommended to pass NULL to use the default settings)
770  IAkAutoStream *& out_pStream, ///< Returned interface to an automatic stream. If the function does not return AK_Success, this pointer is left untouched.
771  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
772  ) = 0;
773 
774  /// Create an automatic stream (in-memory buffer overload).
775  /// \return AK_Success if the stream was created successfully
776  /// \remarks The stream needs to be started explicitly with IAkAutoStream::Start().
777  /// \sa
778  /// - \ref streamingdevicemanager
779  virtual AKRESULT CreateAuto(
780  void * in_pBuffer, ///< Pointer to the memory area containing stream data
781  AkUInt64 in_uSize, ///< Size of the memory area containing stream data
782  const AkAutoStmHeuristics & in_heuristics, ///< Streaming heuristics
783  IAkAutoStream *& out_pStream ///< Returned interface to an automatic stream. If the function does not return AK_Success, this pointer is left untouched.
784  ) = 0;
785 
786  /// Start streaming the first "in_pFSFlags->uNumBytesPrefetch" bytes of the file with id "in_fileID" into cache. The stream will be scheduled only after
787  /// all regular streams (not file caching streams) are serviced. The file will stay cached until either the UnpinFileInCache is called,
788  /// or the limit as set by uMaxCachePinnedBytes is reached and another higher priority file (in_uPriority) needs the space.
789  /// \remarks PinFileInCache()/UnpinFileInCache()/UpdateCachingPriority() are typically not used directly, but instead used via the AK::SoundEngine::PinEventInStreamCache() API.
790  /// Using PinFileInCache() directly does not allow users to take advantage of sound bank data. The file and the number of bytes they wish to cache must be explicitly specified.
791  ///
792  /// \sa
793  /// - \ref streamingdevicemanager
794  /// - AK::SoundEngine::PinEventInStreamCache
795  /// - AK::SoundEngine::UnpinEventInStreamCache
796  /// - AkFileSystemFlags
797  virtual AKRESULT PinFileInCache(
798  AkFileID in_fileID, ///< Application-defined ID
799  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can NOT pass NULL)
800  AkPriority in_uPriority ///< Stream caching priority. Note: Caching requests only get serviced after all regular streaming requests.
801  ) = 0;
802 
803  /// Un-pin a file that has been previouly pinned into cache. This function must be called once for every call to PinFileInCache() with the same file id.
804  /// The file may still remain in stream cache after this is called, until the memory is reused by the streaming memory manager in accordance with to its
805  /// cache management algorithm.
806  /// \remarks PinFileInCache()/UnpinFileInCache()/UpdateCachingPriority() are typically not used directly, but instead used via the AK::SoundEngine::PinEventInStreamCache() API.
807  /// Using UnpinFileInCache() directly does not allow users to take advantage of sound bank data. The file must be explicitly specified.
808  /// \sa
809  /// - \ref streamingdevicemanager
810  /// - AK::SoundEngine::PinEventInStreamCache
811  /// - AK::SoundEngine::UnpinEventInStreamCache
812  virtual AKRESULT UnpinFileInCache(
813  AkFileID in_fileID, ///< Application-defined ID
814  AkPriority in_uPriority ///< Priority of stream that you are unpinning
815  ) = 0;
816 
817  /// Update the priority of the caching stream. Higher priority streams will be serviced before lower priority caching streams, and will be more likely to stay in
818  /// memory if the cache pin limit as set by "uMaxCachePinnedBytes" is reached.
819  /// \remarks PinFileInCache()/UnpinFileInCache()/UpdateCachingPriority() are typically not used directly, but instead used via the AK::SoundEngine::PinEventInStreamCache() API.
820  /// Using UpdateCachingPriority() directly does not allow users to take advantage of sound bank data. The file must be explicitly specified.
821  /// \sa
822  /// - \ref streamingdevicemanager
823  /// - AK::SoundEngine::PinEventInStreamCache
824  /// - AK::SoundEngine::UnpinEventInStreamCache
825  virtual AKRESULT UpdateCachingPriority(
826  AkFileID in_fileID, ///< Application-defined ID
827  AkPriority in_uPriority, ///< Priority
828  AkPriority in_uOldPriority ///< Old priority
829  ) = 0;
830 
831  /// Return information about a file that has been pinned into cache.
832  /// Retrieves the percentage of the requested buffer size that has been streamed in and stored into stream cache, and whether
833  /// the cache pinned memory limit is preventing this buffer from filling.
834  virtual AKRESULT GetBufferStatusForPinnedFile(
835  AkFileID in_fileID, ///< Application-defined ID
836  AkReal32& out_fPercentBuffered, ///< Percentage of buffer full (out of 100)
837  bool& out_bCacheFull ///< Set to true if the rest of the buffer can not fit into the cache-pinned memory limit.
838  ) = 0;
839 
840  /// Make a memory stream point to a new area in memory, otherwise keeping the exact same state.
841  virtual AKRESULT RelocateMemoryStream(
842  IAkAutoStream * in_pStream, ///< The stream to relocate. Must be a stream created with the memory overload of CreateAutoStm.
843  AkUInt8 * in_pNewStart ///< The new area in memory to point to
844  ) = 0;
845 
846  //@}
847 
848  protected:
849  /// Definition of the global pointer to the interface of the Stream Manager singleton.
850  /// \sa
851  /// - \ref streamingdevicemanager
852  static AKSOUNDENGINE_API IAkStreamMgr * m_pStreamMgr;
853  };
854 
855 }
856 #endif //_IAK_STREAM_MGR_H_
AkUInt32 uNumBytesPrefetch
Definition: IAkStreamMgr.h:104
bool bIsOpen
True when the file is open (implementations may defer file opening)
Definition: IAkStreamMgr.h:118
AkUInt32 uCachePinnedBytes
Number of bytes that can be pinned into cache.
Definition: IAkStreamMgr.h:177
AkUInt32 uLoopStart
Set to the start of loop (byte offset from the beginning of the stream) for streams that loop,...
Definition: IAkStreamMgr.h:125
static IAkStreamMgr * Get()
Definition: IAkStreamMgr.h:691
AkUInt32 uBufferedSize
Size of available data (specific to IAkAutoStream)
Definition: IAkStreamMgr.h:203
virtual void * GetData(AkUInt32 &out_uSize)=0
virtual IAkStreamMgrProfile * GetStreamMgrProfile()=0
Audiokinetic namespace.
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:115
virtual bool IsNew()=0
AkUInt64 uFileSize
File size.
Definition: IAkStreamMgr.h:187
virtual AKRESULT SetMinimalBufferSize(AkUInt32 in_uMinBufferSize)=0
virtual AkUInt64 GetPosition(bool *out_pbEndOfStream)=0
bool bCanRead
Specifies whether or not the device is readable.
Definition: IAkStreamMgr.h:153
Automatic streams buffer settings/constraints.
Definition: IAkStreamMgr.h:135
AkUInt32 uPriority
Stream priority.
Definition: IAkStreamMgr.h:199
virtual void * GetFileDescriptor()=0
virtual IAkDeviceProfile * GetDeviceProfile(AkUInt32 in_uDeviceIndex)=0
AkUInt32 uVirtualBufferingSize
Size of available data including requested data (specific to IAkAutoStream)
Definition: IAkStreamMgr.h:202
virtual AKRESULT ReleaseBuffer()=0
AkUInt32 uLoopEnd
Set to the end of loop (byte offset from the beginning of the stream) for streams that loop,...
Definition: IAkStreamMgr.h:126
AkUInt32 uPeakRefdMemUsed
Memory peak since monitoring started.
Definition: IAkStreamMgr.h:166
virtual ~IAkStreamMgr()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:684
virtual void GetInfo(AkStreamInfo &out_info)=0
virtual AkUInt32 GetBlockSize()=0
virtual AKRESULT SetPosition(AkInt64 in_iMoveOffset, AkMoveMethod in_eMoveMethod, AkInt64 *out_piRealOffset)=0
virtual AkUInt32 GetNumStreams()=0
AkUInt32 uNumBytesTransferedLowLevel
Transfered amount (from low-level IO only) since last query (Accumulate/Reset)
Definition: IAkStreamMgr.h:205
virtual void GetStreamData(AkStreamData &out_streamData)=0
AkUInt32 uBlockSize
Hard user constraint: When non-zero, buffer size will be a multiple of that number,...
Definition: IAkStreamMgr.h:142
virtual AKRESULT Stop()=0
bool bIsAutoStream
True for auto streams.
Definition: IAkStreamMgr.h:190
AkUInt32 uMinBufferSize
Definition: IAkStreamMgr.h:140
AkUInt32 uBufferSize
Definition: IAkStreamMgr.h:137
AkUInt32 uLowLevelBytesTransferred
Number of bytes transferred exclusively via low-level.
Definition: IAkStreamMgr.h:171
virtual void OnProfileEnd()=0
Notify device when monitor sampling ends.
virtual AKRESULT SetMinTargetBufferSize(AkUInt32 in_uMinTargetBufferSize)=0
virtual AkUInt32 GetNominalBuffering()=0
virtual AkUInt32 GetBlockSize()=0
virtual AkStmStatus GetStatus()=0
virtual AKRESULT Read(void *in_pBuffer, AkUInt32 in_uReqSize, bool in_bWait, AkPriority in_priority, AkReal32 in_fDeadline, AkUInt32 &out_uSize)=0
AkUInt32 uStreamID
Unique stream identifier.
Definition: IAkStreamMgr.h:197
virtual void OnProfileStart()=0
Notify device when monitor sampling starts.
Stream statistics.
Definition: IAkStreamMgr.h:195
AkUInt32 uCompanyID
Company ID (Wwise uses AKCOMPANYID_AUDIOKINETIC, defined in AkTypes.h, for soundbanks and standard st...
Definition: IAkStreamMgr.h:95
AkUInt32 uStringSize
Device name string's size (number of characters)
Definition: IAkStreamMgr.h:155
virtual AKRESULT SetStreamName(const AkOSChar *in_pszStreamName)=0
virtual void GetData(AkDeviceData &out_deviceData)=0
virtual void ClearNew()=0
Device descriptor.
Definition: IAkStreamMgr.h:159
virtual ~IAkStreamMgrProfile()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:321
virtual void StopMonitoring()=0
virtual AKRESULT SetHeuristics(const AkAutoStmHeuristics &in_heuristics)=0
bool bIsAutomaticStream
Definition: IAkStreamMgr.h:100
AkUInt32 uTargetBufferingSize
Total stream buffer size (specific to IAkAutoStream)
Definition: IAkStreamMgr.h:201
AkReal32 fThroughput
Average throughput in bytes/ms.
Definition: IAkStreamMgr.h:124
virtual AKRESULT SetPosition(AkInt64 in_iMoveOffset, AkMoveMethod in_eMoveMethod, AkInt64 *out_piRealOffset)=0
virtual AKRESULT SetStreamName(const AkOSChar *in_pszStreamName)=0
AkUInt32 uGranularity
IO memory pool block size.
Definition: IAkStreamMgr.h:168
AkUInt32 uFrees
Cumulative number of deallocations.
Definition: IAkStreamMgr.h:165
virtual AkStmStatus WaitForPendingOperation()=0
AkUInt32 uNumLowLevelRequestsCancelled
Number of low-level transfers that were cancelled in the previous monitoring frame.
Definition: IAkStreamMgr.h:174
bool bIsLanguageSpecific
True when the file location depends on language.
Definition: IAkStreamMgr.h:99
virtual AKRESULT CreateAuto(const AkOSChar *in_pszFileName, AkFileSystemFlags *in_pFSFlags, const AkAutoStmHeuristics &in_heuristics, AkAutoStmBufSettings *in_pBufferSettings, IAkAutoStream *&out_pStream, bool in_bSyncOpen)=0
AkUInt32 uCustomParamSize
File descriptor's uCustomParamSize.
Definition: IAkStreamMgr.h:188
bool bActive
True if this stream has been active (that is, was ready for I/O or had at least one pending I/O trans...
Definition: IAkStreamMgr.h:208
AkUInt32 uMemUsed
IO memory pool used.
Definition: IAkStreamMgr.h:163
virtual void Destroy()=0
AkUInt32 uStreamID
Unique stream identifier.
Definition: IAkStreamMgr.h:183
virtual ~IAkDeviceProfile()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:263
Stream general information.
Definition: IAkStreamMgr.h:181
virtual AKRESULT RelocateMemoryStream(IAkAutoStream *in_pStream, AkUInt8 *in_pNewStart)=0
Make a memory stream point to a new area in memory, otherwise keeping the exact same state.
virtual AKRESULT StartMonitoring()=0
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:151
AkUInt32 uNumActiveStreams
Number of streams that have been active in the previous frame.
Definition: IAkStreamMgr.h:169
AkUInt32 uCustomParam
File descriptor's pCustomParam (on 32 bits)
Definition: IAkStreamMgr.h:189
virtual AKRESULT QueryBufferingStatus(AkUInt32 &out_uNumBytesAvailable)=0
const AkOSChar * pszName
User-defined stream name (specified through AK::IAkStdStream::SetStreamName() or AK::IAkAutoStream::S...
Definition: IAkStreamMgr.h:116
AkUInt32 uCustomParam
Custom number queried from low-level IO.
Definition: IAkStreamMgr.h:176
virtual ~IAkStdStream()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:364
AkUInt32 uTotalBytesTransferred
Number of bytes transferred, including cached transfers.
Definition: IAkStreamMgr.h:170
virtual void GetInfo(AkStreamInfo &out_info)=0
virtual AKRESULT PinFileInCache(AkFileID in_fileID, AkFileSystemFlags *in_pFSFlags, AkPriority in_uPriority)=0
AkUInt32 uUnreferencedCachedBytes
IO memory that is cached but is not currently used for active streams.
Definition: IAkStreamMgr.h:167
virtual AKRESULT CreateStd(const AkOSChar *in_pszFileName, AkFileSystemFlags *in_pFSFlags, AkOpenMode in_eOpenMode, IAkStdStream *&out_pStream, bool in_bSyncOpen)=0
AkFileSystemFlags(AkUInt32 in_uCompanyID, AkUInt32 in_uCodecID, AkUInt32 in_uCustomParamSize, void *in_pCustomParam, bool in_bIsLanguageSpecific, AkFileID in_uCacheID)
Definition: IAkStreamMgr.h:86
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:184
virtual void Destroy()=0
virtual IAkStreamProfile * GetStreamProfile(AkUInt32 in_uStreamIndex)=0
virtual AKRESULT GetBuffer(void *&out_pBuffer, AkUInt32 &out_uSize, bool in_bWait)=0
AkReal32 fEstimatedThroughput
Estimated throughput heuristic.
Definition: IAkStreamMgr.h:207
virtual void GetHeuristics(AkAutoStmHeuristics &out_heuristics)=0
AkUInt32 uAllocs
Cumulative number of allocations.
Definition: IAkStreamMgr.h:164
File system flags for file descriptors mapping.
Definition: IAkStreamMgr.h:81
AkUInt32 uMemSize
IO memory pool size.
Definition: IAkStreamMgr.h:162
AkUInt32 uNumLowLevelRequestsPending
Number of low-level transfers that are currently pending.
Definition: IAkStreamMgr.h:175
AkFileID uCacheID
Definition: IAkStreamMgr.h:102
AkUInt32 uNumBytesTransfered
Transfered amount since last query (Accumulate/Reset)
Definition: IAkStreamMgr.h:204
virtual void GetDesc(AkDeviceDesc &out_deviceDesc)=0
bool bCanWrite
Specifies whether or not the device is writable.
Definition: IAkStreamMgr.h:152
Device descriptor.
Definition: IAkStreamMgr.h:149
AkUInt32 uNumLowLevelRequestsCompleted
Number of low-level transfers that have completed in the previous monitoring frame.
Definition: IAkStreamMgr.h:173
AkUInt64 uSize
Total stream/file size in bytes.
Definition: IAkStreamMgr.h:117
virtual ~IAkAutoStream()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:504
virtual AKRESULT Start()=0
AkReal32 fAvgCacheEfficiency
Total bytes from cache as a percentage of total bytes.
Definition: IAkStreamMgr.h:172
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:161
virtual ~IAkStreamProfile()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:225
AkUtf16 szStreamName[AK_MONITOR_STREAMNAME_MAXLENGTH]
Stream name.
Definition: IAkStreamMgr.h:185
virtual void Destroy()=0
AkUInt32 uStringSize
Stream name string's size (number of characters)
Definition: IAkStreamMgr.h:186
virtual AkUInt32 GetNumDevices()=0
AkUInt32 uCustomParamSize
Size of the custom parameter.
Definition: IAkStreamMgr.h:97
AkPriority priority
The stream priority. it should be between AK_MIN_PRIORITY and AK_MAX_PRIORITY (included).
Definition: IAkStreamMgr.h:131
virtual void Cancel()=0
AkUInt32 uMemoryReferenced
Amount of streaming memory referenced by this stream.
Definition: IAkStreamMgr.h:206
virtual AKRESULT Write(void *in_pBuffer, AkUInt32 in_uReqSize, bool in_bWait, AkPriority in_priority, AkReal32 in_fDeadline, AkUInt32 &out_uSize)=0
AkUInt8 uMinNumBuffers
Definition: IAkStreamMgr.h:127
Automatic streams heuristics.
Definition: IAkStreamMgr.h:122
virtual AKRESULT UnpinFileInCache(AkFileID in_fileID, AkPriority in_uPriority)=0
bool bIsCachingStream
True for caching streams.
Definition: IAkStreamMgr.h:191
static IAkStreamMgr * m_pStreamMgr
Definition: IAkStreamMgr.h:852
virtual void GetStreamRecord(AkStreamRecord &out_streamRecord)=0
AkUtf16 szDeviceName[AK_MONITOR_DEVICENAME_MAXLENGTH]
Device name.
Definition: IAkStreamMgr.h:154
virtual bool IsNew()=0
virtual AKRESULT GetBufferStatusForPinnedFile(AkFileID in_fileID, AkReal32 &out_fPercentBuffered, bool &out_bCacheFull)=0
virtual AKRESULT UpdateCachingPriority(AkFileID in_fileID, AkPriority in_uPriority, AkPriority in_uOldPriority)=0
virtual void * GetFileDescriptor()=0
AkUInt64 uFilePosition
Current position.
Definition: IAkStreamMgr.h:200
virtual AkUInt64 GetPosition(bool *out_pbEndOfStream)=0
virtual void ClearNew()=0
AkUInt32 uCodecID
File/codec type ID (defined in AkTypes.h)
Definition: IAkStreamMgr.h:96
void * pCustomParam
Custom parameter.
Definition: IAkStreamMgr.h:98