Skip to content

Commit

Permalink
use webrtc::suportedcodec for H264
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed Nov 4, 2023
1 parent 4516fe4 commit 68e8d8e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion inc/VideoDecoderFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

class VideoDecoderFactory : public webrtc::VideoDecoderFactory {
public:
VideoDecoderFactory(): supported_formats_({webrtc::SdpVideoFormat(cricket::kH264CodecName),webrtc::SdpVideoFormat("H265")}) {}
VideoDecoderFactory(): supported_formats_(webrtc::SupportedH264Codecs()) {
supported_formats_.push_back(webrtc::SdpVideoFormat(cricket::kH265CodecName));
}
virtual ~VideoDecoderFactory() override {}

std::unique_ptr<webrtc::VideoDecoder> CreateVideoDecoder(const webrtc::SdpVideoFormat& format) override {
Expand Down
4 changes: 3 additions & 1 deletion inc/VideoEncoderFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

class VideoEncoderFactory : public webrtc::VideoEncoderFactory {
public:
VideoEncoderFactory(): supported_formats_({webrtc::SdpVideoFormat(cricket::kH264CodecName),webrtc::SdpVideoFormat("H265")}) {}
VideoEncoderFactory(): supported_formats_(webrtc::SupportedH264Codecs()) {
supported_formats_.push_back(webrtc::SdpVideoFormat(cricket::kH265CodecName));
}
virtual ~VideoEncoderFactory() override {}

std::unique_ptr<webrtc::VideoEncoder> CreateVideoEncoder(const webrtc::SdpVideoFormat& format) override {
Expand Down
4 changes: 2 additions & 2 deletions src/PeerConnectionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ std::tuple<int, std::map<std::string,std::string>,Json::Value> PeerConnectionMan

} else {
std::string offersdp(in.asString());
RTC_LOG(LS_ERROR) << "offer:" << offersdp;
RTC_LOG(LS_WARNING) << "offer:" << offersdp;
std::unique_ptr<webrtc::SessionDescriptionInterface> desc = this->getAnswer(peerid, offersdp, videourl, audiourl, options, true);
if (desc.get()) {
desc->ToString(&answersdp);
Expand All @@ -413,7 +413,7 @@ std::tuple<int, std::map<std::string,std::string>,Json::Value> PeerConnectionMan
} else {
RTC_LOG(LS_ERROR) << "Failed to create answer - no SDP";
}
RTC_LOG(LS_INFO) << "anwser:" << answersdp;
RTC_LOG(LS_WARNING) << "anwser:" << answersdp;

}
return std::make_tuple(httpcode, headers, answersdp);
Expand Down

0 comments on commit 68e8d8e

Please sign in to comment.