OLD | NEW |
---|---|
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_PROTOCOL_VIDEO_STUB_H_ | 5 #ifndef REMOTING_PROTOCOL_VIDEO_STUB_H_ |
6 #define REMOTING_PROTOCOL_VIDEO_STUB_H_ | 6 #define REMOTING_PROTOCOL_VIDEO_STUB_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | 12 |
13 class VideoPacket; | 13 class VideoPacket; |
14 | 14 |
15 namespace protocol { | 15 namespace protocol { |
16 | 16 |
17 class VideoStub { | 17 class VideoStub { |
18 public: | 18 public: |
19 virtual void ProcessVideoPacket(scoped_ptr<VideoPacket> video_packet, | 19 // For each packet VideoStub calls the specified ProgressCallback to |
20 const base::Closure& done) = 0; | 20 // notify about packet progress. SENT state may be skipped, if the packet is |
21 // processed locally. If SupportsAcks() returns true then DONE progress | |
22 // notification is emitted only after the acknowledgment has been received. | |
23 enum class PacketProgress { | |
24 SENT, | |
Wez
2015/02/03 00:54:32
Do we really need the "SENT" state? It ends up mak
Sergey Ulanov
2015/02/09 19:14:54
Reverted this change now. Using VideoFeedbackStub
| |
25 DONE, | |
26 }; | |
27 typedef base::Callback<void(PacketProgress progress)> ProgressCallback; | |
28 | |
29 virtual void ProcessVideoPacket( | |
30 scoped_ptr<VideoPacket> video_packet, | |
31 const ProgressCallback& progress_callback) = 0; | |
Wez
2015/02/03 00:54:32
This complicates the VideoStub interface quite a b
Sergey Ulanov
2015/02/09 19:14:54
Reverted this change now. Using VideoFeedbackStub
| |
32 | |
33 // Indicates that the connection supports video packet acknowledgments. | |
34 virtual bool SupportsAcks() { return false; } | |
21 | 35 |
22 protected: | 36 protected: |
23 VideoStub() {} | 37 VideoStub() {} |
24 virtual ~VideoStub() {} | 38 virtual ~VideoStub() {} |
25 | 39 |
26 private: | 40 private: |
27 DISALLOW_COPY_AND_ASSIGN(VideoStub); | 41 DISALLOW_COPY_AND_ASSIGN(VideoStub); |
28 }; | 42 }; |
29 | 43 |
30 } // namespace protocol | 44 } // namespace protocol |
31 } // namespace remoting | 45 } // namespace remoting |
32 | 46 |
33 #endif // REMOTING_PROTOCOL_VIDEO_STUB_H_ | 47 #endif // REMOTING_PROTOCOL_VIDEO_STUB_H_ |
OLD | NEW |