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 |