OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Callback function which is called when an image has been encoded. | 57 // Callback function which is called when an image has been encoded. |
58 virtual Result OnEncodedImage( | 58 virtual Result OnEncodedImage( |
59 const EncodedImage& encoded_image, | 59 const EncodedImage& encoded_image, |
60 const CodecSpecificInfo* codec_specific_info, | 60 const CodecSpecificInfo* codec_specific_info, |
61 const RTPFragmentationHeader* fragmentation) = 0; | 61 const RTPFragmentationHeader* fragmentation) = 0; |
62 }; | 62 }; |
63 | 63 |
64 class VideoEncoder { | 64 class VideoEncoder { |
65 public: | 65 public: |
66 enum EncoderType { | |
67 kH264, | |
68 kVp8, | |
69 kVp9, | |
70 kUnsupportedCodec, | |
71 }; | |
72 | |
73 static VideoEncoder* Create(EncoderType codec_type); | |
74 // Returns true if this type of encoder can be created using | |
75 // VideoEncoder::Create. | |
76 static bool IsSupportedSoftware(EncoderType codec_type); | |
77 static EncoderType CodecToEncoderType(VideoCodecType codec_type); | |
78 | |
79 static VideoCodecVP8 GetDefaultVp8Settings(); | 66 static VideoCodecVP8 GetDefaultVp8Settings(); |
80 static VideoCodecVP9 GetDefaultVp9Settings(); | 67 static VideoCodecVP9 GetDefaultVp9Settings(); |
81 static VideoCodecH264 GetDefaultH264Settings(); | 68 static VideoCodecH264 GetDefaultH264Settings(); |
82 | 69 |
83 virtual ~VideoEncoder() {} | 70 virtual ~VideoEncoder() {} |
84 | 71 |
85 // Initialize the encoder with the information from the codecSettings | 72 // Initialize the encoder with the information from the codecSettings |
86 // | 73 // |
87 // Input: | 74 // Input: |
88 // - codec_settings : Codec settings | 75 // - codec_settings : Codec settings |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 149 } |
163 | 150 |
164 virtual int32_t SetPeriodicKeyFrames(bool enable) { return -1; } | 151 virtual int32_t SetPeriodicKeyFrames(bool enable) { return -1; } |
165 virtual void OnDroppedFrame() {} | 152 virtual void OnDroppedFrame() {} |
166 virtual bool SupportsNativeHandle() const { return false; } | 153 virtual bool SupportsNativeHandle() const { return false; } |
167 virtual const char* ImplementationName() const { return "unknown"; } | 154 virtual const char* ImplementationName() const { return "unknown"; } |
168 }; | 155 }; |
169 | 156 |
170 } // namespace webrtc | 157 } // namespace webrtc |
171 #endif // WEBRTC_VIDEO_ENCODER_H_ | 158 #endif // WEBRTC_VIDEO_ENCODER_H_ |
OLD | NEW |