copy meta to consumers and forwarders,
this feature is missed when merge the modification about "implement save meta,need more test"
正在显示
1 个修改的文件
包含
25 行增加
和
0 行删除
| @@ -1603,6 +1603,31 @@ int SrsSource::on_data(SrsCommonMessage* shared_data) | @@ -1603,6 +1603,31 @@ int SrsSource::on_data(SrsCommonMessage* shared_data) | ||
| 1603 | } | 1603 | } |
| 1604 | #endif | 1604 | #endif |
| 1605 | 1605 | ||
| 1606 | + | ||
| 1607 | + // copy to all consumer | ||
| 1608 | + if (1) { | ||
| 1609 | + for (int i = 0; i < (int)consumers.size(); i++) { | ||
| 1610 | + SrsConsumer* consumer = consumers.at(i); | ||
| 1611 | + if ((ret = consumer->enqueue(&msg, atc, jitter_algorithm)) != ERROR_SUCCESS) { | ||
| 1612 | + srs_error("dispatch the video failed. ret=%d", ret); | ||
| 1613 | + return ret; | ||
| 1614 | + } | ||
| 1615 | + } | ||
| 1616 | + srs_info("dispatch video success."); | ||
| 1617 | + } | ||
| 1618 | + | ||
| 1619 | + // copy to all forwarders. | ||
| 1620 | + if (!forwarders.empty()) { | ||
| 1621 | + std::vector<SrsForwarder*>::iterator it; | ||
| 1622 | + for (it = forwarders.begin(); it != forwarders.end(); ++it) { | ||
| 1623 | + SrsForwarder* forwarder = *it; | ||
| 1624 | + if ((ret = forwarder->on_meta_data(&msg)) != ERROR_SUCCESS) { | ||
| 1625 | + srs_error("forwarder process video message failed. ret=%d", ret); | ||
| 1626 | + return ret; | ||
| 1627 | + } | ||
| 1628 | + } | ||
| 1629 | + } | ||
| 1630 | + | ||
| 1606 | return ret; | 1631 | return ret; |
| 1607 | } | 1632 | } |
| 1608 | 1633 |
-
请 注册 或 登录 后发表评论