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

Side by Side Diff: webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h

Issue 1952443002: [H264][Simulcast] Implement the simulcast logic for h264 encoder Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix a few issues with the patch Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 * 9 *
10 */ 10 */
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 int32_t SetPeriodicKeyFrames(bool enable) override; 54 int32_t SetPeriodicKeyFrames(bool enable) override;
55 void OnDroppedFrame() override; 55 void OnDroppedFrame() override;
56 56
57 private: 57 private:
58 bool IsInitialized() const; 58 bool IsInitialized() const;
59 59
60 // Reports statistics with histograms. 60 // Reports statistics with histograms.
61 void ReportInit(); 61 void ReportInit();
62 void ReportError(); 62 void ReportError();
63 63
64 ISVCEncoder* openh264_encoder_; 64 // Set the stream state for stream |stream_idx|.
65 void SetStreamState(bool send_stream, int stream_idx);
66
67 // Scale input_frame to the dimensions of output_frame
68 void Scale(const VideoFrame& input_frame, VideoFrame* output_frame);
69
70 inline uint32_t CalculateYStrideSize(uint32_t frame_width,
71 uint32_t frame_height) {
72 return frame_width;
73 }
74
75 inline uint32_t CalculateUVStrideSize(uint32_t frame_width,
76 uint32_t frame_height) {
77 return (frame_width + 1) / 2;
78 }
79
80 std::vector<ISVCEncoder*> encoders_;
65 VideoCodec codec_settings_; 81 VideoCodec codec_settings_;
66 82
67 EncodedImage encoded_image_;
68 std::unique_ptr<uint8_t[]> encoded_image_buffer_;
69 EncodedImageCallback* encoded_image_callback_; 83 EncodedImageCallback* encoded_image_callback_;
70
71 bool has_reported_init_; 84 bool has_reported_init_;
72 bool has_reported_error_; 85 bool has_reported_error_;
86
87 std::vector<VideoFrame> scaled_input_frames_;
88 std::vector<EncodedImage> encoded_images_;
89 std::vector<std::unique_ptr<uint8_t[]>> encoded_image_buffers_;
90 std::vector<bool> send_streams_;
91 std::vector<bool> key_frame_request_;
sprang_webrtc 2017/03/29 08:44:21 These vectors and encoders_ have to match index wi
73 }; 92 };
74 93
75 } // namespace webrtc 94 } // namespace webrtc
76 95
77 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ 96 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698