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

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

Issue 1288063004: Simplify FrameConsumer interface. Remove FrameProducer interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_CODEC_VIDEO_DECODER_H_ 5 #ifndef REMOTING_CODEC_VIDEO_DECODER_H_
6 #define REMOTING_CODEC_VIDEO_DECODER_H_ 6 #define REMOTING_CODEC_VIDEO_DECODER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "remoting/proto/video.pb.h" 9 #include "remoting/proto/video.pb.h"
10 10
11 namespace webrtc { 11 namespace webrtc {
12 class DesktopRect; 12 class DesktopRect;
13 class DesktopRegion; 13 class DesktopRegion;
14 class DesktopSize; 14 class DesktopSize;
15 } // namespace webrtc 15 } // namespace webrtc
16 16
17 namespace remoting { 17 namespace remoting {
18 18
19 // Interface for a decoder that takes a stream of bytes from the network and 19 // Interface for a decoder that takes a stream of bytes from the network and
20 // outputs frames of data. 20 // outputs frames of data.
21 // TODO(sergeyu): Simplify this interface.
21 class VideoDecoder { 22 class VideoDecoder {
22 public: 23 public:
23 static const int kBytesPerPixel = 4; 24 static const int kBytesPerPixel = 4;
24 25
25 VideoDecoder() {} 26 VideoDecoder() {}
26 virtual ~VideoDecoder() {} 27 virtual ~VideoDecoder() {}
27 28
28 // Initializes the decoder and sets the output dimensions.
29 // |screen size| must not be empty.
30 virtual void Initialize(const webrtc::DesktopSize& screen_size) = 0;
31
32 // Feeds more data into the decoder. Returns true if |packet| was processed 29 // Feeds more data into the decoder. Returns true if |packet| was processed
33 // and the frame can be displayed now. 30 // and the frame can be displayed now.
34 virtual bool DecodePacket(const VideoPacket& packet) = 0; 31 virtual bool DecodePacket(const VideoPacket& packet) = 0;
35 32
36 // Marks the specified |region| of the view for update the next time 33 // Marks the specified |region| of the view for update the next time
37 // RenderFrame() is called. |region| is expressed in |view_size| coordinates. 34 // RenderFrame() is called. |region| is expressed in |view_size| coordinates.
38 // |view_size| must not be empty. 35 // |view_size| must not be empty.
39 virtual void Invalidate(const webrtc::DesktopSize& view_size, 36 virtual void Invalidate(const webrtc::DesktopSize& view_size,
40 const webrtc::DesktopRegion& region) = 0; 37 const webrtc::DesktopRegion& region) = 0;
41 38
(...skipping 16 matching lines...) Expand all
58 webrtc::DesktopRegion* output_region) = 0; 55 webrtc::DesktopRegion* output_region) = 0;
59 56
60 // Returns the "shape", if any, of the most recently rendered frame. 57 // Returns the "shape", if any, of the most recently rendered frame.
61 // The shape is returned in source dimensions. 58 // The shape is returned in source dimensions.
62 virtual const webrtc::DesktopRegion* GetImageShape() = 0; 59 virtual const webrtc::DesktopRegion* GetImageShape() = 0;
63 }; 60 };
64 61
65 } // namespace remoting 62 } // namespace remoting
66 63
67 #endif // REMOTING_CODEC_VIDEO_DECODER_H_ 64 #endif // REMOTING_CODEC_VIDEO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698