Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2650)

Unified Diff: content/renderer/media/rtc_encoding_video_capturer_factory.h

Issue 16320005: Define EncodedVideoSource and RtcCapturedEncodingVideoCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/rtc_encoding_video_capturer_factory.h
diff --git a/content/renderer/media/rtc_encoding_video_capturer_factory.h b/content/renderer/media/rtc_encoding_video_capturer_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..20fba27552411b8d1568c5a2c04a9b53258d739e
--- /dev/null
+++ b/content/renderer/media/rtc_encoding_video_capturer_factory.h
@@ -0,0 +1,66 @@
+// 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_FACTORY_H_
+#define CONTENT_RENDERER_MEDIA_RTC_ENCODING_VIDEO_CAPTURER_FACTORY_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"
+#include "third_party/libjingle/source/talk/media/webrtc/webrtcvideoframe.h"
+#include "third_party/libjingle/source/talk/media/webrtc/webrtcvie.h"
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 I suspect neither of l.12-13 is necessary in this
hshi1 2013/06/10 21:49:35 Done.
+
+using cricket::WebRtcVideoEncoderFactory;
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 style: "using" is verboten in headers. (here & els
hshi1 2013/06/10 21:49:35 Done.
+
+namespace content {
+
+class RtcEncodingVideoCapturer;
+
+class RtcEncodingVideoCapturerFactory :
+ public WebRtcVideoEncoderFactory,
+ public media::EncodedVideoSource::Observer,
+ public base::RefCountedThreadSafe<RtcEncodingVideoCapturerFactory> {
+ public:
+ RtcEncodingVideoCapturerFactory();
+
+ // WebRtcVideoEncoderFactory interface.
+ virtual webrtc::VideoEncoder* CreateVideoEncoder(
+ webrtc::VideoCodecType type) OVERRIDE;
+ virtual void DestroyVideoEncoder(webrtc::VideoEncoder* encoder) OVERRIDE;
+
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 remove newline
hshi1 2013/06/10 21:49:35 Done.
+ virtual const std::vector<WebRtcVideoEncoderFactory::VideoCodec>& codecs()
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 WebRtcVideoEncoderFactory:: unnecessary
hshi1 2013/06/10 21:49:35 Done.
+ const OVERRIDE;
+
+ // EncodedVideoSource::Observer interface.
+ virtual void OnCapabilitiesAvailable(
+ media::EncodedVideoSource* source) OVERRIDE;
+
+ // Invoked when an EncodedVideoSource is added/removed.
+ void OnEncodedVideoSourceAdded(media::EncodedVideoSource* source) OVERRIDE;
+ void OnEncodedVideoSourceRemoved(media::EncodedVideoSource* source) OVERRIDE;
+
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 remove one of these two newlines
hshi1 2013/06/10 21:49:35 Done.
+
+private:
+ friend class base::RefCountedThreadSafe<RtcEncodingVideoCapturerFactory>;
+
+ // Rebuilds the list of supported video codecs.
+ void RebuildCodecsList();
+
+ // Map of registered encoding capable video capturers, key is stream_id.
+ typedef std::map<int, RtcEncodingVideoCapturer*> EncoderMap;
+
+ virtual ~RtcEncodingVideoCapturerFactory();
Ami GONE FROM CHROMIUM 2013/06/08 00:18:01 dtor goes at the top of the section
hshi1 2013/06/10 21:49:35 Done.
+
+ media::EncodedVideoSource* encoded_video_source_;
+ std::vector<WebRtcVideoEncoderFactory::VideoCodec> codecs_;
+
+ int next_stream_id_;
+ EncoderMap encoder_map_;
+ DISALLOW_COPY_AND_ASSIGN(RtcEncodingVideoCapturerFactory);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_RTC_ENCODING_VIDEO_CAPTURER_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698