Chromium Code Reviews| Index: content/renderer/media/video_track_adapter.h |
| diff --git a/content/renderer/media/video_track_adapter.h b/content/renderer/media/video_track_adapter.h |
| index 0df314d279933fcd6bccb8623a051f845dec71b1..8a719ec0b43bb43f8c2cf23345d9dfedd3c7e097 100644 |
| --- a/content/renderer/media/video_track_adapter.h |
| +++ b/content/renderer/media/video_track_adapter.h |
| @@ -27,6 +27,8 @@ namespace content { |
| class VideoTrackAdapter |
| : public base::RefCountedThreadSafe<VideoTrackAdapter> { |
| public: |
| + typedef base::Callback<void(bool mute_state)> OnMutedCallback; |
| + |
| explicit VideoTrackAdapter( |
| const scoped_refptr<base::MessageLoopProxy>& io_message_loop); |
| @@ -34,12 +36,16 @@ class VideoTrackAdapter |
| // a resolution within the boundaries of the arguments. |
| // Must be called on the main render thread. |frame_callback| is guaranteed to |
| // be released on the main render thread. |
| + // |target_frame_rate| is used to calculate a prudent interval to check for |
|
Henrik Grunell
2014/07/09 08:55:53
I think the naming of |target_frame_rate| is not c
Henrik Grunell
2014/07/09 13:01:22
I guess you missed a reply on this, |source_frame_
|
| + // passing frames and inform of the result via |on_muted_state_callback|. |
|
Henrik Grunell
2014/07/09 08:55:52
It only informs via the callback if we consider it
mcasas
2014/07/09 12:39:35
It pings back every time it wakes up, with the
ap
Henrik Grunell
2014/07/09 13:01:22
Oh, right.
|
| void AddTrack(const MediaStreamVideoTrack* track, |
| VideoCaptureDeliverFrameCB frame_callback, |
| int max_width, int max_height, |
| double min_aspect_ratio, |
| double max_aspect_ratio, |
| - double max_frame_rate); |
| + double max_frame_rate, |
| + double target_frame_rate, |
| + const OnMutedCallback& on_muted_state_callback); |
| void RemoveTrack(const MediaStreamVideoTrack* track); |
| // Delivers |frame| to all tracks that have registered a callback. |
| @@ -67,6 +73,15 @@ class VideoTrackAdapter |
| double max_frame_rate); |
| void RemoveTrackOnIO(const MediaStreamVideoTrack* track); |
| + void StartTrackMonitoringOnIO( |
| + const OnMutedCallback& on_muted_state_callback, |
| + double target_frame_rate); |
| + |
| + // Compare |frame_counter_snapshot| with the current |frame_counter_|, and |
| + // inform of the situation via |set_muted_state_callback|. |
|
Henrik Grunell
2014/07/09 08:55:53
Same as above. Clarify only if considered muted.
mcasas
2014/07/09 12:39:35
Done.
|
| + void CheckFramesReceivedOnIO(const OnMutedCallback& set_muted_state_callback, |
| + uint64 old_frame_counter_snapshot); |
| + |
| // |thread_checker_| is bound to the main render thread. |
| base::ThreadChecker thread_checker_; |
| @@ -84,6 +99,11 @@ class VideoTrackAdapter |
| FrameAdapters; |
| FrameAdapters adapters_; |
| + // Running frame_counter, accesed on IO-thread. |
|
Henrik Grunell
2014/07/09 08:55:52
"Running frame counter, accessed on the IO-thread.
mcasas
2014/07/09 12:39:35
Done.
|
| + uint64 frame_counter_; |
| + // Frame rate configured on the source, accesed on IO-thread. |
|
Henrik Grunell
2014/07/09 08:55:52
Nit: add empty line before.
Henrik Grunell
2014/07/09 08:55:53
I don't understand the "configured on the source"
mcasas
2014/07/09 12:39:35
Done.
mcasas
2014/07/09 12:39:35
Done.
|
| + float target_frame_rate_; |
|
Henrik Grunell
2014/07/09 08:55:53
Same as above, for me the "target" part of the nam
mcasas
2014/07/09 12:39:35
See above.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter); |
| }; |