Chromium Code Reviews| Index: content/renderer/media/rtc_encoding_video_capturer.h |
| diff --git a/content/renderer/media/rtc_encoding_video_capturer.h b/content/renderer/media/rtc_encoding_video_capturer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9004b685d8c97d708d20be1699eb43546539e8e5 |
| --- /dev/null |
| +++ b/content/renderer/media/rtc_encoding_video_capturer.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_MEDIA_RTC_ENCODING_VIDEO_CAPTURER_H_ |
| +#define CONTENT_RENDERER_MEDIA_RTC_ENCODING_VIDEO_CAPTURER_H_ |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "media/video/encoded_video_source.h" |
| +#include "media/video/video_encode_types.h" |
| +#include "third_party/libjingle/source/talk/media/webrtc/webrtcvideoencoderfactory.h" |
|
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
unused
hshi1
2013/06/10 19:12:31
Done.
|
| +#include "third_party/libjingle/source/talk/media/webrtc/webrtcvideoframe.h" |
|
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
unnecessary in this .h - this file doesn't make an
hshi1
2013/06/10 19:12:31
Done.
|
| +#include "third_party/libjingle/source/talk/media/webrtc/webrtcvie.h" |
| + |
| +using cricket::WebRtcVideoEncoderFactory; |
|
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
unused
hshi1
2013/06/10 19:12:31
Done.
|
| + |
| +namespace content { |
| + |
| +// Class to represent an encoding capable video capture interface for the |
| +// WebRTC component. This class expects to be registered as an encoder with |
| +// an internal source to the WebRTC stack and will not be able to function as |
| +// an encoder for uncompressed video frames. |
| +class RtcEncodingVideoCapturer : public webrtc::VideoEncoder { |
| + public: |
| + RtcEncodingVideoCapturer(int stream_id, |
| + media::EncodedVideoSource* encoded_video_source); |
| + virtual ~RtcEncodingVideoCapturer(); |
| + |
| + // webrtc::VideoEncoder implementation. |
| + virtual int32_t InitEncode(const webrtc::VideoCodec* codecSettings, |
| + int32_t numberOfCores, |
| + uint32_t maxPayloadSize) OVERRIDE; |
| + virtual int32_t Encode( |
| + const webrtc::I420VideoFrame& inputImage, |
|
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
ignored params should be like this:
/* inputImage
hshi1
2013/06/10 19:12:31
Done.
|
| + const webrtc::CodecSpecificInfo* codecSpecificInfo, |
| + const std::vector<webrtc::VideoFrameType>* frame_types) OVERRIDE; |
| + virtual int32_t RegisterEncodeCompleteCallback( |
| + webrtc::EncodedImageCallback* callback) OVERRIDE; |
| + virtual int32_t Release() OVERRIDE; |
| + virtual int32_t SetChannelParameters(uint32_t packetLoss, |
| + int rtt_in_ms) OVERRIDE; |
| + virtual int32_t SetRates(uint32_t newBitRate, |
| + uint32_t frameRate) OVERRIDE; |
| + private: |
| + // Forward declaration for private implementation to represent the |
| + // encapsulated bitstream; |
| + class Bitstream; |
| + int stream_id_; |
|
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
write-only variable?
hshi1
2013/06/10 19:12:31
Removed.
|
| + scoped_refptr<Bitstream> bitstream_; |
| + |
| + // Pointer to the underlying EncodedVideoSource object. It is guaranteed to |
| + // outlive the RtcEncodingVideoCapturer. |
| + media::EncodedVideoSource* encoded_video_source_; |
| + DISALLOW_COPY_AND_ASSIGN(RtcEncodingVideoCapturer); |
|
Ami GONE FROM CHROMIUM
2013/06/08 00:18:01
nit: extra new line before this
hshi1
2013/06/10 19:12:31
Done.
|
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_RTC_ENCODING_VIDEO_CAPTURER_H_ |