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

Side by Side Diff: remoting/codec/video_decoder_vpx.cc

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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "remoting/codec/video_decoder_vpx.h" 5 #include "remoting/codec/video_decoder_vpx.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 16 matching lines...) Expand all
27 return make_scoped_ptr(new VideoDecoderVpx(vpx_codec_vp8_dx())); 27 return make_scoped_ptr(new VideoDecoderVpx(vpx_codec_vp8_dx()));
28 } 28 }
29 29
30 // static 30 // static
31 scoped_ptr<VideoDecoderVpx> VideoDecoderVpx::CreateForVP9() { 31 scoped_ptr<VideoDecoderVpx> VideoDecoderVpx::CreateForVP9() {
32 return make_scoped_ptr(new VideoDecoderVpx(vpx_codec_vp9_dx())); 32 return make_scoped_ptr(new VideoDecoderVpx(vpx_codec_vp9_dx()));
33 } 33 }
34 34
35 VideoDecoderVpx::~VideoDecoderVpx() {} 35 VideoDecoderVpx::~VideoDecoderVpx() {}
36 36
37 void VideoDecoderVpx::Initialize(const webrtc::DesktopSize& source_size) {
38 // Nothing to do here; the codec handles resizing internally, and returns
39 // the source dimensions as part of the vpx_image_t.
40 }
41
42 bool VideoDecoderVpx::DecodePacket(const VideoPacket& packet) { 37 bool VideoDecoderVpx::DecodePacket(const VideoPacket& packet) {
43 // Pass the packet to the codec to process. 38 // Pass the packet to the codec to process.
44 vpx_codec_err_t ret = vpx_codec_decode( 39 vpx_codec_err_t ret = vpx_codec_decode(
45 codec_.get(), reinterpret_cast<const uint8*>(packet.data().data()), 40 codec_.get(), reinterpret_cast<const uint8*>(packet.data().data()),
46 packet.data().size(), nullptr, 0); 41 packet.data().size(), nullptr, 0);
47 if (ret != VPX_CODEC_OK) { 42 if (ret != VPX_CODEC_OK) {
48 const char* error = vpx_codec_error(codec_.get()); 43 const char* error = vpx_codec_error(codec_.get());
49 const char* error_detail = vpx_codec_error_detail(codec_.get()); 44 const char* error_detail = vpx_codec_error_detail(codec_.get());
50 LOG(ERROR) << "Decoding failed:" << (error ? error : "(NULL)") << "\n" 45 LOG(ERROR) << "Decoding failed:" << (error ? error : "(NULL)") << "\n"
51 << "Details: " << (error_detail ? error_detail : "(NULL)"); 46 << "Details: " << (error_detail ? error_detail : "(NULL)");
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 vpx_codec_err_t ret = vpx_codec_dec_init(codec_.get(), codec, &config, 0); 231 vpx_codec_err_t ret = vpx_codec_dec_init(codec_.get(), codec, &config, 0);
237 CHECK_EQ(VPX_CODEC_OK, ret); 232 CHECK_EQ(VPX_CODEC_OK, ret);
238 } 233 }
239 234
240 webrtc::DesktopSize VideoDecoderVpx::image_size() const { 235 webrtc::DesktopSize VideoDecoderVpx::image_size() const {
241 return image_ ? webrtc::DesktopSize(image_->d_w, image_->d_h) 236 return image_ ? webrtc::DesktopSize(image_->d_w, image_->d_h)
242 : webrtc::DesktopSize(); 237 : webrtc::DesktopSize();
243 } 238 }
244 239
245 } // namespace remoting 240 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698