mirror of
https://gitee.com/openharmony/multimedia_av_codec
synced 2024-11-30 10:32:24 +00:00
add fd log
Signed-off-by: y30025806 <yangjunhui10@huawei.com> Change-Id: Id48159d9d5a7fbd41acef781587ca1b91b525c75
This commit is contained in:
parent
72cdce74b5
commit
32d4fb2c9a
@ -111,8 +111,11 @@ int32_t AVSourceImpl::InitWithFD(int32_t fd, int64_t offset, int64_t size)
|
||||
"Create source with fd failed because input offset is negative");
|
||||
CHECK_AND_RETURN_RET_LOG(size > 0, AVCS_ERR_INVALID_VAL,
|
||||
"Create source with fd failed because input size must be greater than zero");
|
||||
if (fd <= 2) {
|
||||
AVCODEC_LOGW("Using special fd: %{public}d, isatty: %{public}d", fd, isatty(fd));
|
||||
}
|
||||
int32_t flag = fcntl(fd, F_GETFL, 0);
|
||||
CHECK_AND_RETURN_RET_LOG(flag >= 0, AVCS_ERR_INVALID_VAL, "get fd status failed");
|
||||
CHECK_AND_RETURN_RET_LOG(flag >= 0, AVCS_ERR_INVALID_VAL, "Get fd status failed");
|
||||
CHECK_AND_RETURN_RET_LOG(
|
||||
(static_cast<uint32_t>(flag) & static_cast<uint32_t>(O_WRONLY)) != static_cast<uint32_t>(O_WRONLY),
|
||||
AVCS_ERR_INVALID_VAL, "Fd not be permitted to read ");
|
||||
|
Loading…
Reference in New Issue
Block a user