Reland of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2491613005/ )

Reason for revert:
More downstream issues fixed again.

Original issue's description:
> Revert of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2494683006/ )
>
> Reason for revert:
> Another downstream error.
>
> Original issue's description:
> > Reland of Declare VideoCodec.codec_specific_info private (patchset #1 id:1 of https://codereview.webrtc.org/2491933002/ )
> >
> > Reason for revert:
> > Relanding, now that downstream issues have been fixed.
> >
> > Original issue's description:
> > > Revert of Declare VideoCodec.codec_specific_info private (patchset #5 id:80001 of https://codereview.webrtc.org/2452963002/ )
> > >
> > > Reason for revert:
> > > Broke a google3 build
> > >
> > > Original issue's description:
> > > > Declare VideoCodec.codec_specific_info private
> > > >
> > > > This completes the privatization of the codec specific
> > > > information in VideoCodec.
> > > >
> > > > BUG=webrtc:6603
> > > >
> > > > Committed: https://crrev.com/792738640234d81c916ac4458ac72286cb2548a4
> > > > Cr-Commit-Position: refs/heads/master@{#15013}
> > >
> > > TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:6603
> > >
> > > Committed: https://crrev.com/7fe6db91d99cf6d43874651bcca56092cf869e2f
> > > Cr-Commit-Position: refs/heads/master@{#15027}
> >
> > TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:6603
> >
> > Committed: https://crrev.com/c63fb3a0d3b9b2081a6a5e6e238d8ee595dca2a2
> > Cr-Commit-Position: refs/heads/master@{#15041}
>
> TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6603
>
> Committed: https://crrev.com/281459896124685d355d37388ee2290b55015594
> Cr-Commit-Position: refs/heads/master@{#15042}

TBR=tommi@chromium.org,magjed@chromium.org,tommi@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6603

Review-Url: https://codereview.webrtc.org/2508853002
Cr-Commit-Position: refs/heads/master@{#15117}
This commit is contained in:
hta 2016-11-16 23:23:04 -08:00 committed by Commit bot
parent 05f845d025
commit 527d3474ad
5 changed files with 21 additions and 26 deletions

View File

@ -405,7 +405,7 @@ int32_t MediaCodecVideoEncoder::InitEncode(
// TODO(pbos): Extract automaticResizeOn out of VP8 settings.
scale_ = false;
if (codecType_ == kVideoCodecVP8) {
scale_ = codec_settings->codecSpecific.VP8.automaticResizeOn;
scale_ = codec_settings->VP8().automaticResizeOn;
} else if (codecType_ != kVideoCodecVP9) {
scale_ = true;
}

View File

@ -61,36 +61,36 @@ VideoCodec::VideoCodec()
spatialLayers(),
mode(kRealtimeVideo),
expect_encode_from_texture(false),
codecSpecific() {}
codec_specific_() {}
VideoCodecVP8* VideoCodec::VP8() {
RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
return &codecSpecific.VP8;
return &codec_specific_.VP8;
}
const VideoCodecVP8& VideoCodec::VP8() const {
RTC_DCHECK_EQ(codecType, kVideoCodecVP8);
return codecSpecific.VP8;
return codec_specific_.VP8;
}
VideoCodecVP9* VideoCodec::VP9() {
RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
return &codecSpecific.VP9;
return &codec_specific_.VP9;
}
const VideoCodecVP9& VideoCodec::VP9() const {
RTC_DCHECK_EQ(codecType, kVideoCodecVP9);
return codecSpecific.VP9;
return codec_specific_.VP9;
}
VideoCodecH264* VideoCodec::H264() {
RTC_DCHECK_EQ(codecType, kVideoCodecH264);
return &codecSpecific.H264;
return &codec_specific_.H264;
}
const VideoCodecH264& VideoCodec::H264() const {
RTC_DCHECK_EQ(codecType, kVideoCodecH264);
return codecSpecific.H264;
return codec_specific_.H264;
}
static const char* kPayloadNameVp8 = "VP8";

View File

@ -637,11 +637,10 @@ class VideoCodec {
VideoCodecH264* H264();
const VideoCodecH264& H264() const;
// This variable will be declared private and renamed to codec_specific_
// once Chromium is not accessing it.
private:
// TODO(hta): Consider replacing the union with a pointer type.
// This will allow removing the VideoCodec* types from this file.
VideoCodecUnion codecSpecific;
VideoCodecUnion codec_specific_;
};
class BitrateAllocation {

View File

@ -167,11 +167,11 @@ VideoEncoderConfig::VideoEncoderConfig(const VideoEncoderConfig&) = default;
void VideoEncoderConfig::EncoderSpecificSettings::FillEncoderSpecificSettings(
VideoCodec* codec) const {
if (codec->codecType == kVideoCodecH264) {
FillVideoCodecH264(&codec->codecSpecific.H264);
FillVideoCodecH264(codec->H264());
} else if (codec->codecType == kVideoCodecVP8) {
FillVideoCodecVp8(&codec->codecSpecific.VP8);
FillVideoCodecVp8(codec->VP8());
} else if (codec->codecType == kVideoCodecVP9) {
FillVideoCodecVp9(&codec->codecSpecific.VP9);
FillVideoCodecVp9(codec->VP9());
} else {
RTC_NOTREACHED() << "Encoder specifics set/used for unknown codec type.";
}

View File

@ -528,19 +528,15 @@ void ViEEncoder::EncodeVideoFrame(const VideoFrame& video_frame,
webrtc::CodecSpecificInfo codec_specific_info;
codec_specific_info.codecType = webrtc::kVideoCodecVP8;
codec_specific_info.codecSpecific.VP8.hasReceivedRPSI =
has_received_rpsi_;
codec_specific_info.codecSpecific.VP8.hasReceivedSLI =
has_received_sli_;
codec_specific_info.codecSpecific.VP8.pictureIdRPSI =
picture_id_rpsi_;
codec_specific_info.codecSpecific.VP8.pictureIdSLI =
picture_id_sli_;
has_received_sli_ = false;
has_received_rpsi_ = false;
codec_specific_info.codecSpecific.VP8.hasReceivedRPSI = has_received_rpsi_;
codec_specific_info.codecSpecific.VP8.hasReceivedSLI = has_received_sli_;
codec_specific_info.codecSpecific.VP8.pictureIdRPSI = picture_id_rpsi_;
codec_specific_info.codecSpecific.VP8.pictureIdSLI = picture_id_sli_;
has_received_sli_ = false;
has_received_rpsi_ = false;
video_sender_.AddVideoFrame(video_frame, &codec_specific_info);
return;
video_sender_.AddVideoFrame(video_frame, &codec_specific_info);
return;
}
video_sender_.AddVideoFrame(video_frame, nullptr);
}