Lines Matching defs:receiverId
86 MEDIA_LOGD("BufferDispatcher NotifyThreadWorker before wait, receiverId: %{public}u.", GetReceiverId());
91 MEDIA_LOGD("wait Audio, receiverId: %{public}u.", GetReceiverId());
96 MEDIA_LOGD("wait Video, receiverId: %{public}u.", GetReceiverId());
101 MEDIA_LOGD("wait Mixed, receiverId: %{public}u.", GetReceiverId());
112 MEDIA_LOGD("BufferDispatcher NotifyThreadWorker after wait start read, receiverId: %{public}u.", GetReceiverId());
122 SHARING_LOGD("receiverId: %{public}u notify start read.", GetReceiverId());
146 SHARING_LOGD("receiverId: %{public}u notify stop read.", GetReceiverId());
625 uint32_t BufferDispatcher::FindReceiverIndex(uint32_t receiverId)
628 if (notifiers_.find(receiverId) != notifiers_.end()) {
629 return notifiers_[receiverId]->GetReadIndex();
635 bool BufferDispatcher::IsRecevierExist(uint32_t receiverId)
638 auto notifier = GetNotifierByReceiverId(receiverId);
684 SHARING_LOGI("receiverId: %{public}d, readIndex: %{public}d, usableRef: %{public}d, readRefFlag_: %{public}d.",
767 int32_t BufferDispatcher::DetachReceiver(uint32_t receiverId, DataNotifier::Ptr notifier)
775 SetReceiverReadRef(receiverId, MEDIA_TYPE_AUDIO, false);
776 SetReceiverReadRef(receiverId, MEDIA_TYPE_VIDEO, false);
779 notifiers_.erase(receiverId);
801 auto receiverId = receiver->GetReceiverId();
802 if (notifiers_.find(receiverId) != notifiers_.end()) {
803 auto notifierFind = notifiers_[receiverId];
805 DetachReceiver(receiverId, notifierFind);
845 DataNotifier::Ptr BufferDispatcher::GetNotifierByReceiverId(uint32_t receiverId)
849 if (notifiers_.find(receiverId) != notifiers_.end()) {
850 return notifiers_[receiverId];
856 int32_t BufferDispatcher::ReadBufferData(uint32_t receiverId, MediaType type,
859 MEDIA_LOGD("in, receiverId: %{public}u.", receiverId);
860 auto notifier = GetNotifierByReceiverId(receiverId);
875 UpdateReceiverReadIndex(receiverId, readIndex, type);
880 if (IsDataReaded(receiverId, circularBuffer_.at(readIndex))) {
881 UpdateReceiverReadIndex(receiverId, readIndex, type);
905 SetReceiverReadFlag(receiverId, data);
912 receiverId, circularBuffer_.size(), readIndex, int32_t(type), circularBuffer_.size() - readIndex);
913 UpdateReceiverReadIndex(receiverId, readIndex, type);
1238 void BufferDispatcher::UpdateReceiverReadIndex(uint32_t receiverId, const uint32_t readIndex, MediaType type)
1241 uint32_t nextIndex = FindNextIndex(readIndex, type, receiverId);
1247 auto notifier = GetNotifierByReceiverId(receiverId);
1298 uint32_t BufferDispatcher::FindNextIndex(uint32_t index, MediaType type, uint32_t receiverId)
1309 auto notifier = GetNotifierByReceiverId(receiverId);
1323 SetReceiverReadFlag(receiverId, circularBuffer_[bIndex]);
1352 bool BufferDispatcher::IsDataReaded(uint32_t receiverId, DataSpec::Ptr &dataSpec)
1355 uint32_t index = FindReceiverIndex(receiverId);
1497 void BufferDispatcher::NotifyReadReady(uint32_t receiverId, MediaType type)
1500 auto notifier = GetNotifierByReceiverId(receiverId);
1509 SetReceiverReadRef(receiverId, MEDIA_TYPE_VIDEO, true);
1510 SetReceiverReadRef(receiverId, MEDIA_TYPE_AUDIO, true);
1512 SetReceiverReadRef(receiverId, type, true);
1516 MEDIA_LOGD("receiverId %{public}d MediaType %{public}d dataAvaliable %{public}d.", receiverId, type,
1519 SetReceiverDataRef(receiverId, MEDIA_TYPE_VIDEO, dataAvaliable);
1520 SetReceiverDataRef(receiverId, MEDIA_TYPE_AUDIO, dataAvaliable);
1522 SetReceiverDataRef(receiverId, type, dataAvaliable);
1583 void BufferDispatcher::SetReceiverDataRef(uint32_t receiverId, MediaType type, bool ready)
1586 uint32_t index = FindReceiverIndex(receiverId);
1594 MEDIA_LOGD("Audio recvid %{public}d ,bitRef %{public}d ready %{public}d.", receiverId, bitRef, ready);
1604 MEDIA_LOGD("Video recvid %{public}d ,bitRef %{public}d ready %{public}d.", receiverId, bitRef, ready);
1614 void BufferDispatcher::SetReceiverReadRef(uint32_t receiverId, MediaType type, bool ready)
1617 uint32_t index = FindReceiverIndex(receiverId);
1625 MEDIA_LOGD("Audio recvid %{public}d ,bitRef %{public}d ready %{public}d.", receiverId, bitRef, ready);
1636 MEDIA_LOGD("Video recvid %{public}d ,bitRef %{public}d ready %{public}d.", receiverId, bitRef, ready);
1647 uint32_t BufferDispatcher::GetReceiverDataRef(uint32_t receiverId)
1653 uint32_t BufferDispatcher::GetReceiverReadRef(uint32_t receiverId)
1656 uint32_t retBitRef = GetReceiverIndexRef(receiverId);
1661 uint32_t BufferDispatcher::GetReceiverIndexRef(uint32_t receiverId)
1664 uint32_t index = FindReceiverIndex(receiverId);
1673 void BufferDispatcher::ClearReadBit(uint32_t receiverId, MediaType type)
1678 SetReceiverReadRef(receiverId, type, false);
1680 SetReceiverReadRef(receiverId, MEDIA_TYPE_VIDEO, false);
1681 SetReceiverReadRef(receiverId, MEDIA_TYPE_AUDIO, false);
1685 void BufferDispatcher::ClearDataBit(uint32_t receiverId, MediaType type)
1690 SetReceiverDataRef(receiverId, type, false);
1692 SetReceiverDataRef(receiverId, MEDIA_TYPE_VIDEO, false);
1693 SetReceiverDataRef(receiverId, MEDIA_TYPE_AUDIO, false);
1697 bool BufferDispatcher::IsRead(uint32_t receiverId, uint32_t index)
1703 return IsDataReaded(receiverId, circularBuffer_.at(index));
1732 void BufferDispatcher::SetReceiverReadFlag(uint32_t receiverId, DataSpec::Ptr &dataSpec)
1736 uint32_t index = FindReceiverIndex(receiverId);
1740 ", reserveFlag: %{public}x, receiverId: %{public}d, index: %{public}d.",
1741 dataSpec->mediaData->mediaType, dataSpec->mediaData->pts, dataSpec->reserveFlag.load(), receiverId,
1796 SHARING_LOGD("receiverId: %{public}u, videoIndex: %{public}d, nextIndex: %{public}d.",