Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc

Issue 1886113003: Add rotation to EncodedImage and make sure it is passed through encoders. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix merge mistake. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc
index feacfc57b3325540d4a006ff9f6b9081b3851865..992ec0ce7b06403eb28f5f8109abab5f3911c03c 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.cc
@@ -118,8 +118,14 @@ struct FrameEncodeParams {
int32_t w,
int32_t h,
int64_t rtms,
- uint32_t ts)
- : encoder(e), width(w), height(h), render_time_ms(rtms), timestamp(ts) {
+ uint32_t ts,
+ webrtc::VideoRotation r)
+ : encoder(e),
+ width(w),
+ height(h),
+ render_time_ms(rtms),
+ timestamp(ts),
+ rotation(r) {
if (csi) {
codec_specific_info = *csi;
} else {
@@ -133,6 +139,7 @@ struct FrameEncodeParams {
int32_t height;
int64_t render_time_ms;
uint32_t timestamp;
+ webrtc::VideoRotation rotation;
};
// We receive I420Frames as input, but we need to feed CVPixelBuffers into the
@@ -185,7 +192,8 @@ void VTCompressionOutputCallback(void* encoder,
encode_params->encoder->OnEncodedFrame(
status, info_flags, sample_buffer, encode_params->codec_specific_info,
encode_params->width, encode_params->height,
- encode_params->render_time_ms, encode_params->timestamp);
+ encode_params->render_time_ms, encode_params->timestamp,
+ encode_params->rotation);
}
} // namespace internal
@@ -306,7 +314,7 @@ int H264VideoToolboxEncoder::Encode(
std::unique_ptr<internal::FrameEncodeParams> encode_params;
encode_params.reset(new internal::FrameEncodeParams(
this, codec_specific_info, width_, height_, input_image.render_time_ms(),
- input_image.timestamp()));
+ input_image.timestamp(), input_image.rotation()));
// Update the bitrate if needed.
SetBitrateBps(bitrate_adjuster_.GetAdjustedBitrateBps());
@@ -471,7 +479,8 @@ void H264VideoToolboxEncoder::OnEncodedFrame(
int32_t width,
int32_t height,
int64_t render_time_ms,
- uint32_t timestamp) {
+ uint32_t timestamp,
+ VideoRotation rotation) {
if (status != noErr) {
LOG(LS_ERROR) << "H264 encode failed.";
return;
@@ -511,6 +520,7 @@ void H264VideoToolboxEncoder::OnEncodedFrame(
is_keyframe ? webrtc::kVideoFrameKey : webrtc::kVideoFrameDelta;
frame.capture_time_ms_ = render_time_ms;
frame._timeStamp = timestamp;
+ frame.rotation_ = rotation;
int result = callback_->Encoded(frame, &codec_specific_info, header.get());
if (result != 0) {

Powered by Google App Engine
This is Rietveld 408576698