버전

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

이 페이지가 도움이 되었나요?

지원이 필요하신가요?

질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!

지원 페이지를 방문해 주세요

작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.

프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.

Wwise를 시작해 보세요