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

Side by Side Diff: media/cast/sender/video_encoder_impl.cc

Issue 450693006: VideoToolbox encoder for cast senders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove useless include and clean up in unit tests. Created 6 years 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
« no previous file with comments | « media/cast/sender/h264_vt_encoder_unittest.cc ('k') | media/cast/sender/video_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/sender/video_encoder_impl.h" 5 #include "media/cast/sender/video_encoder_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 CastEnvironment::MAIN, 49 CastEnvironment::MAIN,
50 FROM_HERE, 50 FROM_HERE,
51 base::Bind(frame_encoded_callback, base::Passed(&encoded_frame))); 51 base::Bind(frame_encoded_callback, base::Passed(&encoded_frame)));
52 } 52 }
53 } // namespace 53 } // namespace
54 54
55 VideoEncoderImpl::VideoEncoderImpl( 55 VideoEncoderImpl::VideoEncoderImpl(
56 scoped_refptr<CastEnvironment> cast_environment, 56 scoped_refptr<CastEnvironment> cast_environment,
57 const VideoSenderConfig& video_config) 57 const VideoSenderConfig& video_config)
58 : cast_environment_(cast_environment) { 58 : cast_environment_(cast_environment) {
59 CHECK(cast_environment_->HasVideoThread());
59 if (video_config.codec == CODEC_VIDEO_VP8) { 60 if (video_config.codec == CODEC_VIDEO_VP8) {
60 encoder_.reset(new Vp8Encoder(video_config)); 61 encoder_.reset(new Vp8Encoder(video_config));
61 cast_environment_->PostTask(CastEnvironment::VIDEO, 62 cast_environment_->PostTask(CastEnvironment::VIDEO,
62 FROM_HERE, 63 FROM_HERE,
63 base::Bind(&InitializeEncoderOnEncoderThread, 64 base::Bind(&InitializeEncoderOnEncoderThread,
64 cast_environment, 65 cast_environment,
65 encoder_.get())); 66 encoder_.get()));
66 #ifndef OFFICIAL_BUILD 67 #ifndef OFFICIAL_BUILD
67 } else if (video_config.codec == CODEC_VIDEO_FAKE) { 68 } else if (video_config.codec == CODEC_VIDEO_FAKE) {
68 encoder_.reset(new FakeSoftwareVideoEncoder(video_config)); 69 encoder_.reset(new FakeSoftwareVideoEncoder(video_config));
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 dynamic_config_.key_frame_requested = true; 117 dynamic_config_.key_frame_requested = true;
117 } 118 }
118 119
119 // Inform the encoder to only reference frames older or equal to frame_id; 120 // Inform the encoder to only reference frames older or equal to frame_id;
120 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) { 121 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) {
121 dynamic_config_.latest_frame_id_to_reference = frame_id; 122 dynamic_config_.latest_frame_id_to_reference = frame_id;
122 } 123 }
123 124
124 } // namespace cast 125 } // namespace cast
125 } // namespace media 126 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/h264_vt_encoder_unittest.cc ('k') | media/cast/sender/video_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698