Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 #ifndef WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
| 12 #define WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
| 13 | 13 |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/modules/video_coding/include/video_codec_interface.h" | 17 #include "webrtc/modules/video_coding/include/video_codec_interface.h" |
| 18 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 18 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 19 #include "webrtc/modules/video_coding/utility/ivf_file_writer.h" | |
| 19 | 20 |
| 20 #include "webrtc/base/criticalsection.h" | 21 #include "webrtc/base/criticalsection.h" |
| 21 | 22 |
| 22 namespace webrtc { | 23 namespace webrtc { |
| 23 class CriticalSectionWrapper; | 24 class CriticalSectionWrapper; |
| 24 | 25 |
| 25 namespace media_optimization { | 26 namespace media_optimization { |
| 26 class MediaOptimization; | 27 class MediaOptimization; |
| 27 } // namespace media_optimization | 28 } // namespace media_optimization |
| 28 | 29 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 | 65 |
| 65 void SetInternalSource(bool internalSource) { | 66 void SetInternalSource(bool internalSource) { |
| 66 _internalSource = internalSource; | 67 _internalSource = internalSource; |
| 67 } | 68 } |
| 68 | 69 |
| 69 void SetRotation(VideoRotation rotation) { _rotation = rotation; } | 70 void SetRotation(VideoRotation rotation) { _rotation = rotation; } |
| 70 void SignalLastEncoderImplementationUsed( | 71 void SignalLastEncoderImplementationUsed( |
| 71 const char* encoder_implementation_name); | 72 const char* encoder_implementation_name); |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 VCMPacketizationCallback* send_callback_; | 75 friend class VCMGenericEncoder; |
| 75 media_optimization::MediaOptimization* _mediaOpt; | |
| 76 uint8_t _payloadType; | |
| 77 bool _internalSource; | |
| 78 VideoRotation _rotation; | |
| 79 | 76 |
| 80 EncodedImageCallback* post_encode_callback_; | 77 int GetLayer(const CodecSpecificInfo& codec_specific); |
| 81 | 78 |
| 82 #ifdef DEBUG_ENCODER_BIT_STREAM | 79 static const bool kEnableFrameRecording = false; |
|
pbos-webrtc
2016/04/04 11:22:23
I think this should be plumbed further out through
sprang_webrtc
2016/04/05 10:35:38
Done.
| |
| 83 FILE* _bitStreamAfterEncoder; | 80 static const int kMaxLayers = 3; |
| 84 #endif | 81 VideoCodecType codec_type_ = kVideoCodecVP8; |
| 82 std::unique_ptr<IvfFileWriter> file_writers_[kMaxLayers]; | |
| 83 | |
| 84 VCMPacketizationCallback* send_callback_; | |
| 85 media_optimization::MediaOptimization* _mediaOpt; | |
| 86 uint8_t _payloadType; | |
| 87 bool _internalSource; | |
| 88 VideoRotation _rotation; | |
| 89 | |
| 90 EncodedImageCallback* post_encode_callback_; | |
| 85 }; // end of VCMEncodeFrameCallback class | 91 }; // end of VCMEncodeFrameCallback class |
| 86 | 92 |
| 87 /******************************/ | 93 /******************************/ |
| 88 /* VCMGenericEncoder class */ | 94 /* VCMGenericEncoder class */ |
| 89 /******************************/ | 95 /******************************/ |
| 90 class VCMGenericEncoder { | 96 class VCMGenericEncoder { |
| 91 friend class VCMCodecDataBase; | 97 friend class VCMCodecDataBase; |
| 92 | 98 |
| 93 public: | 99 public: |
| 94 VCMGenericEncoder(VideoEncoder* encoder, | 100 VCMGenericEncoder(VideoEncoder* encoder, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 const bool internal_source_; | 145 const bool internal_source_; |
| 140 rtc::CriticalSection params_lock_; | 146 rtc::CriticalSection params_lock_; |
| 141 EncoderParameters encoder_params_ GUARDED_BY(params_lock_); | 147 EncoderParameters encoder_params_ GUARDED_BY(params_lock_); |
| 142 VideoRotation rotation_; | 148 VideoRotation rotation_; |
| 143 bool is_screenshare_; | 149 bool is_screenshare_; |
| 144 }; // end of VCMGenericEncoder class | 150 }; // end of VCMGenericEncoder class |
| 145 | 151 |
| 146 } // namespace webrtc | 152 } // namespace webrtc |
| 147 | 153 |
| 148 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ | 154 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
| OLD | NEW |