I am writing the code for an application which should be able to send the two video streams(such as one 720P video and one 360P video) from same camera to peer.
Based on the peerconnection_client. Below is my code: I reuse VideoSource to create two VideoTracks.
rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> video_track_source;
video_track_source = peer_connection_factory_->CreateVideoSource(OpenVideoCaptureDevice(),NULL);
rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
peer_connection_factory_->CreateVideoTrack(
kVideoLabel, video_track_source));
rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track2(
peer_connection_factory_->CreateVideoTrack(
"video_label2", video_track_source));
rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
peer_connection_factory_->CreateLocalMediaStream(kStreamLabel);
stream->AddTrack(audio_track);
stream->AddTrack(video_track);
stream->AddTrack(video_track2);
But how to specify video_track and video_track2 with different resoltion?
(I also try to reuse VideoCapture object to create two VideoSources, but it does not work.)
I think another method is using simulcast. From "Javascript Session Establishment Protocol",
"Applications request support for simulcast by configuring multiple encodings on an RTPSender..."
How to do this using Native C++ code? And this method does not support H.264 and VP9 , is it right?