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

Unified Diff: modules/video_coding/video_codec_initializer.cc

Issue 2951033003: [EXPERIMENTAL] Generic stereo codec with index header sending single frames
Patch Set: Rebase and add external codec support. Created 3 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/video_coding/rtp_frame_reference_finder.cc ('k') | test/video_codec_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/video_coding/video_codec_initializer.cc
diff --git a/modules/video_coding/video_codec_initializer.cc b/modules/video_coding/video_codec_initializer.cc
index 51131ed83f3cf4fcc61a8bfc2eb284cc2bf5ded4..7cd9b10b0795372b58f618702020a568837dfd01 100644
--- a/modules/video_coding/video_codec_initializer.cc
+++ b/modules/video_coding/video_codec_initializer.cc
@@ -39,9 +39,9 @@ bool VideoCodecInitializer::SetupCodec(
bool nack_enabled,
VideoCodec* codec,
std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator) {
- *codec =
- VideoEncoderConfigToVideoCodec(config, streams, settings.payload_name,
- settings.payload_type, nack_enabled);
+ *codec = VideoEncoderConfigToVideoCodec(
+ config, streams, settings.payload_name, settings.payload_type,
+ settings.stereo_associated_payload_name, nack_enabled);
std::unique_ptr<TemporalLayersFactory> tl_factory;
switch (codec->codecType) {
@@ -97,6 +97,7 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
const std::vector<VideoStream>& streams,
const std::string& payload_name,
int payload_type,
+ const std::string& stereo_associated_payload_name,
bool nack_enabled) {
static const int kEncoderMinBitrateKbps = 30;
RTC_DCHECK(!streams.empty());
@@ -106,6 +107,12 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
memset(&video_codec, 0, sizeof(video_codec));
video_codec.codecType = PayloadStringToCodecType(payload_name);
+ const bool is_stereo_codec = video_codec.codecType == kVideoCodecStereo;
+ if (is_stereo_codec) {
+ video_codec.codecType =
+ PayloadStringToCodecType(stereo_associated_payload_name);
+ }
+
switch (config.content_type) {
case VideoEncoderConfig::ContentType::kRealtimeVideo:
video_codec.mode = kRealtimeVideo;
@@ -238,6 +245,10 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
RTC_DCHECK_GT(streams[0].max_framerate, 0);
video_codec.maxFramerate = streams[0].max_framerate;
+
+ if (is_stereo_codec)
+ video_codec.codecType = kVideoCodecStereo;
+
return video_codec;
}
« no previous file with comments | « modules/video_coding/rtp_frame_reference_finder.cc ('k') | test/video_codec_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698