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

Side by Side Diff: content/renderer/media/media_stream_video_track.h

Issue 1873293002: Report if video capturing meets output protection requirement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Rebased. Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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_MEDIA_STREAM_VIDEO_TRACK_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_
6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ 6 #define CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/threading/thread_checker.h" 13 #include "base/threading/thread_checker.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/public/renderer/media_stream_video_sink.h" 15 #include "content/public/renderer/media_stream_video_sink.h"
16 #include "content/renderer/media/capturing_link_secure_tracker.h"
16 #include "content/renderer/media/media_stream_track.h" 17 #include "content/renderer/media/media_stream_track.h"
17 #include "content/renderer/media/media_stream_video_source.h" 18 #include "content/renderer/media/media_stream_video_source.h"
18 19
19 namespace content { 20 namespace content {
20 21
21 // MediaStreamVideoTrack is a video specific representation of a 22 // MediaStreamVideoTrack is a video specific representation of a
22 // blink::WebMediaStreamTrack in content. It is owned by the blink object 23 // blink::WebMediaStreamTrack in content. It is owned by the blink object
23 // and can be retrieved from a blink object using 24 // and can be retrieved from a blink object using
24 // WebMediaStreamTrack::getExtraData() or MediaStreamVideoTrack::GetVideoTrack. 25 // WebMediaStreamTrack::getExtraData() or MediaStreamVideoTrack::GetVideoTrack.
25 class CONTENT_EXPORT MediaStreamVideoTrack : public MediaStreamTrack { 26 class CONTENT_EXPORT MediaStreamVideoTrack : public MediaStreamTrack {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, RemoteTrackStop); 66 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, RemoteTrackStop);
66 FRIEND_TEST_ALL_PREFIXES(PepperToVideoTrackAdapterTest, PutFrame); 67 FRIEND_TEST_ALL_PREFIXES(PepperToVideoTrackAdapterTest, PutFrame);
67 68
68 // Add |sink| to receive state changes on the main render thread and video 69 // Add |sink| to receive state changes on the main render thread and video
69 // frames in the |callback| method on the IO-thread. 70 // frames in the |callback| method on the IO-thread.
70 // |callback| will be reset on the render thread. 71 // |callback| will be reset on the render thread.
71 // These two methods are private such that no subclass can intercept and 72 // These two methods are private such that no subclass can intercept and
72 // store the callback. This is important to ensure that we can release 73 // store the callback. This is important to ensure that we can release
73 // the callback on render thread without reference to it on the IO-thread. 74 // the callback on render thread without reference to it on the IO-thread.
74 void AddSink(MediaStreamVideoSink* sink, 75 void AddSink(MediaStreamVideoSink* sink,
75 const VideoCaptureDeliverFrameCB& callback); 76 const VideoCaptureDeliverFrameCB& callback,
77 bool is_sink_secure);
76 void RemoveSink(MediaStreamVideoSink* sink); 78 void RemoveSink(MediaStreamVideoSink* sink);
77 79
78 std::vector<MediaStreamVideoSink*> sinks_; 80 std::vector<MediaStreamVideoSink*> sinks_;
79 81
80 // |FrameDeliverer| is an internal helper object used for delivering video 82 // |FrameDeliverer| is an internal helper object used for delivering video
81 // frames on the IO-thread using callbacks to all registered tracks. 83 // frames on the IO-thread using callbacks to all registered tracks.
82 class FrameDeliverer; 84 class FrameDeliverer;
83 const scoped_refptr<FrameDeliverer> frame_deliverer_; 85 const scoped_refptr<FrameDeliverer> frame_deliverer_;
84 86
85 const blink::WebMediaConstraints constraints_; 87 const blink::WebMediaConstraints constraints_;
86 88
87 // Weak ref to the source this tracks is connected to. |source_| is owned 89 // Weak ref to the source this tracks is connected to. |source_| is owned
88 // by the blink::WebMediaStreamSource and is guaranteed to outlive the 90 // by the blink::WebMediaStreamSource and is guaranteed to outlive the
89 // track. 91 // track.
90 MediaStreamVideoSource* source_; 92 MediaStreamVideoSource* source_;
91 93
94 // This is used for tracking if all connected video sinks are secure.
95 std::unique_ptr<CapturingLinkSecureTracker<MediaStreamVideoSink>>
miu 2016/04/26 01:25:14 ditto: Extra indirection unnecessary here.
xjz 2016/04/29 00:11:42 Done.
96 secure_tracker_;
97
92 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrack); 98 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrack);
93 }; 99 };
94 100
95 } // namespace content 101 } // namespace content
96 102
97 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ 103 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698