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

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

Issue 2742893003: Let getSettings() return the constrained track resolution, not source. (Closed)
Patch Set: Use common target size calculation Created 3 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 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"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 void SetEnabled(bool enabled) override; 54 void SetEnabled(bool enabled) override;
55 void SetContentHint( 55 void SetContentHint(
56 blink::WebMediaStreamTrack::ContentHintType content_hint) override; 56 blink::WebMediaStreamTrack::ContentHintType content_hint) override;
57 void Stop() override; 57 void Stop() override;
58 void getSettings(blink::WebMediaStreamTrack::Settings& settings) override; 58 void getSettings(blink::WebMediaStreamTrack::Settings& settings) override;
59 59
60 void OnReadyStateChanged(blink::WebMediaStreamSource::ReadyState state); 60 void OnReadyStateChanged(blink::WebMediaStreamSource::ReadyState state);
61 61
62 const blink::WebMediaConstraints& constraints() const { return constraints_; } 62 const blink::WebMediaConstraints& constraints() const { return constraints_; }
63 63
64 // Setting information about the track size.
65 // Called from MediaStreamVideoSource at track initialization.
66 void SetTargetSize(int width, int height) {
Guido Urdaneta 2017/03/13 14:12:37 Is there a reason why the track cannot set these v
hta - Chromium 2017/03/13 15:04:35 Yes - when it is created, I don't think the resolu
67 width_ = width;
68 height_ = height;
69 }
70
64 private: 71 private:
65 // MediaStreamVideoSink is a friend to allow it to call AddSink() and 72 // MediaStreamVideoSink is a friend to allow it to call AddSink() and
66 // RemoveSink(). 73 // RemoveSink().
67 friend class MediaStreamVideoSink; 74 friend class MediaStreamVideoSink;
68 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, StartTrack); 75 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, StartTrack);
69 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, RemoteTrackStop); 76 FRIEND_TEST_ALL_PREFIXES(MediaStreamRemoteVideoSourceTest, RemoteTrackStop);
70 FRIEND_TEST_ALL_PREFIXES(PepperToVideoTrackAdapterTest, PutFrame); 77 FRIEND_TEST_ALL_PREFIXES(PepperToVideoTrackAdapterTest, PutFrame);
71 78
72 // Add |sink| to receive state changes on the main render thread and video 79 // Add |sink| to receive state changes on the main render thread and video
73 // frames in the |callback| method on the IO-thread. 80 // frames in the |callback| method on the IO-thread.
(...skipping 14 matching lines...) Expand all
88 const scoped_refptr<FrameDeliverer> frame_deliverer_; 95 const scoped_refptr<FrameDeliverer> frame_deliverer_;
89 96
90 const blink::WebMediaConstraints constraints_; 97 const blink::WebMediaConstraints constraints_;
91 98
92 // Weak ref to the source this tracks is connected to. 99 // Weak ref to the source this tracks is connected to.
93 base::WeakPtr<MediaStreamVideoSource> source_; 100 base::WeakPtr<MediaStreamVideoSource> source_;
94 101
95 // This is used for tracking if all connected video sinks are secure. 102 // This is used for tracking if all connected video sinks are secure.
96 SecureDisplayLinkTracker<MediaStreamVideoSink> secure_tracker_; 103 SecureDisplayLinkTracker<MediaStreamVideoSink> secure_tracker_;
97 104
105 // Remembering our desired video size.
106 int width_ = 0;
107 int height_ = 0;
108
98 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrack); 109 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrack);
99 }; 110 };
100 111
101 } // namespace content 112 } // namespace content
102 113
103 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_ 114 #endif // CONTENT_RENDERER_MEDIA_MEDIA_STREAM_VIDEO_TRACK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698