Chromium Code Reviews| Index: content/renderer/media/rtc_video_encoder.cc |
| diff --git a/content/renderer/media/rtc_video_encoder.cc b/content/renderer/media/rtc_video_encoder.cc |
| index 99e963a96b27fe7ff7532447e20541ca50c12669..95779ae3af8fb47eaaa0834c73d149941b8ac7f1 100644 |
| --- a/content/renderer/media/rtc_video_encoder.cc |
| +++ b/content/renderer/media/rtc_video_encoder.cc |
| @@ -62,6 +62,20 @@ bool GetRTPFragmentationHeaderH264(webrtc::RTPFragmentationHeader* header, |
| return true; |
| } |
| +// Maps webrtc::VideoCodecProfile to media::VideoCodecProfile for H264 codec. |
|
Pawel Osciak
2014/10/20 06:28:43
Could we instead have a method that takes both pro
hshi1
2014/10/20 16:55:50
The |profile_| is of media::VideoCodecProfile type
Pawel Osciak
2014/10/21 13:41:46
Yes. My suggestion though was that it would be nic
hshi1
2014/10/22 19:01:16
Done.
|
| +media::VideoCodecProfile GetH264CodecProfile( |
| + webrtc::VideoCodecProfile profile) { |
| + switch (profile) { |
| + case webrtc::kProfileBase: |
| + return media::H264PROFILE_BASELINE; |
|
Pawel Osciak
2014/10/20 06:28:43
Is this actually baseline or constrained baseline?
hshi1
2014/10/20 16:55:50
This is the actual baseline, however as I commente
Pawel Osciak
2014/10/21 13:41:46
The issue is, what if an encoder does non-constrai
hshi1
2014/10/22 19:01:16
But there's no constrained baseline profile defini
Pawel Osciak
2014/10/25 01:29:57
Right, but that's a bug (crbug.com/345569) so perh
|
| + case webrtc::kProfileMain: |
| + return media::H264PROFILE_MAIN; |
| + default: |
| + DLOG(ERROR) << "Unrecognized H264 video codec profile"; |
| + } |
| + return media::H264PROFILE_BASELINE; |
|
Pawel Osciak
2014/10/20 06:28:43
notreached.
hshi1
2014/10/20 16:55:50
Acknowledged.
|
| +} |
| + |
| } // namespace |
| // This private class of RTCVideoEncoder does the actual work of communicating |
| @@ -574,6 +588,11 @@ int32_t RTCVideoEncoder::InitEncode(const webrtc::VideoCodec* codec_settings, |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DCHECK(!impl_.get()); |
| + if (codec_settings->codecType == webrtc::kVideoCodecH264) { |
|
Pawel Osciak
2014/10/20 06:28:43
If we can't determine profile on construction, can
hshi1
2014/10/20 16:55:50
No we can't because of the way webRTC defines the
Pawel Osciak
2014/10/21 13:41:46
We could perhaps store webrtc codec in RTCVE const
hshi1
2014/10/22 19:01:16
Done.
|
| + video_codec_profile_ = |
| + GetH264CodecProfile(codec_settings->codecSpecific.H264.profile); |
| + } |
| + |
| weak_factory_.InvalidateWeakPtrs(); |
| impl_ = new Impl(weak_factory_.GetWeakPtr(), gpu_factories_); |
| base::WaitableEvent initialization_waiter(true, false); |