mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2025-02-11 09:38:02 +00:00
过滤视频流传输消息回调
Signed-off-by: liuhongjie <liuhongjie3@huawei.com>
This commit is contained in:
parent
bdbca41dbf
commit
fb81d1d217
@ -135,6 +135,7 @@ private:
|
||||
int32_t ConfigEngineParam(std::shared_ptr<T> &engine, const SurfaceParams& param);
|
||||
void UpdateTransChannelStatus(int32_t channelId, bool isConnect);
|
||||
int32_t GetTransChannelInfo(const TransChannelType& type, TransChannelInfo& info);
|
||||
bool IsStreamBytesChannel(const int32_t channelId);
|
||||
|
||||
void ExeuteConnectCallback(const ConnectResult& result);
|
||||
int32_t ExeuteEventCallback(const std::string& eventType, const EventCallbackInfo& info);
|
||||
|
@ -661,11 +661,9 @@ int32_t AbilityConnectionSession::CreateChannel(const std::string& channelName,
|
||||
return INVALID_PARAMETERS_ERR;
|
||||
}
|
||||
|
||||
if (channelType != TransChannelType::STREAM_CHANNEL_BYTES) {
|
||||
if (channelManager.RegisterChannelListener(channelId, channelListener_) != ERR_OK) {
|
||||
HILOGE("register channel listener failed, channelId is %{public}d", channelId);
|
||||
return INVALID_PARAMETERS_ERR;
|
||||
}
|
||||
if (channelManager.RegisterChannelListener(channelId, channelListener_) != ERR_OK) {
|
||||
HILOGE("register channel listener failed, channelId is %{public}d", channelId);
|
||||
return INVALID_PARAMETERS_ERR;
|
||||
}
|
||||
|
||||
std::unique_lock<std::shared_mutex> channelWriteLock(transChannelMutex_);
|
||||
@ -961,6 +959,11 @@ void AbilityConnectionSession::OnBytesReceived(int32_t channelId, const std::sha
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsStreamBytesChannel(channelId)) {
|
||||
HILOGE("is stream bytes channel, no need to send.");
|
||||
return;
|
||||
}
|
||||
|
||||
EventCallbackInfo callbackInfo;
|
||||
callbackInfo.sessionId = sessionId_;
|
||||
callbackInfo.data = dataBuffer;
|
||||
@ -968,6 +971,18 @@ void AbilityConnectionSession::OnBytesReceived(int32_t channelId, const std::sha
|
||||
ExeuteEventCallback(EVENT_RECEIVE_DATA, callbackInfo);
|
||||
}
|
||||
|
||||
bool AbilityConnectionSession::IsStreamBytesChannel(const int32_t channelId)
|
||||
{
|
||||
TransChannelInfo transChannelInfo;
|
||||
int32_t ret = GetTransChannelInfo(TransChannelType::STREAM_CHANNEL_BYTES, transChannelInfo);
|
||||
if (ret != ERR_OK) {
|
||||
HILOGE("stream bytes channel not exit!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return transChannelInfo.channelId == channelId;
|
||||
}
|
||||
|
||||
bool AbilityConnectionSession::IsVaildChannel(const int32_t channelId)
|
||||
{
|
||||
HILOGD("called");
|
||||
|
Loading…
x
Reference in New Issue
Block a user