Fix app list crash when reparenting a single item folder's only app onto itself.
[chromium-blink-merge.git] / media / cast / sender / software_video_encoder.h
blobe3136d5352f56f07dbad953df791a3640e24afa1
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_SENDER_SOFTWARE_VIDEO_ENCODER_H_
6 #define MEDIA_CAST_SENDER_SOFTWARE_VIDEO_ENCODER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
11 namespace base {
12 class TimeTicks;
15 namespace media {
16 class VideoFrame;
19 namespace media {
20 namespace cast {
21 struct EncodedFrame;
23 class SoftwareVideoEncoder {
24 public:
25 virtual ~SoftwareVideoEncoder() {}
27 // Initialize the encoder before Encode() can be called. This method
28 // must be called on the thread that Encode() is called.
29 virtual void Initialize() = 0;
31 // Encode a raw image (as a part of a video stream).
32 virtual void Encode(const scoped_refptr<media::VideoFrame>& video_frame,
33 const base::TimeTicks& reference_time,
34 EncodedFrame* encoded_frame) = 0;
36 // Update the encoder with a new target bit rate.
37 virtual void UpdateRates(uint32 new_bitrate) = 0;
39 // Set the next frame to be a key frame.
40 virtual void GenerateKeyFrame() = 0;
42 // Set the last frame to reference.
43 virtual void LatestFrameIdToReference(uint32 frame_id) = 0;
46 } // namespace cast
47 } // namespace media
49 #endif // MEDIA_CAST_SENDER_SOFTWARE_VIDEO_ENCODER_H_