| 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 1a616126985bd16831e69b161f6d919fa0d6b983..e71d3d6cf110331c478a2d383dbf10d97487eae4 100644
|
| --- a/content/renderer/media/video_track_adapter.h
|
| +++ b/content/renderer/media/video_track_adapter.h
|
| @@ -6,6 +6,7 @@
|
| #define CONTENT_RENDERER_MEDIA_VIDEO_TRACK_ADAPTER_H_
|
|
|
| #include <vector>
|
| +#include <queue>
|
|
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| @@ -27,7 +28,7 @@ namespace content {
|
| class VideoTrackAdapter
|
| : public base::RefCountedThreadSafe<VideoTrackAdapter> {
|
| public:
|
| - typedef base::Callback<void(bool mute_state)> OnMutedCallback;
|
| + typedef base::Callback<void(float framerate, int dropped_frames)> OnFrameRateCallback;
|
|
|
| explicit VideoTrackAdapter(
|
| const scoped_refptr<base::MessageLoopProxy>& io_message_loop);
|
| @@ -62,13 +63,16 @@ class VideoTrackAdapter
|
| // |DeliverFrameOnIO| is called with a frame rate of |source_frame_rate|.
|
| // |on_muted_callback| is triggered on the main render thread.
|
| void StartFrameMonitoring(double source_frame_rate,
|
| - const OnMutedCallback& on_muted_callback);
|
| + const OnFrameRateCallback& on_muted_callback);
|
| void StopFrameMonitoring();
|
|
|
| private:
|
| virtual ~VideoTrackAdapter();
|
| friend class base::RefCountedThreadSafe<VideoTrackAdapter>;
|
|
|
| + typedef base::Callback<void(float framerate, int dropped_frames)>
|
| + FrameRateCallback;
|
| +
|
| void AddTrackOnIO(
|
| const MediaStreamVideoTrack* track,
|
| VideoCaptureDeliverFrameCB frame_callback,
|
| @@ -79,14 +83,18 @@ class VideoTrackAdapter
|
| void RemoveTrackOnIO(const MediaStreamVideoTrack* track);
|
|
|
| void StartFrameMonitoringOnIO(
|
| - const OnMutedCallback& on_muted_state_callback,
|
| + const OnFrameRateCallback& on_muted_state_callback,
|
| double source_frame_rate);
|
| void StopFrameMonitoringOnIO();
|
|
|
| // Compare |frame_counter_snapshot| with the current |frame_counter_|, and
|
| // inform of the situation (muted, not muted) via |set_muted_state_callback|.
|
| - void CheckFramesReceivedOnIO(const OnMutedCallback& set_muted_state_callback,
|
| - uint64 old_frame_counter_snapshot);
|
| + void CheckFramesReceivedOnIO(const OnFrameRateCallback& set_muted_state_callback,
|
| + uint64 old_frame_counter_snapshot,
|
| + int old_dropped_frame_counter_snapshot);
|
| +
|
| + void UpdateFrameRateOnIO(base::TimeDelta timestamp);
|
| + float GetFrameRateOnIO();
|
|
|
| // |thread_checker_| is bound to the main render thread.
|
| base::ThreadChecker thread_checker_;
|
| @@ -119,6 +127,9 @@ class VideoTrackAdapter
|
| // Frame rate configured on the video source, accessed on the IO-thread.
|
| float source_frame_rate_;
|
|
|
| + int dropped_frames_counter_;
|
| + std::queue<base::TimeDelta> frame_timestamps_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(VideoTrackAdapter);
|
| };
|
|
|
|
|