Revert of Rename OpenH264 frame-type conversion function. (patchset #2 id:20001 of https://codereview.webrtc.org/1943193003/ )
Reason for revert: Speculative revert for perf regression (though unlikely). Original issue's description: > Rename OpenH264 frame-type conversion function. > > Also removing default case, so if another frame is added to > EVideoFrameType we have to handle it. > > This will now NOTREACHED on videoFrameTypeInvalid, but > videoFrameTypeInvalid shouldn't happen if encoding succeeds, so it > should be fine or we should become aware of it. > > BUG= > R=hbos@webrtc.org > > Committed: https://crrev.com/39a36705ab734914d500b8a0f214ea630d82ab70 > Cr-Commit-Position: refs/heads/master@{#12636} TBR=hbos@webrtc.org # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=chromium:610347 Review URL: https://codereview.webrtc.org/1964913002 . Cr-Commit-Position: refs/heads/master@{#12677}
This commit is contained in:
@ -50,8 +50,12 @@ int NumberOfThreads(int width, int height, int number_of_cores) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameType ConvertToVideoFrameType(EVideoFrameType type) {
|
} // namespace
|
||||||
|
|
||||||
|
static FrameType EVideoFrameType_to_FrameType(EVideoFrameType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case videoFrameTypeInvalid:
|
||||||
|
return kEmptyFrame;
|
||||||
case videoFrameTypeIDR:
|
case videoFrameTypeIDR:
|
||||||
return kVideoFrameKey;
|
return kVideoFrameKey;
|
||||||
case videoFrameTypeSkip:
|
case videoFrameTypeSkip:
|
||||||
@ -59,15 +63,12 @@ FrameType ConvertToVideoFrameType(EVideoFrameType type) {
|
|||||||
case videoFrameTypeP:
|
case videoFrameTypeP:
|
||||||
case videoFrameTypeIPMixed:
|
case videoFrameTypeIPMixed:
|
||||||
return kVideoFrameDelta;
|
return kVideoFrameDelta;
|
||||||
case videoFrameTypeInvalid:
|
default:
|
||||||
break;
|
LOG(LS_WARNING) << "Unknown EVideoFrameType: " << type;
|
||||||
|
return kVideoFrameDelta;
|
||||||
}
|
}
|
||||||
RTC_NOTREACHED() << "Unexpected/invalid frame type: " << type;
|
|
||||||
return kEmptyFrame;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
// Helper method used by H264EncoderImpl::Encode.
|
// Helper method used by H264EncoderImpl::Encode.
|
||||||
// Copies the encoded bytes from |info| to |encoded_image| and updates the
|
// Copies the encoded bytes from |info| to |encoded_image| and updates the
|
||||||
// fragmentation information of |frag_header|. The |encoded_image->_buffer| may
|
// fragmentation information of |frag_header|. The |encoded_image->_buffer| may
|
||||||
@ -393,7 +394,7 @@ int32_t H264EncoderImpl::Encode(
|
|||||||
encoded_image_.ntp_time_ms_ = frame.ntp_time_ms();
|
encoded_image_.ntp_time_ms_ = frame.ntp_time_ms();
|
||||||
encoded_image_.capture_time_ms_ = frame.render_time_ms();
|
encoded_image_.capture_time_ms_ = frame.render_time_ms();
|
||||||
encoded_image_.rotation_ = frame.rotation();
|
encoded_image_.rotation_ = frame.rotation();
|
||||||
encoded_image_._frameType = ConvertToVideoFrameType(info.eFrameType);
|
encoded_image_._frameType = EVideoFrameType_to_FrameType(info.eFrameType);
|
||||||
|
|
||||||
// Split encoded image up into fragments. This also updates |encoded_image_|.
|
// Split encoded image up into fragments. This also updates |encoded_image_|.
|
||||||
RTPFragmentationHeader frag_header;
|
RTPFragmentationHeader frag_header;
|
||||||
|
|||||||
Reference in New Issue
Block a user