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

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

Issue 2474993002: Pass selected cricket::VideoCodec down to internal H264 encoder (Closed)
Patch Set: Fix. Created 4 years, 1 month 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 */
11 11
12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ 12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_
13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ 13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_
14 14
15 #include <memory> 15 #include <memory>
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/common_video/h264/h264_bitstream_parser.h" 18 #include "webrtc/common_video/h264/h264_bitstream_parser.h"
19 #include "webrtc/media/base/codec.h"
19 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" 20 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
20 #include "webrtc/modules/video_coding/utility/quality_scaler.h" 21 #include "webrtc/modules/video_coding/utility/quality_scaler.h"
21 22
22 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" 23 #include "third_party/openh264/src/codec/api/svc/codec_app_def.h"
23 24
24 class ISVCEncoder; 25 class ISVCEncoder;
25 26
26 namespace webrtc { 27 namespace webrtc {
27 28
28 class H264EncoderImpl : public H264Encoder { 29 class H264EncoderImpl : public H264Encoder {
29 public: 30 public:
30 H264EncoderImpl(); 31 explicit H264EncoderImpl(const cricket::VideoCodec& codec);
31 ~H264EncoderImpl() override; 32 ~H264EncoderImpl() override;
32 33
33 // |max_payload_size| is ignored. 34 // |max_payload_size| is ignored.
34 // The following members of |codec_settings| are used. The rest are ignored. 35 // The following members of |codec_settings| are used. The rest are ignored.
35 // - codecType (must be kVideoCodecH264) 36 // - codecType (must be kVideoCodecH264)
36 // - targetBitrate 37 // - targetBitrate
37 // - maxFramerate 38 // - maxFramerate
38 // - width 39 // - width
39 // - height 40 // - height
hta-webrtc 2016/11/04 10:04:05 Are any of these also present in cricket::VideoCod
magjed_webrtc 2016/11/04 13:48:29 codecType is deducible from cricket::VideoCodec. I
40 int32_t InitEncode(const VideoCodec* codec_settings, 41 int32_t InitEncode(const VideoCodec* codec_settings,
41 int32_t number_of_cores, 42 int32_t number_of_cores,
42 size_t /*max_payload_size*/) override; 43 size_t /*max_payload_size*/) override;
43 int32_t Release() override; 44 int32_t Release() override;
44 45
45 int32_t RegisterEncodeCompleteCallback( 46 int32_t RegisterEncodeCompleteCallback(
46 EncodedImageCallback* callback) override; 47 EncodedImageCallback* callback) override;
47 int32_t SetRates(uint32_t bitrate, uint32_t framerate) override; 48 int32_t SetRates(uint32_t bitrate, uint32_t framerate) override;
48 49
49 // The result of encoding - an EncodedImage and RTPFragmentationHeader - are 50 // The result of encoding - an EncodedImage and RTPFragmentationHeader - are
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 std::unique_ptr<uint8_t[]> encoded_image_buffer_; 88 std::unique_ptr<uint8_t[]> encoded_image_buffer_;
88 EncodedImageCallback* encoded_image_callback_; 89 EncodedImageCallback* encoded_image_callback_;
89 90
90 bool has_reported_init_; 91 bool has_reported_init_;
91 bool has_reported_error_; 92 bool has_reported_error_;
92 }; 93 };
93 94
94 } // namespace webrtc 95 } // namespace webrtc
95 96
96 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ 97 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698