summaryrefslogtreecommitdiffstats
path: root/media/cast/video_sender/fake_software_video_encoder.h
blob: bcc5ed06d8d1efef47a2d961e281fae69b24df95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2014 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.

#ifndef MEDIA_CAST_VIDEO_SENDER_FAKE_SOFTWARE_VIDEO_ENCODER_H_
#define MEDIA_CAST_VIDEO_SENDER_FAKE_SOFTWARE_VIDEO_ENCODER_H_

#include "media/cast/video_sender/software_video_encoder.h"

namespace media {
namespace cast {

class FakeSoftwareVideoEncoder : public SoftwareVideoEncoder {
 public:
  FakeSoftwareVideoEncoder();
  virtual ~FakeSoftwareVideoEncoder();

  // SoftwareVideoEncoder implementations.
  virtual void Initialize() OVERRIDE;
  virtual bool Encode(const scoped_refptr<media::VideoFrame>& video_frame,
                      transport::EncodedVideoFrame* encoded_image) OVERRIDE;
  virtual void UpdateRates(uint32 new_bitrate) OVERRIDE;
  virtual void GenerateKeyFrame() OVERRIDE;
  virtual void LatestFrameIdToReference(uint32 frame_id) OVERRIDE;

 private:
  bool next_frame_is_key_;
  uint32 frame_id_;
  uint32 frame_id_to_reference_;
};

}  // namespace cast
}  // namespace media

#endif  // MEDIA_CAST_VIDEO_SENDER_FAKE_SOFTWARE_VIDEO_ENCODER_H_