Table of Contents

Wwise SDK 2019.1.6
IAkStreamMgr.h
Go to the documentation of this file.
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 
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.
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()
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.
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 {
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
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
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  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
220  {
221  protected:
222  /// Virtual destructor on interface to avoid warnings.
223  virtual ~IAkStreamProfile(){}
224 
225  public:
226  /// Returns the stream's record (once).
227  /// \sa
228  /// - \ref streamingdevicemanager
229  virtual void GetStreamRecord(
230  AkStreamRecord & out_streamRecord ///< Returned stream record interface
231  ) = 0;
232 
233  /// Returns the stream's statistics (every profile frame).
234  /// \sa
235  /// - \ref streamingdevicemanager
236  virtual void GetStreamData(
237  AkStreamData & out_streamData ///< Returned periodic stream data interface
238  ) = 0;
239 
240  /// Query the stream's "new" flag.
241  /// \return True, until AK::IAkStreamProfile::ClearNew() is called.
242  /// \sa
243  /// - \ref streamingdevicemanager
244  virtual bool IsNew() = 0;
245 
246  /// Resets the stream's "new" flag.
247  /// \sa
248  /// - \ref streamingdevicemanager
249  virtual void ClearNew() = 0;
250  };
251 
252 
253  /// Profiling interface of high-level I/O devices.
254  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
256  {
257  protected:
258  /// Virtual destructor on interface to avoid warnings.
259  virtual ~IAkDeviceProfile(){}
260 
261  public:
262 
263  /// Notify device when monitor sampling starts.
264  virtual void OnProfileStart() = 0;
265 
266  /// Notify device when monitor sampling ends.
267  virtual void OnProfileEnd() = 0;
268 
269  /// Query the device's description (once).
270  /// \sa
271  /// - \ref streamingdevicemanager
272  virtual void GetDesc(
273  AkDeviceDesc & out_deviceDesc ///< Device descriptor.
274  ) = 0;
275 
276  /// Query the device's statistics (at every profiling frame).
277  /// \sa
278  /// - \ref streamingdevicemanager
279  virtual void GetData(
280  AkDeviceData & out_deviceData ///< Device data.
281  ) = 0;
282 
283  /// Query the device's "new" flag.
284  /// \return True, until ClearNew() is called.
285  /// \sa
286  /// - \ref streamingdevicemanager
287  virtual bool IsNew() = 0;
288 
289  /// Resets the device's "new" flag.
290  /// \sa
291  /// - \ref streamingdevicemanager
292  virtual void ClearNew() = 0;
293 
294  /// Get the number of streams currently associated with that device.
295  /// \return The number of streams
296  /// \sa
297  /// - \ref streamingdevicemanager
298  virtual AkUInt32 GetNumStreams() = 0;
299 
300  /// Get a stream profile, for a specified stream index.
301  /// \remarks GetStreamProfile() refers to streams by index, which must honor the call to AK::IAkDeviceProfile::GetNumStreams().
302  /// \sa
303  /// - \ref streamingdevicemanager
305  AkUInt32 in_uStreamIndex ///< Stream index: [0,numStreams[
306  ) = 0;
307  };
308 
309  /// Profiling interface of the Stream Manager.
310  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
312  {
313  protected:
314  /// Virtual destructor on interface to avoid warnings.
316 
317  public:
318  /// Start profile monitoring.
319  /// \return AK_Success if successful, AK_Fail otherwise.
320  /// \sa
321  /// - \ref streamingdevicemanager
322  virtual AKRESULT StartMonitoring() = 0;
323 
324  /// Stop profile monitoring.
325  /// \sa
326  /// - \ref streamingdevicemanager
327  virtual void StopMonitoring() = 0;
328 
329  /// Device enumeration.
330  /// \return The number of devices.
331  /// \sa
332  /// - \ref streamingdevicemanager
333  virtual AkUInt32 GetNumDevices() = 0;
334 
335  /// Get a device profile for a specified device index.
336  /// \remarks GetDeviceProfile() refers to devices by index, which must honor the call to AK::IAkStreamMgrProfile::GetNumDevices().
337  /// \remarks The device index is not the same as the device ID (AkDeviceID).
338  /// \sa
339  /// - \ref streamingdevicemanager
341  AkUInt32 in_uDeviceIndex ///< Device index: [0,numDevices[
342  ) = 0;
343  };
344  //@}
345 
346  /// \name High-level streams API.
347  //@{
348 
349  /// Interface of standard streams. Used as a handle to a standard stream. Has methods for
350  /// stream control. Obtained through the Stream Manager's AK::IAkStreamMgr::CreateStd() method.
351  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
353  {
354  protected:
355  /// Virtual destructor on interface to avoid warnings.
356  virtual ~IAkStdStream(){}
357 
358  public:
359  /// \name Stream management and settings.
360  //@{
361  /// Close the stream. The object is destroyed and the interface becomes invalid.
362  /// \sa
363  /// - \ref streamingdevicemanager
364  virtual void Destroy() = 0;
365 
366  /// Get information about a stream.
367  /// \sa
368  /// - \ref streamingdevicemanager
369  virtual void GetInfo(
370  AkStreamInfo & out_info ///< Returned stream info
371  ) = 0;
372 
373  /// Returns a unique cookie for a given stream.
374  /// The default implementation of the Stream Manager returns its file descriptor (see AkStreamMgrModule.h).
375  virtual void * GetFileDescriptor() = 0;
376 
377  /// Give the stream a name (appears in the Wwise Profiler).
378  /// \sa
379  /// - \ref streamingdevicemanager
380  virtual AKRESULT SetStreamName(
381  const AkOSChar * in_pszStreamName ///< Stream name
382  ) = 0;
383 
384  /// Get the I/O block size.
385  /// \remark Queries the low-level I/O, by calling AK::StreamMgr::IAkLowLevelIOHook::GetBlockSize() with the
386  /// stream's file descriptor.
387  /// \return The block size, in bytes.
388  /// \sa
389  /// - \ref streamingdevicemanager
390  virtual AkUInt32 GetBlockSize() = 0;
391  //@}
392 
393  /// \name I/O operations.
394  //@{
395 
396  /// Schedule a read request.
397  /// \warning Use only with a multiple of the block size, queried via AK::IAkStdStream::GetBlockSize().
398  /// \remarks If the call is asynchronous (in_bWait = false), wait until AK::IAkStdStream::GetStatus() stops returning AK_StmStatusPending.
399  /// \return AK_Success if the operation was successfully scheduled (but not necessarily completed)
400  /// \sa
401  /// - \ref streamingdevicemanager
402  virtual AKRESULT Read(
403  void * in_pBuffer, ///< User buffer address
404  AkUInt32 in_uReqSize, ///< Requested read size
405  bool in_bWait, ///< Block until the operation is complete
406  AkPriority in_priority, ///< Heuristic: operation priority
407  AkReal32 in_fDeadline, ///< Heuristic: operation deadline (ms)
408  AkUInt32 & out_uSize ///< The size that was actually read
409  ) = 0;
410 
411  /// Schedule a write request.
412  /// \warning Use only with a multiple of the block size, queried via AK::IAkStdStream::GetBlockSize().
413  /// \remarks If the call is asynchronous (in_bWait = false), wait until GetStatus() stops returning AK_StmStatusPending.
414  /// \return AK_Success if the operation was successfully scheduled
415  /// \sa
416  /// - \ref streamingdevicemanager
417  virtual AKRESULT Write(
418  void * in_pBuffer, ///< User buffer address
419  AkUInt32 in_uReqSize, ///< Requested write size
420  bool in_bWait, ///< Block until the operation is complete
421  AkPriority in_priority, ///< Heuristic: operation priority
422  AkReal32 in_fDeadline, ///< Heuristic: operation deadline (ms)
423  AkUInt32 & out_uSize ///< The size that was actually written
424  ) = 0;
425 
426  /// Get the current stream position.
427  /// \remarks If an operation is pending, there is no guarantee that the position was queried before (or after) the operation was completed.
428  /// \return The current stream position
429  /// \sa
430  /// - \ref streamingdevicemanager
431  virtual AkUInt64 GetPosition(
432  bool * out_pbEndOfStream ///< Returned end-of-stream flag, only for streams opened with AK_OpenModeRead (can pass NULL)
433  ) = 0;
434 
435  /// Set the stream position. Modifies the position for the next read/write operation.
436  /// \warning No operation should be pending.
437  /// \remarks The new position will snap to the lowest block boundary.
438  /// \return AK_Success if the stream position was changed
439  /// \sa
440  /// - \ref streamingdevicemanager
441  virtual AKRESULT SetPosition(
442  AkInt64 in_iMoveOffset, ///< Seek offset
443  AkMoveMethod in_eMoveMethod, ///< Seek method, from the beginning, end, or current file position
444  AkInt64 * out_piRealOffset ///< The actual seek offset may differ from the expected value when the block size is bigger than 1.
445  ///< In that case, the seek offset floors to the sector boundary. Can pass NULL.
446  ) = 0;
447 
448  /// Cancel the current operation.
449  /// \remarks When it returns, the caller is guaranteed that no operation is pending.
450  /// \remarks This method can block the caller for the whole duration of the I/O operation, if the request was already posted.
451  /// \sa
452  /// - \ref streamingdevicemanager
453  virtual void Cancel() = 0;
454 
455  //@}
456 
457  /// \name Access to data and status.
458  //@{
459  /// Get user data (and accessed size).
460  /// \return The address of data provided by user
461  /// \sa
462  /// - \ref streamingdevicemanager
463  virtual void * GetData(
464  AkUInt32 & out_uSize ///< Size actually read or written
465  ) = 0;
466 
467  /// Get the stream's status.
468  /// \return The stream status.
469  /// \sa
470  /// - \ref streamingdevicemanager
471  virtual AkStmStatus GetStatus() = 0;
472 
473  //@}
474  };
475 
476 
477  /// Interface of automatic streams. It is used as a handle to a stream,
478  /// I/O operations are triggered from here.
479  /// Obtained through the Stream Manager's AK::IAkStreamMgr::CreateAuto() method.
480  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
481  /// \sa
482  /// - \ref streamingdevicemanager
484  {
485  protected:
486  /// Virtual destructor on interface to avoid warnings.
487  virtual ~IAkAutoStream(){}
488 
489  public:
490  /// \name Stream management, settings access, and run-time change.
491  //@{
492  /// Close the stream. The object is destroyed and the interface becomes invalid.
493  /// \sa
494  /// - \ref streamingdevicemanager
495  virtual void Destroy() = 0;
496 
497  /// Get information about the stream.
498  /// \sa
499  /// - \ref streamingdevicemanager
500  virtual void GetInfo(
501  AkStreamInfo & out_info ///< Returned stream info
502  ) = 0;
503 
504  /// Returns a unique cookie for a given stream.
505  /// The default implementation of the Stream Manager returns its file descriptor (see AkStreamMgrModule.h).
506  virtual void * GetFileDescriptor() = 0;
507 
508  /// Get the stream's heuristics.
509  /// \sa
510  /// - \ref streamingdevicemanager
511  virtual void GetHeuristics(
512  AkAutoStmHeuristics & out_heuristics///< Returned stream heuristics
513  ) = 0;
514 
515  /// Run-time change of the stream's heuristics.
516  /// \sa
517  /// - \ref streamingdevicemanager
518  virtual AKRESULT SetHeuristics(
519  const AkAutoStmHeuristics & in_heuristics ///< New stream heuristics
520  ) = 0;
521 
522  /// Run-time change of the stream's minimum buffer size that can be handed out to client
523  /// in GetBuffer() (except the last buffer at the end of file).
524  /// Corresponds to the uMinBufferSize field of the AkAutoStmBufSettings passed to CreateAuto().
525  /// \sa
526  /// - AkAutoStmBufSettings
527  /// - \ref streamingdevicemanager
529  AkUInt32 in_uMinBufferSize ///< Minimum buffer size that can be handed out to client.
530  ) = 0;
531 
532  /// Set the minimum size to buffer ahead in an automated stream.
533  ///
534  /// 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.
535  /// The system will predict the minimum size to buffer and will consider this value as the minimal size to be the target.
536  /// \sa
537  /// - AkAutoStmBufSettings
538  /// - \ref streamingdevicemanager
539  /// - \ref AkAutoStmHeuristics
541  AkUInt32 in_uMinTargetBufferSize ///< Minimum size to buffer ahead in an automated stream. (in bytes)
542  ) = 0;
543 
544  /// Give the stream a name (appears in the Wwise profiler).
545  /// \sa
546  /// - \ref streamingdevicemanager
547  virtual AKRESULT SetStreamName(
548  const AkOSChar * in_pszStreamName ///< Stream name
549  ) = 0;
550 
551  /// Get the I/O block size.
552  /// \remark Queries the actual low-level I/O device, by calling AK::StreamMgr::IAkLowLevelIOHook::GetBlockSize() with the
553  /// stream's file descriptor.
554  /// \return The block size (in bytes)
555  /// \sa
556  /// - \ref streamingdevicemanager
557  virtual AkUInt32 GetBlockSize() = 0;
558 
559  /// Get the amount of buffering that the stream has.
560  /// The buffering is defined as the number of bytes that the stream has buffered, excluding the number
561  /// of bytes that is currently granted to the user (with GetBuffer()).
562  /// \remark The returned value corresponds to the buffering status at that moment, and does not even
563  /// guarantee that it will not shrink.
564  /// \return
565  /// - AK_DataReady: Some data has been buffered (out_uNumBytesAvailable is greater than 0).
566  /// - AK_NoDataReady: No data is available, and the end of file has not been reached.
567  /// - AK_NoMoreData: Some or no data is available, but the end of file has been reached. The stream will not buffer any more data.
568  /// - AK_Fail: The stream is invalid due to an I/O error.
570  AkUInt32 & out_uNumBytesAvailable ///< Number of bytes available in the stream's buffer(s).
571  ) = 0;
572 
573  /// Returns the target buffering size based on the throughput heuristic.
574  /// \return
575  /// Target buffering length expressed in bytes.
576  virtual AkUInt32 GetNominalBuffering() = 0;
577 
578  //@}
579 
580  /// \name Stream operations.
581  //@{
582 
583  /// Start the automatic scheduling.
584  /// \return AK_Success if the automatic scheduling was started successfully
585  /// \sa
586  /// - \ref streamingdevicemanager
587  virtual AKRESULT Start() = 0;
588 
589  /// Stop the automatic scheduling.
590  /// \return AK_Success if the automatic scheduling was stopped successfully.
591  /// \sa
592  /// - \ref streamingdevicemanager
593  virtual AKRESULT Stop() = 0;
594 
595  /// Get the stream's position.
596  /// \remarks The stream position is the position seen by the user, not the position of the file
597  /// already streamed into the Stream Manager's memory. The stream position is updated when buffers
598  /// are released, using AK::IAkAutoStream::ReleaseBuffer().
599  /// \return The file position in bytes of the beginning of the first buffer owned by the user.
600  /// If the user does not own a buffer, it returns the position of the beginning of the buffer that
601  /// would be returned from a call to AK::IAkAutoStream::GetBuffer().
602  /// \sa
603  /// - \ref streamingdevicemanager
604  virtual AkUInt64 GetPosition(
605  bool * out_pbEndOfStream ///< Returned end-of-stream flag (can pass NULL)
606  ) = 0;
607 
608  /// Set the stream's position.
609  /// The next call to AK::IAkAutoStream::GetBuffer() will grant data that corresponds to the position specified here.
610  /// \remarks Data already streamed into the Stream Manager's memory might be flushed.
611  /// \remarks The new position will round down to the low-level I/O block size.
612  /// \return AK_Success if the resulting position is valid
613  /// \sa
614  /// - \ref streamingdevicemanager
615  virtual AKRESULT SetPosition(
616  AkInt64 in_iMoveOffset, ///< Seek offset
617  AkMoveMethod in_eMoveMethod, ///< Seek method, from the beginning, end or current file position
618  AkInt64 * out_piRealOffset ///< The actual seek offset may differ from the expected value when the low-level's block size is greater than 1.
619  ///< In that case, the real absolute position rounds down to the block boundary. Can pass NULL.
620  ) = 0;
621 
622  //@}
623 
624 
625  /// \name Data/status access.
626  //@{
627 
628  /// Get data from the Stream Manager buffers.
629  /// \remarks Grants a buffer if data is available. Each successful call to this method returns a new
630  /// buffer of data, at the current stream position.
631  /// Buffers should be released as soon as they are not needed, using AK::IAkAutoStream::ReleaseBuffer().
632  /// \aknote AK::IAkAutoStream::ReleaseBuffer() does not take any argument, because it releases buffers in order. \endaknote
633  /// \return
634  /// - AK_DataReady : the buffer was granted
635  /// - AK_NoDataReady : the buffer is not granted yet (never happens when called with in_bWait flag)
636  /// - AK_NoMoreData : the buffer was granted but reached end of file (next call will return with size 0)
637  /// - AK_Fail : there was an I/O error
638  /// \sa
639  /// - \ref streamingdevicemanager
640  virtual AKRESULT GetBuffer(
641  void *& out_pBuffer, ///< Returned address of granted data space
642  AkUInt32 & out_uSize, ///< Returned size of granted data space
643  bool in_bWait ///< Block until data is ready
644  ) = 0;
645 
646  /// Release buffer granted through GetBuffer(). Buffers are released in order.
647  /// \return AK_Success if a valid buffer was released, AK_Fail if the user did not own any buffer.
648  /// \note To implementers: Clients like the sound engine may release buffers until this function returns AK_Fail.
649  /// Failing to release a buffer should not be considered as a fatal error.
650  /// \sa
651  /// - \ref streamingdevicemanager
652  virtual AKRESULT ReleaseBuffer() = 0;
653  //@}
654  };
655 
656  //@}
657 
658 
659  /// Interface of the Stream Manager.
660  /// \warning The functions in this interface are not thread-safe, unless stated otherwise.
662  {
663  protected:
664  /// Virtual destructor on interface to avoid warnings.
665  virtual ~IAkStreamMgr(){}
666 
667  public:
668  /// Global access to singleton.
669  /// \return The interface of the global Stream Manager
670  /// \sa
671  /// - \ref streamingdevicemanager
672  inline static IAkStreamMgr * Get()
673  {
674  return m_pStreamMgr;
675  }
676 
677  /// Destroy the Stream Manager.
678  /// \sa
679  /// - \ref streamingdevicemanager
680  virtual void Destroy() = 0;
681 
682 
683  /// \name Profiling.
684  //@{
685  /// Get the profiling interface.
686  /// \return The interface of the Stream Manager profiler
687  virtual IAkStreamMgrProfile * GetStreamMgrProfile() = 0;
688  //@}
689 
690 
691  /// \name Stream creation interface.
692  //@{
693 
694  // Standard stream creation methods.
695 
696  /// Create a standard stream (string overload).
697  /// \return AK_Success if the stream was created successfully
698  /// \remarks The string overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
699  /// \sa
700  /// - \ref streamingdevicemanager
701  virtual AKRESULT CreateStd(
702  const AkOSChar* in_pszFileName, ///< Application-defined string (title only, or full path, or code...)
703  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags. Can pass NULL
704  AkOpenMode in_eOpenMode, ///< Open mode (read, write, ...)
705  IAkStdStream *& out_pStream, ///< Returned interface to a standard stream. If the function does not return AK_Success, this pointer is left untouched.
706  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
707  ) = 0;
708 
709  /// Create a standard stream (ID overload).
710  /// \return AK_Success if the stream was created successfully
711  /// \remarks The ID overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
712  /// \sa
713  /// - \ref streamingdevicemanager
714  virtual AKRESULT CreateStd(
715  AkFileID in_fileID, ///< Application-defined ID
716  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can pass NULL)
717  AkOpenMode in_eOpenMode, ///< Open mode (read, write, ...)
718  IAkStdStream *& out_pStream, ///< Returned interface to a standard stream. If the function does not return AK_Success, this pointer is left untouched.
719  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
720  ) = 0;
721 
722 
723  // Automatic stream create methods.
724 
725  /// Create an automatic stream (string overload).
726  /// \return AK_Success if the stream was created successfully
727  /// \remarks The stream needs to be started explicitly with AK::IAkAutoStream::Start().
728  /// \remarks The string overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
729  /// \sa
730  /// - \ref streamingdevicemanager
731  virtual AKRESULT CreateAuto(
732  const AkOSChar* in_pszFileName, ///< Application-defined string (title only, or full path, or code...)
733  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can pass NULL)
734  const AkAutoStmHeuristics & in_heuristics, ///< Streaming heuristics
735  AkAutoStmBufSettings * in_pBufferSettings, ///< Stream buffer settings (it is recommended to pass NULL in order to use the default settings)
736  IAkAutoStream *& out_pStream, ///< Returned interface to an automatic stream. If the function does not return AK_Success, this pointer is left untouched.
737  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
738  ) = 0;
739 
740  /// Create an automatic stream (ID overload).
741  /// \return AK_Success if the stream was created successfully
742  /// \remarks The stream needs to be started explicitly with IAkAutoStream::Start().
743  /// \remarks The ID overload of AK::StreamMgr::IAkFileLocationResolver::Open() will be called.
744  /// \sa
745  /// - \ref streamingdevicemanager
746  virtual AKRESULT CreateAuto(
747  AkFileID in_fileID, ///< Application-defined ID
748  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can pass NULL)
749  const AkAutoStmHeuristics & in_heuristics, ///< Streaming heuristics
750  AkAutoStmBufSettings * in_pBufferSettings, ///< Stream buffer settings (it is recommended to pass NULL to use the default settings)
751  IAkAutoStream *& out_pStream, ///< Returned interface to an automatic stream. If the function does not return AK_Success, this pointer is left untouched.
752  bool in_bSyncOpen ///< If true, force the Stream Manager to open file synchronously. Otherwise, it is left to its discretion.
753  ) = 0;
754 
755  /// Start streaming the first "in_pFSFlags->uNumBytesPrefetch" bytes of the file with id "in_fileID" into cache. The stream will be scheduled only after
756  /// all regular streams (not file caching streams) are serviced. The file will stay cached until either the UnpinFileInCache is called,
757  /// or the limit as set by uMaxCachePinnedBytes is reached and another higher priority file (in_uPriority) needs the space.
758  /// \remarks PinFileInCache()/UnpinFileInCache()/UpdateCachingPriority() are typically not used directly, but instead used via the AK::SoundEngine::PinEventInStreamCache() API.
759  /// 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.
760  ///
761  /// \sa
762  /// - \ref streamingdevicemanager
763  /// - AK::SoundEngine::PinEventInStreamCache
764  /// - AK::SoundEngine::UnpinEventInStreamCache
765  /// - AkFileSystemFlags
766  virtual AKRESULT PinFileInCache(
767  AkFileID in_fileID, ///< Application-defined ID
768  AkFileSystemFlags * in_pFSFlags, ///< Special file system flags (can NOT pass NULL)
769  AkPriority in_uPriority ///< Stream caching priority. Note: Caching requests only get serviced after all regular streaming requests.
770  ) = 0;
771 
772  /// 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.
773  /// 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
774  /// cache management algorithm.
775  /// \remarks PinFileInCache()/UnpinFileInCache()/UpdateCachingPriority() are typically not used directly, but instead used via the AK::SoundEngine::PinEventInStreamCache() API.
776  /// Using UnpinFileInCache() directly does not allow users to take advantage of sound bank data. The file must be explicitly specified.
777  /// \sa
778  /// - \ref streamingdevicemanager
779  /// - AK::SoundEngine::PinEventInStreamCache
780  /// - AK::SoundEngine::UnpinEventInStreamCache
781  virtual AKRESULT UnpinFileInCache(
782  AkFileID in_fileID, ///< Application-defined ID
783  AkPriority in_uPriority ///< Priority of stream that you are unpinning
784  ) = 0;
785 
786  /// 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
787  /// memory if the cache pin limit as set by "uMaxCachePinnedBytes" is reached.
788  /// \remarks PinFileInCache()/UnpinFileInCache()/UpdateCachingPriority() are typically not used directly, but instead used via the AK::SoundEngine::PinEventInStreamCache() API.
789  /// Using UpdateCachingPriority() directly does not allow users to take advantage of sound bank data. The file must be explicitly specified.
790  /// \sa
791  /// - \ref streamingdevicemanager
792  /// - AK::SoundEngine::PinEventInStreamCache
793  /// - AK::SoundEngine::UnpinEventInStreamCache
795  AkFileID in_fileID, ///< Application-defined ID
796  AkPriority in_uPriority, ///< Priority
797  AkPriority in_uOldPriority ///< Old priority
798  ) = 0;
799 
800  /// Return information about a file that has been pinned into cache.
801  /// Retrieves the percentage of the requested buffer size that has been streamed in and stored into stream cache, and whether
802  /// the cache pinned memory limit is preventing this buffer from filling.
804  AkFileID in_fileID, ///< Application-defined ID
805  AkReal32& out_fPercentBuffered, ///< Percentage of buffer full (out of 100)
806  bool& out_bCacheFull ///< Set to true if the rest of the buffer can not fit into the cache-pinned memory limit.
807  ) = 0;
808 
809  //@}
810 
811  protected:
812  /// Definition of the global pointer to the interface of the Stream Manager singleton.
813  /// \sa
814  /// - \ref streamingdevicemanager
816  };
817 
818 }
819 #endif //_IAK_STREAM_MGR_H_
AkUInt32 uCustomParamSize
Size of the custom parameter.
Definition: IAkStreamMgr.h:97
AkOpenMode
File open mode.
Definition: IAkStreamMgr.h:72
bool bIsAutoStream
True for auto streams.
Definition: IAkStreamMgr.h:190
virtual void OnProfileEnd()=0
Notify device when monitor sampling ends.
AkUInt64 uFilePosition
Current position.
Definition: IAkStreamMgr.h:200
AkUtf16 szStreamName[AK_MONITOR_STREAMNAME_MAXLENGTH]
Stream name.
Definition: IAkStreamMgr.h:185
virtual void Destroy()=0
virtual void Destroy()=0
virtual AKRESULT Stop()=0
virtual ~IAkStreamMgrProfile()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:315
AkMoveMethod
Definition: IAkStreamMgr.h:64
AkStmStatus
Stream status.
Definition: IAkStreamMgr.h:51
static const AkFileID AK_INVALID_FILE_ID
Invalid file ID.
Definition: AkTypes.h:106
AkPriority priority
The stream priority. it should be between AK_MIN_PRIORITY and AK_MAX_PRIORITY (included).
Definition: IAkStreamMgr.h:131
AkUInt32 uTotalBytesTransferred
Number of bytes transferred, including cached transfers.
Definition: IAkStreamMgr.h:170
bool bCanRead
Specifies whether or not the device is readable.
Definition: IAkStreamMgr.h:153
virtual AkUInt32 GetNumDevices()=0
AkUInt32 uCustomParamSize
File descriptor's uCustomParamSize.
Definition: IAkStreamMgr.h:188
Operation pending / The stream is waiting for I/O.
Definition: IAkStreamMgr.h:55
#define AKSOUNDENGINE_API
virtual ~IAkStdStream()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:356
AkUInt32 uLowLevelBytesTransferred
Number of bytes transferred exclusively via low-level.
Definition: IAkStreamMgr.h:171
AkReal32 fAvgCacheEfficiency
Total bytes from cache as a percentage of total bytes.
Definition: IAkStreamMgr.h:172
AkUInt32 uStreamID
Unique stream identifier.
Definition: IAkStreamMgr.h:183
Automatic streams heuristics.
Definition: IAkStreamMgr.h:122
virtual bool IsNew()=0
AkUInt32 uUnreferencedCachedBytes
IO memory that is cached but is not currently used for active streams.
Definition: IAkStreamMgr.h:167
AKRESULT
Standard function call result.
Definition: AkTypes.h:126
Write-only access (opens the file if it already exists)
Definition: IAkStreamMgr.h:75
AkUInt32 uAllocs
Cumulative number of allocations.
Definition: IAkStreamMgr.h:164
uint8_t AkUInt8
Unsigned 8-bit integer.
Definition: AkTypes.h:76
virtual void Destroy()=0
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:115
wchar_t AkUtf16
Definition: AkTypes.h:106
uint64_t AkUInt64
Unsigned 64-bit integer.
Definition: AkTypes.h:79
Move offset from the end of the stream.
Definition: IAkStreamMgr.h:68
virtual void ClearNew()=0
File system flags for file descriptors mapping.
Definition: IAkStreamMgr.h:81
virtual AKRESULT Write(void *in_pBuffer, AkUInt32 in_uReqSize, bool in_bWait, AkPriority in_priority, AkReal32 in_fDeadline, AkUInt32 &out_uSize)=0
Audiokinetic namespace.
AkUInt32 uNumLowLevelRequestsCompleted
Number of low-level transfers that have completed in the previous monitoring frame.
Definition: IAkStreamMgr.h:173
virtual AKRESULT GetBufferStatusForPinnedFile(AkFileID in_fileID, AkReal32 &out_fPercentBuffered, bool &out_bCacheFull)=0
AkUInt32 uLoopStart
Set to the start of loop (byte offset from the beginning of the stream) for streams that loop,...
Definition: IAkStreamMgr.h:125
virtual AKRESULT QueryBufferingStatus(AkUInt32 &out_uNumBytesAvailable)=0
virtual ~IAkAutoStream()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:487
Device descriptor.
Definition: IAkStreamMgr.h:159
AkUInt32 uNumLowLevelRequestsPending
Number of low-level transfers that are currently pending.
Definition: IAkStreamMgr.h:175
AkUInt8 uMinNumBuffers
Definition: IAkStreamMgr.h:127
AkUInt32 uNumLowLevelRequestsCancelled
Number of low-level transfers that were cancelled in the previous monitoring frame.
Definition: IAkStreamMgr.h:174
AkUInt32 AkDeviceID
I/O device ID.
Definition: AkTypes.h:87
virtual AKRESULT SetPosition(AkInt64 in_iMoveOffset, AkMoveMethod in_eMoveMethod, AkInt64 *out_piRealOffset)=0
virtual AkUInt32 GetNominalBuffering()=0
Move offset from the start of the stream.
Definition: IAkStreamMgr.h:66
AkUInt32 uStringSize
Device name string's size (number of characters)
Definition: IAkStreamMgr.h:155
virtual AkUInt32 GetNumStreams()=0
virtual ~IAkDeviceProfile()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:259
Automatic streams buffer settings/constraints.
Definition: IAkStreamMgr.h:135
AkUInt32 uNumBytesTransfered
Transfered amount since last query (Accumulate/Reset)
Definition: IAkStreamMgr.h:204
bool bIsCachingStream
True for caching streams.
Definition: IAkStreamMgr.h:191
Operation completed / Automatic stream reached end.
Definition: IAkStreamMgr.h:54
AkReal32 fThroughput
Average throughput in bytes/ms.
Definition: IAkStreamMgr.h:124
virtual void StopMonitoring()=0
Stream statistics.
Definition: IAkStreamMgr.h:195
bool bIsLanguageSpecific
True when the file location depends on language.
Definition: IAkStreamMgr.h:99
AkReal32 fEstimatedThroughput
Estimated throughput heuristic.
Definition: IAkStreamMgr.h:207
virtual AKRESULT UpdateCachingPriority(AkFileID in_fileID, AkPriority in_uPriority, AkPriority in_uOldPriority)=0
AkFileID uCacheID
Definition: IAkStreamMgr.h:102
virtual AKRESULT UnpinFileInCache(AkFileID in_fileID, AkPriority in_uPriority)=0
virtual AkUInt64 GetPosition(bool *out_pbEndOfStream)=0
AkUInt32 uCustomParam
File descriptor's pCustomParam (on 32 bits)
Definition: IAkStreamMgr.h:189
virtual void GetStreamRecord(AkStreamRecord &out_streamRecord)=0
virtual void GetData(AkDeviceData &out_deviceData)=0
bool bIsOpen
True when the file is open (implementations may defer file opening)
Definition: IAkStreamMgr.h:118
virtual AKRESULT SetStreamName(const AkOSChar *in_pszStreamName)=0
virtual void * GetData(AkUInt32 &out_uSize)=0
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:184
virtual void * GetFileDescriptor()=0
AkInt8 AkPriority
Priority.
Definition: AkTypes.h:77
virtual IAkStreamMgrProfile * GetStreamMgrProfile()=0
virtual AkUInt32 GetBlockSize()=0
AkUInt32 uBufferSize
Definition: IAkStreamMgr.h:137
virtual AKRESULT SetHeuristics(const AkAutoStmHeuristics &in_heuristics)=0
virtual void GetInfo(AkStreamInfo &out_info)=0
Write-only access (deletes the file if it already exists)
Definition: IAkStreamMgr.h:76
AkUInt64 uSize
Total stream/file size in bytes.
Definition: IAkStreamMgr.h:117
virtual ~IAkStreamProfile()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:223
The low-level I/O reported an error.
Definition: IAkStreamMgr.h:57
AkUInt64 uFileSize
File size.
Definition: IAkStreamMgr.h:187
AkUInt32 uStreamID
Unique stream identifier.
Definition: IAkStreamMgr.h:197
virtual void Cancel()=0
virtual AKRESULT SetMinimalBufferSize(AkUInt32 in_uMinBufferSize)=0
AkUInt32 uPriority
Stream priority.
Definition: IAkStreamMgr.h:199
The stream is idle.
Definition: IAkStreamMgr.h:53
virtual void GetInfo(AkStreamInfo &out_info)=0
virtual void * GetFileDescriptor()=0
static IAkStreamMgr * m_pStreamMgr
Definition: IAkStreamMgr.h:815
AkUInt32 uGranularity
IO memory pool block size.
Definition: IAkStreamMgr.h:168
virtual AKRESULT GetBuffer(void *&out_pBuffer, AkUInt32 &out_uSize, bool in_bWait)=0
Device descriptor.
Definition: IAkStreamMgr.h:149
static IAkStreamMgr * Get()
Definition: IAkStreamMgr.h:672
AkUInt32 uNumBytesTransferedLowLevel
Transfered amount (from low-level IO only) since last query (Accumulate/Reset)
Definition: IAkStreamMgr.h:205
int64_t AkInt64
Signed 64-bit integer.
Definition: AkTypes.h:92
virtual IAkDeviceProfile * GetDeviceProfile(AkUInt32 in_uDeviceIndex)=0
AkUInt32 uNumBytesPrefetch
Definition: IAkStreamMgr.h:104
#define AK_MONITOR_STREAMNAME_MAXLENGTH
Definition: IAkStreamMgr.h:42
AkUInt32 uMemoryReferenced
Amount of streaming memory referenced by this stream.
Definition: IAkStreamMgr.h:206
AkUInt32 uVirtualBufferingSize
Size of available data including requested data (specific to IAkAutoStream)
Definition: IAkStreamMgr.h:202
AkUInt32 uCustomParam
Custom number queried from low-level IO.
Definition: IAkStreamMgr.h:176
AkUInt32 uPeakRefdMemUsed
Memory peak since monitoring started.
Definition: IAkStreamMgr.h:166
void * pCustomParam
Custom parameter.
Definition: IAkStreamMgr.h:98
#define AK_MONITOR_DEVICENAME_MAXLENGTH
Definition: IAkStreamMgr.h:43
AkUInt32 uMemSize
IO memory pool size.
Definition: IAkStreamMgr.h:162
virtual AKRESULT CreateAuto(const AkOSChar *in_pszFileName, AkFileSystemFlags *in_pFSFlags, const AkAutoStmHeuristics &in_heuristics, AkAutoStmBufSettings *in_pBufferSettings, IAkAutoStream *&out_pStream, bool in_bSyncOpen)=0
virtual AkUInt64 GetPosition(bool *out_pbEndOfStream)=0
AkUInt32 uMinBufferSize
Definition: IAkStreamMgr.h:140
AkUInt32 uCompanyID
Company ID (Wwise uses AKCOMPANYID_AUDIOKINETIC, defined in AkTypes.h, for soundbanks and standard st...
Definition: IAkStreamMgr.h:95
AkUInt32 AkFileID
Integer-type file identifier.
Definition: AkTypes.h:86
Read and write access.
Definition: IAkStreamMgr.h:77
Move offset from the current stream position.
Definition: IAkStreamMgr.h:67
virtual void GetDesc(AkDeviceDesc &out_deviceDesc)=0
virtual AkUInt32 GetBlockSize()=0
AkUInt32 uCodecID
File/codec type ID (defined in AkTypes.h)
Definition: IAkStreamMgr.h:96
virtual ~IAkStreamMgr()
Virtual destructor on interface to avoid warnings.
Definition: IAkStreamMgr.h:665
virtual IAkStreamProfile * GetStreamProfile(AkUInt32 in_uStreamIndex)=0
AkUInt32 uMemUsed
IO memory pool used.
Definition: IAkStreamMgr.h:163
AkFileSystemFlags(AkUInt32 in_uCompanyID, AkUInt32 in_uCodecID, AkUInt32 in_uCustomParamSize, void *in_pCustomParam, bool in_bIsLanguageSpecific, AkFileID in_uCacheID)
Definition: IAkStreamMgr.h:86
virtual AKRESULT PinFileInCache(AkFileID in_fileID, AkFileSystemFlags *in_pFSFlags, AkPriority in_uPriority)=0
virtual bool IsNew()=0
AkUInt32 uStringSize
Stream name string's size (number of characters)
Definition: IAkStreamMgr.h:186
virtual AKRESULT ReleaseBuffer()=0
virtual AKRESULT CreateStd(const AkOSChar *in_pszFileName, AkFileSystemFlags *in_pFSFlags, AkOpenMode in_eOpenMode, IAkStdStream *&out_pStream, bool in_bSyncOpen)=0
virtual AkStmStatus GetStatus()=0
virtual void GetHeuristics(AkAutoStmHeuristics &out_heuristics)=0
Read-only access.
Definition: IAkStreamMgr.h:74
uint32_t AkUInt32
Unsigned 32-bit integer.
Definition: AkTypes.h:78
AkUInt32 uCachePinnedBytes
Number of bytes that can be pinned into cache.
Definition: IAkStreamMgr.h:177
virtual AKRESULT SetPosition(AkInt64 in_iMoveOffset, AkMoveMethod in_eMoveMethod, AkInt64 *out_piRealOffset)=0
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:161
const AkOSChar * pszName
User-defined stream name (specified through AK::IAkStdStream::SetStreamName() or AK::IAkAutoStream::S...
Definition: IAkStreamMgr.h:116
AkUInt32 uBlockSize
Hard user constraint: When non-zero, buffer size will be a multiple of that number,...
Definition: IAkStreamMgr.h:142
virtual AKRESULT Read(void *in_pBuffer, AkUInt32 in_uReqSize, bool in_bWait, AkPriority in_priority, AkReal32 in_fDeadline, AkUInt32 &out_uSize)=0
AkUInt32 uFrees
Cumulative number of deallocations.
Definition: IAkStreamMgr.h:165
virtual void ClearNew()=0
virtual void OnProfileStart()=0
Notify device when monitor sampling starts.
virtual AKRESULT Start()=0
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
bool bIsAutomaticStream
Definition: IAkStreamMgr.h:100
AkUInt32 uLoopEnd
Set to the end of loop (byte offset from the beginning of the stream) for streams that loop,...
Definition: IAkStreamMgr.h:126
float AkReal32
32-bit floating point
Definition: AkTypes.h:96
AkUInt32 uTargetBufferingSize
Total stream buffer size (specific to IAkAutoStream)
Definition: IAkStreamMgr.h:201
virtual AKRESULT SetMinTargetBufferSize(AkUInt32 in_uMinTargetBufferSize)=0
char AkOSChar
Generic character string.
Definition: AkTypes.h:94
AkUtf16 szDeviceName[AK_MONITOR_DEVICENAME_MAXLENGTH]
Device name.
Definition: IAkStreamMgr.h:154
virtual AKRESULT StartMonitoring()=0
Operation cancelled.
Definition: IAkStreamMgr.h:56
AkUInt32 uBufferedSize
Size of available data (specific to IAkAutoStream)
Definition: IAkStreamMgr.h:203
AkDeviceID deviceID
Device ID.
Definition: IAkStreamMgr.h:151
virtual AKRESULT SetStreamName(const AkOSChar *in_pszStreamName)=0
bool bCanWrite
Specifies whether or not the device is writable.
Definition: IAkStreamMgr.h:152
virtual void GetStreamData(AkStreamData &out_streamData)=0
AkUInt32 uNumActiveStreams
Number of streams that have been active in the previous frame.
Definition: IAkStreamMgr.h:169
Stream general information.
Definition: IAkStreamMgr.h:181