blob: 58093463371b3de5564273c3c583e9dd1104f99d [file] [log] [blame]
// 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 COBALT_MEDIA_CAST_SENDER_SOFTWARE_VIDEO_ENCODER_H_
#define COBALT_MEDIA_CAST_SENDER_SOFTWARE_VIDEO_ENCODER_H_
#include "base/memory/ref_counted.h"
#include "media/cast/sender/sender_encoded_frame.h"
#include "starboard/types.h"
namespace base {
class TimeTicks;
}
namespace cobalt {
namespace media {
class VideoFrame;
}
namespace cobalt {
namespace media {
namespace cast {
class SoftwareVideoEncoder {
public:
virtual ~SoftwareVideoEncoder() {}
// Initialize the encoder before Encode() can be called. This method
// must be called on the thread that Encode() is called.
virtual void Initialize() = 0;
// Encode a raw image (as a part of a video stream).
virtual void Encode(const scoped_refptr<media::VideoFrame>& video_frame,
const base::TimeTicks& reference_time,
SenderEncodedFrame* encoded_frame) = 0;
// Update the encoder with a new target bit rate.
virtual void UpdateRates(uint32_t new_bitrate) = 0;
// Set the next frame to be a key frame.
virtual void GenerateKeyFrame() = 0;
};
} // namespace cast
} // namespace media
} // namespace cobalt
#endif // COBALT_MEDIA_CAST_SENDER_SOFTWARE_VIDEO_ENCODER_H_