Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Side by Side Diff: remoting/codec/video_encoder_helper.h

Issue 530243002: Move common VideoPacket initialization into VideoEncoderHelper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit tests Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef REMOTING_CODEC_VIDEO_ENCODER_HELPER_H_
6 #define REMOTING_CODEC_VIDEO_ENCODER_HELPER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
10
11 namespace webrtc {
12 class DesktopFrame;
13 class DesktopRegion;
14 }
15
16 namespace remoting {
17
18 class VideoPacket;
19
20 class VideoEncoderHelper {
21 public:
22 VideoEncoderHelper();
23
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);
29
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_;
40
41 DISALLOW_COPY_AND_ASSIGN(VideoEncoderHelper);
42 };
43
44 } // namespace remoting
45
46 #endif // REMOTING_CODEC_VIDEO_ENCODER_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/codec/video_encoder_helper.cc » ('j') | remoting/codec/video_encoder_vpx.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698