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

Side by Side Diff: media/cast/video_receiver/video_decoder.cc

Issue 109413004: Cast:Adding cast_transport_config and cleaning up (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 11 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 | Annotate | Revision Log
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 "media/cast/video_receiver/video_decoder.h" 5 #include "media/cast/video_receiver/video_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/cast/video_receiver/codecs/vp8/vp8_decoder.h" 10 #include "media/cast/video_receiver/codecs/vp8/vp8_decoder.h"
11 11
12 namespace media { 12 namespace media {
13 namespace cast { 13 namespace cast {
14 14
15 VideoDecoder::VideoDecoder(const VideoReceiverConfig& video_config, 15 VideoDecoder::VideoDecoder(const VideoReceiverConfig& video_config,
16 scoped_refptr<CastEnvironment> cast_environment) 16 scoped_refptr<CastEnvironment> cast_environment)
17 : codec_(video_config.codec), 17 : codec_(video_config.codec),
18 vp8_decoder_() { 18 vp8_decoder_() {
19 switch (video_config.codec) { 19 switch (video_config.codec) {
20 case kVp8: 20 case transport::kVp8:
21 vp8_decoder_.reset(new Vp8Decoder(cast_environment)); 21 vp8_decoder_.reset(new Vp8Decoder(cast_environment));
22 break; 22 break;
23 case kH264: 23 case transport::kH264:
24 NOTIMPLEMENTED(); 24 NOTIMPLEMENTED();
25 break; 25 break;
26 } 26 }
27 } 27 }
28 28
29 VideoDecoder::~VideoDecoder() {} 29 VideoDecoder::~VideoDecoder() {}
30 30
31 bool VideoDecoder::DecodeVideoFrame(const EncodedVideoFrame* encoded_frame, 31 bool VideoDecoder::DecodeVideoFrame(
32 const base::TimeTicks render_time, 32 const transport::EncodedVideoFrame* encoded_frame,
33 const VideoFrameDecodedCallback& 33 const base::TimeTicks render_time,
34 frame_decoded_cb) { 34 const VideoFrameDecodedCallback&
35 frame_decoded_cb) {
35 DCHECK(encoded_frame->codec == codec_) << "Invalid codec"; 36 DCHECK(encoded_frame->codec == codec_) << "Invalid codec";
36 DCHECK_GT(encoded_frame->data.size(), GG_UINT64_C(0)) << "Empty video frame"; 37 DCHECK_GT(encoded_frame->data.size(), GG_UINT64_C(0)) << "Empty video frame";
37 return vp8_decoder_->Decode(encoded_frame, render_time, frame_decoded_cb); 38 return vp8_decoder_->Decode(encoded_frame, render_time, frame_decoded_cb);
38 } 39 }
39 40
40 } // namespace cast 41 } // namespace cast
41 } // namespace media 42 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/video_receiver/video_decoder.h ('k') | media/cast/video_receiver/video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698