[SyncFS] Initialize SyncWorker when sync is enabled.
[chromium-blink-merge.git] / media / cast / sender / software_video_encoder.h
blob16c8cd347330107adb5c4d1d650497c6f99b9729
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 media {
12 class VideoFrame;
15 namespace media {
16 namespace cast {
17 struct EncodedFrame;
19 class SoftwareVideoEncoder {
20 public:
21 virtual ~SoftwareVideoEncoder() {}
23 // Initialize the encoder before Encode() can be called. This method
24 // must be called on the thread that Encode() is called.
25 virtual void Initialize() = 0;
27 // Encode a raw image (as a part of a video stream).
28 virtual bool Encode(const scoped_refptr<media::VideoFrame>& video_frame,
29 EncodedFrame* encoded_image) = 0;
31 // Update the encoder with a new target bit rate.
32 virtual void UpdateRates(uint32 new_bitrate) = 0;
34 // Set the next frame to be a key frame.
35 virtual void GenerateKeyFrame() = 0;
37 // Set the last frame to reference.
38 virtual void LatestFrameIdToReference(uint32 frame_id) = 0;
41 } // namespace cast
42 } // namespace media
44 #endif // MEDIA_CAST_SENDER_SOFTWARE_VIDEO_ENCODER_H_