mirror of
https://gitee.com/openharmony/multimedia_audio_standard
synced 2024-12-04 02:42:55 +00:00
Reduce continous latency during frame write
Signed-off-by: Anurup M <anurup.m@huawei.com>
This commit is contained in:
parent
b178e4da6b
commit
e9657a6d05
@ -55,6 +55,10 @@ config("audio_client_public_config") {
|
||||
"-Werror",
|
||||
]
|
||||
|
||||
if ("${product_name}" == "m40") {
|
||||
cflags += [ "-DPRODUCT_M40" ]
|
||||
}
|
||||
|
||||
if (target_cpu == "arm") {
|
||||
cflags += [ "-DBINDER_IPC_32BIT" ]
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ private:
|
||||
const void *internalReadBuffer;
|
||||
size_t internalRdBufLen;
|
||||
size_t internalRdBufIndex;
|
||||
size_t setBufferSize = MINIMUM_BUFFER_SIZE;
|
||||
size_t setBufferSize;
|
||||
int32_t streamCmdStatus;
|
||||
int32_t streamDrainStatus;
|
||||
int32_t streamFlushStatus;
|
||||
|
@ -33,8 +33,12 @@ namespace AudioStandard {
|
||||
AudioRendererCallbacks::~AudioRendererCallbacks() = default;
|
||||
AudioCapturerCallbacks::~AudioCapturerCallbacks() = default;
|
||||
|
||||
const uint32_t CHECK_UTIL_SUCCESS = 0;
|
||||
#ifdef PRODUCT_M40
|
||||
const uint64_t LATENCY_IN_MSEC = 45UL;
|
||||
#else
|
||||
const uint64_t LATENCY_IN_MSEC = 50UL;
|
||||
#endif
|
||||
const uint32_t CHECK_UTIL_SUCCESS = 0;
|
||||
const uint32_t READ_TIMEOUT_IN_SEC = 5;
|
||||
const uint32_t DOUBLE_VALUE = 2;
|
||||
const uint32_t MAX_LENGTH_FACTOR = 5;
|
||||
@ -414,6 +418,7 @@ AudioServiceClient::AudioServiceClient()
|
||||
acache.totalCacheSize = 0;
|
||||
acache.buffer = nullptr;
|
||||
|
||||
setBufferSize = 0;
|
||||
PAStreamCorkSuccessCb = PAStreamStopSuccessCb;
|
||||
}
|
||||
|
||||
@ -491,6 +496,7 @@ void AudioServiceClient::ResetPAAudioClient()
|
||||
acache.isFull = false;
|
||||
acache.totalCacheSize = 0;
|
||||
|
||||
setBufferSize = 0;
|
||||
PAStreamCorkSuccessCb = nullptr;
|
||||
}
|
||||
|
||||
@ -1445,7 +1451,11 @@ int32_t AudioServiceClient::GetMinimumBufferSize(size_t &minBufferSize) const
|
||||
if (renderMode_ == RENDER_MODE_CALLBACK) {
|
||||
minBufferSize = (size_t)bufferAttr->minreq;
|
||||
} else {
|
||||
minBufferSize = setBufferSize;
|
||||
if (setBufferSize) {
|
||||
minBufferSize = setBufferSize;
|
||||
} else {
|
||||
minBufferSize = (size_t)bufferAttr->minreq;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1475,7 +1485,11 @@ int32_t AudioServiceClient::GetMinimumFrameCount(uint32_t &frameCount) const
|
||||
if (renderMode_ == RENDER_MODE_CALLBACK) {
|
||||
minBufferSize = (size_t)bufferAttr->minreq;
|
||||
} else {
|
||||
minBufferSize = setBufferSize;
|
||||
if (setBufferSize) {
|
||||
minBufferSize = setBufferSize;
|
||||
} else {
|
||||
minBufferSize = (size_t)bufferAttr->minreq;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user