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 REMOTING_CODEC_VIDEO_ENCODER_HELPER_H_
6 #define REMOTING_CODEC_VIDEO_ENCODER_HELPER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
20 class VideoEncoderHelper
{
24 // Returns a new VideoPacket with common fields (e.g. capture_time_ms, rects
25 // list, frame shape if any) initialized based on the supplied |frame|.
26 // Screen width and height will be set iff |frame|'s size differs from that
27 // of the previously-supplied frame.
28 scoped_ptr
<VideoPacket
> CreateVideoPacket(const webrtc::DesktopFrame
& frame
);
30 // Returns a new VideoPacket with the common fields populated from |frame|,
31 // but the updated rects overridden by |updated_region|. This is useful for
32 // encoders which alter the updated region e.g. by expanding it to macroblock
34 scoped_ptr
<VideoPacket
> CreateVideoPacketWithUpdatedRegion(
35 const webrtc::DesktopFrame
& frame
,
36 const webrtc::DesktopRegion
& updated_region
);
38 // The most recent screen size. Used to detect screen size changes.
39 webrtc::DesktopSize screen_size_
;
41 DISALLOW_COPY_AND_ASSIGN(VideoEncoderHelper
);
44 } // namespace remoting
46 #endif // REMOTING_CODEC_VIDEO_ENCODER_HELPER_H_