Chromium Code Reviews| Index: remoting/codec/video_encoder_vpx.cc |
| diff --git a/remoting/codec/video_encoder_vpx.cc b/remoting/codec/video_encoder_vpx.cc |
| index 75b6d4eb363e2fdd6287d6b17d170b50300f9940..61d94c9c8b2b9da0837b10665406ddae2f1247f6 100644 |
| --- a/remoting/codec/video_encoder_vpx.cc |
| +++ b/remoting/codec/video_encoder_vpx.cc |
| @@ -288,7 +288,9 @@ scoped_ptr<VideoPacket> VideoEncoderVpx::Encode( |
| // TODO(hclam): Make sure we get exactly one frame from the packet. |
|
Sergey Ulanov
2014/09/03 01:11:25
this TODO can be removed
|
| // TODO(hclam): We should provide the output buffer to avoid one copy. |
| - scoped_ptr<VideoPacket> packet(new VideoPacket()); |
| + scoped_ptr<VideoPacket> packet( |
| + helper_.CreateVideoPacketWithUpdatedRegion(frame, updated_region)); |
| + packet->mutable_format()->set_encoding(VideoPacketFormat::ENCODING_VP8); |
| while (!got_data) { |
| const vpx_codec_cx_pkt_t* vpx_packet = |
| @@ -306,25 +308,9 @@ scoped_ptr<VideoPacket> VideoEncoderVpx::Encode( |
| } |
| } |
| - // Construct the VideoPacket message. |
| - packet->mutable_format()->set_encoding(VideoPacketFormat::ENCODING_VP8); |
| - packet->mutable_format()->set_screen_width(frame.size().width()); |
| - packet->mutable_format()->set_screen_height(frame.size().height()); |
| - packet->set_capture_time_ms(frame.capture_time_ms()); |
| + // Note the time taken to encode the pixel data. |
| packet->set_encode_time_ms( |
| (base::TimeTicks::Now() - encode_start_time).InMillisecondsRoundedUp()); |
| - if (!frame.dpi().is_zero()) { |
| - packet->mutable_format()->set_x_dpi(frame.dpi().x()); |
| - packet->mutable_format()->set_y_dpi(frame.dpi().y()); |
| - } |
| - for (webrtc::DesktopRegion::Iterator r(updated_region); !r.IsAtEnd(); |
| - r.Advance()) { |
| - Rect* rect = packet->add_dirty_rects(); |
| - rect->set_x(r.rect().left()); |
| - rect->set_y(r.rect().top()); |
| - rect->set_width(r.rect().width()); |
| - rect->set_height(r.rect().height()); |
| - } |
| return packet.Pass(); |
| } |