[Android WebView] Make loading of V8 data compatible with child services
[chromium-blink-merge.git] / remoting / codec / video_encoder_helper.h
blobc33fdb994f4c9bdba04ef8ad2ca1094e8dce9e93
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"
11 namespace webrtc {
12 class DesktopFrame;
13 class DesktopRegion;
16 namespace remoting {
18 class VideoPacket;
20 class VideoEncoderHelper {
21 public:
22 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
33 // boundaries.
34 scoped_ptr<VideoPacket> CreateVideoPacketWithUpdatedRegion(
35 const webrtc::DesktopFrame& frame,
36 const webrtc::DesktopRegion& updated_region);
37 private:
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_