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 |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 class VCMEncodedFrameCallback : public EncodedImageCallback { | 36 class VCMEncodedFrameCallback : public EncodedImageCallback { |
37 public: | 37 public: |
38 explicit VCMEncodedFrameCallback(EncodedImageCallback* post_encode_callback); | 38 explicit VCMEncodedFrameCallback(EncodedImageCallback* post_encode_callback); |
39 virtual ~VCMEncodedFrameCallback(); | 39 virtual ~VCMEncodedFrameCallback(); |
40 | 40 |
41 // Implements EncodedImageCallback. | 41 // Implements EncodedImageCallback. |
42 int32_t Encoded(const EncodedImage& encoded_image, | 42 int32_t Encoded(const EncodedImage& encoded_image, |
43 const CodecSpecificInfo* codec_specific, | 43 const CodecSpecificInfo* codec_specific, |
44 const RTPFragmentationHeader* fragmentation_header) override; | 44 const RTPFragmentationHeader* fragmentation_header) override; |
45 int32_t SetTransportCallback(VCMPacketizationCallback* transport); | |
46 void SetMediaOpt(media_optimization::MediaOptimization* media_opt); | 45 void SetMediaOpt(media_optimization::MediaOptimization* media_opt); |
47 void SetInternalSource(bool internal_source) { | 46 void SetInternalSource(bool internal_source) { |
48 internal_source_ = internal_source; | 47 internal_source_ = internal_source; |
49 } | 48 } |
50 void SignalLastEncoderImplementationUsed( | |
51 const char* encoder_implementation_name); | |
52 | 49 |
53 private: | 50 private: |
54 VCMPacketizationCallback* send_callback_; | |
55 media_optimization::MediaOptimization* media_opt_; | 51 media_optimization::MediaOptimization* media_opt_; |
56 bool internal_source_; | 52 bool internal_source_; |
57 | 53 |
58 EncodedImageCallback* post_encode_callback_; | 54 EncodedImageCallback* const post_encode_callback_; |
59 }; | 55 }; |
60 | 56 |
61 class VCMGenericEncoder { | 57 class VCMGenericEncoder { |
62 friend class VCMCodecDataBase; | 58 friend class VCMCodecDataBase; |
63 | 59 |
64 public: | 60 public: |
65 VCMGenericEncoder(VideoEncoder* encoder, | 61 VCMGenericEncoder(VideoEncoder* encoder, |
66 VideoEncoderRateObserver* rate_observer, | 62 VideoEncoderRateObserver* rate_observer, |
67 VCMEncodedFrameCallback* encoded_frame_callback, | 63 VCMEncodedFrameCallback* encoded_frame_callback, |
68 bool internal_source); | 64 bool internal_source); |
69 ~VCMGenericEncoder(); | 65 ~VCMGenericEncoder(); |
70 int32_t Release(); | 66 int32_t Release(); |
71 int32_t InitEncode(const VideoCodec* settings, | 67 int32_t InitEncode(const VideoCodec* settings, |
72 int32_t number_of_cores, | 68 int32_t number_of_cores, |
73 size_t max_payload_size); | 69 size_t max_payload_size); |
74 int32_t Encode(const VideoFrame& frame, | 70 int32_t Encode(const VideoFrame& frame, |
75 const CodecSpecificInfo* codec_specific, | 71 const CodecSpecificInfo* codec_specific, |
76 const std::vector<FrameType>& frame_types); | 72 const std::vector<FrameType>& frame_types); |
77 | 73 |
| 74 const char* ImplementationName() const; |
| 75 |
78 void SetEncoderParameters(const EncoderParameters& params); | 76 void SetEncoderParameters(const EncoderParameters& params); |
79 EncoderParameters GetEncoderParameters() const; | 77 EncoderParameters GetEncoderParameters() const; |
80 | 78 |
81 int32_t SetPeriodicKeyFrames(bool enable); | 79 int32_t SetPeriodicKeyFrames(bool enable); |
82 int32_t RequestFrame(const std::vector<FrameType>& frame_types); | 80 int32_t RequestFrame(const std::vector<FrameType>& frame_types); |
83 bool InternalSource() const; | 81 bool InternalSource() const; |
84 void OnDroppedFrame(); | 82 void OnDroppedFrame(); |
85 bool SupportsNativeHandle() const; | 83 bool SupportsNativeHandle() const; |
86 int GetTargetFramerate(); | 84 int GetTargetFramerate(); |
87 | 85 |
88 private: | 86 private: |
89 VideoEncoder* const encoder_; | 87 VideoEncoder* const encoder_; |
90 VideoEncoderRateObserver* const rate_observer_; | 88 VideoEncoderRateObserver* const rate_observer_; |
91 VCMEncodedFrameCallback* const vcm_encoded_frame_callback_; | 89 VCMEncodedFrameCallback* const vcm_encoded_frame_callback_; |
92 const bool internal_source_; | 90 const bool internal_source_; |
93 rtc::CriticalSection params_lock_; | 91 rtc::CriticalSection params_lock_; |
94 EncoderParameters encoder_params_ GUARDED_BY(params_lock_); | 92 EncoderParameters encoder_params_ GUARDED_BY(params_lock_); |
95 bool is_screenshare_; | 93 bool is_screenshare_; |
96 }; | 94 }; |
97 | 95 |
98 } // namespace webrtc | 96 } // namespace webrtc |
99 | 97 |
100 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ | 98 #endif // WEBRTC_MODULES_VIDEO_CODING_GENERIC_ENCODER_H_ |
OLD | NEW |