| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ | 6 #define CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // SetChannelParameters are run on ProcessThread or the libjingle worker thread. | 42 // SetChannelParameters are run on ProcessThread or the libjingle worker thread. |
| 43 // Callbacks from the Impl due to its VEA::Client notifications are posted back | 43 // Callbacks from the Impl due to its VEA::Client notifications are posted back |
| 44 // to RTCVideoEncoder on the libjingle worker thread. | 44 // to RTCVideoEncoder on the libjingle worker thread. |
| 45 class CONTENT_EXPORT RTCVideoEncoder | 45 class CONTENT_EXPORT RTCVideoEncoder |
| 46 : NON_EXPORTED_BASE(public webrtc::VideoEncoder) { | 46 : NON_EXPORTED_BASE(public webrtc::VideoEncoder) { |
| 47 public: | 47 public: |
| 48 RTCVideoEncoder( | 48 RTCVideoEncoder( |
| 49 webrtc::VideoCodecType type, | 49 webrtc::VideoCodecType type, |
| 50 media::VideoCodecProfile profile, | 50 media::VideoCodecProfile profile, |
| 51 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories); | 51 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories); |
| 52 virtual ~RTCVideoEncoder(); | 52 ~RTCVideoEncoder() override; |
| 53 | 53 |
| 54 // webrtc::VideoEncoder implementation. Tasks are posted to |impl_| using the | 54 // webrtc::VideoEncoder implementation. Tasks are posted to |impl_| using the |
| 55 // appropriate VEA methods. | 55 // appropriate VEA methods. |
| 56 virtual int32_t InitEncode(const webrtc::VideoCodec* codec_settings, | 56 int32_t InitEncode(const webrtc::VideoCodec* codec_settings, |
| 57 int32_t number_of_cores, | 57 int32_t number_of_cores, |
| 58 uint32_t max_payload_size) override; | 58 uint32_t max_payload_size) override; |
| 59 virtual int32_t Encode( | 59 int32_t Encode( |
| 60 const webrtc::I420VideoFrame& input_image, | 60 const webrtc::I420VideoFrame& input_image, |
| 61 const webrtc::CodecSpecificInfo* codec_specific_info, | 61 const webrtc::CodecSpecificInfo* codec_specific_info, |
| 62 const std::vector<webrtc::VideoFrameType>* frame_types) override; | 62 const std::vector<webrtc::VideoFrameType>* frame_types) override; |
| 63 virtual int32_t RegisterEncodeCompleteCallback( | 63 int32_t RegisterEncodeCompleteCallback( |
| 64 webrtc::EncodedImageCallback* callback) override; | 64 webrtc::EncodedImageCallback* callback) override; |
| 65 virtual int32_t Release() override; | 65 int32_t Release() override; |
| 66 virtual int32_t SetChannelParameters(uint32_t packet_loss, int rtt) override; | 66 int32_t SetChannelParameters(uint32_t packet_loss, int rtt) override; |
| 67 virtual int32_t SetRates(uint32_t new_bit_rate, uint32_t frame_rate) override; | 67 int32_t SetRates(uint32_t new_bit_rate, uint32_t frame_rate) override; |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 class Impl; | 70 class Impl; |
| 71 friend class RTCVideoEncoder::Impl; | 71 friend class RTCVideoEncoder::Impl; |
| 72 | 72 |
| 73 // Return an encoded output buffer to WebRTC. | 73 // Return an encoded output buffer to WebRTC. |
| 74 void ReturnEncodedImage(scoped_ptr<webrtc::EncodedImage> image, | 74 void ReturnEncodedImage(scoped_ptr<webrtc::EncodedImage> image, |
| 75 int32 bitstream_buffer_id, | 75 int32 bitstream_buffer_id, |
| 76 uint16 picture_id); | 76 uint16 picture_id); |
| 77 | 77 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 106 // RTCVideoEncoder. | 106 // RTCVideoEncoder. |
| 107 // NOTE: Weak pointers must be invalidated before all other member variables. | 107 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 108 base::WeakPtrFactory<RTCVideoEncoder> weak_factory_; | 108 base::WeakPtrFactory<RTCVideoEncoder> weak_factory_; |
| 109 | 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoder); | 110 DISALLOW_COPY_AND_ASSIGN(RTCVideoEncoder); |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace content | 113 } // namespace content |
| 114 | 114 |
| 115 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ | 115 #endif // CONTENT_RENDERER_MEDIA_RTC_VIDEO_ENCODER_H_ |
| OLD | NEW |