Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit a3c1913

Browse files
committed
Allow application to use AV1 only
1 parent bf4a2f8 commit a3c1913

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

talk/owt/sdk/base/codecutils.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ webrtc::VideoCodecType CodecUtils::ConvertSdpFormatToCodecType(webrtc::SdpVideoF
5757
} else if (absl::EqualsIgnoreCase(format.name, cricket::kH265CodecName)) {
5858
return webrtc::kVideoCodecH265;
5959
#endif
60+
} else if (absl::EqualsIgnoreCase(format.name, cricket::kAv1CodecName)) {
61+
return webrtc::kVideoCodecAV1;
6062
}
6163
else {
6264
return webrtc::kVideoCodecGeneric;

talk/owt/sdk/base/sdputils.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ static const std::unordered_map<VideoCodec, const std::string, EnumClassHash>
2121
video_codec_names = {{VideoCodec::kVp8, "VP8"},
2222
{VideoCodec::kH264, "H264"},
2323
{VideoCodec::kVp9, "VP9"},
24-
{VideoCodec::kH265, "H265"}};
24+
{VideoCodec::kH265, "H265"},
25+
{VideoCodec::kAv1, "AV1X"}};
2526
std::string SdpUtils::SetPreferAudioCodecs(const std::string& original_sdp,
2627
std::vector<AudioCodec>& codec) {
2728
std::string cur_sdp(original_sdp);

talk/owt/sdk/base/win/msdkvideodecoder.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ int32_t MSDKVideoDecoder::InitDecodeOnCodecThread() {
247247
}
248248

249249
m_mfxVideoParams.mfx.CodecId = codec_id;
250-
if (codec_id == MFX_CODEC_VP9)
250+
if (codec_id == MFX_CODEC_VP9 || codec_id == MFX_CODEC_AV1)
251251
m_mfxVideoParams.mfx.EnableReallocRequest = MFX_CODINGOPTION_ON;
252252
inited = true;
253253
RTC_LOG(LS_ERROR) << "InitDecodeOnCodecThread --";
@@ -332,7 +332,6 @@ int32_t MSDKVideoDecoder::Decode(
332332
}
333333
// Finally we're done with all configurations and we're OK to init the
334334
// decoder.
335-
336335
sts = m_pmfxDEC->Init(&m_mfxVideoParams);
337336
if (MFX_ERR_NONE != sts) {
338337
RTC_LOG(LS_ERROR) << "Failed to init the decoder.";

talk/owt/sdk/base/win/msdkvideoencoderfactory.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ std::unique_ptr<webrtc::VideoEncoder> MSDKVideoEncoderFactory::CreateVideoEncode
100100
else if (absl::EqualsIgnoreCase(format.name, cricket::kVp9CodecName)/* &&
101101
!vp9_hw*/)
102102
return webrtc::VP9Encoder::Create(cricket::VideoCodec(format));
103-
// TODO: Replace with AV1 HW encoder post TGL.
104-
else if (absl::EqualsIgnoreCase(format.name, cricket::kAv1CodecName) &&
105-
!av1_hw)
103+
// TODO: Replace with AV1 HW encoder post ADL.
104+
else if (absl::EqualsIgnoreCase(format.name, cricket::kAv1CodecName)/* &&
105+
!av1_hw*/)
106106
return webrtc::CreateLibaomAv1Encoder();
107107
#ifndef DISABLE_H265
108108
else if (absl::EqualsIgnoreCase(format.name, cricket::kH265CodecName) &&

talk/owt/sdk/base/win/videorendererd3d11.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ void WebrtcVideoRendererD3D11Impl::OnFrame(
5151
const webrtc::VideoFrame& video_frame) {
5252
uint16_t width = video_frame.video_frame_buffer()->width();
5353
uint16_t height = video_frame.video_frame_buffer()->height();
54-
55-
RTC_LOG(LS_ERROR) << "On frame." << width << "x" << height;
5654
if (width == 0 || height == 0)
5755
return;
5856

@@ -554,9 +552,11 @@ void WebrtcVideoRendererD3D11Impl::RenderToBackbuffer(int array_slice) {
554552
0, 0, &parameters);
555553
int64_t current_time = clock_->TimeInMilliseconds();
556554
frame_count++;
555+
#if 0
557556
FILE* f = fopen("frames.txt", "a");
558557
fprintf(f, "timestamp: %lld, frames drawn: %d\r\n", current_time, frame_count);
559558
fclose(f);
559+
#endif
560560
}
561561

562562
// Helper method to initialize a shader resource view

0 commit comments

Comments
 (0)