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

Unified Diff: remoting/client/rectangle_update_decoder.cc

Issue 4255001: Revert 64672 - Cleanups in the video encoding decoding code. Reenable VP8.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/rectangle_update_decoder.h ('k') | remoting/host/capturer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/rectangle_update_decoder.cc
===================================================================
--- remoting/client/rectangle_update_decoder.cc (revision 64676)
+++ remoting/client/rectangle_update_decoder.cc (working copy)
@@ -9,7 +9,6 @@
#include "media/base/callback.h"
#include "remoting/base/decoder.h"
#include "remoting/base/decoder_row_based.h"
-#include "remoting/base/decoder_vp8.h"
#include "remoting/base/tracer.h"
#include "remoting/base/util.h"
#include "remoting/client/frame_consumer.h"
@@ -47,7 +46,7 @@
RectangleUpdateDecoder::~RectangleUpdateDecoder() {
}
-void RectangleUpdateDecoder::DecodePacket(const VideoPacket& packet,
+void RectangleUpdateDecoder::DecodePacket(const RectangleUpdatePacket& packet,
Task* done) {
if (message_loop_ != MessageLoop::current()) {
message_loop_->PostTask(
@@ -71,8 +70,8 @@
&RectangleUpdateDecoder::ProcessPacketData,
packet, done_runner.release());
- if (packet.flags() | VideoPacket::FIRST_PACKET) {
- const VideoPacketFormat& format = packet.format();
+ if (packet.flags() | RectangleUpdatePacket::FIRST_PACKET) {
+ const RectangleFormat& format = packet.format();
InitializeDecoder(format, process_packet_data);
} else {
@@ -82,7 +81,8 @@
}
void RectangleUpdateDecoder::ProcessPacketData(
- const VideoPacket& packet, Task* done) {
+ const RectangleUpdatePacket& packet,
+ Task* done) {
AutoTaskRunner done_runner(done);
if (!decoder_->IsReadyForData()) {
@@ -92,9 +92,9 @@
}
TraceContext::tracer()->PrintString("Executing Decode.");
- decoder_->DecodeBytes(packet.data());
+ decoder_->DecodeBytes(packet.encoded_rect());
- if (packet.flags() | VideoPacket::LAST_PACKET) {
+ if (packet.flags() | RectangleUpdatePacket::LAST_PACKET) {
decoder_->Reset();
UpdatedRects* rects = new UpdatedRects();
@@ -109,38 +109,39 @@
}
// static
-bool RectangleUpdateDecoder::IsValidPacket(const VideoPacket& packet) {
+bool RectangleUpdateDecoder::IsValidPacket(
+ const RectangleUpdatePacket& packet) {
if (!packet.IsInitialized()) {
LOG(WARNING) << "Protobuf consistency checks fail.";
return false;
}
// First packet must have a format.
- if (packet.flags() | VideoPacket::FIRST_PACKET) {
+ if (packet.flags() | RectangleUpdatePacket::FIRST_PACKET) {
if (!packet.has_format()) {
LOG(WARNING) << "First packet must have format.";
return false;
}
// TODO(ajwong): Verify that we don't need to whitelist encodings.
- const VideoPacketFormat& format = packet.format();
+ const RectangleFormat& format = packet.format();
if (!format.has_encoding() ||
- format.encoding() == VideoPacketFormat::ENCODING_INVALID) {
+ format.encoding() == EncodingInvalid) {
LOG(WARNING) << "Invalid encoding specified.";
return false;
}
}
// We shouldn't generate null packets.
- if (!packet.has_data()) {
- LOG(WARNING) << "Packet w/o data received.";
+ if (!packet.has_encoded_rect()) {
+ LOG(WARNING) << "Packet w/o an encoded rectangle received.";
return false;
}
return true;
}
-void RectangleUpdateDecoder::InitializeDecoder(const VideoPacketFormat& format,
+void RectangleUpdateDecoder::InitializeDecoder(const RectangleFormat& format,
Task* done) {
if (message_loop_ != MessageLoop::current()) {
message_loop_->PostTask(
@@ -191,15 +192,12 @@
CHECK(decoder_->Encoding() == format.encoding());
} else {
// Initialize a new decoder based on this message encoding.
- if (format.encoding() == VideoPacketFormat::ENCODING_VERBATIM) {
+ if (format.encoding() == EncodingNone) {
TraceContext::tracer()->PrintString("Creating Verbatim decoder.");
decoder_.reset(DecoderRowBased::CreateVerbatimDecoder());
- } else if (format.encoding() == VideoPacketFormat::ENCODING_ZLIB) {
+ } else if (format.encoding() == EncodingZlib) {
TraceContext::tracer()->PrintString("Creating Zlib decoder");
decoder_.reset(DecoderRowBased::CreateZlibDecoder());
- } else if (format.encoding() == VideoPacketFormat::ENCODING_VP8) {
- TraceContext::tracer()->PrintString("Creating VP8 decoder");
- decoder_.reset(new DecoderVp8());
} else {
NOTREACHED() << "Invalid Encoding found: " << format.encoding();
}
« no previous file with comments | « remoting/client/rectangle_update_decoder.h ('k') | remoting/host/capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698