OLD | NEW |
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/video_sender/external_video_encoder.h" | 5 #include "media/cast/video_sender/external_video_encoder.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/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 switch (video_config.codec) { | 101 switch (video_config.codec) { |
102 case transport::kVp8: | 102 case transport::kVp8: |
103 output_profile = media::VP8PROFILE_MAIN; | 103 output_profile = media::VP8PROFILE_MAIN; |
104 break; | 104 break; |
105 case transport::kH264: | 105 case transport::kH264: |
106 output_profile = media::H264PROFILE_MAIN; | 106 output_profile = media::H264PROFILE_MAIN; |
107 break; | 107 break; |
108 case transport::kFakeSoftwareVideo: | 108 case transport::kFakeSoftwareVideo: |
109 NOTREACHED() << "Fake software video encoder cannot be external"; | 109 NOTREACHED() << "Fake software video encoder cannot be external"; |
110 break; | 110 break; |
| 111 case transport::kUnknownVideoCodec: |
| 112 NOTREACHED() << "Video codec not specified"; |
| 113 break; |
111 } | 114 } |
112 codec_ = video_config.codec; | 115 codec_ = video_config.codec; |
113 max_frame_rate_ = video_config.max_frame_rate; | 116 max_frame_rate_ = video_config.max_frame_rate; |
114 | 117 |
115 if (!video_encode_accelerator_->Initialize( | 118 if (!video_encode_accelerator_->Initialize( |
116 media::VideoFrame::I420, | 119 media::VideoFrame::I420, |
117 gfx::Size(video_config.width, video_config.height), | 120 gfx::Size(video_config.width, video_config.height), |
118 output_profile, | 121 output_profile, |
119 video_config.start_bitrate, | 122 video_config.start_bitrate, |
120 this)) { | 123 this)) { |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // Do nothing not supported. | 442 // Do nothing not supported. |
440 } | 443 } |
441 | 444 |
442 int ExternalVideoEncoder::NumberOfSkippedFrames() const { | 445 int ExternalVideoEncoder::NumberOfSkippedFrames() const { |
443 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); | 446 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); |
444 return skip_count_; | 447 return skip_count_; |
445 } | 448 } |
446 | 449 |
447 } // namespace cast | 450 } // namespace cast |
448 } // namespace media | 451 } // namespace media |
OLD | NEW |