@@ -59,7 +59,7 @@ AudioCache::AudioCache()
59
59
, _isLoadingFinished(false )
60
60
, _isSkipReadDataTask(false )
61
61
{
62
- ALOGV (" AudioCache() {}, id={}" , fmt::ptr (this ), _id);
62
+ AXLOGV (" AudioCache() {}, id={}" , fmt::ptr (this ), _id);
63
63
for (int i = 0 ; i < QUEUEBUFFER_NUM; ++i)
64
64
{
65
65
_queBuffers[i] = nullptr ;
@@ -69,16 +69,16 @@ AudioCache::AudioCache()
69
69
70
70
AudioCache::~AudioCache ()
71
71
{
72
- ALOGV (" ~AudioCache() {}, id={}, begin" , fmt::ptr (this ), _id);
72
+ AXLOGV (" ~AudioCache() {}, id={}, begin" , fmt::ptr (this ), _id);
73
73
*_isDestroyed = true ;
74
74
while (!_isLoadingFinished)
75
75
{
76
76
if (_isSkipReadDataTask)
77
77
{
78
- ALOGV (" id={}, Skip read data task, don't continue to wait!" , _id);
78
+ AXLOGV (" id={}, Skip read data task, don't continue to wait!" , _id);
79
79
break ;
80
80
}
81
- ALOGV (" id={}, waiting readData thread to finish ..." , _id);
81
+ AXLOGV (" id={}, waiting readData thread to finish ..." , _id);
82
82
std::this_thread::sleep_for (std::chrono::milliseconds (5 ));
83
83
}
84
84
// wait for the 'readDataTask' task to exit
@@ -88,14 +88,14 @@ AudioCache::~AudioCache()
88
88
{
89
89
if (_alBufferId != INVALID_AL_BUFFER_ID && alIsBuffer (_alBufferId))
90
90
{
91
- ALOGV (" ~AudioCache(id={}), delete buffer: {}" , _id, _alBufferId);
91
+ AXLOGV (" ~AudioCache(id={}), delete buffer: {}" , _id, _alBufferId);
92
92
alDeleteBuffers (1 , &_alBufferId);
93
93
_alBufferId = INVALID_AL_BUFFER_ID;
94
94
}
95
95
}
96
96
else
97
97
{
98
- ALOGW (" AudioCache ({}), id={}, buffer isn't ready, state={}" , fmt::ptr (this ), _id, (int )_state);
98
+ AXLOGW (" AudioCache ({}), id={}, buffer isn't ready, state={}" , fmt::ptr (this ), _id, (int )_state);
99
99
}
100
100
101
101
if (_queBufferFrames > 0 )
@@ -105,14 +105,14 @@ AudioCache::~AudioCache()
105
105
free (_queBuffers[index]);
106
106
}
107
107
}
108
- ALOGV (" ~AudioCache() {}, id={}, end" , fmt::ptr (this ), _id);
108
+ AXLOGV (" ~AudioCache() {}, id={}, end" , fmt::ptr (this ), _id);
109
109
_readDataTaskMutex.unlock ();
110
110
}
111
111
112
112
void AudioCache::readDataTask (unsigned int selfId)
113
113
{
114
114
// Note: It's in sub thread
115
- ALOGV (" readDataTask begin, cache id={}" , selfId);
115
+ AXLOGV (" readDataTask begin, cache id={}" , selfId);
116
116
117
117
_readDataTaskMutex.lock ();
118
118
_state = State::LOADING;
@@ -178,7 +178,7 @@ void AudioCache::readDataTask(unsigned int selfId)
178
178
auto alError = alGetError ();
179
179
if (alError != AL_NO_ERROR)
180
180
{
181
- ALOGE (" {}: attaching audio to buffer fail: {:#x}" , __FUNCTION__, alError);
181
+ AXLOGE (" {}: attaching audio to buffer fail: {:#x}" , __FUNCTION__, alError);
182
182
break ;
183
183
}
184
184
@@ -221,7 +221,7 @@ void AudioCache::readDataTask(unsigned int selfId)
221
221
}
222
222
223
223
#if AX_USE_ALSOFT
224
- ALOGV (" pcm buffer was loaded successfully, total frames: {}, total read frames: {}, remainingFrames: {}" ,
224
+ AXLOGV (" pcm buffer was loaded successfully, total frames: {}, total read frames: {}, remainingFrames: {}" ,
225
225
totalFrames, _framesRead, remainingFrames);
226
226
if (sourceFormat == AUDIO_SOURCE_FORMAT::ADPCM || sourceFormat == AUDIO_SOURCE_FORMAT::IMA_ADPCM)
227
227
alBufferi (_alBufferId, AL_UNPACK_BLOCK_ALIGNMENT_SOFT, decoder->getSamplesPerBlock ());
@@ -252,7 +252,7 @@ void AudioCache::readDataTask(unsigned int selfId)
252
252
253
253
if (adjustFrames > 0 )
254
254
{
255
- ALOGV (" Orignal total frames: {}, adjust frames: {}, current total frames: {}" , totalFrames,
255
+ AXLOGV (" Orignal total frames: {}, adjust frames: {}, current total frames: {}" , totalFrames,
256
256
adjustFrames, totalFrames + adjustFrames);
257
257
totalFrames += adjustFrames;
258
258
_totalFrames = remainingFrames = totalFrames;
@@ -270,7 +270,7 @@ void AudioCache::readDataTask(unsigned int selfId)
270
270
dataSize = static_cast <uint32_t >(pcmBuffer.size ());
271
271
}
272
272
# endif /* Adjust frames, may not needed */
273
- ALOGV (
273
+ AXLOGV (
274
274
" pcm buffer was loaded successfully, total frames: {}, total read frames: {}, adjust frames: {}, "
275
275
" remainingFrames: {}" ,
276
276
totalFrames, _framesRead, adjustFrames, remainingFrames);
@@ -280,7 +280,7 @@ void AudioCache::readDataTask(unsigned int selfId)
280
280
alError = alGetError ();
281
281
if (alError != AL_NO_ERROR)
282
282
{
283
- ALOGE (" {}:alBufferData error code:{:#x}" , __FUNCTION__, alError);
283
+ AXLOGE (" {}:alBufferData error code:{:#x}" , __FUNCTION__, alError);
284
284
break ;
285
285
}
286
286
@@ -313,7 +313,7 @@ void AudioCache::readDataTask(unsigned int selfId)
313
313
_state = State::FAILED;
314
314
if (_alBufferId != INVALID_AL_BUFFER_ID && alIsBuffer (_alBufferId))
315
315
{
316
- ALOGV (" readDataTask failed, delete buffer: {}" , _alBufferId);
316
+ AXLOGV (" readDataTask failed, delete buffer: {}" , _alBufferId);
317
317
alDeleteBuffers (1 , &_alBufferId);
318
318
_alBufferId = INVALID_AL_BUFFER_ID;
319
319
}
@@ -327,7 +327,7 @@ void AudioCache::readDataTask(unsigned int selfId)
327
327
invokingLoadCallbacks ();
328
328
329
329
_readDataTaskMutex.unlock ();
330
- ALOGV (" readDataTask end, cache id={}" , selfId);
330
+ AXLOGV (" readDataTask end, cache id={}" , selfId);
331
331
}
332
332
333
333
void AudioCache::addPlayCallback (const std::function<void ()>& callback)
@@ -348,7 +348,7 @@ void AudioCache::addPlayCallback(const std::function<void()>& callback)
348
348
break ;
349
349
350
350
default :
351
- ALOGE (" Invalid state: {}" , (int )_state);
351
+ AXLOGE (" Invalid state: {}" , (int )_state);
352
352
break ;
353
353
}
354
354
}
@@ -382,7 +382,7 @@ void AudioCache::addLoadCallback(const std::function<void(bool)>& callback)
382
382
break ;
383
383
384
384
default :
385
- ALOGE (" Invalid state: {}" , (int )_state);
385
+ AXLOGE (" Invalid state: {}" , (int )_state);
386
386
break ;
387
387
}
388
388
}
@@ -391,7 +391,7 @@ void AudioCache::invokingLoadCallbacks()
391
391
{
392
392
if (*_isDestroyed)
393
393
{
394
- ALOGV (" AudioCache ({}) was destroyed, don't invoke preload callback ..." , fmt::ptr (this ));
394
+ AXLOGV (" AudioCache ({}) was destroyed, don't invoke preload callback ..." , fmt::ptr (this ));
395
395
return ;
396
396
}
397
397
@@ -400,7 +400,7 @@ void AudioCache::invokingLoadCallbacks()
400
400
scheduler->runOnAxmolThread ([&, isDestroyed]() {
401
401
if (*isDestroyed)
402
402
{
403
- ALOGV (" invokingLoadCallbacks perform in cocos thread, AudioCache ({}) was destroyed!" , fmt::ptr (this ));
403
+ AXLOGV (" invokingLoadCallbacks perform in cocos thread, AudioCache ({}) was destroyed!" , fmt::ptr (this ));
404
404
return ;
405
405
}
406
406
0 commit comments