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

Issue 3335012: Add in a new FrameConsumer interface, Decode API, and a RectangleUpdateDecoder abstraction. (Closed)

Created:
10 years, 3 months ago by awong
Modified:
7 years, 1 month ago
CC:
chromium-reviews, Sergey Ulanov, dmac, garykac, Alpha Left Google, awong
Visibility:
Public.

Description

Add in a new FrameConsumer interface, Decode API, and a RectangleUpdateDecoder abstraction. This should allow a decoder that can still request the view to allocate frames without being owned by the view itself. This allows for cleaner threading semantics and reduced coupling of classes. The new decoder API keeps the decoder from being aware of the network packet types tightening up the API layering. BUG=52833 TEST=None. This code isn't used yet. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=60703 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=60721

Patch Set 1 #

Patch Set 2 : rebased. #

Patch Set 3 : fixed syle issues. #

Patch Set 4 : Rebased, somewhat fixed. #

Patch Set 5 : Fix style. #

Total comments: 34

Patch Set 6 : Address Gary's comments. #

Patch Set 7 : Fix silly compile errors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+365 lines, -1 line) Patch
M remoting/base/decoder.h View 4 5 1 chunk +24 lines, -0 lines 0 comments Download
M remoting/base/protocol/chromotocol.proto View 1 chunk +1 line, -1 line 0 comments Download
A remoting/client/frame_consumer.h View 1 2 3 4 5 1 chunk +59 lines, -0 lines 0 comments Download
A remoting/client/rectangle_update_decoder.h View 1 2 3 4 5 1 chunk +60 lines, -0 lines 0 comments Download
A remoting/client/rectangle_update_decoder.cc View 1 2 3 4 5 6 1 chunk +218 lines, -0 lines 0 comments Download
M remoting/remoting.gyp View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
awong
next fragment of the big update. The new decoder interface...
10 years, 3 months ago (2010-09-08 19:41:38 UTC) #1
awong
Uh oh...this doesn't compile at all. I'll ping you again when it's ready. -Albert On ...
10 years, 3 months ago (2010-09-08 19:43:29 UTC) #2
awong
Finally ready for review (2 weeks later...stupid non-dev work...)
10 years, 2 months ago (2010-09-24 02:57:07 UTC) #3
garykac
LGTM. Mostly nits. I assume that some of the TODOs (like dropped-packet recovery) are in ...
10 years, 2 months ago (2010-09-24 23:07:37 UTC) #4
awong
10 years, 2 months ago (2010-09-27 20:36:12 UTC) #5
Thanks for the review! Fixed comments.

http://codereview.chromium.org/3335012/diff/10001/11001
File remoting/base/decoder.h (right):

http://codereview.chromium.org/3335012/diff/10001/11001#newcode95
remoting/base/decoder.h:95: // protocol like VP8.  However, it breaks the layer
violation of depending on
On 2010/09/24 23:07:41, garykac wrote:
> "breaks the layer violation"?

Done.

http://codereview.chromium.org/3335012/diff/10001/11001#newcode99
remoting/base/decoder.h:99: // Initizes the decoder to draw into the given
|frame|.  The |clip| specifies
On 2010/09/24 23:07:41, garykac wrote:
> Initizes?

Done.

http://codereview.chromium.org/3335012/diff/10001/11001#newcode101
remoting/base/decoder.h:101: // region must fit inside the dimensions of frame.
Failure to due so will
On 2010/09/24 23:07:41, garykac wrote:
> "to do so"

Done.

http://codereview.chromium.org/3335012/diff/10001/11001#newcode103
remoting/base/decoder.h:103: // overflow).
On 2010/09/24 23:07:41, garykac wrote:
> I'm assuming that we actively want to prevent any possibility of a buffer
> overflow. Can we guarantee that it will (at worst) CHECK?

Done.

http://codereview.chromium.org/3335012/diff/10001/11001#newcode107
remoting/base/decoder.h:107: // Reset the decoder to an uninitialized state.
Released all references to
On 2010/09/24 23:07:41, garykac wrote:
> Release all ...

Done.

http://codereview.chromium.org/3335012/diff/10001/11001#newcode108
remoting/base/decoder.h:108: // the initialized |frame|.  Initialize() must be
called before the decoder
On 2010/09/24 23:07:41, garykac wrote:
> "Initialize() must be called before..." but an earlier comment says (in
> reference to Initialize()): "Not all decoders will use this."

Stale comment in Initialize(). removed.

http://codereview.chromium.org/3335012/diff/10001/11002
File remoting/client/frame_consumer.h (right):

http://codereview.chromium.org/3335012/diff/10001/11002#newcode21
remoting/client/frame_consumer.h:21: // may be bigger. If the knowing the actual
frame size is important, be sure
On 2010/09/24 23:07:41, garykac wrote:
> If knowing the...

Reworded.

http://codereview.chromium.org/3335012/diff/10001/11002#newcode37
remoting/client/frame_consumer.h:37: base::TimeDelta duration,
On 2010/09/24 23:07:41, garykac wrote:
> What does it mean for an allocated frame to have a 'duration'?

This is for video codecs.  It's how long the frame should display for since some
codecs (including I'm betting ours eventually) can display display for a long
period of time. Think still frame.

http://codereview.chromium.org/3335012/diff/10001/11003
File remoting/client/rectangle_update_decoder.cc (right):

http://codereview.chromium.org/3335012/diff/10001/11003#newcode116
remoting/client/rectangle_update_decoder.cc:116: if (packet.flags() |
RectangleUpdatePacket::FIRST_PACKET) {
On 2010/09/24 23:07:41, garykac wrote:
> According to .proto, the first packet should also have a sequence number of 0.

> And any packet with a non-0 sequence number is not a first packet. 

I don't like this requirement...I'm going to modify the protocol buffer
documentation.

http://codereview.chromium.org/3335012/diff/10001/11003#newcode124
remoting/client/rectangle_update_decoder.cc:124: format.encoding() ==
EncodingInvalid) {
On 2010/09/24 23:07:41, garykac wrote:
> This isn't the only invalid encoding. Suggest:
>   encoding <= EncodingInvalid || encoding >= EncodingMax
> where EncodingMax is added at the end of the enum in chromotocol.proto.
> 

I think that should be caught by packet.IsValid(), which I just added.

http://codereview.chromium.org/3335012/diff/10001/11003#newcode180
remoting/client/rectangle_update_decoder.cc:180: // stream input.  The the very
least, don't crash the process.
On 2010/09/24 23:07:41, garykac wrote:
> ...may feed us a corrupt stream or manually create a stream that changes
> decoders. At the very least, ...

Done.

http://codereview.chromium.org/3335012/diff/10001/11003#newcode182
remoting/client/rectangle_update_decoder.cc:182: // For not though, assume that
only one encoding is used throughout.
On 2010/09/24 23:07:41, garykac wrote:
> for now,

Done.

http://codereview.chromium.org/3335012/diff/10001/11003#newcode185
remoting/client/rectangle_update_decoder.cc:185: // However, we need to verify
that flushing semantics of the decoder first.
On 2010/09/24 23:07:41, garykac wrote:
> verify the

Done.

http://codereview.chromium.org/3335012/diff/10001/11003#newcode195
remoting/client/rectangle_update_decoder.cc:195: }
On 2010/09/24 23:07:41, garykac wrote:
> else {Trace or Error invalid encoding}

Done.

http://codereview.chromium.org/3335012/diff/10001/11003#newcode199
remoting/client/rectangle_update_decoder.cc:199: // out the right behavior and
make this more reslient.
On 2010/09/24 23:07:41, garykac wrote:
> resilient

Done.

http://codereview.chromium.org/3335012/diff/10001/11004
File remoting/client/rectangle_update_decoder.h (right):

http://codereview.chromium.org/3335012/diff/10001/11004#newcode30
remoting/client/rectangle_update_decoder.h:30: // regsitered as data is
avaialable. DecodePacket may keep a reference to
On 2010/09/24 23:07:41, garykac wrote:
> should this be "on the registered FrameConsumer as data is available"?

Done.

http://codereview.chromium.org/3335012/diff/10001/11004#newcode45
remoting/client/rectangle_update_decoder.h:45: MessageLoop* message_loop_;
On 2010/09/24 23:07:41, garykac wrote:
> Do we have a convention for showing ownership of ptrs like this?

Done.

Powered by Google App Engine
This is Rietveld 408576698