Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / media / cast / video_sender / software_video_encoder.h
blob3d63f20b3cfc892ec85713ac357bc29785668c09
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MEDIA_CAST_VIDEO_SENDER_SOFTWARE_VIDEO_ENCODER_H_
6 #define MEDIA_CAST_VIDEO_SENDER_SOFTWARE_VIDEO_ENCODER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
11 namespace media {
12 class VideoFrame;
15 namespace media {
16 namespace cast {
17 namespace transport {
18 struct EncodedVideoFrame;
19 } // namespace transport
21 class SoftwareVideoEncoder {
22 public:
23 virtual ~SoftwareVideoEncoder() {}
25 // Initialize the encoder before Encode() can be called. This method
26 // must be called on the thread that Encode() is called.
27 virtual void Initialize() = 0;
29 // Encode a raw image (as a part of a video stream).
30 virtual bool Encode(const scoped_refptr<media::VideoFrame>& video_frame,
31 transport::EncodedVideoFrame* encoded_image) = 0;
33 // Update the encoder with a new target bit rate.
34 virtual void UpdateRates(uint32 new_bitrate) = 0;
36 // Set the next frame to be a key frame.
37 virtual void GenerateKeyFrame() = 0;
39 // Set the last frame to reference.
40 virtual void LatestFrameIdToReference(uint32 frame_id) = 0;
43 } // namespace cast
44 } // namespace media
46 #endif // MEDIA_CAST_VIDEO_SENDER_SOFTWARE_VIDEO_ENCODER_H_