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

Unified Diff: webrtc/modules/video_coding/video_codec_initializer.cc

Issue 2990463002: [EXPERIMENTAL] Generic stereo codec with index header sending merged frames
Patch Set: Created 3 years, 5 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 | « webrtc/modules/video_coding/rtp_frame_reference_finder.cc ('k') | webrtc/video/payload_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/video_codec_initializer.cc
diff --git a/webrtc/modules/video_coding/video_codec_initializer.cc b/webrtc/modules/video_coding/video_codec_initializer.cc
index c759e84a36d8bd19db81cff0af6e291d2f204daa..7917a2789c6fbdef98589c984181334ccf951520 100644
--- a/webrtc/modules/video_coding/video_codec_initializer.cc
+++ b/webrtc/modules/video_coding/video_codec_initializer.cc
@@ -30,9 +30,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) {
@@ -88,6 +88,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());
@@ -98,6 +99,13 @@ VideoCodec VideoCodecInitializer::VideoEncoderConfigToVideoCodec(
video_codec.codecType = PayloadNameToCodecType(payload_name)
.value_or(VideoCodecType::kVideoCodecGeneric);
+ const bool is_stereo_codec = video_codec.codecType == kVideoCodecStereo;
+ if (is_stereo_codec) {
+ video_codec.codecType =
+ PayloadNameToCodecType(stereo_associated_payload_name)
+ .value_or(VideoCodecType::kVideoCodecGeneric);
+ }
+
switch (config.content_type) {
case VideoEncoderConfig::ContentType::kRealtimeVideo:
video_codec.mode = kRealtimeVideo;
@@ -227,6 +235,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 | « webrtc/modules/video_coding/rtp_frame_reference_finder.cc ('k') | webrtc/video/payload_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698