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

Side by Side Diff: content/renderer/media/rtc_video_encoder_factory.cc

Issue 827443003: Add querying supported formats to V4L2 VEA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 5 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
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/media/rtc_video_encoder_factory.h" 5 #include "content/renderer/media/rtc_video_encoder_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h" 8 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h"
9 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_switches.h"
10 #include "content/renderer/media/rtc_video_encoder.h" 10 #include "content/renderer/media/rtc_video_encoder.h"
(...skipping 10 matching lines...) Expand all
21 std::vector<cricket::WebRtcVideoEncoderFactory::VideoCodec>* codecs, 21 std::vector<cricket::WebRtcVideoEncoderFactory::VideoCodec>* codecs,
22 const media::VideoEncodeAccelerator::SupportedProfile& profile) { 22 const media::VideoEncodeAccelerator::SupportedProfile& profile) {
23 int width = profile.max_resolution.width(); 23 int width = profile.max_resolution.width();
24 int height = profile.max_resolution.height(); 24 int height = profile.max_resolution.height();
25 int fps = profile.max_framerate_numerator; 25 int fps = profile.max_framerate_numerator;
26 DCHECK_EQ(profile.max_framerate_denominator, 1U); 26 DCHECK_EQ(profile.max_framerate_denominator, 1U);
27 27
28 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); 28 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
29 if (profile.profile >= media::VP8PROFILE_MIN && 29 if (profile.profile >= media::VP8PROFILE_MIN &&
30 profile.profile <= media::VP8PROFILE_MAX) { 30 profile.profile <= media::VP8PROFILE_MAX) {
31 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWVp8Encoding)) { 31 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec(
32 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec( 32 webrtc::kVideoCodecVP8, "VP8", width, height, fps));
33 webrtc::kVideoCodecVP8, "VP8", width, height, fps));
34 }
35 } else if (profile.profile >= media::H264PROFILE_MIN && 33 } else if (profile.profile >= media::H264PROFILE_MIN &&
36 profile.profile <= media::H264PROFILE_MAX) { 34 profile.profile <= media::H264PROFILE_MAX) {
37 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWH264Encoding)) { 35 if (cmd_line->HasSwitch(switches::kEnableWebRtcHWH264Encoding)) {
38 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec( 36 codecs->push_back(cricket::WebRtcVideoEncoderFactory::VideoCodec(
39 webrtc::kVideoCodecH264, "H264", width, height, fps)); 37 webrtc::kVideoCodecH264, "H264", width, height, fps));
40 } 38 }
41 } 39 }
42 } 40 }
43 41
44 } // anonymous namespace 42 } // anonymous namespace
(...skipping 27 matching lines...) Expand all
72 RTCVideoEncoderFactory::codecs() const { 70 RTCVideoEncoderFactory::codecs() const {
73 return codecs_; 71 return codecs_;
74 } 72 }
75 73
76 void RTCVideoEncoderFactory::DestroyVideoEncoder( 74 void RTCVideoEncoderFactory::DestroyVideoEncoder(
77 webrtc::VideoEncoder* encoder) { 75 webrtc::VideoEncoder* encoder) {
78 delete encoder; 76 delete encoder;
79 } 77 }
80 78
81 } // namespace content 79 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698