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

Unified Diff: content/public/renderer/media_stream_track_api.cc

Issue 1672713002: MediaStreamVideoSource exports current video format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added public API Created 4 years, 9 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/public/renderer/media_stream_track_api.cc
diff --git a/content/public/renderer/media_stream_track_api.cc b/content/public/renderer/media_stream_track_api.cc
new file mode 100644
index 0000000000000000000000000000000000000000..fa6d97d773e5e40a4e6d2d76177c6b1f8b2e50dd
--- /dev/null
+++ b/content/public/renderer/media_stream_track_api.cc
@@ -0,0 +1,24 @@
+// Copyright 2016 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.
+
+#include "content/public/renderer/media_stream_track_api.h"
+
+#include "content/renderer/media/media_stream_video_source.h"
+
+namespace content {
+
+const media::VideoCaptureFormat* GetCurrentVideoTrackFormat(
+ const blink::WebMediaStreamTrack& video_track) {
+ if (video_track.isNull())
+ return nullptr;
+
+ content::MediaStreamVideoSource* source =
+ content::MediaStreamVideoSource::GetVideoSource(video_track.source());
+ if (!source)
+ return nullptr;
+
+ return source->GetCurrentFormat();
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698