OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 * | |
10 */ | |
11 | |
12 #ifndef WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_ENCODER_IMPL_H_ | |
13 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_ENCODER_IMPL_H_ | |
14 | |
15 #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" | |
16 | |
17 #include <vector> | |
18 | |
19 #include "webrtc/base/scoped_ptr.h" | |
20 | |
21 class ISVCEncoder; | |
22 | |
23 namespace webrtc { | |
24 | |
25 class H264EncoderImpl : public H264Encoder { | |
26 public: | |
27 H264EncoderImpl(); | |
28 ~H264EncoderImpl() override; | |
29 | |
30 // |number_of_cores| and |max_payload_size| are ignored. | |
31 // The following members of |codec_settings| are used. The rest are ignored. | |
32 // - codecType (must be kVideoCodecH264) | |
33 // - targetBitrate | |
34 // - maxFramerate | |
35 // - width | |
36 // - height | |
37 int32_t InitEncode(const VideoCodec* codec_settings, | |
38 int32_t /*number_of_cores*/, | |
39 size_t /*max_payload_size*/) override; | |
40 int32_t Release() override; | |
41 | |
42 int32_t RegisterEncodeCompleteCallback( | |
43 EncodedImageCallback* callback) override; | |
44 int32_t SetRates(uint32_t bitrate, uint32_t framerate) override; | |
45 | |
46 // The result of encoding - an EncodedImage and RTPFragmentationHeader - are | |
47 // passed to the encode complete callback. | |
48 int32_t Encode(const VideoFrame& frame, | |
49 const CodecSpecificInfo* codec_specific_info, | |
50 const std::vector<VideoFrameType>* frame_types) override; | |
51 | |
52 bool IsInitialized(); | |
stefan-webrtc
2015/10/01 13:13:52
Can this be private?
hbos
2015/11/27 14:43:43
Yes! :)))
| |
53 | |
54 // Unsupported / Do nothing. | |
55 int32_t SetChannelParameters(uint32_t packet_loss, int64_t rtt) override; | |
56 int32_t SetPeriodicKeyFrames(bool enable) override; | |
57 int32_t CodecConfigParameters(uint8_t* buffer, int32_t size) override; | |
58 void OnDroppedFrame() override; | |
59 | |
60 private: | |
61 ISVCEncoder* openh264_encoder_; | |
62 VideoCodec codec_settings_; | |
63 | |
64 EncodedImage encoded_image_; | |
65 rtc::scoped_ptr<uint8_t> encoded_image_buffer_; | |
66 EncodedImageCallback* encoded_image_callback_; | |
67 }; | |
68 | |
69 } // namespace webrtc | |
70 | |
71 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_ENCODER_IMPL_H_ | |
OLD | NEW |