Adopt absl::string_view in modules/audio_coding/
Bug: webrtc:13579 Change-Id: Ifec66fb6ba9724d18539de7245a358c2d13c7939 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/268547 Reviewed-by: Ivo Creusen <ivoc@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Ali Tofigh <alito@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37573}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
761072f68e
commit
714e3cbb48
@ -11,6 +11,8 @@
|
||||
#include "modules/audio_coding/neteq/tools/rtp_file_source.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "absl/strings/string_view.h"
|
||||
#ifndef WIN32
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
@ -24,20 +26,20 @@
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
||||
RtpFileSource* RtpFileSource::Create(const std::string& file_name,
|
||||
RtpFileSource* RtpFileSource::Create(absl::string_view file_name,
|
||||
absl::optional<uint32_t> ssrc_filter) {
|
||||
RtpFileSource* source = new RtpFileSource(ssrc_filter);
|
||||
RTC_CHECK(source->OpenFile(file_name));
|
||||
return source;
|
||||
}
|
||||
|
||||
bool RtpFileSource::ValidRtpDump(const std::string& file_name) {
|
||||
bool RtpFileSource::ValidRtpDump(absl::string_view file_name) {
|
||||
std::unique_ptr<RtpFileReader> temp_file(
|
||||
RtpFileReader::Create(RtpFileReader::kRtpDump, file_name));
|
||||
return !!temp_file;
|
||||
}
|
||||
|
||||
bool RtpFileSource::ValidPcap(const std::string& file_name) {
|
||||
bool RtpFileSource::ValidPcap(absl::string_view file_name) {
|
||||
std::unique_ptr<RtpFileReader> temp_file(
|
||||
RtpFileReader::Create(RtpFileReader::kPcap, file_name));
|
||||
return !!temp_file;
|
||||
@ -81,7 +83,7 @@ RtpFileSource::RtpFileSource(absl::optional<uint32_t> ssrc_filter)
|
||||
: PacketSource(),
|
||||
ssrc_filter_(ssrc_filter) {}
|
||||
|
||||
bool RtpFileSource::OpenFile(const std::string& file_name) {
|
||||
bool RtpFileSource::OpenFile(absl::string_view file_name) {
|
||||
rtp_reader_.reset(RtpFileReader::Create(RtpFileReader::kRtpDump, file_name));
|
||||
if (rtp_reader_)
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user